diff --git a/.azure-pipelines/client.test.yml b/.azure-pipelines/client.test.yml new file mode 100644 index 0000000000000..a65978881ffab --- /dev/null +++ b/.azure-pipelines/client.test.yml @@ -0,0 +1,28 @@ +parameters: + name: '' + vmImage: '' + +jobs: +- job: ${{ format('Test_{0}', parameters.name) }} + dependsOn: + - 'Build' + pool: + vmImage: ${{ parameters.vmImage }} + + steps: + - script: | + mvn jetty:run-forked -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --batch-mode -f pom.client.xml + displayName: 'Start Jetty' + + - task: Maven@3 + displayName: 'Run tests' + inputs: + mavenPomFile: $(pomFile) + options: '--batch-mode' #hides dependencies download progress from CI output + mavenOptions: '-Xmx3072m -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.8' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + goals: 'test' diff --git a/.azure-pipelines/client.yml b/.azure-pipelines/client.yml new file mode 100644 index 0000000000000..ef88514a34152 --- /dev/null +++ b/.azure-pipelines/client.yml @@ -0,0 +1,46 @@ +trigger: +- master + +jobs: +- job: 'Build' + + pool: + vmImage: 'ubuntu-16.04' + + steps: + - task: Maven@3 + displayName: 'Build and Package' + inputs: + mavenPomFile: $(pomFile) + goals: 'checkstyle:check javadoc:jar source:jar package' + options: '--batch-mode -Dmaven.test.skip=true' + mavenOptions: '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.8' + jdkArchitectureOption: 'x64' + publishJUnitResults: false + + - powershell: | + # use sources files as a marker to find POM files so we can copy them to the output. The sources.jar file is generally + # in a target folder next to the pom.xml file so $_.Directory.Parent should get us the folder that contains the POM. + dir -r -i *-sources.jar | % { copy (Join-Path $_.Directory.Parent.FullName "pom.xml") (Join-Path $(Build.ArtifactStagingDirectory) $_.Name.Replace("-sources.jar",".pom")) } + dir -r -i *.jar | % { copy $_ $(Build.ArtifactStagingDirectory) } + displayName: 'Copy JAR and POM files to artifact staging' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish' + +- template: client.test.yml + parameters: + name: Linux + vmImage: 'ubuntu-16.04' + +- template: client.test.yml + parameters: + name: macOS + vmImage: 'macOS-10.13' + +- template: client.test.yml + parameters: + name: Windows + vmImage: 'vs2017-win2016' diff --git a/README.md b/README.md index 727a56c9d301a..43a115ee3ef5f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ -[![Build Status](https://travis-ci.org/Azure/azure-libraries-for-java.svg?style=flat-square&label=build)](https://travis-ci.org/Azure/azure-libraries-for-java) - > :warning: *NOTE: The **Azure Libraries for Java** project (resource management APIs with fluent interface design pattern) has moved to http://github.com/azure/azure-libraries-for-java, so please log issues for that project in that new repository. This repository is now dedicated to other, auto-generated, non-management Azure SDKs only.* # Azure SDKs for Java +| Component | Build Status | +| --------- | ------------ | +| Management Libraries | [![Build Status](https://travis-ci.org/Azure/azure-sdk-for-java.svg?branch=master)](https://travis-ci.org/Azure/azure-sdk-for-java) | +| Client Libraries | [![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-java.client)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=17) | + :+1: [Try Azure for FREE](http://go.microsoft.com/fwlink/?LinkId=330212) This repository contains Azure SDKs enabling the programmatic *consumption* of miscellaneous Azure services (i.e. *not management* - for that see http://github.com/azure/azure-libraries-for-java) diff --git a/api-specs.json b/api-specs.json index 2187614d8f1cb..a942a45d0c703 100644 --- a/api-specs.json +++ b/api-specs.json @@ -3,6 +3,10 @@ "source": "specification/applicationinsights/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "applicationinsights/data-plane": { + "source": "specification/applicationinsights/data-plane/readme.md", + "args": "--payload-flattening-threshold=1" + }, "appservice/resource-manager": { "source": "specification/web/resource-manager/readme.md", "args": "--multiapi --fluent", @@ -36,6 +40,14 @@ }, "containerregistry/resource-manager": { "source": "specification/containerregistry/resource-manager/readme.md", + "args": "--multiapi=true --fluent=true" + }, + "datalakeanalytics/resource-manager": { + "source": "specification/datalake-analytics/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, + "datalakestore/resource-manager": { + "source": "specification/datalake-store/resource-manager/readme.md", "args": "--multiapi --fluent" }, "dns/resource-manager": { @@ -50,6 +62,10 @@ "source": "specification/eventgrid/data-plane/readme.md", "args": "--multiapi" }, + "hdinsight/resource-manager": { + "source": "specification/hdinsight/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "iotcentral/resource-manager": { "source": "specification/iotcentral/resource-manager/readme.md", "args": "--multiapi --fluent", @@ -68,10 +84,18 @@ "source": "specification/keyvault/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "loganalytics/data-plane": { + "source": "specification/operationalinsights/data-plane/readme.md", + "args": "--payload-flattening-threshold=1 --override-client-name=LogAnalyticsDataClient" + }, "logic/resource-manager": { "source": "specification/logic/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "notificationhubs/resource-manager": { + "source": "specification/notificationhubs/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "mediaservices/resource-manager": { "source": "specification/mediaservices/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/applicationinsights/data-plane/README.md b/applicationinsights/data-plane/README.md new file mode 100644 index 0000000000000..15885629d7289 --- /dev/null +++ b/applicationinsights/data-plane/README.md @@ -0,0 +1,50 @@ +# Azure Application Insights + +This project provides client tools or utilities in Java that make it easy to query data in [Azure Application Insights](https://azure.microsoft.com/en-us/services/application-insights/). For reference documentation on classes and models, please see the [Azure SDK for Java reference](https://docs.microsoft.com/en-us/java/api/overview/azure/?view=azure-java-stable). + +Azure Application Insights provides SDKs for telemtry collection and enables deep analytics via a [rich query language](https://docs.loganalytics.io/index). This SDK provides query access to data already stored in Application Insights. To start monitoring a Java application, take a look at the [quickstart](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-quick-start). + +## Examples + +Please see [here](src/main/java/com/microsoft/azure/applicationinsights/query/samples) for code examples using this SDK. + +## Download + +### Latest release + +To get the binaries of the official Microsoft Azure Log Analytics SDK as distributed by Microsoft, reade for use within your project, you can use Maven. + +```xml + + com.microsoft.azure + azure-applicationinsights-query + LATEST + +``` + +## Prerequisites + +- A Java Developer Kit (JDK), v 1.7 or later +- Maven + +## Help and Issues + +If you encounter any bugs with these SDKs, please file issues via [Issues](https://github.com/Azure/azure-sdk-for-java/issues) or checkout [StackOverflow for Azure Java SDK](http://stackoverflow.com/questions/tagged/azure-java-sdk). + +## Contribute Code + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +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 + +## More information +- [Azure Java SDKs](https://docs.microsoft.com/java/azure/) +- If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212) + +--- + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file diff --git a/applicationinsights/data-plane/pom.xml b/applicationinsights/data-plane/pom.xml new file mode 100644 index 0000000000000..7a9e7b65ab7d5 --- /dev/null +++ b/applicationinsights/data-plane/pom.xml @@ -0,0 +1,164 @@ + + + 4.0.0 + com.microsoft.azure + azure-applicationinsights-query + 1.0.0-Preview-1 + jar + Microsoft Azure SDK for Application Insights Query API + This package contains Microsoft Application Insights SDK for retrieving metrics, events, and running queries. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + 1.6.3 + record + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + ${runtime.version} + + + junit + junit + 4.12 + test + + + com.microsoft.azure + azure-client-authentication + ${runtime.version} + test + + + com.microsoft.azure + azure-arm-client-runtime + ${runtime.version} + test-jar + test + + + com.microsoft.azure + azure-arm-client-runtime + ${runtime.version} + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + generate-resources + + write-project-properties + + + + ${project.build.outputDirectory}/maven.properties + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+ + org.apache.maven.plugins + maven-surefire-plugin + 2.20 + + false + + **/Test*.java + **/*Test.java + **/*Tests.java + **/*TestCase.java + + + ${testMode} + + + +
+
+
diff --git a/applicationinsights/data-plane/samples/pom.xml b/applicationinsights/data-plane/samples/pom.xml new file mode 100644 index 0000000000000..9336ce554fa19 --- /dev/null +++ b/applicationinsights/data-plane/samples/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + com.microsoft.azure + azure-applicationinsights-query-sample + 1.0.0-Preview-1 + jar + Microsoft Azure SDK for Application Insights Query Sample + This package contains Microsoft Application Insights Query SDK Sample. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + 1.6.3 + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-applicationinsights-query + ${version} + + + com.microsoft.azure + azure-client-authentication + ${runtime.version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + + \ No newline at end of file diff --git a/applicationinsights/data-plane/samples/src/main/java/com/microsoft/azure/applicationinsights/query/samples/ApplicationInsightsClientExample.java b/applicationinsights/data-plane/samples/src/main/java/com/microsoft/azure/applicationinsights/query/samples/ApplicationInsightsClientExample.java new file mode 100644 index 0000000000000..4beac5489e35c --- /dev/null +++ b/applicationinsights/data-plane/samples/src/main/java/com/microsoft/azure/applicationinsights/query/samples/ApplicationInsightsClientExample.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + */ +package com.microsoft.azure.applicationinsights.query.samples; + +import java.util.ArrayList; +import java.util.List; +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.applicationinsights.query.implementation.ApplicationInsightsDataClientImpl; +import com.microsoft.azure.applicationinsights.query.models.QueryBody; +import com.microsoft.azure.applicationinsights.query.models.MetricId; +import com.microsoft.azure.applicationinsights.query.models.MetricsResult; +import com.microsoft.azure.applicationinsights.query.models.MetricsResultsItem; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchema; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchemaParameters; +import com.microsoft.azure.applicationinsights.query.models.EventType; +import com.microsoft.azure.applicationinsights.query.models.EventsResult; +import com.microsoft.azure.applicationinsights.query.models.EventsResults; +import com.microsoft.azure.applicationinsights.query.models.QueryResults; +import com.microsoft.azure.applicationinsights.query.models.Column; +import com.microsoft.azure.credentials.ApplicationTokenCredentials; + +/** + * Basic query example + * + */ +public class ApplicationInsightsClientExample +{ + public static void main( String[] args ) + { + // ApplicationTokenCredentials work well for service principal authentication + ApplicationTokenCredentials credentials = new ApplicationTokenCredentials( + "", + "", + "", + AzureEnvironment.AZURE + ); + + // New up client. Accepts credentials, or a pre-authenticated restClient + ApplicationInsightsDataClientImpl client = new ApplicationInsightsDataClientImpl(credentials); + + // Prepare information for query + String query = "availabilityResults | take 1"; + String appId = ""; + String eventId = ""; + + // POST parameters for multiple metrics + List parameters = new ArrayList(); + parameters.add(new MetricsPostBodySchema().withId("1").withParameters(new MetricsPostBodySchemaParameters().withMetricId(MetricId.AVAILABILITY_RESULTSAVAILABILITY_PERCENTAGE))); + parameters.add(new MetricsPostBodySchema().withId("2").withParameters(new MetricsPostBodySchemaParameters().withMetricId(MetricId.AVAILABILITY_RESULTSDURATION))); + + // Execute log query + QueryResults queryResults = client.querys().execute(appId, new QueryBody().withQuery(query)); + + // Metrics + MetricsResult metricResultSingle = client.metrics().get(appId, MetricId.AVAILABILITY_RESULTSAVAILABILITY_PERCENTAGE); + List metricResultMultiple = client.metrics().getMultiple(appId, parameters); + Object metadata = client.metrics().getMetadata(appId); + + // Events + EventsResults eventsResultByType = client.events().getByType(appId, EventType.AVAILABILITY_RESULTS); + EventsResults eventsResult = client.events().get(appId, EventType.AVAILABILITY_RESULTS, eventId); + + // Process and print results + List row = queryResults.tables().get(0).rows().get(0); + List columnNames = queryResults + .tables() + .get(0) + .columns(); + + for (int i = 0; i < row.size(); i++){ + System.out.println("The value of " + columnNames.get(i).name() + " is " + row.get(i)); + } + + System.out.println(metricResultMultiple.get(0).body().value().additionalProperties()); + + } +} \ No newline at end of file diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClient.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClient.java new file mode 100644 index 0000000000000..702d01f4294da --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClient.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for ApplicationInsightsDataClient class. + */ +public interface ApplicationInsightsDataClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + ApplicationInsightsDataClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + ApplicationInsightsDataClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + ApplicationInsightsDataClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Metrics object to access its operations. + * @return the Metrics object. + */ + Metrics metrics(); + + /** + * Gets the Events object to access its operations. + * @return the Events object. + */ + Events events(); + + /** + * Gets the Querys object to access its operations. + * @return the Querys object. + */ + Querys querys(); + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Events.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Events.java new file mode 100644 index 0000000000000..87143dfa1fabd --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Events.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query; + +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.EventsResults; +import com.microsoft.azure.applicationinsights.query.models.EventType; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Events. + */ +public interface Events { + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + EventsResults getByType(String appId, EventType eventType); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getByTypeAsync(String appId, EventType eventType, final ServiceCallback serviceCallback); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable getByTypeAsync(String appId, EventType eventType); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable> getByTypeWithServiceResponseAsync(String appId, EventType eventType); + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + EventsResults getByType(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getByTypeAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply, final ServiceCallback serviceCallback); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable getByTypeAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply); + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable> getByTypeWithServiceResponseAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + EventsResults get(String appId, EventType eventType, String eventId); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String appId, EventType eventType, String eventId, final ServiceCallback serviceCallback); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable getAsync(String appId, EventType eventType, String eventId); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable> getWithServiceResponseAsync(String appId, EventType eventType, String eventId); + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + EventsResults get(String appId, EventType eventType, String eventId, String timespan); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String appId, EventType eventType, String eventId, String timespan, final ServiceCallback serviceCallback); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable getAsync(String appId, EventType eventType, String eventId, String timespan); + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + Observable> getWithServiceResponseAsync(String appId, EventType eventType, String eventId, String timespan); + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Metrics.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Metrics.java new file mode 100644 index 0000000000000..d7aa0b88253dd --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Metrics.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query; + +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.MetricId; +import com.microsoft.azure.applicationinsights.query.models.MetricsAggregation; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchema; +import com.microsoft.azure.applicationinsights.query.models.MetricsResult; +import com.microsoft.azure.applicationinsights.query.models.MetricsResultsItem; +import com.microsoft.azure.applicationinsights.query.models.MetricsSegment; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import org.joda.time.Period; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Metrics. + */ +public interface Metrics { + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricsResult object if successful. + */ + MetricsResult get(String appId, MetricId metricId); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String appId, MetricId metricId, final ServiceCallback serviceCallback); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + Observable getAsync(String appId, MetricId metricId); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + Observable> getWithServiceResponseAsync(String appId, MetricId metricId); + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricsResult object if successful. + */ + MetricsResult get(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter, final ServiceCallback serviceCallback); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + Observable getAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter); + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + Observable> getWithServiceResponseAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter); + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<MetricsResultsItem> object if successful. + */ + List getMultiple(String appId, List body); + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultipleAsync(String appId, List body, final ServiceCallback> serviceCallback); + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricsResultsItem> object + */ + Observable> getMultipleAsync(String appId, List body); + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricsResultsItem> object + */ + Observable>> getMultipleWithServiceResponseAsync(String appId, List body); + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + Object getMetadata(String appId); + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMetadataAsync(String appId, final ServiceCallback serviceCallback); + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable getMetadataAsync(String appId); + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> getMetadataWithServiceResponseAsync(String appId); + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Querys.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Querys.java new file mode 100644 index 0000000000000..2e92f8a8a266e --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/Querys.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query; + +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.QueryBody; +import com.microsoft.azure.applicationinsights.query.models.QueryResults; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Querys. + */ +public interface Querys { + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryResults object if successful. + */ + QueryResults execute(String appId, QueryBody body); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture executeAsync(String appId, QueryBody body, final ServiceCallback serviceCallback); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + Observable executeAsync(String appId, QueryBody body); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + Observable> executeWithServiceResponseAsync(String appId, QueryBody body); + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/ApplicationInsightsDataClientImpl.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/ApplicationInsightsDataClientImpl.java new file mode 100644 index 0000000000000..a89ec1b6cd09a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/ApplicationInsightsDataClientImpl.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.implementation; + +import com.microsoft.azure.applicationinsights.query.ApplicationInsightsDataClient; +import com.microsoft.azure.applicationinsights.query.Events; +import com.microsoft.azure.applicationinsights.query.Metrics; +import com.microsoft.azure.applicationinsights.query.Querys; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ApplicationInsightsDataClientImpl class. + */ +public class ApplicationInsightsDataClientImpl extends AzureServiceClient implements ApplicationInsightsDataClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ApplicationInsightsDataClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ApplicationInsightsDataClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ApplicationInsightsDataClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Metrics object to access its operations. + */ + private Metrics metrics; + + /** + * Gets the Metrics object to access its operations. + * @return the Metrics object. + */ + public Metrics metrics() { + return this.metrics; + } + + /** + * The Events object to access its operations. + */ + private Events events; + + /** + * Gets the Events object to access its operations. + * @return the Events object. + */ + public Events events() { + return this.events; + } + + /** + * The Querys object to access its operations. + */ + private Querys querys; + + /** + * Gets the Querys object to access its operations. + * @return the Querys object. + */ + public Querys querys() { + return this.querys; + } + + /** + * Initializes an instance of ApplicationInsightsDataClient client. + * + * @param credentials the management credentials for Azure + */ + public ApplicationInsightsDataClientImpl(ServiceClientCredentials credentials) { + this("https://api.applicationinsights.io/v1", credentials); + } + + /** + * Initializes an instance of ApplicationInsightsDataClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ApplicationInsightsDataClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ApplicationInsightsDataClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ApplicationInsightsDataClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.metrics = new MetricsImpl(restClient().retrofit(), this); + this.events = new EventsImpl(restClient().retrofit(), this); + this.querys = new QuerysImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ApplicationInsightsDataClient", "v1"); + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java new file mode 100644 index 0000000000000..8f94c8bfcc144 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java @@ -0,0 +1,458 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.applicationinsights.query.Events; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.EventsResults; +import com.microsoft.azure.applicationinsights.query.models.EventType; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Events. + */ +public class EventsImpl implements Events { + /** The Retrofit service to perform REST calls. */ + private EventsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsDataClientImpl client; + + /** + * Initializes an instance of EventsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventsImpl(Retrofit retrofit, ApplicationInsightsDataClientImpl client) { + this.service = retrofit.create(EventsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Events to be + * used by Retrofit to perform actually REST calls. + */ + interface EventsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Events getByType" }) + @GET("apps/{appId}/events/{eventType}") + Observable> getByType(@Path("appId") String appId, @Path("eventType") EventType eventType1, @Query("timespan") String timespan, @Query("$filter") String filter1, @Query("$search") String search, @Query("$orderby") String orderby1, @Query("$select") String select, @Query("$skip") Integer skip, @Query("$top") Integer top1, @Query("$format") String format, @Query("$count") Boolean count, @Query("$apply") String apply, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Events get" }) + @GET("apps/{appId}/events/{eventType}/{eventId}") + Observable> get(@Path("appId") String appId, @Path("eventType") EventType eventType1, @Path("eventId") String eventId, @Query("timespan") String timespan, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + public EventsResults getByType(String appId, EventType eventType) { + return getByTypeWithServiceResponseAsync(appId, eventType).toBlocking().single().body(); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByTypeAsync(String appId, EventType eventType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByTypeWithServiceResponseAsync(appId, eventType), serviceCallback); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable getByTypeAsync(String appId, EventType eventType) { + return getByTypeWithServiceResponseAsync(appId, eventType).map(new Func1, EventsResults>() { + @Override + public EventsResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable> getByTypeWithServiceResponseAsync(String appId, EventType eventType) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (eventType == null) { + throw new IllegalArgumentException("Parameter eventType is required and cannot be null."); + } + final String timespan = null; + final String filter = null; + final String search = null; + final String orderby = null; + final String select = null; + final Integer skip = null; + final Integer top = null; + final String format = null; + final Boolean count = null; + final String apply = null; + return service.getByType(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + public EventsResults getByType(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) { + return getByTypeWithServiceResponseAsync(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply).toBlocking().single().body(); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByTypeAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByTypeWithServiceResponseAsync(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply), serviceCallback); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable getByTypeAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) { + return getByTypeWithServiceResponseAsync(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply).map(new Func1, EventsResults>() { + @Override + public EventsResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute OData query. + * Executes an OData query for events. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param filter An expression used to filter the returned events + * @param search A free-text search expression to match for whether a particular event should be returned + * @param orderby A comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order of returned events + * @param select Limits the properties to just those requested on each returned event + * @param skip The number of items to skip over before returning events + * @param top The number of events to return + * @param format Format for the returned events + * @param count Request a count of matching items included with the returned events + * @param apply An expression used for aggregation over returned events + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable> getByTypeWithServiceResponseAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (eventType == null) { + throw new IllegalArgumentException("Parameter eventType is required and cannot be null."); + } + return service.getByType(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByTypeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + public EventsResults get(String appId, EventType eventType, String eventId) { + return getWithServiceResponseAsync(appId, eventType, eventId).toBlocking().single().body(); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String appId, EventType eventType, String eventId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(appId, eventType, eventId), serviceCallback); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable getAsync(String appId, EventType eventType, String eventId) { + return getWithServiceResponseAsync(appId, eventType, eventId).map(new Func1, EventsResults>() { + @Override + public EventsResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable> getWithServiceResponseAsync(String appId, EventType eventType, String eventId) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (eventType == null) { + throw new IllegalArgumentException("Parameter eventType is required and cannot be null."); + } + if (eventId == null) { + throw new IllegalArgumentException("Parameter eventId is required and cannot be null."); + } + final String timespan = null; + return service.get(appId, eventType, eventId, timespan, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventsResults object if successful. + */ + public EventsResults get(String appId, EventType eventType, String eventId, String timespan) { + return getWithServiceResponseAsync(appId, eventType, eventId, timespan).toBlocking().single().body(); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String appId, EventType eventType, String eventId, String timespan, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(appId, eventType, eventId, timespan), serviceCallback); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable getAsync(String appId, EventType eventType, String eventId, String timespan) { + return getWithServiceResponseAsync(appId, eventType, eventId, timespan).map(new Func1, EventsResults>() { + @Override + public EventsResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an event. + * Gets the data for a single event. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all event types. Possible values include: '$all', 'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests', 'dependencies', 'exceptions', 'availabilityResults', 'performanceCounters', 'customMetrics' + * @param eventId ID of event. + * @param timespan Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventsResults object + */ + public Observable> getWithServiceResponseAsync(String appId, EventType eventType, String eventId, String timespan) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (eventType == null) { + throw new IllegalArgumentException("Parameter eventType is required and cannot be null."); + } + if (eventId == null) { + throw new IllegalArgumentException("Parameter eventId is required and cannot be null."); + } + return service.get(appId, eventType, eventId, timespan, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/MetricsImpl.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/MetricsImpl.java new file mode 100644 index 0000000000000..8aed0b43a9a3f --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/MetricsImpl.java @@ -0,0 +1,443 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.applicationinsights.query.Metrics; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.MetricId; +import com.microsoft.azure.applicationinsights.query.models.MetricsAggregation; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchema; +import com.microsoft.azure.applicationinsights.query.models.MetricsResult; +import com.microsoft.azure.applicationinsights.query.models.MetricsResultsItem; +import com.microsoft.azure.applicationinsights.query.models.MetricsSegment; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import org.joda.time.Period; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Metrics. + */ +public class MetricsImpl implements Metrics { + /** The Retrofit service to perform REST calls. */ + private MetricsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsDataClientImpl client; + + /** + * Initializes an instance of MetricsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MetricsImpl(Retrofit retrofit, ApplicationInsightsDataClientImpl client) { + this.service = retrofit.create(MetricsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Metrics to be + * used by Retrofit to perform actually REST calls. + */ + interface MetricsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Metrics get" }) + @GET("apps/{appId}/metrics/{metricId}") + Observable> get(@Path("appId") String appId, @Path("metricId") MetricId metricId1, @Query("timespan") String timespan, @Query("interval") Period interval, @Query("aggregation") String aggregation, @Query("segment") String segment, @Query("top") Integer top, @Query("orderby") String orderby, @Query("filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Metrics getMultiple" }) + @POST("apps/{appId}/metrics") + Observable> getMultiple(@Path("appId") String appId, @Body List body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Metrics getMetadata" }) + @GET("apps/{appId}/metrics/metadata") + Observable> getMetadata(@Path("appId") String appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricsResult object if successful. + */ + public MetricsResult get(String appId, MetricId metricId) { + return getWithServiceResponseAsync(appId, metricId).toBlocking().single().body(); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String appId, MetricId metricId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(appId, metricId), serviceCallback); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + public Observable getAsync(String appId, MetricId metricId) { + return getWithServiceResponseAsync(appId, metricId).map(new Func1, MetricsResult>() { + @Override + public MetricsResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + public Observable> getWithServiceResponseAsync(String appId, MetricId metricId) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (metricId == null) { + throw new IllegalArgumentException("Parameter metricId is required and cannot be null."); + } + final String timespan = null; + final Period interval = null; + final List aggregation = null; + final List segment = null; + final Integer top = null; + final String orderby = null; + final String filter = null; + String aggregationConverted = this.client.serializerAdapter().serializeList(aggregation, CollectionFormat.CSV);String segmentConverted = this.client.serializerAdapter().serializeList(segment, CollectionFormat.CSV); + return service.get(appId, metricId, timespan, interval, aggregationConverted, segmentConverted, top, orderby, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricsResult object if successful. + */ + public MetricsResult get(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter) { + return getWithServiceResponseAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter).toBlocking().single().body(); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter), serviceCallback); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + public Observable getAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter) { + return getWithServiceResponseAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter).map(new Func1, MetricsResult>() { + @Override + public MetricsResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve metric data. + * Gets metric values for a single metric. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param metricId ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count' + * @param timespan The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response. + * @param interval The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response. + * @param aggregation The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used. + * @param segment The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter. + * @param top The number of segments to return. This value is only valid when segment is specified. + * @param orderby The aggregation function and direction to sort the segments by. This value is only valid when segment is specified. + * @param filter An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricsResult object + */ + public Observable> getWithServiceResponseAsync(String appId, MetricId metricId, String timespan, Period interval, List aggregation, List segment, Integer top, String orderby, String filter) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (metricId == null) { + throw new IllegalArgumentException("Parameter metricId is required and cannot be null."); + } + Validator.validate(aggregation); + Validator.validate(segment); + String aggregationConverted = this.client.serializerAdapter().serializeList(aggregation, CollectionFormat.CSV);String segmentConverted = this.client.serializerAdapter().serializeList(segment, CollectionFormat.CSV); + return service.get(appId, metricId, timespan, interval, aggregationConverted, segmentConverted, top, orderby, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<MetricsResultsItem> object if successful. + */ + public List getMultiple(String appId, List body) { + return getMultipleWithServiceResponseAsync(appId, body).toBlocking().single().body(); + } + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultipleAsync(String appId, List body, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getMultipleWithServiceResponseAsync(appId, body), serviceCallback); + } + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricsResultsItem> object + */ + public Observable> getMultipleAsync(String appId, List body) { + return getMultipleWithServiceResponseAsync(appId, body).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve metric data. + * Gets metric values for multiple metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The batched metrics query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricsResultsItem> object + */ + public Observable>> getMultipleWithServiceResponseAsync(String appId, List body) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.getMultiple(appId, body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getMultipleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultipleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object getMetadata(String appId) { + return getMetadataWithServiceResponseAsync(appId).toBlocking().single().body(); + } + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMetadataAsync(String appId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMetadataWithServiceResponseAsync(appId), serviceCallback); + } + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getMetadataAsync(String appId) { + return getMetadataWithServiceResponseAsync(appId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve metric metatadata. + * Gets metadata describing the available metrics. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getMetadataWithServiceResponseAsync(String appId) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + return service.getMetadata(appId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMetadataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMetadataDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/QuerysImpl.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/QuerysImpl.java new file mode 100644 index 0000000000000..f898a1ccbcf6c --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/QuerysImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.applicationinsights.query.Querys; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.applicationinsights.query.models.ErrorResponseException; +import com.microsoft.azure.applicationinsights.query.models.QueryBody; +import com.microsoft.azure.applicationinsights.query.models.QueryResults; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Querys. + */ +public class QuerysImpl implements Querys { + /** The Retrofit service to perform REST calls. */ + private QuerysService service; + /** The service client containing this operation class. */ + private ApplicationInsightsDataClientImpl client; + + /** + * Initializes an instance of QuerysImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QuerysImpl(Retrofit retrofit, ApplicationInsightsDataClientImpl client) { + this.service = retrofit.create(QuerysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Querys to be + * used by Retrofit to perform actually REST calls. + */ + interface QuerysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.applicationinsights.query.Querys execute" }) + @POST("apps/{appId}/query") + Observable> execute(@Path("appId") String appId, @Body QueryBody body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryResults object if successful. + */ + public QueryResults execute(String appId, QueryBody body) { + return executeWithServiceResponseAsync(appId, body).toBlocking().single().body(); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture executeAsync(String appId, QueryBody body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeWithServiceResponseAsync(appId, body), serviceCallback); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + public Observable executeAsync(String appId, QueryBody body) { + return executeWithServiceResponseAsync(appId, body).map(new Func1, QueryResults>() { + @Override + public QueryResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query. + * + * @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + public Observable> executeWithServiceResponseAsync(String appId, QueryBody body) { + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.execute(appId, body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/package-info.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/package-info.java new file mode 100644 index 0000000000000..8d9ffd1005120 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ApplicationInsightsDataClient. + * Composite Swagger for Application Insights Data Client. + */ +package com.microsoft.azure.applicationinsights.query.implementation; diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Column.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Column.java new file mode 100644 index 0000000000000..7c16bd50a0f25 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Column.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A table column. + * A column in a table. + */ +public class Column { + /** + * The name of this column. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The data type of this column. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of this column. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of this column. + * + * @param name the name value to set + * @return the Column object itself. + */ + public Column withName(String name) { + this.name = name; + return this; + } + + /** + * Get the data type of this column. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the data type of this column. + * + * @param type the type value to set + * @return the Column object itself. + */ + public Column withType(String type) { + this.type = type; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorDetail.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorDetail.java new file mode 100644 index 0000000000000..b8b3c731dc44c --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorDetail.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetail { + /** + * The error's code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Indicates which property in the request is responsible for the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Indicates which value in 'target' is responsible for the error. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Indicates resources which were responsible for the error. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get the error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error's code. + * + * @param code the code value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates which property in the request is responsible for the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set indicates which property in the request is responsible for the error. + * + * @param target the target value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get indicates which value in 'target' is responsible for the error. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set indicates which value in 'target' is responsible for the error. + * + * @param value the value value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withValue(String value) { + this.value = value; + return this; + } + + /** + * Get indicates resources which were responsible for the error. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set indicates resources which were responsible for the error. + * + * @param resources the resources value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorInfo.java new file mode 100644 index 0000000000000..2a8452404503d --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorInfo.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The code and message for an error. + */ +public class ErrorInfo { + /** + * A machine readable error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Inner error details if they exist. + */ + @JsonProperty(value = "innererror") + private ErrorInfo innererror; + + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get a machine readable error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set a machine readable error code. + * + * @param code the code value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set error details. + * + * @param details the details value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get inner error details if they exist. + * + * @return the innererror value + */ + public ErrorInfo innererror() { + return this.innererror; + } + + /** + * Set inner error details if they exist. + * + * @param innererror the innererror value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withInnererror(ErrorInfo innererror) { + this.innererror = innererror; + return this; + } + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponse.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponse.java new file mode 100644 index 0000000000000..ceeb2cd5a2ba3 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponse.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + * Contains details when the response code indicates an error. + */ +public class ErrorResponse { + /** + * The error details. + */ + @JsonProperty(value = "error", required = true) + private ErrorInfo error; + + /** + * Get the error details. + * + * @return the error value + */ + public ErrorInfo error() { + return this.error; + } + + /** + * Set the error details. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorInfo error) { + this.error = error; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponseException.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponseException.java new file mode 100644 index 0000000000000..ac31cf8b9d6a4 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventType.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventType.java new file mode 100644 index 0000000000000..7e563b86fd32f --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventType.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventType. + */ +public final class EventType extends ExpandableStringEnum { + /** Static value $all for EventType. */ + public static final EventType ALL = fromString("$all"); + + /** Static value traces for EventType. */ + public static final EventType TRACES = fromString("traces"); + + /** Static value customEvents for EventType. */ + public static final EventType CUSTOM_EVENTS = fromString("customEvents"); + + /** Static value pageViews for EventType. */ + public static final EventType PAGE_VIEWS = fromString("pageViews"); + + /** Static value browserTimings for EventType. */ + public static final EventType BROWSER_TIMINGS = fromString("browserTimings"); + + /** Static value requests for EventType. */ + public static final EventType REQUESTS = fromString("requests"); + + /** Static value dependencies for EventType. */ + public static final EventType DEPENDENCIES = fromString("dependencies"); + + /** Static value exceptions for EventType. */ + public static final EventType EXCEPTIONS = fromString("exceptions"); + + /** Static value availabilityResults for EventType. */ + public static final EventType AVAILABILITY_RESULTS = fromString("availabilityResults"); + + /** Static value performanceCounters for EventType. */ + public static final EventType PERFORMANCE_COUNTERS = fromString("performanceCounters"); + + /** Static value customMetrics for EventType. */ + public static final EventType CUSTOM_METRICS = fromString("customMetrics"); + + /** + * Creates or finds a EventType from its string representation. + * @param name a name to look for + * @return the corresponding EventType + */ + @JsonCreator + public static EventType fromString(String name) { + return fromString(name, EventType.class); + } + + /** + * @return known EventType values + */ + public static Collection values() { + return values(EventType.class); + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAiInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAiInfo.java new file mode 100644 index 0000000000000..cb6d2f6d07ed6 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAiInfo.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AI related application info for an event result. + */ +public class EventsAiInfo { + /** + * iKey of the app. + */ + @JsonProperty(value = "iKey") + private String iKey; + + /** + * Name of the application. + */ + @JsonProperty(value = "appName") + private String appName; + + /** + * ID of the application. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * SDK version of the application. + */ + @JsonProperty(value = "sdkVersion") + private String sdkVersion; + + /** + * Get iKey of the app. + * + * @return the iKey value + */ + public String iKey() { + return this.iKey; + } + + /** + * Set iKey of the app. + * + * @param iKey the iKey value to set + * @return the EventsAiInfo object itself. + */ + public EventsAiInfo withIKey(String iKey) { + this.iKey = iKey; + return this; + } + + /** + * Get name of the application. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set name of the application. + * + * @param appName the appName value to set + * @return the EventsAiInfo object itself. + */ + public EventsAiInfo withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get iD of the application. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set iD of the application. + * + * @param appId the appId value to set + * @return the EventsAiInfo object itself. + */ + public EventsAiInfo withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get sDK version of the application. + * + * @return the sdkVersion value + */ + public String sdkVersion() { + return this.sdkVersion; + } + + /** + * Set sDK version of the application. + * + * @param sdkVersion the sdkVersion value to set + * @return the EventsAiInfo object itself. + */ + public EventsAiInfo withSdkVersion(String sdkVersion) { + this.sdkVersion = sdkVersion; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsApplicationInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsApplicationInfo.java new file mode 100644 index 0000000000000..80ead1d7e2eb4 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsApplicationInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application info for an event result. + */ +public class EventsApplicationInfo { + /** + * Version of the application. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get version of the application. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the application. + * + * @param version the version value to set + * @return the EventsApplicationInfo object itself. + */ + public EventsApplicationInfo withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultInfo.java new file mode 100644 index 0000000000000..7c6e810360a2a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultInfo.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The availability result info. + */ +public class EventsAvailabilityResultInfo { + /** + * The name of the availability result. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Indicates if the availability result was successful. + */ + @JsonProperty(value = "success") + private String success; + + /** + * The duration of the availability result. + */ + @JsonProperty(value = "duration") + private Long duration; + + /** + * The performance bucket of the availability result. + */ + @JsonProperty(value = "performanceBucket") + private String performanceBucket; + + /** + * The message of the availability result. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The location of the availability result. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The ID of the availability result. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The size of the availability result. + */ + @JsonProperty(value = "size") + private String size; + + /** + * Get the name of the availability result. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the availability result. + * + * @param name the name value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates if the availability result was successful. + * + * @return the success value + */ + public String success() { + return this.success; + } + + /** + * Set indicates if the availability result was successful. + * + * @param success the success value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withSuccess(String success) { + this.success = success; + return this; + } + + /** + * Get the duration of the availability result. + * + * @return the duration value + */ + public Long duration() { + return this.duration; + } + + /** + * Set the duration of the availability result. + * + * @param duration the duration value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withDuration(Long duration) { + this.duration = duration; + return this; + } + + /** + * Get the performance bucket of the availability result. + * + * @return the performanceBucket value + */ + public String performanceBucket() { + return this.performanceBucket; + } + + /** + * Set the performance bucket of the availability result. + * + * @param performanceBucket the performanceBucket value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withPerformanceBucket(String performanceBucket) { + this.performanceBucket = performanceBucket; + return this; + } + + /** + * Get the message of the availability result. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message of the availability result. + * + * @param message the message value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the location of the availability result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the availability result. + * + * @param location the location value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the ID of the availability result. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the availability result. + * + * @param id the id value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get the size of the availability result. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size of the availability result. + * + * @param size the size value to set + * @return the EventsAvailabilityResultInfo object itself. + */ + public EventsAvailabilityResultInfo withSize(String size) { + this.size = size; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultResult.java new file mode 100644 index 0000000000000..91d410b9c195a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsAvailabilityResultResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * An availability result result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("availabilityResult") +public class EventsAvailabilityResultResult extends EventsResultData { + /** + * The availabilityResult property. + */ + @JsonProperty(value = "availabilityResult") + private EventsAvailabilityResultInfo availabilityResult; + + /** + * Get the availabilityResult value. + * + * @return the availabilityResult value + */ + public EventsAvailabilityResultInfo availabilityResult() { + return this.availabilityResult; + } + + /** + * Set the availabilityResult value. + * + * @param availabilityResult the availabilityResult value to set + * @return the EventsAvailabilityResultResult object itself. + */ + public EventsAvailabilityResultResult withAvailabilityResult(EventsAvailabilityResultInfo availabilityResult) { + this.availabilityResult = availabilityResult; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingInfo.java new file mode 100644 index 0000000000000..6cc4bb4be338a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingInfo.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The browser timing information. + */ +public class EventsBrowserTimingInfo { + /** + * The path of the URL. + */ + @JsonProperty(value = "urlPath") + private String urlPath; + + /** + * The host of the URL. + */ + @JsonProperty(value = "urlHost") + private String urlHost; + + /** + * The name of the page. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The url of the page. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The total duration of the load. + */ + @JsonProperty(value = "totalDuration") + private Long totalDuration; + + /** + * The performance bucket of the load. + */ + @JsonProperty(value = "performanceBucket") + private String performanceBucket; + + /** + * The network duration of the load. + */ + @JsonProperty(value = "networkDuration") + private Long networkDuration; + + /** + * The send duration of the load. + */ + @JsonProperty(value = "sendDuration") + private Long sendDuration; + + /** + * The receive duration of the load. + */ + @JsonProperty(value = "receiveDuration") + private Long receiveDuration; + + /** + * The processing duration of the load. + */ + @JsonProperty(value = "processingDuration") + private Long processingDuration; + + /** + * Get the path of the URL. + * + * @return the urlPath value + */ + public String urlPath() { + return this.urlPath; + } + + /** + * Set the path of the URL. + * + * @param urlPath the urlPath value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withUrlPath(String urlPath) { + this.urlPath = urlPath; + return this; + } + + /** + * Get the host of the URL. + * + * @return the urlHost value + */ + public String urlHost() { + return this.urlHost; + } + + /** + * Set the host of the URL. + * + * @param urlHost the urlHost value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withUrlHost(String urlHost) { + this.urlHost = urlHost; + return this; + } + + /** + * Get the name of the page. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the page. + * + * @param name the name value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the url of the page. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the url of the page. + * + * @param url the url value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the total duration of the load. + * + * @return the totalDuration value + */ + public Long totalDuration() { + return this.totalDuration; + } + + /** + * Set the total duration of the load. + * + * @param totalDuration the totalDuration value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withTotalDuration(Long totalDuration) { + this.totalDuration = totalDuration; + return this; + } + + /** + * Get the performance bucket of the load. + * + * @return the performanceBucket value + */ + public String performanceBucket() { + return this.performanceBucket; + } + + /** + * Set the performance bucket of the load. + * + * @param performanceBucket the performanceBucket value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withPerformanceBucket(String performanceBucket) { + this.performanceBucket = performanceBucket; + return this; + } + + /** + * Get the network duration of the load. + * + * @return the networkDuration value + */ + public Long networkDuration() { + return this.networkDuration; + } + + /** + * Set the network duration of the load. + * + * @param networkDuration the networkDuration value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withNetworkDuration(Long networkDuration) { + this.networkDuration = networkDuration; + return this; + } + + /** + * Get the send duration of the load. + * + * @return the sendDuration value + */ + public Long sendDuration() { + return this.sendDuration; + } + + /** + * Set the send duration of the load. + * + * @param sendDuration the sendDuration value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withSendDuration(Long sendDuration) { + this.sendDuration = sendDuration; + return this; + } + + /** + * Get the receive duration of the load. + * + * @return the receiveDuration value + */ + public Long receiveDuration() { + return this.receiveDuration; + } + + /** + * Set the receive duration of the load. + * + * @param receiveDuration the receiveDuration value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withReceiveDuration(Long receiveDuration) { + this.receiveDuration = receiveDuration; + return this; + } + + /** + * Get the processing duration of the load. + * + * @return the processingDuration value + */ + public Long processingDuration() { + return this.processingDuration; + } + + /** + * Set the processing duration of the load. + * + * @param processingDuration the processingDuration value to set + * @return the EventsBrowserTimingInfo object itself. + */ + public EventsBrowserTimingInfo withProcessingDuration(Long processingDuration) { + this.processingDuration = processingDuration; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingResult.java new file mode 100644 index 0000000000000..754f49a8af3bc --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsBrowserTimingResult.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A browser timing result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("browserTiming") +public class EventsBrowserTimingResult extends EventsResultData { + /** + * The browserTiming property. + */ + @JsonProperty(value = "browserTiming") + private EventsBrowserTimingInfo browserTiming; + + /** + * The clientPerformance property. + */ + @JsonProperty(value = "clientPerformance") + private EventsClientPerformanceInfo clientPerformance; + + /** + * Get the browserTiming value. + * + * @return the browserTiming value + */ + public EventsBrowserTimingInfo browserTiming() { + return this.browserTiming; + } + + /** + * Set the browserTiming value. + * + * @param browserTiming the browserTiming value to set + * @return the EventsBrowserTimingResult object itself. + */ + public EventsBrowserTimingResult withBrowserTiming(EventsBrowserTimingInfo browserTiming) { + this.browserTiming = browserTiming; + return this; + } + + /** + * Get the clientPerformance value. + * + * @return the clientPerformance value + */ + public EventsClientPerformanceInfo clientPerformance() { + return this.clientPerformance; + } + + /** + * Set the clientPerformance value. + * + * @param clientPerformance the clientPerformance value to set + * @return the EventsBrowserTimingResult object itself. + */ + public EventsBrowserTimingResult withClientPerformance(EventsClientPerformanceInfo clientPerformance) { + this.clientPerformance = clientPerformance; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientInfo.java new file mode 100644 index 0000000000000..151e8c83388d1 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientInfo.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client info for an event result. + */ +public class EventsClientInfo { + /** + * Model of the client. + */ + @JsonProperty(value = "model") + private String model; + + /** + * Operating system of the client. + */ + @JsonProperty(value = "os") + private String os; + + /** + * Type of the client. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Browser of the client. + */ + @JsonProperty(value = "browser") + private String browser; + + /** + * IP address of the client. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * City of the client. + */ + @JsonProperty(value = "city") + private String city; + + /** + * State or province of the client. + */ + @JsonProperty(value = "stateOrProvince") + private String stateOrProvince; + + /** + * Country or region of the client. + */ + @JsonProperty(value = "countryOrRegion") + private String countryOrRegion; + + /** + * Get model of the client. + * + * @return the model value + */ + public String model() { + return this.model; + } + + /** + * Set model of the client. + * + * @param model the model value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withModel(String model) { + this.model = model; + return this; + } + + /** + * Get operating system of the client. + * + * @return the os value + */ + public String os() { + return this.os; + } + + /** + * Set operating system of the client. + * + * @param os the os value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withOs(String os) { + this.os = os; + return this; + } + + /** + * Get type of the client. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the client. + * + * @param type the type value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withType(String type) { + this.type = type; + return this; + } + + /** + * Get browser of the client. + * + * @return the browser value + */ + public String browser() { + return this.browser; + } + + /** + * Set browser of the client. + * + * @param browser the browser value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withBrowser(String browser) { + this.browser = browser; + return this; + } + + /** + * Get iP address of the client. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set iP address of the client. + * + * @param ip the ip value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get city of the client. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set city of the client. + * + * @param city the city value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withCity(String city) { + this.city = city; + return this; + } + + /** + * Get state or province of the client. + * + * @return the stateOrProvince value + */ + public String stateOrProvince() { + return this.stateOrProvince; + } + + /** + * Set state or province of the client. + * + * @param stateOrProvince the stateOrProvince value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * Get country or region of the client. + * + * @return the countryOrRegion value + */ + public String countryOrRegion() { + return this.countryOrRegion; + } + + /** + * Set country or region of the client. + * + * @param countryOrRegion the countryOrRegion value to set + * @return the EventsClientInfo object itself. + */ + public EventsClientInfo withCountryOrRegion(String countryOrRegion) { + this.countryOrRegion = countryOrRegion; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientPerformanceInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientPerformanceInfo.java new file mode 100644 index 0000000000000..2edbd1bf59591 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsClientPerformanceInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client performance information. + */ +public class EventsClientPerformanceInfo { + /** + * The name of the client performance. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name of the client performance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the client performance. + * + * @param name the name value to set + * @return the EventsClientPerformanceInfo object itself. + */ + public EventsClientPerformanceInfo withName(String name) { + this.name = name; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCloudInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCloudInfo.java new file mode 100644 index 0000000000000..fcb6fd194b440 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCloudInfo.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cloud info for an event result. + */ +public class EventsCloudInfo { + /** + * Role name of the cloud. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /** + * Role instance of the cloud. + */ + @JsonProperty(value = "roleInstance") + private String roleInstance; + + /** + * Get role name of the cloud. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + + /** + * Set role name of the cloud. + * + * @param roleName the roleName value to set + * @return the EventsCloudInfo object itself. + */ + public EventsCloudInfo withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get role instance of the cloud. + * + * @return the roleInstance value + */ + public String roleInstance() { + return this.roleInstance; + } + + /** + * Set role instance of the cloud. + * + * @param roleInstance the roleInstance value to set + * @return the EventsCloudInfo object itself. + */ + public EventsCloudInfo withRoleInstance(String roleInstance) { + this.roleInstance = roleInstance; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventInfo.java new file mode 100644 index 0000000000000..8235e1cd39f12 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The custom event information. + */ +public class EventsCustomEventInfo { + /** + * The name of the custom event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name of the custom event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the custom event. + * + * @param name the name value to set + * @return the EventsCustomEventInfo object itself. + */ + public EventsCustomEventInfo withName(String name) { + this.name = name; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventResult.java new file mode 100644 index 0000000000000..9fe0cd493cd15 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomEventResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A custom event result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("customEvent") +public class EventsCustomEventResult extends EventsResultData { + /** + * The customEvent property. + */ + @JsonProperty(value = "customEvent") + private EventsCustomEventInfo customEvent; + + /** + * Get the customEvent value. + * + * @return the customEvent value + */ + public EventsCustomEventInfo customEvent() { + return this.customEvent; + } + + /** + * Set the customEvent value. + * + * @param customEvent the customEvent value to set + * @return the EventsCustomEventResult object itself. + */ + public EventsCustomEventResult withCustomEvent(EventsCustomEventInfo customEvent) { + this.customEvent = customEvent; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricInfo.java new file mode 100644 index 0000000000000..04a0bffba09f5 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricInfo.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The custom metric info. + */ +public class EventsCustomMetricInfo { + /** + * The name of the custom metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the custom metric. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * The sum of the custom metric. + */ + @JsonProperty(value = "valueSum") + private Double valueSum; + + /** + * The count of the custom metric. + */ + @JsonProperty(value = "valueCount") + private Integer valueCount; + + /** + * The minimum value of the custom metric. + */ + @JsonProperty(value = "valueMin") + private Double valueMin; + + /** + * The maximum value of the custom metric. + */ + @JsonProperty(value = "valueMax") + private Double valueMax; + + /** + * The standard deviation of the custom metric. + */ + @JsonProperty(value = "valueStdDev") + private Double valueStdDev; + + /** + * Get the name of the custom metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the custom metric. + * + * @param name the name value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the custom metric. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the value of the custom metric. + * + * @param value the value value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValue(Double value) { + this.value = value; + return this; + } + + /** + * Get the sum of the custom metric. + * + * @return the valueSum value + */ + public Double valueSum() { + return this.valueSum; + } + + /** + * Set the sum of the custom metric. + * + * @param valueSum the valueSum value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValueSum(Double valueSum) { + this.valueSum = valueSum; + return this; + } + + /** + * Get the count of the custom metric. + * + * @return the valueCount value + */ + public Integer valueCount() { + return this.valueCount; + } + + /** + * Set the count of the custom metric. + * + * @param valueCount the valueCount value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValueCount(Integer valueCount) { + this.valueCount = valueCount; + return this; + } + + /** + * Get the minimum value of the custom metric. + * + * @return the valueMin value + */ + public Double valueMin() { + return this.valueMin; + } + + /** + * Set the minimum value of the custom metric. + * + * @param valueMin the valueMin value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValueMin(Double valueMin) { + this.valueMin = valueMin; + return this; + } + + /** + * Get the maximum value of the custom metric. + * + * @return the valueMax value + */ + public Double valueMax() { + return this.valueMax; + } + + /** + * Set the maximum value of the custom metric. + * + * @param valueMax the valueMax value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValueMax(Double valueMax) { + this.valueMax = valueMax; + return this; + } + + /** + * Get the standard deviation of the custom metric. + * + * @return the valueStdDev value + */ + public Double valueStdDev() { + return this.valueStdDev; + } + + /** + * Set the standard deviation of the custom metric. + * + * @param valueStdDev the valueStdDev value to set + * @return the EventsCustomMetricInfo object itself. + */ + public EventsCustomMetricInfo withValueStdDev(Double valueStdDev) { + this.valueStdDev = valueStdDev; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricResult.java new file mode 100644 index 0000000000000..50fda289964b2 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsCustomMetricResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A custom metric result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("customMetric") +public class EventsCustomMetricResult extends EventsResultData { + /** + * The customMetric property. + */ + @JsonProperty(value = "customMetric") + private EventsCustomMetricInfo customMetric; + + /** + * Get the customMetric value. + * + * @return the customMetric value + */ + public EventsCustomMetricInfo customMetric() { + return this.customMetric; + } + + /** + * Set the customMetric value. + * + * @param customMetric the customMetric value to set + * @return the EventsCustomMetricResult object itself. + */ + public EventsCustomMetricResult withCustomMetric(EventsCustomMetricInfo customMetric) { + this.customMetric = customMetric; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyInfo.java new file mode 100644 index 0000000000000..29c8c8db4955a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyInfo.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The dependency info. + */ +public class EventsDependencyInfo { + /** + * The target of the dependency. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The data of the dependency. + */ + @JsonProperty(value = "data") + private String data; + + /** + * Indicates if the dependency was successful. + */ + @JsonProperty(value = "success") + private String success; + + /** + * The duration of the dependency. + */ + @JsonProperty(value = "duration") + private Long duration; + + /** + * The performance bucket of the dependency. + */ + @JsonProperty(value = "performanceBucket") + private String performanceBucket; + + /** + * The result code of the dependency. + */ + @JsonProperty(value = "resultCode") + private String resultCode; + + /** + * The type of the dependency. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The name of the dependency. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the dependency. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the target of the dependency. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the dependency. + * + * @param target the target value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the data of the dependency. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set the data of the dependency. + * + * @param data the data value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withData(String data) { + this.data = data; + return this; + } + + /** + * Get indicates if the dependency was successful. + * + * @return the success value + */ + public String success() { + return this.success; + } + + /** + * Set indicates if the dependency was successful. + * + * @param success the success value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withSuccess(String success) { + this.success = success; + return this; + } + + /** + * Get the duration of the dependency. + * + * @return the duration value + */ + public Long duration() { + return this.duration; + } + + /** + * Set the duration of the dependency. + * + * @param duration the duration value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withDuration(Long duration) { + this.duration = duration; + return this; + } + + /** + * Get the performance bucket of the dependency. + * + * @return the performanceBucket value + */ + public String performanceBucket() { + return this.performanceBucket; + } + + /** + * Set the performance bucket of the dependency. + * + * @param performanceBucket the performanceBucket value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withPerformanceBucket(String performanceBucket) { + this.performanceBucket = performanceBucket; + return this; + } + + /** + * Get the result code of the dependency. + * + * @return the resultCode value + */ + public String resultCode() { + return this.resultCode; + } + + /** + * Set the result code of the dependency. + * + * @param resultCode the resultCode value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withResultCode(String resultCode) { + this.resultCode = resultCode; + return this; + } + + /** + * Get the type of the dependency. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the dependency. + * + * @param type the type value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name of the dependency. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the dependency. + * + * @param name the name value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the dependency. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the dependency. + * + * @param id the id value to set + * @return the EventsDependencyInfo object itself. + */ + public EventsDependencyInfo withId(String id) { + this.id = id; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyResult.java new file mode 100644 index 0000000000000..af0da237a05a1 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsDependencyResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A dependency result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("dependency") +public class EventsDependencyResult extends EventsResultData { + /** + * The dependency property. + */ + @JsonProperty(value = "dependency") + private EventsDependencyInfo dependency; + + /** + * Get the dependency value. + * + * @return the dependency value + */ + public EventsDependencyInfo dependency() { + return this.dependency; + } + + /** + * Set the dependency value. + * + * @param dependency the dependency value to set + * @return the EventsDependencyResult object itself. + */ + public EventsDependencyResult withDependency(EventsDependencyInfo dependency) { + this.dependency = dependency; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetail.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetail.java new file mode 100644 index 0000000000000..7a966d9264ea6 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetail.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Exception details. + */ +public class EventsExceptionDetail { + /** + * The severity level of the exception detail. + */ + @JsonProperty(value = "severityLevel") + private String severityLevel; + + /** + * The outer ID of the exception detail. + */ + @JsonProperty(value = "outerId") + private String outerId; + + /** + * The message of the exception detail. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The type of the exception detail. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The ID of the exception detail. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The parsed stack. + */ + @JsonProperty(value = "parsedStack") + private List parsedStack; + + /** + * Get the severity level of the exception detail. + * + * @return the severityLevel value + */ + public String severityLevel() { + return this.severityLevel; + } + + /** + * Set the severity level of the exception detail. + * + * @param severityLevel the severityLevel value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withSeverityLevel(String severityLevel) { + this.severityLevel = severityLevel; + return this; + } + + /** + * Get the outer ID of the exception detail. + * + * @return the outerId value + */ + public String outerId() { + return this.outerId; + } + + /** + * Set the outer ID of the exception detail. + * + * @param outerId the outerId value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withOuterId(String outerId) { + this.outerId = outerId; + return this; + } + + /** + * Get the message of the exception detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message of the exception detail. + * + * @param message the message value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type of the exception detail. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the exception detail. + * + * @param type the type value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withType(String type) { + this.type = type; + return this; + } + + /** + * Get the ID of the exception detail. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the exception detail. + * + * @param id the id value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withId(String id) { + this.id = id; + return this; + } + + /** + * Get the parsed stack. + * + * @return the parsedStack value + */ + public List parsedStack() { + return this.parsedStack; + } + + /** + * Set the parsed stack. + * + * @param parsedStack the parsedStack value to set + * @return the EventsExceptionDetail object itself. + */ + public EventsExceptionDetail withParsedStack(List parsedStack) { + this.parsedStack = parsedStack; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetailsParsedStack.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetailsParsedStack.java new file mode 100644 index 0000000000000..7ecd63cfe08e1 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionDetailsParsedStack.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A parsed stack entry. + */ +public class EventsExceptionDetailsParsedStack { + /** + * The assembly of the stack entry. + */ + @JsonProperty(value = "assembly") + private String assembly; + + /** + * The method of the stack entry. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The level of the stack entry. + */ + @JsonProperty(value = "level") + private Long level; + + /** + * The line of the stack entry. + */ + @JsonProperty(value = "line") + private Long line; + + /** + * Get the assembly of the stack entry. + * + * @return the assembly value + */ + public String assembly() { + return this.assembly; + } + + /** + * Set the assembly of the stack entry. + * + * @param assembly the assembly value to set + * @return the EventsExceptionDetailsParsedStack object itself. + */ + public EventsExceptionDetailsParsedStack withAssembly(String assembly) { + this.assembly = assembly; + return this; + } + + /** + * Get the method of the stack entry. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the method of the stack entry. + * + * @param method the method value to set + * @return the EventsExceptionDetailsParsedStack object itself. + */ + public EventsExceptionDetailsParsedStack withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the level of the stack entry. + * + * @return the level value + */ + public Long level() { + return this.level; + } + + /** + * Set the level of the stack entry. + * + * @param level the level value to set + * @return the EventsExceptionDetailsParsedStack object itself. + */ + public EventsExceptionDetailsParsedStack withLevel(Long level) { + this.level = level; + return this; + } + + /** + * Get the line of the stack entry. + * + * @return the line value + */ + public Long line() { + return this.line; + } + + /** + * Set the line of the stack entry. + * + * @param line the line value to set + * @return the EventsExceptionDetailsParsedStack object itself. + */ + public EventsExceptionDetailsParsedStack withLine(Long line) { + this.line = line; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionInfo.java new file mode 100644 index 0000000000000..acccb6106c2e8 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionInfo.java @@ -0,0 +1,434 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The exception info. + */ +public class EventsExceptionInfo { + /** + * The severity level of the exception. + */ + @JsonProperty(value = "severityLevel") + private Integer severityLevel; + + /** + * The problem ID of the exception. + */ + @JsonProperty(value = "problemId") + private String problemId; + + /** + * Indicates where the exception was handled at. + */ + @JsonProperty(value = "handledAt") + private String handledAt; + + /** + * The assembly which threw the exception. + */ + @JsonProperty(value = "assembly") + private String assembly; + + /** + * The method that threw the exception. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The message of the exception. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The type of the exception. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The outer type of the exception. + */ + @JsonProperty(value = "outerType") + private String outerType; + + /** + * The outer method of the exception. + */ + @JsonProperty(value = "outerMethod") + private String outerMethod; + + /** + * The outer assmebly of the exception. + */ + @JsonProperty(value = "outerAssembly") + private String outerAssembly; + + /** + * The outer message of the exception. + */ + @JsonProperty(value = "outerMessage") + private String outerMessage; + + /** + * The inner most type of the exception. + */ + @JsonProperty(value = "innermostType") + private String innermostType; + + /** + * The inner most message of the exception. + */ + @JsonProperty(value = "innermostMessage") + private String innermostMessage; + + /** + * The inner most method of the exception. + */ + @JsonProperty(value = "innermostMethod") + private String innermostMethod; + + /** + * The inner most assembly of the exception. + */ + @JsonProperty(value = "innermostAssembly") + private String innermostAssembly; + + /** + * The details of the exception. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the severity level of the exception. + * + * @return the severityLevel value + */ + public Integer severityLevel() { + return this.severityLevel; + } + + /** + * Set the severity level of the exception. + * + * @param severityLevel the severityLevel value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withSeverityLevel(Integer severityLevel) { + this.severityLevel = severityLevel; + return this; + } + + /** + * Get the problem ID of the exception. + * + * @return the problemId value + */ + public String problemId() { + return this.problemId; + } + + /** + * Set the problem ID of the exception. + * + * @param problemId the problemId value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withProblemId(String problemId) { + this.problemId = problemId; + return this; + } + + /** + * Get indicates where the exception was handled at. + * + * @return the handledAt value + */ + public String handledAt() { + return this.handledAt; + } + + /** + * Set indicates where the exception was handled at. + * + * @param handledAt the handledAt value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withHandledAt(String handledAt) { + this.handledAt = handledAt; + return this; + } + + /** + * Get the assembly which threw the exception. + * + * @return the assembly value + */ + public String assembly() { + return this.assembly; + } + + /** + * Set the assembly which threw the exception. + * + * @param assembly the assembly value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withAssembly(String assembly) { + this.assembly = assembly; + return this; + } + + /** + * Get the method that threw the exception. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the method that threw the exception. + * + * @param method the method value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the message of the exception. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message of the exception. + * + * @param message the message value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type of the exception. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the exception. + * + * @param type the type value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withType(String type) { + this.type = type; + return this; + } + + /** + * Get the outer type of the exception. + * + * @return the outerType value + */ + public String outerType() { + return this.outerType; + } + + /** + * Set the outer type of the exception. + * + * @param outerType the outerType value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withOuterType(String outerType) { + this.outerType = outerType; + return this; + } + + /** + * Get the outer method of the exception. + * + * @return the outerMethod value + */ + public String outerMethod() { + return this.outerMethod; + } + + /** + * Set the outer method of the exception. + * + * @param outerMethod the outerMethod value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withOuterMethod(String outerMethod) { + this.outerMethod = outerMethod; + return this; + } + + /** + * Get the outer assmebly of the exception. + * + * @return the outerAssembly value + */ + public String outerAssembly() { + return this.outerAssembly; + } + + /** + * Set the outer assmebly of the exception. + * + * @param outerAssembly the outerAssembly value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withOuterAssembly(String outerAssembly) { + this.outerAssembly = outerAssembly; + return this; + } + + /** + * Get the outer message of the exception. + * + * @return the outerMessage value + */ + public String outerMessage() { + return this.outerMessage; + } + + /** + * Set the outer message of the exception. + * + * @param outerMessage the outerMessage value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withOuterMessage(String outerMessage) { + this.outerMessage = outerMessage; + return this; + } + + /** + * Get the inner most type of the exception. + * + * @return the innermostType value + */ + public String innermostType() { + return this.innermostType; + } + + /** + * Set the inner most type of the exception. + * + * @param innermostType the innermostType value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withInnermostType(String innermostType) { + this.innermostType = innermostType; + return this; + } + + /** + * Get the inner most message of the exception. + * + * @return the innermostMessage value + */ + public String innermostMessage() { + return this.innermostMessage; + } + + /** + * Set the inner most message of the exception. + * + * @param innermostMessage the innermostMessage value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withInnermostMessage(String innermostMessage) { + this.innermostMessage = innermostMessage; + return this; + } + + /** + * Get the inner most method of the exception. + * + * @return the innermostMethod value + */ + public String innermostMethod() { + return this.innermostMethod; + } + + /** + * Set the inner most method of the exception. + * + * @param innermostMethod the innermostMethod value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withInnermostMethod(String innermostMethod) { + this.innermostMethod = innermostMethod; + return this; + } + + /** + * Get the inner most assembly of the exception. + * + * @return the innermostAssembly value + */ + public String innermostAssembly() { + return this.innermostAssembly; + } + + /** + * Set the inner most assembly of the exception. + * + * @param innermostAssembly the innermostAssembly value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withInnermostAssembly(String innermostAssembly) { + this.innermostAssembly = innermostAssembly; + return this; + } + + /** + * Get the details of the exception. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details of the exception. + * + * @param details the details value to set + * @return the EventsExceptionInfo object itself. + */ + public EventsExceptionInfo withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionResult.java new file mode 100644 index 0000000000000..f51fa97cdc09c --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsExceptionResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * An exception result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("exception") +public class EventsExceptionResult extends EventsResultData { + /** + * The exception property. + */ + @JsonProperty(value = "exception") + private EventsExceptionInfo exception; + + /** + * Get the exception value. + * + * @return the exception value + */ + public EventsExceptionInfo exception() { + return this.exception; + } + + /** + * Set the exception value. + * + * @param exception the exception value to set + * @return the EventsExceptionResult object itself. + */ + public EventsExceptionResult withException(EventsExceptionInfo exception) { + this.exception = exception; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsOperationInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsOperationInfo.java new file mode 100644 index 0000000000000..14bcc6f9ae9d3 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsOperationInfo.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation info for an event result. + */ +public class EventsOperationInfo { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * ID of the operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Parent ID of the operation. + */ + @JsonProperty(value = "parentId") + private String parentId; + + /** + * Synthetic source of the operation. + */ + @JsonProperty(value = "syntheticSource") + private String syntheticSource; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the EventsOperationInfo object itself. + */ + public EventsOperationInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get iD of the operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the operation. + * + * @param id the id value to set + * @return the EventsOperationInfo object itself. + */ + public EventsOperationInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get parent ID of the operation. + * + * @return the parentId value + */ + public String parentId() { + return this.parentId; + } + + /** + * Set parent ID of the operation. + * + * @param parentId the parentId value to set + * @return the EventsOperationInfo object itself. + */ + public EventsOperationInfo withParentId(String parentId) { + this.parentId = parentId; + return this; + } + + /** + * Get synthetic source of the operation. + * + * @return the syntheticSource value + */ + public String syntheticSource() { + return this.syntheticSource; + } + + /** + * Set synthetic source of the operation. + * + * @param syntheticSource the syntheticSource value to set + * @return the EventsOperationInfo object itself. + */ + public EventsOperationInfo withSyntheticSource(String syntheticSource) { + this.syntheticSource = syntheticSource; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewInfo.java new file mode 100644 index 0000000000000..55566fffb5253 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewInfo.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The page view information. + */ +public class EventsPageViewInfo { + /** + * The name of the page. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URL of the page. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The duration of the page view. + */ + @JsonProperty(value = "duration") + private String duration; + + /** + * The performance bucket of the page view. + */ + @JsonProperty(value = "performanceBucket") + private String performanceBucket; + + /** + * Get the name of the page. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the page. + * + * @param name the name value to set + * @return the EventsPageViewInfo object itself. + */ + public EventsPageViewInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URL of the page. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the URL of the page. + * + * @param url the url value to set + * @return the EventsPageViewInfo object itself. + */ + public EventsPageViewInfo withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the duration of the page view. + * + * @return the duration value + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration of the page view. + * + * @param duration the duration value to set + * @return the EventsPageViewInfo object itself. + */ + public EventsPageViewInfo withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Get the performance bucket of the page view. + * + * @return the performanceBucket value + */ + public String performanceBucket() { + return this.performanceBucket; + } + + /** + * Set the performance bucket of the page view. + * + * @param performanceBucket the performanceBucket value to set + * @return the EventsPageViewInfo object itself. + */ + public EventsPageViewInfo withPerformanceBucket(String performanceBucket) { + this.performanceBucket = performanceBucket; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewResult.java new file mode 100644 index 0000000000000..15d7fb9002b18 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPageViewResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A page view result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("pageView") +public class EventsPageViewResult extends EventsResultData { + /** + * The pageView property. + */ + @JsonProperty(value = "pageView") + private EventsPageViewInfo pageView; + + /** + * Get the pageView value. + * + * @return the pageView value + */ + public EventsPageViewInfo pageView() { + return this.pageView; + } + + /** + * Set the pageView value. + * + * @param pageView the pageView value to set + * @return the EventsPageViewResult object itself. + */ + public EventsPageViewResult withPageView(EventsPageViewInfo pageView) { + this.pageView = pageView; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterInfo.java new file mode 100644 index 0000000000000..4d7d77c52b9a7 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterInfo.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The performance counter info. + */ +public class EventsPerformanceCounterInfo { + /** + * The value of the performance counter. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * The name of the performance counter. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The category of the performance counter. + */ + @JsonProperty(value = "category") + private String category; + + /** + * The counter of the performance counter. + */ + @JsonProperty(value = "counter") + private String counter; + + /** + * The instance name of the performance counter. + */ + @JsonProperty(value = "instanceName") + private String instanceName; + + /** + * The instance of the performance counter. + */ + @JsonProperty(value = "instance") + private String instance; + + /** + * Get the value of the performance counter. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the value of the performance counter. + * + * @param value the value value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withValue(Double value) { + this.value = value; + return this; + } + + /** + * Get the name of the performance counter. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the performance counter. + * + * @param name the name value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the category of the performance counter. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category of the performance counter. + * + * @param category the category value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the counter of the performance counter. + * + * @return the counter value + */ + public String counter() { + return this.counter; + } + + /** + * Set the counter of the performance counter. + * + * @param counter the counter value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withCounter(String counter) { + this.counter = counter; + return this; + } + + /** + * Get the instance name of the performance counter. + * + * @return the instanceName value + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Set the instance name of the performance counter. + * + * @param instanceName the instanceName value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withInstanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * Get the instance of the performance counter. + * + * @return the instance value + */ + public String instance() { + return this.instance; + } + + /** + * Set the instance of the performance counter. + * + * @param instance the instance value to set + * @return the EventsPerformanceCounterInfo object itself. + */ + public EventsPerformanceCounterInfo withInstance(String instance) { + this.instance = instance; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterResult.java new file mode 100644 index 0000000000000..b5c33c6b620c7 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsPerformanceCounterResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A performance counter result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("performanceCounter") +public class EventsPerformanceCounterResult extends EventsResultData { + /** + * The performanceCounter property. + */ + @JsonProperty(value = "performanceCounter") + private EventsPerformanceCounterInfo performanceCounter; + + /** + * Get the performanceCounter value. + * + * @return the performanceCounter value + */ + public EventsPerformanceCounterInfo performanceCounter() { + return this.performanceCounter; + } + + /** + * Set the performanceCounter value. + * + * @param performanceCounter the performanceCounter value to set + * @return the EventsPerformanceCounterResult object itself. + */ + public EventsPerformanceCounterResult withPerformanceCounter(EventsPerformanceCounterInfo performanceCounter) { + this.performanceCounter = performanceCounter; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestInfo.java new file mode 100644 index 0000000000000..b6bb8fb7a392e --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestInfo.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request info. + */ +public class EventsRequestInfo { + /** + * The name of the request. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URL of the request. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Indicates if the request was successful. + */ + @JsonProperty(value = "success") + private String success; + + /** + * The duration of the request. + */ + @JsonProperty(value = "duration") + private Double duration; + + /** + * The performance bucket of the request. + */ + @JsonProperty(value = "performanceBucket") + private String performanceBucket; + + /** + * The result code of the request. + */ + @JsonProperty(value = "resultCode") + private String resultCode; + + /** + * The source of the request. + */ + @JsonProperty(value = "source") + private String source; + + /** + * The ID of the request. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the request. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the request. + * + * @param name the name value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URL of the request. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the URL of the request. + * + * @param url the url value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get indicates if the request was successful. + * + * @return the success value + */ + public String success() { + return this.success; + } + + /** + * Set indicates if the request was successful. + * + * @param success the success value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withSuccess(String success) { + this.success = success; + return this; + } + + /** + * Get the duration of the request. + * + * @return the duration value + */ + public Double duration() { + return this.duration; + } + + /** + * Set the duration of the request. + * + * @param duration the duration value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withDuration(Double duration) { + this.duration = duration; + return this; + } + + /** + * Get the performance bucket of the request. + * + * @return the performanceBucket value + */ + public String performanceBucket() { + return this.performanceBucket; + } + + /** + * Set the performance bucket of the request. + * + * @param performanceBucket the performanceBucket value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withPerformanceBucket(String performanceBucket) { + this.performanceBucket = performanceBucket; + return this; + } + + /** + * Get the result code of the request. + * + * @return the resultCode value + */ + public String resultCode() { + return this.resultCode; + } + + /** + * Set the result code of the request. + * + * @param resultCode the resultCode value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withResultCode(String resultCode) { + this.resultCode = resultCode; + return this; + } + + /** + * Get the source of the request. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set the source of the request. + * + * @param source the source value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the ID of the request. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request. + * + * @param id the id value to set + * @return the EventsRequestInfo object itself. + */ + public EventsRequestInfo withId(String id) { + this.id = id; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestResult.java new file mode 100644 index 0000000000000..fc8f8e5b35975 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsRequestResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A request result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("request") +public class EventsRequestResult extends EventsResultData { + /** + * The request property. + */ + @JsonProperty(value = "request") + private EventsRequestInfo request; + + /** + * Get the request value. + * + * @return the request value + */ + public EventsRequestInfo request() { + return this.request; + } + + /** + * Set the request value. + * + * @param request the request value to set + * @return the EventsRequestResult object itself. + */ + public EventsRequestResult withRequest(EventsRequestInfo request) { + this.request = request; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResult.java new file mode 100644 index 0000000000000..36f36b895ccd2 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An event query result. + */ +public class EventsResult { + /** + * OData messages for this response. + */ + @JsonProperty(value = "@ai\\.messages") + private List aimessages; + + /** + * The value property. + */ + @JsonProperty(value = "value") + private EventsResultData value; + + /** + * Get oData messages for this response. + * + * @return the aimessages value + */ + public List aimessages() { + return this.aimessages; + } + + /** + * Set oData messages for this response. + * + * @param aimessages the aimessages value to set + * @return the EventsResult object itself. + */ + public EventsResult withAimessages(List aimessages) { + this.aimessages = aimessages; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public EventsResultData value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the EventsResult object itself. + */ + public EventsResult withValue(EventsResultData value) { + this.value = value; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultData.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultData.java new file mode 100644 index 0000000000000..0ed8c89a89caa --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultData.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Events query result data. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("eventsResultData") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "trace", value = EventsTraceResult.class), + @JsonSubTypes.Type(name = "customEvent", value = EventsCustomEventResult.class), + @JsonSubTypes.Type(name = "pageView", value = EventsPageViewResult.class), + @JsonSubTypes.Type(name = "browserTiming", value = EventsBrowserTimingResult.class), + @JsonSubTypes.Type(name = "request", value = EventsRequestResult.class), + @JsonSubTypes.Type(name = "dependency", value = EventsDependencyResult.class), + @JsonSubTypes.Type(name = "exception", value = EventsExceptionResult.class), + @JsonSubTypes.Type(name = "availabilityResult", value = EventsAvailabilityResultResult.class), + @JsonSubTypes.Type(name = "performanceCounter", value = EventsPerformanceCounterResult.class), + @JsonSubTypes.Type(name = "customMetric", value = EventsCustomMetricResult.class) +}) +public class EventsResultData { + /** + * The unique ID for this event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Count of the event. + */ + @JsonProperty(value = "count") + private Long count; + + /** + * Timestamp of the event. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * Custom dimensions of the event. + */ + @JsonProperty(value = "customDimensions") + private EventsResultDataCustomDimensions customDimensions; + + /** + * Custom measurements of the event. + */ + @JsonProperty(value = "customMeasurements") + private EventsResultDataCustomMeasurements customMeasurements; + + /** + * Operation info of the event. + */ + @JsonProperty(value = "operation") + private EventsOperationInfo operation; + + /** + * Session info of the event. + */ + @JsonProperty(value = "session") + private EventsSessionInfo session; + + /** + * User info of the event. + */ + @JsonProperty(value = "user") + private EventsUserInfo user; + + /** + * Cloud info of the event. + */ + @JsonProperty(value = "cloud") + private EventsCloudInfo cloud; + + /** + * AI info of the event. + */ + @JsonProperty(value = "ai") + private EventsAiInfo ai; + + /** + * Application info of the event. + */ + @JsonProperty(value = "application") + private EventsApplicationInfo application; + + /** + * Client info of the event. + */ + @JsonProperty(value = "client") + private EventsClientInfo client; + + /** + * Get the unique ID for this event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID for this event. + * + * @param id the id value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withId(String id) { + this.id = id; + return this; + } + + /** + * Get count of the event. + * + * @return the count value + */ + public Long count() { + return this.count; + } + + /** + * Set count of the event. + * + * @param count the count value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get timestamp of the event. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set timestamp of the event. + * + * @param timestamp the timestamp value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get custom dimensions of the event. + * + * @return the customDimensions value + */ + public EventsResultDataCustomDimensions customDimensions() { + return this.customDimensions; + } + + /** + * Set custom dimensions of the event. + * + * @param customDimensions the customDimensions value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withCustomDimensions(EventsResultDataCustomDimensions customDimensions) { + this.customDimensions = customDimensions; + return this; + } + + /** + * Get custom measurements of the event. + * + * @return the customMeasurements value + */ + public EventsResultDataCustomMeasurements customMeasurements() { + return this.customMeasurements; + } + + /** + * Set custom measurements of the event. + * + * @param customMeasurements the customMeasurements value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withCustomMeasurements(EventsResultDataCustomMeasurements customMeasurements) { + this.customMeasurements = customMeasurements; + return this; + } + + /** + * Get operation info of the event. + * + * @return the operation value + */ + public EventsOperationInfo operation() { + return this.operation; + } + + /** + * Set operation info of the event. + * + * @param operation the operation value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withOperation(EventsOperationInfo operation) { + this.operation = operation; + return this; + } + + /** + * Get session info of the event. + * + * @return the session value + */ + public EventsSessionInfo session() { + return this.session; + } + + /** + * Set session info of the event. + * + * @param session the session value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withSession(EventsSessionInfo session) { + this.session = session; + return this; + } + + /** + * Get user info of the event. + * + * @return the user value + */ + public EventsUserInfo user() { + return this.user; + } + + /** + * Set user info of the event. + * + * @param user the user value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withUser(EventsUserInfo user) { + this.user = user; + return this; + } + + /** + * Get cloud info of the event. + * + * @return the cloud value + */ + public EventsCloudInfo cloud() { + return this.cloud; + } + + /** + * Set cloud info of the event. + * + * @param cloud the cloud value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withCloud(EventsCloudInfo cloud) { + this.cloud = cloud; + return this; + } + + /** + * Get aI info of the event. + * + * @return the ai value + */ + public EventsAiInfo ai() { + return this.ai; + } + + /** + * Set aI info of the event. + * + * @param ai the ai value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withAi(EventsAiInfo ai) { + this.ai = ai; + return this; + } + + /** + * Get application info of the event. + * + * @return the application value + */ + public EventsApplicationInfo application() { + return this.application; + } + + /** + * Set application info of the event. + * + * @param application the application value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withApplication(EventsApplicationInfo application) { + this.application = application; + return this; + } + + /** + * Get client info of the event. + * + * @return the client value + */ + public EventsClientInfo client() { + return this.client; + } + + /** + * Set client info of the event. + * + * @param client the client value to set + * @return the EventsResultData object itself. + */ + public EventsResultData withClient(EventsClientInfo client) { + this.client = client; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomDimensions.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomDimensions.java new file mode 100644 index 0000000000000..81a59c08b9729 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomDimensions.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom dimensions of the event. + */ +public class EventsResultDataCustomDimensions { + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the EventsResultDataCustomDimensions object itself. + */ + public EventsResultDataCustomDimensions withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomMeasurements.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomMeasurements.java new file mode 100644 index 0000000000000..d273146acc29f --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResultDataCustomMeasurements.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom measurements of the event. + */ +public class EventsResultDataCustomMeasurements { + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the EventsResultDataCustomMeasurements object itself. + */ + public EventsResultDataCustomMeasurements withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResults.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResults.java new file mode 100644 index 0000000000000..c67ab50356e9f --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsResults.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An events query result. + */ +public class EventsResults { + /** + * OData context metadata endpoint for this response. + */ + @JsonProperty(value = "@odata\\.context") + private String odatacontext; + + /** + * OData messages for this response. + */ + @JsonProperty(value = "@ai\\.messages") + private List aimessages; + + /** + * Contents of the events query result. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get oData context metadata endpoint for this response. + * + * @return the odatacontext value + */ + public String odatacontext() { + return this.odatacontext; + } + + /** + * Set oData context metadata endpoint for this response. + * + * @param odatacontext the odatacontext value to set + * @return the EventsResults object itself. + */ + public EventsResults withOdatacontext(String odatacontext) { + this.odatacontext = odatacontext; + return this; + } + + /** + * Get oData messages for this response. + * + * @return the aimessages value + */ + public List aimessages() { + return this.aimessages; + } + + /** + * Set oData messages for this response. + * + * @param aimessages the aimessages value to set + * @return the EventsResults object itself. + */ + public EventsResults withAimessages(List aimessages) { + this.aimessages = aimessages; + return this; + } + + /** + * Get contents of the events query result. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set contents of the events query result. + * + * @param value the value value to set + * @return the EventsResults object itself. + */ + public EventsResults withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsSessionInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsSessionInfo.java new file mode 100644 index 0000000000000..66dc1b3e6c23b --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsSessionInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Session info for an event result. + */ +public class EventsSessionInfo { + /** + * ID of the session. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get iD of the session. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the session. + * + * @param id the id value to set + * @return the EventsSessionInfo object itself. + */ + public EventsSessionInfo withId(String id) { + this.id = id; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceInfo.java new file mode 100644 index 0000000000000..29308331cb2c9 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceInfo.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The trace information. + */ +public class EventsTraceInfo { + /** + * The trace message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The trace severity level. + */ + @JsonProperty(value = "severityLevel") + private Integer severityLevel; + + /** + * Get the trace message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the trace message. + * + * @param message the message value to set + * @return the EventsTraceInfo object itself. + */ + public EventsTraceInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the trace severity level. + * + * @return the severityLevel value + */ + public Integer severityLevel() { + return this.severityLevel; + } + + /** + * Set the trace severity level. + * + * @param severityLevel the severityLevel value to set + * @return the EventsTraceInfo object itself. + */ + public EventsTraceInfo withSeverityLevel(Integer severityLevel) { + this.severityLevel = severityLevel; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceResult.java new file mode 100644 index 0000000000000..a04fb4dce7336 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsTraceResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A trace result. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("trace") +public class EventsTraceResult extends EventsResultData { + /** + * The trace property. + */ + @JsonProperty(value = "trace") + private EventsTraceInfo trace; + + /** + * Get the trace value. + * + * @return the trace value + */ + public EventsTraceInfo trace() { + return this.trace; + } + + /** + * Set the trace value. + * + * @param trace the trace value to set + * @return the EventsTraceResult object itself. + */ + public EventsTraceResult withTrace(EventsTraceInfo trace) { + this.trace = trace; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsUserInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsUserInfo.java new file mode 100644 index 0000000000000..0fbd14ff4a331 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/EventsUserInfo.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User info for an event result. + */ +public class EventsUserInfo { + /** + * ID of the user. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Account ID of the user. + */ + @JsonProperty(value = "accountId") + private String accountId; + + /** + * Authenticated ID of the user. + */ + @JsonProperty(value = "authenticatedId") + private String authenticatedId; + + /** + * Get iD of the user. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the user. + * + * @param id the id value to set + * @return the EventsUserInfo object itself. + */ + public EventsUserInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get account ID of the user. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Set account ID of the user. + * + * @param accountId the accountId value to set + * @return the EventsUserInfo object itself. + */ + public EventsUserInfo withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get authenticated ID of the user. + * + * @return the authenticatedId value + */ + public String authenticatedId() { + return this.authenticatedId; + } + + /** + * Set authenticated ID of the user. + * + * @param authenticatedId the authenticatedId value to set + * @return the EventsUserInfo object itself. + */ + public EventsUserInfo withAuthenticatedId(String authenticatedId) { + this.authenticatedId = authenticatedId; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricId.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricId.java new file mode 100644 index 0000000000000..819266979fb64 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricId.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MetricId. + */ +public final class MetricId extends ExpandableStringEnum { + /** Static value requests/count for MetricId. */ + public static final MetricId REQUESTSCOUNT = fromString("requests/count"); + + /** Static value requests/duration for MetricId. */ + public static final MetricId REQUESTSDURATION = fromString("requests/duration"); + + /** Static value requests/failed for MetricId. */ + public static final MetricId REQUESTSFAILED = fromString("requests/failed"); + + /** Static value users/count for MetricId. */ + public static final MetricId USERSCOUNT = fromString("users/count"); + + /** Static value users/authenticated for MetricId. */ + public static final MetricId USERSAUTHENTICATED = fromString("users/authenticated"); + + /** Static value pageViews/count for MetricId. */ + public static final MetricId PAGE_VIEWSCOUNT = fromString("pageViews/count"); + + /** Static value pageViews/duration for MetricId. */ + public static final MetricId PAGE_VIEWSDURATION = fromString("pageViews/duration"); + + /** Static value client/processingDuration for MetricId. */ + public static final MetricId CLIENTPROCESSING_DURATION = fromString("client/processingDuration"); + + /** Static value client/receiveDuration for MetricId. */ + public static final MetricId CLIENTRECEIVE_DURATION = fromString("client/receiveDuration"); + + /** Static value client/networkDuration for MetricId. */ + public static final MetricId CLIENTNETWORK_DURATION = fromString("client/networkDuration"); + + /** Static value client/sendDuration for MetricId. */ + public static final MetricId CLIENTSEND_DURATION = fromString("client/sendDuration"); + + /** Static value client/totalDuration for MetricId. */ + public static final MetricId CLIENTTOTAL_DURATION = fromString("client/totalDuration"); + + /** Static value dependencies/count for MetricId. */ + public static final MetricId DEPENDENCIESCOUNT = fromString("dependencies/count"); + + /** Static value dependencies/failed for MetricId. */ + public static final MetricId DEPENDENCIESFAILED = fromString("dependencies/failed"); + + /** Static value dependencies/duration for MetricId. */ + public static final MetricId DEPENDENCIESDURATION = fromString("dependencies/duration"); + + /** Static value exceptions/count for MetricId. */ + public static final MetricId EXCEPTIONSCOUNT = fromString("exceptions/count"); + + /** Static value exceptions/browser for MetricId. */ + public static final MetricId EXCEPTIONSBROWSER = fromString("exceptions/browser"); + + /** Static value exceptions/server for MetricId. */ + public static final MetricId EXCEPTIONSSERVER = fromString("exceptions/server"); + + /** Static value sessions/count for MetricId. */ + public static final MetricId SESSIONSCOUNT = fromString("sessions/count"); + + /** Static value performanceCounters/requestExecutionTime for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSREQUEST_EXECUTION_TIME = fromString("performanceCounters/requestExecutionTime"); + + /** Static value performanceCounters/requestsPerSecond for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSREQUESTS_PER_SECOND = fromString("performanceCounters/requestsPerSecond"); + + /** Static value performanceCounters/requestsInQueue for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSREQUESTS_IN_QUEUE = fromString("performanceCounters/requestsInQueue"); + + /** Static value performanceCounters/memoryAvailableBytes for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSMEMORY_AVAILABLE_BYTES = fromString("performanceCounters/memoryAvailableBytes"); + + /** Static value performanceCounters/exceptionsPerSecond for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSEXCEPTIONS_PER_SECOND = fromString("performanceCounters/exceptionsPerSecond"); + + /** Static value performanceCounters/processCpuPercentage for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSPROCESS_CPU_PERCENTAGE = fromString("performanceCounters/processCpuPercentage"); + + /** Static value performanceCounters/processIOBytesPerSecond for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSPROCESS_IOBYTES_PER_SECOND = fromString("performanceCounters/processIOBytesPerSecond"); + + /** Static value performanceCounters/processPrivateBytes for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSPROCESS_PRIVATE_BYTES = fromString("performanceCounters/processPrivateBytes"); + + /** Static value performanceCounters/processorCpuPercentage for MetricId. */ + public static final MetricId PERFORMANCE_COUNTERSPROCESSOR_CPU_PERCENTAGE = fromString("performanceCounters/processorCpuPercentage"); + + /** Static value availabilityResults/availabilityPercentage for MetricId. */ + public static final MetricId AVAILABILITY_RESULTSAVAILABILITY_PERCENTAGE = fromString("availabilityResults/availabilityPercentage"); + + /** Static value availabilityResults/duration for MetricId. */ + public static final MetricId AVAILABILITY_RESULTSDURATION = fromString("availabilityResults/duration"); + + /** Static value billing/telemetryCount for MetricId. */ + public static final MetricId BILLINGTELEMETRY_COUNT = fromString("billing/telemetryCount"); + + /** Static value customEvents/count for MetricId. */ + public static final MetricId CUSTOM_EVENTSCOUNT = fromString("customEvents/count"); + + /** + * Creates or finds a MetricId from its string representation. + * @param name a name to look for + * @return the corresponding MetricId + */ + @JsonCreator + public static MetricId fromString(String name) { + return fromString(name, MetricId.class); + } + + /** + * @return known MetricId values + */ + public static Collection values() { + return values(MetricId.class); + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsAggregation.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsAggregation.java new file mode 100644 index 0000000000000..102d137d801f2 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsAggregation.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MetricsAggregation. + */ +public enum MetricsAggregation { + /** Enum value min. */ + MIN("min"), + + /** Enum value max. */ + MAX("max"), + + /** Enum value avg. */ + AVG("avg"), + + /** Enum value sum. */ + SUM("sum"), + + /** Enum value count. */ + COUNT("count"), + + /** Enum value unique. */ + UNIQUE("unique"); + + /** The actual serialized value for a MetricsAggregation instance. */ + private String value; + + MetricsAggregation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MetricsAggregation instance. + * + * @param value the serialized value to parse. + * @return the parsed MetricsAggregation object, or null if unable to parse. + */ + @JsonCreator + public static MetricsAggregation fromString(String value) { + MetricsAggregation[] items = MetricsAggregation.values(); + for (MetricsAggregation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchema.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchema.java new file mode 100644 index 0000000000000..1c63ef29bcd9c --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchema.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric request. + */ +public class MetricsPostBodySchema { + /** + * An identifier for this query. Must be unique within the post body of + * the request. This identifier will be the 'id' property of the response + * object representing this query. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The parameters for a single metrics query. + */ + @JsonProperty(value = "parameters", required = true) + private MetricsPostBodySchemaParameters parameters; + + /** + * Get an identifier for this query. Must be unique within the post body of the request. This identifier will be the 'id' property of the response object representing this query. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set an identifier for this query. Must be unique within the post body of the request. This identifier will be the 'id' property of the response object representing this query. + * + * @param id the id value to set + * @return the MetricsPostBodySchema object itself. + */ + public MetricsPostBodySchema withId(String id) { + this.id = id; + return this; + } + + /** + * Get the parameters for a single metrics query. + * + * @return the parameters value + */ + public MetricsPostBodySchemaParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters for a single metrics query. + * + * @param parameters the parameters value to set + * @return the MetricsPostBodySchema object itself. + */ + public MetricsPostBodySchema withParameters(MetricsPostBodySchemaParameters parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchemaParameters.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchemaParameters.java new file mode 100644 index 0000000000000..3c6b763c7318f --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsPostBodySchemaParameters.java @@ -0,0 +1,245 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for a single metrics query. + */ +public class MetricsPostBodySchemaParameters { + /** + * Possible values include: 'requests/count', 'requests/duration', + * 'requests/failed', 'users/count', 'users/authenticated', + * 'pageViews/count', 'pageViews/duration', 'client/processingDuration', + * 'client/receiveDuration', 'client/networkDuration', + * 'client/sendDuration', 'client/totalDuration', 'dependencies/count', + * 'dependencies/failed', 'dependencies/duration', 'exceptions/count', + * 'exceptions/browser', 'exceptions/server', 'sessions/count', + * 'performanceCounters/requestExecutionTime', + * 'performanceCounters/requestsPerSecond', + * 'performanceCounters/requestsInQueue', + * 'performanceCounters/memoryAvailableBytes', + * 'performanceCounters/exceptionsPerSecond', + * 'performanceCounters/processCpuPercentage', + * 'performanceCounters/processIOBytesPerSecond', + * 'performanceCounters/processPrivateBytes', + * 'performanceCounters/processorCpuPercentage', + * 'availabilityResults/availabilityPercentage', + * 'availabilityResults/duration', 'billing/telemetryCount', + * 'customEvents/count'. + */ + @JsonProperty(value = "metricId", required = true) + private MetricId metricId; + + /** + * The timespan property. + */ + @JsonProperty(value = "timespan") + private String timespan; + + /** + * The aggregation property. + */ + @JsonProperty(value = "aggregation") + private List aggregation; + + /** + * The interval property. + */ + @JsonProperty(value = "interval") + private Period interval; + + /** + * The segment property. + */ + @JsonProperty(value = "segment") + private List segment; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private Integer top; + + /** + * The orderby property. + */ + @JsonProperty(value = "orderby") + private String orderby; + + /** + * The filter property. + */ + @JsonProperty(value = "filter") + private String filter; + + /** + * Get possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count'. + * + * @return the metricId value + */ + public MetricId metricId() { + return this.metricId; + } + + /** + * Set possible values include: 'requests/count', 'requests/duration', 'requests/failed', 'users/count', 'users/authenticated', 'pageViews/count', 'pageViews/duration', 'client/processingDuration', 'client/receiveDuration', 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', 'dependencies/count', 'dependencies/failed', 'dependencies/duration', 'exceptions/count', 'exceptions/browser', 'exceptions/server', 'sessions/count', 'performanceCounters/requestExecutionTime', 'performanceCounters/requestsPerSecond', 'performanceCounters/requestsInQueue', 'performanceCounters/memoryAvailableBytes', 'performanceCounters/exceptionsPerSecond', 'performanceCounters/processCpuPercentage', 'performanceCounters/processIOBytesPerSecond', 'performanceCounters/processPrivateBytes', 'performanceCounters/processorCpuPercentage', 'availabilityResults/availabilityPercentage', 'availabilityResults/duration', 'billing/telemetryCount', 'customEvents/count'. + * + * @param metricId the metricId value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withMetricId(MetricId metricId) { + this.metricId = metricId; + return this; + } + + /** + * Get the timespan value. + * + * @return the timespan value + */ + public String timespan() { + return this.timespan; + } + + /** + * Set the timespan value. + * + * @param timespan the timespan value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get the aggregation value. + * + * @return the aggregation value + */ + public List aggregation() { + return this.aggregation; + } + + /** + * Set the aggregation value. + * + * @param aggregation the aggregation value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withAggregation(List aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Get the interval value. + * + * @return the interval value + */ + public Period interval() { + return this.interval; + } + + /** + * Set the interval value. + * + * @param interval the interval value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withInterval(Period interval) { + this.interval = interval; + return this; + } + + /** + * Get the segment value. + * + * @return the segment value + */ + public List segment() { + return this.segment; + } + + /** + * Set the segment value. + * + * @param segment the segment value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withSegment(List segment) { + this.segment = segment; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public Integer top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withTop(Integer top) { + this.top = top; + return this; + } + + /** + * Get the orderby value. + * + * @return the orderby value + */ + public String orderby() { + return this.orderby; + } + + /** + * Set the orderby value. + * + * @param orderby the orderby value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withOrderby(String orderby) { + this.orderby = orderby; + return this; + } + + /** + * Get the filter value. + * + * @return the filter value + */ + public String filter() { + return this.filter; + } + + /** + * Set the filter value. + * + * @param filter the filter value to set + * @return the MetricsPostBodySchemaParameters object itself. + */ + public MetricsPostBodySchemaParameters withFilter(String filter) { + this.filter = filter; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResult.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResult.java new file mode 100644 index 0000000000000..5f8552d716d0a --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric result. + */ +public class MetricsResult { + /** + * The value property. + */ + @JsonProperty(value = "value") + private MetricsResultInfo value; + + /** + * Get the value value. + * + * @return the value value + */ + public MetricsResultInfo value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the MetricsResult object itself. + */ + public MetricsResult withValue(MetricsResultInfo value) { + this.value = value; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultInfo.java new file mode 100644 index 0000000000000..0af5cfdcbfab8 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultInfo.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.Map; +import org.joda.time.DateTime; +import org.joda.time.Period; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric result data. + */ +public class MetricsResultInfo { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * Start time of the metric. + */ + @JsonProperty(value = "start") + private DateTime start; + + /** + * Start time of the metric. + */ + @JsonProperty(value = "end") + private DateTime end; + + /** + * The interval used to segment the metric data. + */ + @JsonProperty(value = "interval") + private Period interval; + + /** + * Segmented metric data (if segmented). + */ + @JsonProperty(value = "segments") + private List segments; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the MetricsResultInfo object itself. + */ + public MetricsResultInfo withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get start time of the metric. + * + * @return the start value + */ + public DateTime start() { + return this.start; + } + + /** + * Set start time of the metric. + * + * @param start the start value to set + * @return the MetricsResultInfo object itself. + */ + public MetricsResultInfo withStart(DateTime start) { + this.start = start; + return this; + } + + /** + * Get start time of the metric. + * + * @return the end value + */ + public DateTime end() { + return this.end; + } + + /** + * Set start time of the metric. + * + * @param end the end value to set + * @return the MetricsResultInfo object itself. + */ + public MetricsResultInfo withEnd(DateTime end) { + this.end = end; + return this; + } + + /** + * Get the interval used to segment the metric data. + * + * @return the interval value + */ + public Period interval() { + return this.interval; + } + + /** + * Set the interval used to segment the metric data. + * + * @param interval the interval value to set + * @return the MetricsResultInfo object itself. + */ + public MetricsResultInfo withInterval(Period interval) { + this.interval = interval; + return this; + } + + /** + * Get segmented metric data (if segmented). + * + * @return the segments value + */ + public List segments() { + return this.segments; + } + + /** + * Set segmented metric data (if segmented). + * + * @param segments the segments value to set + * @return the MetricsResultInfo object itself. + */ + public MetricsResultInfo withSegments(List segments) { + this.segments = segments; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultsItem.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultsItem.java new file mode 100644 index 0000000000000..9af6d2bd430cd --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsResultsItem.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The MetricsResultsItem model. + */ +public class MetricsResultsItem { + /** + * The specified ID for this metric. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The HTTP status code of this metric query. + */ + @JsonProperty(value = "status", required = true) + private int status; + + /** + * The results of this metric query. + */ + @JsonProperty(value = "body", required = true) + private MetricsResult body; + + /** + * Get the specified ID for this metric. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the specified ID for this metric. + * + * @param id the id value to set + * @return the MetricsResultsItem object itself. + */ + public MetricsResultsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the HTTP status code of this metric query. + * + * @return the status value + */ + public int status() { + return this.status; + } + + /** + * Set the HTTP status code of this metric query. + * + * @param status the status value to set + * @return the MetricsResultsItem object itself. + */ + public MetricsResultsItem withStatus(int status) { + this.status = status; + return this; + } + + /** + * Get the results of this metric query. + * + * @return the body value + */ + public MetricsResult body() { + return this.body; + } + + /** + * Set the results of this metric query. + * + * @param body the body value to set + * @return the MetricsResultsItem object itself. + */ + public MetricsResultsItem withBody(MetricsResult body) { + this.body = body; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegment.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegment.java new file mode 100644 index 0000000000000..fc6f500b4d86c --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegment.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MetricsSegment. + */ +public final class MetricsSegment extends ExpandableStringEnum { + /** Static value applicationBuild for MetricsSegment. */ + public static final MetricsSegment APPLICATION_BUILD = fromString("applicationBuild"); + + /** Static value applicationVersion for MetricsSegment. */ + public static final MetricsSegment APPLICATION_VERSION = fromString("applicationVersion"); + + /** Static value authenticatedOrAnonymousTraffic for MetricsSegment. */ + public static final MetricsSegment AUTHENTICATED_OR_ANONYMOUS_TRAFFIC = fromString("authenticatedOrAnonymousTraffic"); + + /** Static value browser for MetricsSegment. */ + public static final MetricsSegment BROWSER = fromString("browser"); + + /** Static value browserVersion for MetricsSegment. */ + public static final MetricsSegment BROWSER_VERSION = fromString("browserVersion"); + + /** Static value city for MetricsSegment. */ + public static final MetricsSegment CITY = fromString("city"); + + /** Static value cloudRoleName for MetricsSegment. */ + public static final MetricsSegment CLOUD_ROLE_NAME = fromString("cloudRoleName"); + + /** Static value cloudServiceName for MetricsSegment. */ + public static final MetricsSegment CLOUD_SERVICE_NAME = fromString("cloudServiceName"); + + /** Static value continent for MetricsSegment. */ + public static final MetricsSegment CONTINENT = fromString("continent"); + + /** Static value countryOrRegion for MetricsSegment. */ + public static final MetricsSegment COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** Static value deploymentId for MetricsSegment. */ + public static final MetricsSegment DEPLOYMENT_ID = fromString("deploymentId"); + + /** Static value deploymentUnit for MetricsSegment. */ + public static final MetricsSegment DEPLOYMENT_UNIT = fromString("deploymentUnit"); + + /** Static value deviceType for MetricsSegment. */ + public static final MetricsSegment DEVICE_TYPE = fromString("deviceType"); + + /** Static value environment for MetricsSegment. */ + public static final MetricsSegment ENVIRONMENT = fromString("environment"); + + /** Static value hostingLocation for MetricsSegment. */ + public static final MetricsSegment HOSTING_LOCATION = fromString("hostingLocation"); + + /** Static value instanceName for MetricsSegment. */ + public static final MetricsSegment INSTANCE_NAME = fromString("instanceName"); + + /** + * Creates or finds a MetricsSegment from its string representation. + * @param name a name to look for + * @return the corresponding MetricsSegment + */ + @JsonCreator + public static MetricsSegment fromString(String name) { + return fromString(name, MetricsSegment.class); + } + + /** + * @return known MetricsSegment values + */ + public static Collection values() { + return values(MetricsSegment.class); + } +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegmentInfo.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegmentInfo.java new file mode 100644 index 0000000000000..4cc1602288614 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/MetricsSegmentInfo.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.Map; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric segment. + */ +public class MetricsSegmentInfo { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * Start time of the metric segment (only when an interval was specified). + */ + @JsonProperty(value = "start") + private DateTime start; + + /** + * Start time of the metric segment (only when an interval was specified). + */ + @JsonProperty(value = "end") + private DateTime end; + + /** + * Segmented metric data (if further segmented). + */ + @JsonProperty(value = "segments") + private List segments; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the MetricsSegmentInfo object itself. + */ + public MetricsSegmentInfo withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get start time of the metric segment (only when an interval was specified). + * + * @return the start value + */ + public DateTime start() { + return this.start; + } + + /** + * Set start time of the metric segment (only when an interval was specified). + * + * @param start the start value to set + * @return the MetricsSegmentInfo object itself. + */ + public MetricsSegmentInfo withStart(DateTime start) { + this.start = start; + return this; + } + + /** + * Get start time of the metric segment (only when an interval was specified). + * + * @return the end value + */ + public DateTime end() { + return this.end; + } + + /** + * Set start time of the metric segment (only when an interval was specified). + * + * @param end the end value to set + * @return the MetricsSegmentInfo object itself. + */ + public MetricsSegmentInfo withEnd(DateTime end) { + this.end = end; + return this; + } + + /** + * Get segmented metric data (if further segmented). + * + * @return the segments value + */ + public List segments() { + return this.segments; + } + + /** + * Set segmented metric data (if further segmented). + * + * @param segments the segments value to set + * @return the MetricsSegmentInfo object itself. + */ + public MetricsSegmentInfo withSegments(List segments) { + this.segments = segments; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryBody.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryBody.java new file mode 100644 index 0000000000000..0d9c7d754c26e --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryBody.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Analytics query. Learn more about the [Analytics query + * syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/). + */ +public class QueryBody { + /** + * The query to execute. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /** + * Optional. The timespan over which to query data. This is an ISO8601 time + * period value. This timespan is applied in addition to any that are + * specified in the query expression. + */ + @JsonProperty(value = "timespan") + private String timespan; + + /** + * A list of Application IDs for cross-application queries. + */ + @JsonProperty(value = "applications") + private List applications; + + /** + * Get the query to execute. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Set the query to execute. + * + * @param query the query value to set + * @return the QueryBody object itself. + */ + public QueryBody withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. + * + * @return the timespan value + */ + public String timespan() { + return this.timespan; + } + + /** + * Set optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. + * + * @param timespan the timespan value to set + * @return the QueryBody object itself. + */ + public QueryBody withTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get a list of Application IDs for cross-application queries. + * + * @return the applications value + */ + public List applications() { + return this.applications; + } + + /** + * Set a list of Application IDs for cross-application queries. + * + * @param applications the applications value to set + * @return the QueryBody object itself. + */ + public QueryBody withApplications(List applications) { + this.applications = applications; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryResults.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryResults.java new file mode 100644 index 0000000000000..403eaac07c073 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/QueryResults.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A query response. + * Contains the tables, columns & rows resulting from a query. + */ +public class QueryResults { + /** + * The list of tables, columns and rows. + */ + @JsonProperty(value = "tables", required = true) + private List tables; + + /** + * Get the list of tables, columns and rows. + * + * @return the tables value + */ + public List
tables() { + return this.tables; + } + + /** + * Set the list of tables, columns and rows. + * + * @param tables the tables value to set + * @return the QueryResults object itself. + */ + public QueryResults withTables(List
tables) { + this.tables = tables; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Table.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Table.java new file mode 100644 index 0000000000000..114cefd3e75c4 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/Table.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.applicationinsights.query.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A query response table. + * Contains the columns and rows for one table in a query response. + */ +public class Table { + /** + * The name of the table. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The list of columns in this table. + */ + @JsonProperty(value = "columns", required = true) + private List columns; + + /** + * The resulting rows from this query. + */ + @JsonProperty(value = "rows", required = true) + private List> rows; + + /** + * Get the name of the table. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the table. + * + * @param name the name value to set + * @return the Table object itself. + */ + public Table withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of columns in this table. + * + * @return the columns value + */ + public List columns() { + return this.columns; + } + + /** + * Set the list of columns in this table. + * + * @param columns the columns value to set + * @return the Table object itself. + */ + public Table withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get the resulting rows from this query. + * + * @return the rows value + */ + public List> rows() { + return this.rows; + } + + /** + * Set the resulting rows from this query. + * + * @param rows the rows value to set + * @return the Table object itself. + */ + public Table withRows(List> rows) { + this.rows = rows; + return this; + } + +} diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/package-info.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/package-info.java new file mode 100644 index 0000000000000..03c85900b526e --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the models classes for ApplicationInsightsDataClient. + * Composite Swagger for Application Insights Data Client. + */ +package com.microsoft.azure.applicationinsights.query.models; diff --git a/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/package-info.java b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/package-info.java new file mode 100644 index 0000000000000..53a693922cf87 --- /dev/null +++ b/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ApplicationInsightsDataClient. + * Composite Swagger for Application Insights Data Client. + */ +package com.microsoft.azure.applicationinsights.query; diff --git a/applicationinsights/data-plane/src/test/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClientTests.java b/applicationinsights/data-plane/src/test/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClientTests.java new file mode 100644 index 0000000000000..a2bcf9928d39b --- /dev/null +++ b/applicationinsights/data-plane/src/test/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClientTests.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + */ +package com.microsoft.azure.applicationinsights.query; + +import java.util.ArrayList; +import java.util.List; +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.applicationinsights.query.implementation.ApplicationInsightsDataClientImpl; +import com.microsoft.azure.applicationinsights.query.models.QueryBody; +import com.microsoft.azure.applicationinsights.query.models.MetricId; +import com.microsoft.azure.applicationinsights.query.models.MetricsResult; +import com.microsoft.azure.applicationinsights.query.models.MetricsResultsItem; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchema; +import com.microsoft.azure.applicationinsights.query.models.MetricsPostBodySchemaParameters; +import com.microsoft.azure.applicationinsights.query.models.EventType; +import com.microsoft.azure.applicationinsights.query.models.EventsResult; +import com.microsoft.azure.applicationinsights.query.models.EventsResults; +import com.microsoft.azure.applicationinsights.query.models.QueryResults; +import com.microsoft.azure.arm.core.TestBase; +import com.microsoft.rest.RestClient; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +public class ApplicationInsightsDataClientTests extends TestBase { + protected static ApplicationInsightsDataClientImpl applicationInsightsClient; + private static String appId = "578f0e27-12e9-4631-bc02-50b965da2633"; + + @Override + protected String baseUri() { + return AzureEnvironment.AZURE.applicationInsightsEndpoint() + "v1/"; + } + + @Override + protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { + applicationInsightsClient = new ApplicationInsightsDataClientImpl(restClient); + } + + @Override + protected void cleanUpResources() { + return; + } + + @Test + public void canQuery() { + String query = "availabilityResults | take 1"; + QueryResults queryResults = applicationInsightsClient.querys().execute(appId, new QueryBody().withQuery(query)); + Assert.assertNotNull(queryResults); + + // Query should return a single table with one row + Assert.assertEquals(queryResults.tables().size(), 1); + Assert.assertEquals(queryResults.tables().get(0).rows().size(), 1); + + // Check type behavior on results + Assert.assertTrue(queryResults.tables().get(0).rows().get(0).get(1) instanceof String); + Assert.assertNull(queryResults.tables().get(0).rows().get(0).get(6)); + } + + @Test + public void canGetMetric() { + MetricsResult metricResult = applicationInsightsClient.metrics().get(appId, MetricId.AVAILABILITY_RESULTSAVAILABILITY_PERCENTAGE); + // Validate properties + Assert.assertNotNull(metricResult.value().additionalProperties()); + Assert.assertNotNull(metricResult.value().start()); + Assert.assertTrue(metricResult.value().start() instanceof DateTime); + } + + @Test + public void canGetMultipleMetrics() { + List parameters = new ArrayList(); + parameters.add(new MetricsPostBodySchema().withId("1").withParameters(new MetricsPostBodySchemaParameters().withMetricId(MetricId.AVAILABILITY_RESULTSAVAILABILITY_PERCENTAGE))); + parameters.add(new MetricsPostBodySchema().withId("2").withParameters(new MetricsPostBodySchemaParameters().withMetricId(MetricId.AVAILABILITY_RESULTSDURATION))); + + List metricResult = applicationInsightsClient.metrics().getMultiple(appId, parameters); + // Check per-item metadata + Assert.assertNotNull(metricResult.get(0).id()); + Assert.assertEquals(metricResult.get(0).status(), 200); + + // Validate properties + Assert.assertNotNull(metricResult.get(0).body().value().start()); + Assert.assertTrue(metricResult.get(0).body().value().start() instanceof DateTime); + } + + + @Test + public void canGetMetricsMetadata() { + Object metadata = applicationInsightsClient.metrics().getMetadata(appId); + // Sanity check + Assert.assertNotNull(metadata); + } + + @Test + public void canGetEventsByType() { + EventsResults eventsResult = applicationInsightsClient.events().getByType(appId, EventType.AVAILABILITY_RESULTS); + Assert.assertNotNull(eventsResult.value().get(0).id()); + } + + @Test + public void canGetEvent() { + String eventId = "e313e0a0-9c1f-11e8-9f6d-3b25765db004"; + EventsResults eventsResult = applicationInsightsClient.events().get(appId, EventType.AVAILABILITY_RESULTS, eventId); + Assert.assertNotNull(eventsResult.value().get(0).id()); + } +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canGetEvent.json b/applicationinsights/data-plane/target/test-classes/session-records/canGetEvent.json new file mode 100644 index 0000000000000..3361d0fc40086 --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canGetEvent.json @@ -0,0 +1,28 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/events/availabilityResults/e313e0a0-9c1f-11e8-9f6d-3b25765db004", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:07 GMT", + "server" : "nginx", + "content-length" : "1256", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.8bf9a5a5-9c0a-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8; ieee754compatible=false; odata.metadata=none; odata.streaming=false", + "Body" : "{\"@odata.context\":\"http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/events/availabilityResults/$metadata#availabilityResults\",\"value\":[{\"id\":\"e313e0a0-9c1f-11e8-9f6d-3b25765db004\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:01:48.838Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"546358a739bc4a0bb0580a039947dd8a\",\"parentId\":\"546358a739bc4a0bb0580a039947dd8a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":494,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"546358a739bc4a0bb0580a039947dd8a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}}]}", + "age" : "1778", + "odata-version" : "4.0;" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canGetEventsByType.json b/applicationinsights/data-plane/target/test-classes/session-records/canGetEventsByType.json new file mode 100644 index 0000000000000..e062cc8d05679 --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canGetEventsByType.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/events/availabilityResults", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:05 GMT", + "server" : "nginx", + "content-length" : "549738", + "vary" : "Accept, Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.8316e885-9c0b-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8; ieee754compatible=false; odata.metadata=none; odata.streaming=false", + "Body" : "{\"@odata.context\":\"http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/events/$metadata#availabilityResults\",\"@ai.messages\":[{\"code\":\"AddedLimitToQuery\",\"message\":\"The query was limited to last 12 hours, since no other limit for timestamp field was specified\"},{\"code\":\"AddedLimitToQuery\",\"message\":\"The query was limited to 500 rows\"}],\"value\":[{\"id\":\"f6b9d69b-9c24-11e8-8edd-ad8b6ad1bf9b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:38:32.073Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bc97d93f077340559412f0f27fe7f514\",\"parentId\":\"bc97d93f077340559412f0f27fe7f514\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":570,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"bc97d93f077340559412f0f27fe7f514\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ed0eb588-9c24-11e8-9854-25a6b038c75d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:38:10.396Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b8c9f104f2aa46f594b3bb72b61099e6\",\"parentId\":\"b8c9f104f2aa46f594b3bb72b61099e6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":747,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"b8c9f104f2aa46f594b3bb72b61099e6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ec8e621c-9c24-11e8-94ef-2b96afcf77e4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:37:53.493Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"11390889458e42da9f512ca674592e97\",\"parentId\":\"11390889458e42da9f512ca674592e97\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":454,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"11390889458e42da9f512ca674592e97\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d485e30d-9c24-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:37:21.286Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"013f0d286f704b1a8723bb44c96afe0e\",\"parentId\":\"013f0d286f704b1a8723bb44c96afe0e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":663,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"013f0d286f704b1a8723bb44c96afe0e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d2c8064e-9c24-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:37:21.230Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"00efd0883fdf43519e2a82f562c47c9a\",\"parentId\":\"00efd0883fdf43519e2a82f562c47c9a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1236,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"00efd0883fdf43519e2a82f562c47c9a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8040db93-9c24-11e8-923c-e5092b11ff9c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:35:06.047Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b31a90833a1847f8ad4c81304bf9032c\",\"parentId\":\"b31a90833a1847f8ad4c81304bf9032c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":178,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"b31a90833a1847f8ad4c81304bf9032c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"784d07f7-9c24-11e8-a7af-754f0443ae3a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:34:38.901Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a7820c4182fd4fc982a1ee1a73e56a9c\",\"parentId\":\"a7820c4182fd4fc982a1ee1a73e56a9c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":477,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"a7820c4182fd4fc982a1ee1a73e56a9c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"631a1731-9c24-11e8-b7ce-039166a28120\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:34:21.821Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"571c9b93ffca43e3961df87fda001b64\",\"parentId\":\"571c9b93ffca43e3961df87fda001b64\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":986,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"571c9b93ffca43e3961df87fda001b64\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4ee50e04-9c24-11e8-a632-ff4c7cec8fab\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:33:32.062Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7aee3a451c04475991d734d3115ea564\",\"parentId\":\"7aee3a451c04475991d734d3115ea564\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":466,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"7aee3a451c04475991d734d3115ea564\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"50f66202-9c24-11e8-98ab-ff68d10b056c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:33:30.597Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9bc10a8e925f408a99c9318d6433e555\",\"parentId\":\"9bc10a8e925f408a99c9318d6433e555\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":289,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"9bc10a8e925f408a99c9318d6433e555\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"43fdc3aa-9c24-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:33:30.545Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"24fbdd9c80214ab08d92dca93137848c\",\"parentId\":\"24fbdd9c80214ab08d92dca93137848c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":610,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"24fbdd9c80214ab08d92dca93137848c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"41de3f51-9c24-11e8-b43a-7f746c3762cb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:33:10.398Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d23cd9b1641e4d88aa3219ddbfa2ac5f\",\"parentId\":\"d23cd9b1641e4d88aa3219ddbfa2ac5f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":557,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"d23cd9b1641e4d88aa3219ddbfa2ac5f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2a097a6f-9c24-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:32:53.481Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"742b297a7a874b94b58f8971dc12e97c\",\"parentId\":\"742b297a7a874b94b58f8971dc12e97c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":483,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"742b297a7a874b94b58f8971dc12e97c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1aa4e593-9c24-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:32:21.256Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ffacd84c3dae4e8b9dc9e30a044b9a15\",\"parentId\":\"ffacd84c3dae4e8b9dc9e30a044b9a15\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":535,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"ffacd84c3dae4e8b9dc9e30a044b9a15\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1637c742-9c24-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:32:21.217Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"62021020de004caba3068675b9275c33\",\"parentId\":\"62021020de004caba3068675b9275c33\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":549,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"62021020de004caba3068675b9275c33\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d2f77024-9c23-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:30:18.541Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bc7ad451a8a54dbe8e929bd594b74a0b\",\"parentId\":\"bc7ad451a8a54dbe8e929bd594b74a0b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":598,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"bc7ad451a8a54dbe8e929bd594b74a0b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ccf4bde2-9c23-11e8-8edd-ad8b6ad1bf9b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:30:13.337Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2dbb1d03a5be4aac87280b8a86e9c9ae\",\"parentId\":\"2dbb1d03a5be4aac87280b8a86e9c9ae\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":673,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"2dbb1d03a5be4aac87280b8a86e9c9ae\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c4c9ad9b-9c23-11e8-923c-e5092b11ff9c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:30:06.008Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b56db796046148b89e1ee643522d7ac6\",\"parentId\":\"b56db796046148b89e1ee643522d7ac6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":180,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"b56db796046148b89e1ee643522d7ac6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bf2ff677-9c23-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:29:38.886Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7672500028d94a3ea0b6b9a149846ed5\",\"parentId\":\"7672500028d94a3ea0b6b9a149846ed5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":436,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"7672500028d94a3ea0b6b9a149846ed5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bb56176d-9c23-11e8-aa5a-fb9d2c7767db\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:29:21.813Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a9f96532948b4ff799d76b7ca02ce543\",\"parentId\":\"a9f96532948b4ff799d76b7ca02ce543\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1375,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"a9f96532948b4ff799d76b7ca02ce543\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"858f0060-9c23-11e8-9854-25a6b038c75d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:28:10.306Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b1cc70a2653d4d0cab96e8ec2e44b99f\",\"parentId\":\"b1cc70a2653d4d0cab96e8ec2e44b99f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":986,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"b1cc70a2653d4d0cab96e8ec2e44b99f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"800eeba9-9c23-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:27:53.482Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"928783123d9a4cddb1c5ee7e46ea279b\",\"parentId\":\"928783123d9a4cddb1c5ee7e46ea279b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":462,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"928783123d9a4cddb1c5ee7e46ea279b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6e4a46a4-9c23-11e8-a18c-d90e9847a628\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:27:24.644Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3da6354d5f2646f182d0cf6fdef4b3fb\",\"parentId\":\"3da6354d5f2646f182d0cf6fdef4b3fb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":226,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"3da6354d5f2646f182d0cf6fdef4b3fb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"72cb3ab4-9c23-11e8-9b2d-fff542f82f2f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:27:21.249Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3c3cefe3889e467a857c275db71c8091\",\"parentId\":\"3c3cefe3889e467a857c275db71c8091\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":631,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"3c3cefe3889e467a857c275db71c8091\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6b6241e0-9c23-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:27:21.190Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f3ca5bb117e64441872489c0daa0d65d\",\"parentId\":\"f3ca5bb117e64441872489c0daa0d65d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":713,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"f3ca5bb117e64441872489c0daa0d65d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2a5e94d1-9c23-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:25:18.525Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"575365fa08d748ff95a52b6abb0a4b1d\",\"parentId\":\"575365fa08d748ff95a52b6abb0a4b1d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1003,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"575365fa08d748ff95a52b6abb0a4b1d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"271f213a-9c23-11e8-a0c0-d957cbf6d912\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:25:13.319Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5588b6a04647488eb511b9cccb3dd980\",\"parentId\":\"5588b6a04647488eb511b9cccb3dd980\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":655,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"5588b6a04647488eb511b9cccb3dd980\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1cda584b-9c23-11e8-a618-7fc6607ec2bb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:25:05.988Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"079db0b74a3b4383a26fc19a5548a6a6\",\"parentId\":\"079db0b74a3b4383a26fc19a5548a6a6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":178,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"079db0b74a3b4383a26fc19a5548a6a6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"05f5989d-9c23-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:24:38.873Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ddb7c3cdc0bc4a7388f18a2bbde845fc\",\"parentId\":\"ddb7c3cdc0bc4a7388f18a2bbde845fc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":384,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ddb7c3cdc0bc4a7388f18a2bbde845fc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0001da99-9c23-11e8-91a4-1b91e2e5371d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:24:21.811Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"184aea367c4a4402a0e60205d386b677\",\"parentId\":\"184aea367c4a4402a0e60205d386b677\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":914,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"184aea367c4a4402a0e60205d386b677\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d991764e-9c22-11e8-b43a-7f746c3762cb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:23:10.298Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"87727d14849f4edb92dfbc42bf6a3341\",\"parentId\":\"87727d14849f4edb92dfbc42bf6a3341\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":785,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"87727d14849f4edb92dfbc42bf6a3341\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c4675edc-9c22-11e8-bda8-b77fb87599da\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:22:53.477Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f29817998713400ba811e9eaa1a1006a\",\"parentId\":\"f29817998713400ba811e9eaa1a1006a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":393,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"f29817998713400ba811e9eaa1a1006a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b28398be-9c22-11e8-889f-75a9c22c1487\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:22:24.613Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cc350a258b3f4eb5ba8b7fc851420e69\",\"parentId\":\"cc350a258b3f4eb5ba8b7fc851420e69\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":303,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"cc350a258b3f4eb5ba8b7fc851420e69\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a729ddec-9c22-11e8-9f6d-3b25765db004\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:21:57.970Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8439d845d53f457f8028f8ad362437a2\",\"parentId\":\"8439d845d53f457f8028f8ad362437a2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":549,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"8439d845d53f457f8028f8ad362437a2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a0562ea-9c22-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:21:03.348Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"995c6ccbb73445f99c8aa6e148a0a4f7\",\"parentId\":\"995c6ccbb73445f99c8aa6e148a0a4f7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":459,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"995c6ccbb73445f99c8aa6e148a0a4f7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6c3d2e0d-9c22-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:20:18.514Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"937cb3a983ac4cb8baec134a43fb6b5a\",\"parentId\":\"937cb3a983ac4cb8baec134a43fb6b5a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":790,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"937cb3a983ac4cb8baec134a43fb6b5a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6ceb482d-9c22-11e8-a0c0-d957cbf6d912\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:20:13.311Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b5fade5ad5f24507b5d6a0f58ee794d8\",\"parentId\":\"b5fade5ad5f24507b5d6a0f58ee794d8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":5613,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"b5fade5ad5f24507b5d6a0f58ee794d8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6b56777f-9c22-11e8-91a4-1b91e2e5371d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:20:06.818Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f9e6fa408897459789864dd9a1ce84e5\",\"parentId\":\"f9e6fa408897459789864dd9a1ce84e5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":994,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f9e6fa408897459789864dd9a1ce84e5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"61fad65f-9c22-11e8-a618-7fc6607ec2bb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:20:05.970Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c2877804cd52459c805f4ed6754ea900\",\"parentId\":\"c2877804cd52459c805f4ed6754ea900\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":164,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"c2877804cd52459c805f4ed6754ea900\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5e14c243-9c22-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:19:38.842Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5909ceaa316a4663862b66969302a2c9\",\"parentId\":\"5909ceaa316a4663862b66969302a2c9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":415,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"5909ceaa316a4663862b66969302a2c9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2bbbf734-9c22-11e8-a94f-798b72fa8740\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:18:10.195Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0dc95c25d0bd4302a939895c6089f6e8\",\"parentId\":\"0dc95c25d0bd4302a939895c6089f6e8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":655,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"0dc95c25d0bd4302a939895c6089f6e8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1bc1b225-9c22-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:17:53.477Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d71d8c646d2c434b974453e854fb966c\",\"parentId\":\"d71d8c646d2c434b974453e854fb966c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":492,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"d71d8c646d2c434b974453e854fb966c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"07261f2c-9c22-11e8-a18c-d90e9847a628\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:17:24.581Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b06a0d57ab684593878472ae81f5c69a\",\"parentId\":\"b06a0d57ab684593878472ae81f5c69a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":253,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"b06a0d57ab684593878472ae81f5c69a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fde92912-9c21-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:16:57.932Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"019eef6858b347fbaee7c11b6278d600\",\"parentId\":\"019eef6858b347fbaee7c11b6278d600\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":516,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"019eef6858b347fbaee7c11b6278d600\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e08c395b-9c21-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:16:03.328Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b632024d735e4abd853a36937f63ba84\",\"parentId\":\"b632024d735e4abd853a36937f63ba84\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1166,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b632024d735e4abd853a36937f63ba84\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cb73d52a-9c21-11e8-a85e-71e9913384de\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:15:44.430Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5615660f513a4c559027f9321dc13219\",\"parentId\":\"5615660f513a4c559027f9321dc13219\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":162,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"5615660f513a4c559027f9321dc13219\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c02cb838-9c21-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:15:18.498Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"65c9d75257b04ea3bd53dd489ca223e7\",\"parentId\":\"65c9d75257b04ea3bd53dd489ca223e7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":609,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"65c9d75257b04ea3bd53dd489ca223e7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bfd43755-9c21-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:15:13.290Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"de4fef5fe04b41ed9bc16b45b4a56df0\",\"parentId\":\"de4fef5fe04b41ed9bc16b45b4a56df0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":810,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"de4fef5fe04b41ed9bc16b45b4a56df0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b0b2ed39-9c21-11e8-b7ce-039166a28120\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:15:06.806Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"aa0cfb1f6bb64d9882b0989e10b95dd6\",\"parentId\":\"aa0cfb1f6bb64d9882b0989e10b95dd6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":698,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"aa0cfb1f6bb64d9882b0989e10b95dd6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a5165cb4-9c21-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:14:38.814Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7b96a10327b14b51841cba1245ecdbd3\",\"parentId\":\"7b96a10327b14b51841cba1245ecdbd3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":465,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"7b96a10327b14b51841cba1245ecdbd3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6c0d87cf-9c21-11e8-a94f-798b72fa8740\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:13:10.184Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e20af6765bb047988ea09f6446736011\",\"parentId\":\"e20af6765bb047988ea09f6446736011\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":740,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"e20af6765bb047988ea09f6446736011\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6de10f40-9c21-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:12:56.731Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f5f79d6f5ed540f3bdb975f241b672d2\",\"parentId\":\"f5f79d6f5ed540f3bdb975f241b672d2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":209,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f5f79d6f5ed540f3bdb975f241b672d2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5facbd4b-9c21-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:12:53.455Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7b4e93c6bed74ad9a068008ea9889a0b\",\"parentId\":\"7b4e93c6bed74ad9a068008ea9889a0b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":385,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"7b4e93c6bed74ad9a068008ea9889a0b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"633dfaab-9c21-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:12:51.452Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6b5fda050b29472f8cc65f64c3d95c76\",\"parentId\":\"6b5fda050b29472f8cc65f64c3d95c76\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":410,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"6b5fda050b29472f8cc65f64c3d95c76\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"449eed32-9c21-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:11:57.921Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e7399d82df4543168dc42219dd7861ad\",\"parentId\":\"e7399d82df4543168dc42219dd7861ad\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":591,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"e7399d82df4543168dc42219dd7861ad\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3871b569-9c21-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:11:33.615Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"deecc7b66c51471ebfae0fed2812dd48\",\"parentId\":\"deecc7b66c51471ebfae0fed2812dd48\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":561,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"deecc7b66c51471ebfae0fed2812dd48\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3d47a764-9c21-11e8-85c2-a7e6d45354d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:11:31.635Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"190c48edfaf74ce58a6b900817032dbf\",\"parentId\":\"190c48edfaf74ce58a6b900817032dbf\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1194,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"190c48edfaf74ce58a6b900817032dbf\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0c7be536-9c21-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:10:18.478Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"757f6d3c31a546fab6972028a8816f12\",\"parentId\":\"757f6d3c31a546fab6972028a8816f12\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":591,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"757f6d3c31a546fab6972028a8816f12\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"05a7b1d8-9c21-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:10:12.818Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1b6c02f4b48d4975b5f258777adf2a35\",\"parentId\":\"1b6c02f4b48d4975b5f258777adf2a35\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":537,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"1b6c02f4b48d4975b5f258777adf2a35\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"08b87461-9c21-11e8-91a4-1b91e2e5371d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:10:06.748Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2a93c7b5dfe24f6990ae7b9ab4f5287d\",\"parentId\":\"2a93c7b5dfe24f6990ae7b9ab4f5287d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":535,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"2a93c7b5dfe24f6990ae7b9ab4f5287d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ec6a5c10-9c20-11e8-a7af-754f0443ae3a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:09:38.822Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05d33a62f5bd4a65b3f5e502eba882a6\",\"parentId\":\"05d33a62f5bd4a65b3f5e502eba882a6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":440,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"05d33a62f5bd4a65b3f5e502eba882a6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d8a52c6a-9c20-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:08:44.773Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0555650269dd4b7da4a95bd34858a391\",\"parentId\":\"0555650269dd4b7da4a95bd34858a391\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":334,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"0555650269dd4b7da4a95bd34858a391\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bbd539c9-9c20-11e8-a94f-798b72fa8740\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:08:10.175Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1ace9ef21dc140888a680fc8a89c62e4\",\"parentId\":\"1ace9ef21dc140888a680fc8a89c62e4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":745,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"1ace9ef21dc140888a680fc8a89c62e4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b647b7ae-9c20-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:07:53.446Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"47711271e10444beb577906b7866c6a1\",\"parentId\":\"47711271e10444beb577906b7866c6a1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":477,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"47711271e10444beb577906b7866c6a1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b95238ff-9c20-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:07:51.428Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a2369bcd86fa4508823746107c803eff\",\"parentId\":\"a2369bcd86fa4508823746107c803eff\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":240,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"a2369bcd86fa4508823746107c803eff\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a911369-9c20-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:06:48.847Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"64851aa63b984d85a580f89e32c33c3c\",\"parentId\":\"64851aa63b984d85a580f89e32c33c3c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":591,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"64851aa63b984d85a580f89e32c33c3c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7dd27098-9c20-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:06:33.603Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ce26a6dcbe32473dacef19513fd9c84d\",\"parentId\":\"ce26a6dcbe32473dacef19513fd9c84d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":766,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ce26a6dcbe32473dacef19513fd9c84d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"73e3b6f9-9c20-11e8-aa5a-fb9d2c7767db\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:06:13.308Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a38bd7f373fc4d21b08cd6e151d6eb37\",\"parentId\":\"a38bd7f373fc4d21b08cd6e151d6eb37\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":551,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"a38bd7f373fc4d21b08cd6e151d6eb37\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4f2fcf68-9c20-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:05:18.465Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"dc41cdb089d9469191a4e5b117aa8f7a\",\"parentId\":\"dc41cdb089d9469191a4e5b117aa8f7a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":770,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"dc41cdb089d9469191a4e5b117aa8f7a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5cce4a71-9c20-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:05:12.805Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"12bf5f8f7d14469e82e8ffa415fdda44\",\"parentId\":\"12bf5f8f7d14469e82e8ffa415fdda44\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":515,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"12bf5f8f7d14469e82e8ffa415fdda44\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"44901596-9c20-11e8-abac-3361d34a0bb6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:04:38.796Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"67353dcb1bf84a61a718d5d45106ee49\",\"parentId\":\"67353dcb1bf84a61a718d5d45106ee49\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":390,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"67353dcb1bf84a61a718d5d45106ee49\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"200bc95e-9c20-11e8-923c-e5092b11ff9c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:03:44.645Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e371d158c63a4e249e1b79156f60213c\",\"parentId\":\"e371d158c63a4e249e1b79156f60213c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":430,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"e371d158c63a4e249e1b79156f60213c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0930f4d8-9c20-11e8-b43a-7f746c3762cb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:03:10.170Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"632e459dbef34583938a54b61afd0020\",\"parentId\":\"632e459dbef34583938a54b61afd0020\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":781,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"632e459dbef34583938a54b61afd0020\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"092f6e32-9c20-11e8-a185-09f8274ac4d4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:02:53.435Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ff9962f1262547619f522c9e9e432645\",\"parentId\":\"ff9962f1262547619f522c9e9e432645\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":106,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"ff9962f1262547619f522c9e9e432645\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fce4c3eb-9c1f-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:02:47.068Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"41902bf5d65a4d859be1f32680321279\",\"parentId\":\"41902bf5d65a4d859be1f32680321279\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":303,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"41902bf5d65a4d859be1f32680321279\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e313e0a0-9c1f-11e8-9f6d-3b25765db004\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:01:48.838Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"546358a739bc4a0bb0580a039947dd8a\",\"parentId\":\"546358a739bc4a0bb0580a039947dd8a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":494,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"546358a739bc4a0bb0580a039947dd8a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d47d70cc-9c1f-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:01:33.585Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b46584d54de14c7ab7c510a8fa342e0a\",\"parentId\":\"b46584d54de14c7ab7c510a8fa342e0a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":767,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b46584d54de14c7ab7c510a8fa342e0a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cc841ea5-9c1f-11e8-91a4-1b91e2e5371d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:01:13.283Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d46f1dcdcc664f9f92e9bc5b37c51dd5\",\"parentId\":\"d46f1dcdcc664f9f92e9bc5b37c51dd5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":984,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"d46f1dcdcc664f9f92e9bc5b37c51dd5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a4e106d3-9c1f-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:00:18.448Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9f118fce2214486da196f0da76636b7b\",\"parentId\":\"9f118fce2214486da196f0da76636b7b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":639,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"9f118fce2214486da196f0da76636b7b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a2062152-9c1f-11e8-8b32-05583b39d1bf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T22:00:12.790Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d3ab471347804c1293582d73b3006e05\",\"parentId\":\"d3ab471347804c1293582d73b3006e05\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":409,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"d3ab471347804c1293582d73b3006e05\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a8102c9-9c1f-11e8-abac-3361d34a0bb6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:59:38.789Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4c603845bb7947498b21d53f0ded2f8a\",\"parentId\":\"4c603845bb7947498b21d53f0ded2f8a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":1135,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"4c603845bb7947498b21d53f0ded2f8a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6663dd2e-9c1f-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:58:44.628Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"90164f8f3a4e4e9ab5ab0994c077dd10\",\"parentId\":\"90164f8f3a4e4e9ab5ab0994c077dd10\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":282,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"90164f8f3a4e4e9ab5ab0994c077dd10\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5db6cbb5-9c1f-11e8-b43a-7f746c3762cb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:58:10.157Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5def30aaa7e947e2b0a9bfb189d548f0\",\"parentId\":\"5def30aaa7e947e2b0a9bfb189d548f0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":509,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"5def30aaa7e947e2b0a9bfb189d548f0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4d35f0ca-9c1f-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:57:53.428Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"818d256ca8d7497ba7cda07416fea936\",\"parentId\":\"818d256ca8d7497ba7cda07416fea936\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":393,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"818d256ca8d7497ba7cda07416fea936\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4150e5b2-9c1f-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:57:47.046Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e22154f968fb45fd88b7dfb501d9e1f8\",\"parentId\":\"e22154f968fb45fd88b7dfb501d9e1f8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":247,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"e22154f968fb45fd88b7dfb501d9e1f8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"285728c5-9c1f-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:56:48.828Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0744a9ceaafb4dd18dd903b3560eaad2\",\"parentId\":\"0744a9ceaafb4dd18dd903b3560eaad2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":523,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"0744a9ceaafb4dd18dd903b3560eaad2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1b1748a3-9c1f-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:56:33.521Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0baec733ea244a8caf5b3956ce27e09e\",\"parentId\":\"0baec733ea244a8caf5b3956ce27e09e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":613,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"0baec733ea244a8caf5b3956ce27e09e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"11aa6942-9c1f-11e8-8d2a-511a79f0f175\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:56:13.231Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2267671eb6a64d34b968a1369176765b\",\"parentId\":\"2267671eb6a64d34b968a1369176765b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1097,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"2267671eb6a64d34b968a1369176765b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f91f257a-9c1e-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:55:18.426Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f1abf58cc886403dbcdc70cf57bb9c1e\",\"parentId\":\"f1abf58cc886403dbcdc70cf57bb9c1e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":687,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"f1abf58cc886403dbcdc70cf57bb9c1e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e74b6525-9c1e-11e8-85c2-a7e6d45354d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:55:12.779Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"16636636844f4aa3ab0066275e979b67\",\"parentId\":\"16636636844f4aa3ab0066275e979b67\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":559,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"16636636844f4aa3ab0066275e979b67\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e33f5290-9c1e-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:54:38.781Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"825bb58864be44b28e6d36dd9c2fd7e7\",\"parentId\":\"825bb58864be44b28e6d36dd9c2fd7e7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":398,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"825bb58864be44b28e6d36dd9c2fd7e7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d002db05-9c1e-11e8-bcf7-a7cf70afbe0f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:54:30.431Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"efe12d1411bf4b518e84302358601d7e\",\"parentId\":\"efe12d1411bf4b518e84302358601d7e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":243,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"efe12d1411bf4b518e84302358601d7e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c4f9b0fc-9c1e-11e8-9854-25a6b038c75d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:53:50.434Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"95695d08891c468e96118bcba1239a1d\",\"parentId\":\"95695d08891c468e96118bcba1239a1d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":515,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"95695d08891c468e96118bcba1239a1d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"beac6084-9c1e-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:53:44.612Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2b2855caa3994c9aa7807a3fa58e1f19\",\"parentId\":\"2b2855caa3994c9aa7807a3fa58e1f19\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":383,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"2b2855caa3994c9aa7807a3fa58e1f19\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"acd1c2c5-9c1e-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:53:12.434Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"90286c396b2346a4908366f873f69db5\",\"parentId\":\"90286c396b2346a4908366f873f69db5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":885,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"90286c396b2346a4908366f873f69db5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"90aa939d-9c1e-11e8-a185-09f8274ac4d4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:52:31.094Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3c858387779949a58bdc18eb48df69ef\",\"parentId\":\"3c858387779949a58bdc18eb48df69ef\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":413,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3c858387779949a58bdc18eb48df69ef\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8147ac2d-9c1e-11e8-9f6d-3b25765db004\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:52:02.280Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e94d1d16007a4f8b89c1f27b0338254e\",\"parentId\":\"e94d1d16007a4f8b89c1f27b0338254e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":287,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"e94d1d16007a4f8b89c1f27b0338254e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"712d3478-9c1e-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:51:33.413Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2e9200ec5bf7476188fed7411e3b3522\",\"parentId\":\"2e9200ec5bf7476188fed7411e3b3522\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":504,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"2e9200ec5bf7476188fed7411e3b3522\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3fea1ee5-9c1e-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:50:12.765Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"400c952ce3434059ab86de73ff226b53\",\"parentId\":\"400c952ce3434059ab86de73ff226b53\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":505,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"400c952ce3434059ab86de73ff226b53\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"31912d77-9c1e-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:49:53.364Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"77b6d5f70946463b96438f03906b2feb\",\"parentId\":\"77b6d5f70946463b96438f03906b2feb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":609,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"77b6d5f70946463b96438f03906b2feb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2871d27a-9c1e-11e8-b079-612a96038412\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:49:38.755Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e123ce875f1a49b990a2ebc2216266de\",\"parentId\":\"e123ce875f1a49b990a2ebc2216266de\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":419,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"e123ce875f1a49b990a2ebc2216266de\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"242d98b8-9c1e-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:49:30.402Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"feaed4b757e44d7a856b70179c1b5e60\",\"parentId\":\"feaed4b757e44d7a856b70179c1b5e60\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":285,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"feaed4b757e44d7a856b70179c1b5e60\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"07fd902c-9c1e-11e8-adb6-01d037e41e09\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:48:50.429Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3876545e230f4725a0e3fcc6fcd65e9d\",\"parentId\":\"3876545e230f4725a0e3fcc6fcd65e9d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":576,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3876545e230f4725a0e3fcc6fcd65e9d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"047fb3e5-9c1e-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:48:44.536Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"59e891cb49cf43bea67c49e15880501d\",\"parentId\":\"59e891cb49cf43bea67c49e15880501d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":289,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"59e891cb49cf43bea67c49e15880501d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f127c4af-9c1d-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:48:12.418Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c51194e00550453bb82c964421123ce5\",\"parentId\":\"c51194e00550453bb82c964421123ce5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":801,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"c51194e00550453bb82c964421123ce5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d27c0d91-9c1d-11e8-a185-09f8274ac4d4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:47:31.091Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f6e13455ca5741a68e30f1cebc4d1436\",\"parentId\":\"f6e13455ca5741a68e30f1cebc4d1436\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":416,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"f6e13455ca5741a68e30f1cebc4d1436\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c62d43cf-9c1d-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:47:02.241Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"90f6e4ff89e7487681bd07054f113559\",\"parentId\":\"90f6e4ff89e7487681bd07054f113559\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":654,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"90f6e4ff89e7487681bd07054f113559\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b6d2249a-9c1d-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:46:33.390Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9bbd75f9c76c467d9113681bcdcfdf13\",\"parentId\":\"9bbd75f9c76c467d9113681bcdcfdf13\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":498,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"9bbd75f9c76c467d9113681bcdcfdf13\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"85ced794-9c1d-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:45:12.752Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1d26ca42a4494860b9310e3df8f457aa\",\"parentId\":\"1d26ca42a4494860b9310e3df8f457aa\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":608,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"1d26ca42a4494860b9310e3df8f457aa\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6e716570-9c1d-11e8-abac-3361d34a0bb6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:44:38.745Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"465bc2f6106644c7999c027882058d82\",\"parentId\":\"465bc2f6106644c7999c027882058d82\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":448,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"465bc2f6106644c7999c027882058d82\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"67a7e0e5-9c1d-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:44:30.362Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"63e875d6f4dd4b9ab658323e6c94da56\",\"parentId\":\"63e875d6f4dd4b9ab658323e6c94da56\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":360,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"63e875d6f4dd4b9ab658323e6c94da56\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"74709531-9c1d-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:44:29.525Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f1e73c8513d04b94bf38851507404ea4\",\"parentId\":\"f1e73c8513d04b94bf38851507404ea4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":404,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"f1e73c8513d04b94bf38851507404ea4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5c7c138d-9c1d-11e8-adb6-01d037e41e09\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:43:50.407Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c08baaa16e7c4535aae65836c32f61fe\",\"parentId\":\"c08baaa16e7c4535aae65836c32f61fe\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":976,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"c08baaa16e7c4535aae65836c32f61fe\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4abff9b8-9c1d-11e8-8e6f-5b60369171e5\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:43:44.489Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f1232cd2af1f4808957dd9586fa03f09\",\"parentId\":\"f1232cd2af1f4808957dd9586fa03f09\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":258,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f1232cd2af1f4808957dd9586fa03f09\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4699d000-9c1d-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:43:12.404Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f5bd95ba863f46b285781fe7cd16f111\",\"parentId\":\"f5bd95ba863f46b285781fe7cd16f111\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":698,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"f5bd95ba863f46b285781fe7cd16f111\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2d59e222-9c1d-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:42:54.824Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f7fe0587413c4187989579303bf2b464\",\"parentId\":\"f7fe0587413c4187989579303bf2b464\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":436,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f7fe0587413c4187989579303bf2b464\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1d08555d-9c1d-11e8-9f6d-3b25765db004\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:42:02.232Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"35470dfa039841c0b3ce6f0b5e8fe9e4\",\"parentId\":\"35470dfa039841c0b3ce6f0b5e8fe9e4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":555,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"35470dfa039841c0b3ce6f0b5e8fe9e4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ff620016-9c1c-11e8-b3c9-850a5bc7ebac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:41:33.513Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4da56f802d5d4fbe85a9b2b5f81560d5\",\"parentId\":\"4da56f802d5d4fbe85a9b2b5f81560d5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":389,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"4da56f802d5d4fbe85a9b2b5f81560d5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0c161b02-9c1d-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:41:33.350Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"dd1dbb6a5b9d47a3abf864159a7503b3\",\"parentId\":\"dd1dbb6a5b9d47a3abf864159a7503b3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":633,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"dd1dbb6a5b9d47a3abf864159a7503b3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dd3474e2-9c1c-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:40:12.739Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d68ef9cbdca047fd88c684dd36081a5e\",\"parentId\":\"d68ef9cbdca047fd88c684dd36081a5e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":518,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"d68ef9cbdca047fd88c684dd36081a5e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"be5b1e29-9c1c-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:39:30.303Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"dd7f38d6a4bd4d209a9e618eb53a4f53\",\"parentId\":\"dd7f38d6a4bd4d209a9e618eb53a4f53\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":618,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"dd7f38d6a4bd4d209a9e618eb53a4f53\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b98887c6-9c1c-11e8-a185-09f8274ac4d4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:39:29.512Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"981e166b3dec4dd4befa3406b3ce3253\",\"parentId\":\"981e166b3dec4dd4befa3406b3ce3253\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":395,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"981e166b3dec4dd4befa3406b3ce3253\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c1c5998e-9c1c-11e8-b43a-7f746c3762cb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:39:28.812Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e67696d88722449382487aebb6ea06be\",\"parentId\":\"e67696d88722449382487aebb6ea06be\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":627,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"e67696d88722449382487aebb6ea06be\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a3b537e6-9c1c-11e8-a85e-71e9913384de\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:38:44.476Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"834f257dd4dc48cba55ef9f000bbe86b\",\"parentId\":\"834f257dd4dc48cba55ef9f000bbe86b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":396,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"834f257dd4dc48cba55ef9f000bbe86b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a3b0092-9c1c-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:38:12.362Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b1a70df1a8bd418dad2d76ffde556d3a\",\"parentId\":\"b1a70df1a8bd418dad2d76ffde556d3a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":991,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"b1a70df1a8bd418dad2d76ffde556d3a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8681f027-9c1c-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:37:54.812Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"53f95cdfaf784cd7a49784ac8a1b9fce\",\"parentId\":\"53f95cdfaf784cd7a49784ac8a1b9fce\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":452,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"53f95cdfaf784cd7a49784ac8a1b9fce\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"73dbc4ac-9c1c-11e8-bcf7-a7cf70afbe0f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:37:28.510Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d49f18872a3a4a31ba1828cfaf9d12a4\",\"parentId\":\"d49f18872a3a4a31ba1828cfaf9d12a4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":331,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"d49f18872a3a4a31ba1828cfaf9d12a4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6234b99f-9c1c-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:37:02.217Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"db748519140c4d5bb8354a0cfc7b0d3b\",\"parentId\":\"db748519140c4d5bb8354a0cfc7b0d3b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":609,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"db748519140c4d5bb8354a0cfc7b0d3b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"56749b6a-9c1c-11e8-a7af-754f0443ae3a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:36:33.500Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a4a590c5439d40539fc59d96d9e21d1c\",\"parentId\":\"a4a590c5439d40539fc59d96d9e21d1c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":372,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"a4a590c5439d40539fc59d96d9e21d1c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"50d16edc-9c1c-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:36:33.339Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"95b28b1e3a1445e6ab95a53c73351759\",\"parentId\":\"95b28b1e3a1445e6ab95a53c73351759\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":773,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"95b28b1e3a1445e6ab95a53c73351759\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"20ec623d-9c1c-11e8-8b32-05583b39d1bf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:35:12.727Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e2b52b5f8eb2465bbe870be652568daf\",\"parentId\":\"e2b52b5f8eb2465bbe870be652568daf\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":496,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"e2b52b5f8eb2465bbe870be652568daf\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"10c54067-9c1c-11e8-bda8-b77fb87599da\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:34:34.994Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"58aa710b6ed04875b5b54e7aaa4bfef3\",\"parentId\":\"58aa710b6ed04875b5b54e7aaa4bfef3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":384,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"58aa710b6ed04875b5b54e7aaa4bfef3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"115d88c2-9c1c-11e8-adb6-01d037e41e09\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:34:28.791Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"090336f38a594e19a43f0446ae4a7dd3\",\"parentId\":\"090336f38a594e19a43f0446ae4a7dd3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":581,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"090336f38a594e19a43f0446ae4a7dd3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e86df382-9c1b-11e8-a618-7fc6607ec2bb\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:33:44.214Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a4f9443bf336417984fc9e106ca4c594\",\"parentId\":\"a4f9443bf336417984fc9e106ca4c594\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":253,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"a4f9443bf336417984fc9e106ca4c594\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dea93028-9c1b-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:33:12.350Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8192996951ae418d887e8940b5f5beed\",\"parentId\":\"8192996951ae418d887e8940b5f5beed\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":817,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8192996951ae418d887e8940b5f5beed\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b7cdd4a0-9c1b-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:32:28.485Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"254c6a38bf2547cf9f114c63fdd6445a\",\"parentId\":\"254c6a38bf2547cf9f114c63fdd6445a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":293,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"254c6a38bf2547cf9f114c63fdd6445a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b8c52d0c-9c1b-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:32:02.192Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"629a05663f104dfcbdff54ebc880b1b4\",\"parentId\":\"629a05663f104dfcbdff54ebc880b1b4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":639,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"629a05663f104dfcbdff54ebc880b1b4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"97539f61-9c1b-11e8-85ff-3d9d85780d93\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:31:33.492Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7e19a7494c5042ceb752774cf7c4f58e\",\"parentId\":\"7e19a7494c5042ceb752774cf7c4f58e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":262,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"7e19a7494c5042ceb752774cf7c4f58e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"95f2afe4-9c1b-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:31:15.689Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d54f50ba2773448bb4047420e1acd0e2\",\"parentId\":\"d54f50ba2773448bb4047420e1acd0e2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":468,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"d54f50ba2773448bb4047420e1acd0e2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"836c4123-9c1b-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:30:38.067Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"af4ccb7b07c0417394e3691ccb193b39\",\"parentId\":\"af4ccb7b07c0417394e3691ccb193b39\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":457,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"af4ccb7b07c0417394e3691ccb193b39\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7661c894-9c1b-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:30:12.710Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9caa2ebde63247ddbaf8e18ce0b5ef21\",\"parentId\":\"9caa2ebde63247ddbaf8e18ce0b5ef21\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":604,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9caa2ebde63247ddbaf8e18ce0b5ef21\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"54b88929-9c1b-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:29:34.986Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0d87b04f113f41b185184011adebbfb2\",\"parentId\":\"0d87b04f113f41b185184011adebbfb2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":406,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"0d87b04f113f41b185184011adebbfb2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3bd142ea-9c1b-11e8-a85e-71e9913384de\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:28:44.196Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e0040c3fc4b74ffa87e696cc139033ed\",\"parentId\":\"e0040c3fc4b74ffa87e696cc139033ed\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":563,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"e0040c3fc4b74ffa87e696cc139033ed\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"21dad67d-9c1b-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:28:12.337Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c774917fb4d044e18292fac595e0cd9d\",\"parentId\":\"c774917fb4d044e18292fac595e0cd9d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":814,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"c774917fb4d044e18292fac595e0cd9d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0d2b46a4-9c1b-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:27:28.465Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4f52af09b9d544ceac9bb94e47549adc\",\"parentId\":\"4f52af09b9d544ceac9bb94e47549adc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":238,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"4f52af09b9d544ceac9bb94e47549adc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0e7b6d30-9c1b-11e8-a94f-798b72fa8740\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:27:23.889Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bc0381baa8654a6a8d3fd8f29dc7c3d8\",\"parentId\":\"bc0381baa8654a6a8d3fd8f29dc7c3d8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":695,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"bc0381baa8654a6a8d3fd8f29dc7c3d8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fc98e022-9c1a-11e8-9b2d-fff542f82f2f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:27:02.177Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fb456fce191642aba7f6618a5dae3db1\",\"parentId\":\"fb456fce191642aba7f6618a5dae3db1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":506,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"fb456fce191642aba7f6618a5dae3db1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ee70e961-9c1a-11e8-85ff-3d9d85780d93\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:26:33.489Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"82074382eca44a85b7c0da5e33bfb731\",\"parentId\":\"82074382eca44a85b7c0da5e33bfb731\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":379,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"82074382eca44a85b7c0da5e33bfb731\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dbcfc6b0-9c1a-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:26:15.678Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3ffe51a5864640ad80da78eb94bdb35c\",\"parentId\":\"3ffe51a5864640ad80da78eb94bdb35c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":482,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3ffe51a5864640ad80da78eb94bdb35c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c9b512bc-9c1a-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:25:38.061Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6a73b7d3072940a1932e45fd9185b4e5\",\"parentId\":\"6a73b7d3072940a1932e45fd9185b4e5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":522,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"6a73b7d3072940a1932e45fd9185b4e5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b91b58fe-9c1a-11e8-b4b8-7d831ea184fa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:25:12.691Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"baa2607ae87f483590261ca787b773ca\",\"parentId\":\"baa2607ae87f483590261ca787b773ca\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":450,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"baa2607ae87f483590261ca787b773ca\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"af23ed31-9c1a-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:25:03.993Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"66fb5f1294484c75b035fb21be854b98\",\"parentId\":\"66fb5f1294484c75b035fb21be854b98\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":577,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"66fb5f1294484c75b035fb21be854b98\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ac7bfe13-9c1a-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:24:34.974Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d250fe45eea54c4286da9ec1c12c25be\",\"parentId\":\"d250fe45eea54c4286da9ec1c12c25be\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":393,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"d250fe45eea54c4286da9ec1c12c25be\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8597a270-9c1a-11e8-923c-e5092b11ff9c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:23:44.187Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2701275e3b9e4435aeb1389b6fad55a6\",\"parentId\":\"2701275e3b9e4435aeb1389b6fad55a6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":217,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"2701275e3b9e4435aeb1389b6fad55a6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"774a705a-9c1a-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:23:12.321Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8cb4e92104744d8cbbd4854eed626f02\",\"parentId\":\"8cb4e92104744d8cbbd4854eed626f02\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":671,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8cb4e92104744d8cbbd4854eed626f02\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"63925fe3-9c1a-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:22:28.441Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f87fc6db13be465ebe63b76aa15f4cc9\",\"parentId\":\"f87fc6db13be465ebe63b76aa15f4cc9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":267,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"f87fc6db13be465ebe63b76aa15f4cc9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"52e5ba55-9c1a-11e8-a94f-798b72fa8740\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:22:23.871Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3cfcc91a753543bf8dd0aecd76393edb\",\"parentId\":\"3cfcc91a753543bf8dd0aecd76393edb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":629,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3cfcc91a753543bf8dd0aecd76393edb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"483b03f1-9c1a-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:21:41.726Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f646ce8a24df48edb195dc08fa605026\",\"parentId\":\"f646ce8a24df48edb195dc08fa605026\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":566,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f646ce8a24df48edb195dc08fa605026\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3524ffb3-9c1a-11e8-8584-4b5ea0eefbc1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:21:33.474Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3d5166e3955944f9a108e3755a7d19fe\",\"parentId\":\"3d5166e3955944f9a108e3755a7d19fe\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":391,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3d5166e3955944f9a108e3755a7d19fe\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"326b5dd2-9c1a-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:21:15.667Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4625e46ba054453cacb35a3806d38c3e\",\"parentId\":\"4625e46ba054453cacb35a3806d38c3e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":635,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"4625e46ba054453cacb35a3806d38c3e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1a118a72-9c1a-11e8-9b2d-fff542f82f2f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:20:49.054Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9e73b804e8b34e008c178e843219679f\",\"parentId\":\"9e73b804e8b34e008c178e843219679f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":536,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9e73b804e8b34e008c178e843219679f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0a89dcdb-9c1a-11e8-8b32-05583b39d1bf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:20:11.856Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"36baf7b14de84b30b60194eed4847676\",\"parentId\":\"36baf7b14de84b30b60194eed4847676\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":482,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"36baf7b14de84b30b60194eed4847676\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f1f7e27d-9c19-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:19:34.965Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"157c6524f76740cca318ae0bdb8313de\",\"parentId\":\"157c6524f76740cca318ae0bdb8313de\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":388,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"157c6524f76740cca318ae0bdb8313de\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bb335920-9c19-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:18:12.297Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ae0507077feb41e78b2ffd3a900fa5f7\",\"parentId\":\"ae0507077feb41e78b2ffd3a900fa5f7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":734,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"ae0507077feb41e78b2ffd3a900fa5f7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b4335aa4-9c19-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:17:37.785Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c3dc17f5e59e4d43a96f1d12b63910db\",\"parentId\":\"c3dc17f5e59e4d43a96f1d12b63910db\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":790,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"c3dc17f5e59e4d43a96f1d12b63910db\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a9d95c52-9c19-11e8-9854-25a6b038c75d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:17:23.855Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a53296892eaf45df8b77ccc464c20e88\",\"parentId\":\"a53296892eaf45df8b77ccc464c20e88\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":483,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"a53296892eaf45df8b77ccc464c20e88\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c9fa9cc0-9c19-11e8-a85e-71e9913384de\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:17:02.489Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d282bfd7a5554cac89fd533559a8a6a7\",\"parentId\":\"d282bfd7a5554cac89fd533559a8a6a7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":192,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"d282bfd7a5554cac89fd533559a8a6a7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"955dd4c5-9c19-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:17:00.303Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"983d1de461504b728e4ad4c35fd3adb8\",\"parentId\":\"983d1de461504b728e4ad4c35fd3adb8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":245,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"983d1de461504b728e4ad4c35fd3adb8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8d796a67-9c19-11e8-85ff-3d9d85780d93\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:16:33.460Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a124a194423145d6a6a549d75d744c23\",\"parentId\":\"a124a194423145d6a6a549d75d744c23\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":371,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"a124a194423145d6a6a549d75d744c23\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"78467911-9c19-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:16:15.655Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8122ee9700374b4e92695627246d366f\",\"parentId\":\"8122ee9700374b4e92695627246d366f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":455,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"8122ee9700374b4e92695627246d366f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"720dc321-9c19-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:15:49.047Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8d87ab7f1f21484b8920269d35a053b5\",\"parentId\":\"8d87ab7f1f21484b8920269d35a053b5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":592,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"8d87ab7f1f21484b8920269d35a053b5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8b649419-9c19-11e8-8b32-05583b39d1bf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:15:04.054Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a866a5bf33fb4076a2bb9a1a7ddc4f1b\",\"parentId\":\"a866a5bf33fb4076a2bb9a1a7ddc4f1b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":463,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"a866a5bf33fb4076a2bb9a1a7ddc4f1b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"49b1baa2-9c19-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:14:34.959Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9585173e408044c5908524268fae330a\",\"parentId\":\"9585173e408044c5908524268fae330a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":377,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"9585173e408044c5908524268fae330a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"36616ce3-9c19-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:14:03.590Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3f5864a7057b4975a61ae6e64430fc2f\",\"parentId\":\"3f5864a7057b4975a61ae6e64430fc2f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":283,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"3f5864a7057b4975a61ae6e64430fc2f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"106d8b72-9c19-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:13:12.240Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"18f40f8cf2964a0281cc03b9fba1ad35\",\"parentId\":\"18f40f8cf2964a0281cc03b9fba1ad35\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":990,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"18f40f8cf2964a0281cc03b9fba1ad35\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fa7a7ea5-9c18-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:12:37.773Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1289a0169b214a7e9c3d8e14288a861e\",\"parentId\":\"1289a0169b214a7e9c3d8e14288a861e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1107,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"1289a0169b214a7e9c3d8e14288a861e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"efd74236-9c18-11e8-9f6f-8d95b66a59e0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:12:25.934Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a60c68ef370e4ad5ba679b61f85febad\",\"parentId\":\"a60c68ef370e4ad5ba679b61f85febad\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":207,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"a60c68ef370e4ad5ba679b61f85febad\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d2f54e98-9c18-11e8-8dc7-c12c0deee82c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:11:33.452Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"42f63b7c79f5467e8d443b41276a9996\",\"parentId\":\"42f63b7c79f5467e8d443b41276a9996\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":384,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"42f63b7c79f5467e8d443b41276a9996\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d0d2e38e-9c18-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:11:15.637Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3464119b67a9434894af7d91415c0820\",\"parentId\":\"3464119b67a9434894af7d91415c0820\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":435,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3464119b67a9434894af7d91415c0820\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b7a8ef14-9c18-11e8-be23-6fbee8e719c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:10:49.035Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"969e3d32e59a4d538a1aefd2309401cf\",\"parentId\":\"969e3d32e59a4d538a1aefd2309401cf\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":558,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"969e3d32e59a4d538a1aefd2309401cf\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b00e107c-9c18-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:10:20.323Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8322c81949294e64b6775aeff83e6cfb\",\"parentId\":\"8322c81949294e64b6775aeff83e6cfb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":690,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8322c81949294e64b6775aeff83e6cfb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9dab2f9b-9c18-11e8-a3eb-0b6b60821220\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:10:04.045Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fb7c23a62f804b13902126ec6b7eb023\",\"parentId\":\"fb7c23a62f804b13902126ec6b7eb023\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":466,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"fb7c23a62f804b13902126ec6b7eb023\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8d8d35c8-9c18-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:09:34.955Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8475a7175fe94350a65c1ce7a3811e7f\",\"parentId\":\"8475a7175fe94350a65c1ce7a3811e7f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":411,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8475a7175fe94350a65c1ce7a3811e7f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"78cdc746-9c18-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:09:03.570Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"812a3252e3074a12aefc40b0b563c6a2\",\"parentId\":\"812a3252e3074a12aefc40b0b563c6a2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":236,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"812a3252e3074a12aefc40b0b563c6a2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5423ca96-9c18-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:08:12.135Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bb928ec3e6c745d395b64ab28191da37\",\"parentId\":\"bb928ec3e6c745d395b64ab28191da37\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":912,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"bb928ec3e6c745d395b64ab28191da37\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3ecbc5e3-9c18-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:07:26.788Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7ad2353e0357459b813b5edeb92e9313\",\"parentId\":\"7ad2353e0357459b813b5edeb92e9313\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":562,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"7ad2353e0357459b813b5edeb92e9313\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4572a759-9c18-11e8-b3c6-873d539facca\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:07:25.891Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"92c540e4e0924d8abda8ca3d4babf0fe\",\"parentId\":\"92c540e4e0924d8abda8ca3d4babf0fe\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":400,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"92c540e4e0924d8abda8ca3d4babf0fe\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2015ae28-9c18-11e8-9b2d-fff542f82f2f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:06:43.890Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"419555f88c99465bb1da5f411855cd5c\",\"parentId\":\"419555f88c99465bb1da5f411855cd5c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":493,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"419555f88c99465bb1da5f411855cd5c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"195ca49d-9c18-11e8-8dc7-c12c0deee82c\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:06:33.444Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ed0b8ac40a3940259e9f8bb4b776393f\",\"parentId\":\"ed0b8ac40a3940259e9f8bb4b776393f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":409,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ed0b8ac40a3940259e9f8bb4b776393f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1722b9c2-9c18-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:06:15.622Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"674aca9eec804860a07dc06fc06014df\",\"parentId\":\"674aca9eec804860a07dc06fc06014df\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":405,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"674aca9eec804860a07dc06fc06014df\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f141007c-9c17-11e8-9d2c-29f1c81d78ac\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:05:04.030Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9d8a86b3bfb640bcab30ef14a3245abd\",\"parentId\":\"9d8a86b3bfb640bcab30ef14a3245abd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1009,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9d8a86b3bfb640bcab30ef14a3245abd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d19dca4b-9c17-11e8-a185-09f8274ac4d4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:04:27.602Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bdfa1b6de0b146b7a73689d58a92de15\",\"parentId\":\"bdfa1b6de0b146b7a73689d58a92de15\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":425,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"bdfa1b6de0b146b7a73689d58a92de15\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d0fe2f01-9c17-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:04:04.842Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c7d77c2e64e34ccdbe5480a08b5f1656\",\"parentId\":\"c7d77c2e64e34ccdbe5480a08b5f1656\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":507,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"c7d77c2e64e34ccdbe5480a08b5f1656\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cb2b3f85-9c17-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:04:03.542Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"87e6fc58a0124c10b17130db6330fb4c\",\"parentId\":\"87e6fc58a0124c10b17130db6330fb4c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":281,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"87e6fc58a0124c10b17130db6330fb4c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a54ba8ce-9c17-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:03:12.112Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1191dbe92d8644eca21a044ec069b5e5\",\"parentId\":\"1191dbe92d8644eca21a044ec069b5e5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":896,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"1191dbe92d8644eca21a044ec069b5e5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"87309902-9c17-11e8-b3c6-873d539facca\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:02:25.870Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bbd80833874b4f5d87c293e4941ce1ea\",\"parentId\":\"bbd80833874b4f5d87c293e4941ce1ea\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":172,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"bbd80833874b4f5d87c293e4941ce1ea\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7031e8d9-9c17-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:01:49.399Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b69c691446c64620b44348f4ce0257a2\",\"parentId\":\"b69c691446c64620b44348f4ce0257a2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":580,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"b69c691446c64620b44348f4ce0257a2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"757c95d3-9c17-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:01:43.873Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c78b0a1a4eaa48c2a0bc39d6aa698534\",\"parentId\":\"c78b0a1a4eaa48c2a0bc39d6aa698534\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":502,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"c78b0a1a4eaa48c2a0bc39d6aa698534\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5be930b1-9c17-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:01:15.618Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1f977cdaad1f4032869ada55d6e37f81\",\"parentId\":\"1f977cdaad1f4032869ada55d6e37f81\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":491,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"1f977cdaad1f4032869ada55d6e37f81\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4e10ba00-9c17-11e8-b832-21aa99c1c16e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T21:00:33.556Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5146245a0bed45a09c382f70f163cd30\",\"parentId\":\"5146245a0bed45a09c382f70f163cd30\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":483,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"5146245a0bed45a09c382f70f163cd30\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"276c2634-9c17-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:59:27.585Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a3a20971839d4e99be2506a5ad6ba3e1\",\"parentId\":\"a3a20971839d4e99be2506a5ad6ba3e1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":439,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"a3a20971839d4e99be2506a5ad6ba3e1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"16491847-9c17-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:59:04.826Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"27293f4b7bb04d03aa2fd60a4d65f0e9\",\"parentId\":\"27293f4b7bb04d03aa2fd60a4d65f0e9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":859,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"27293f4b7bb04d03aa2fd60a4d65f0e9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0d62f4de-9c17-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:59:03.518Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2a937155a5c34393a06e613ae142e40d\",\"parentId\":\"2a937155a5c34393a06e613ae142e40d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":239,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"2a937155a5c34393a06e613ae142e40d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fa5fdc92-9c16-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:58:12.088Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8ac5d5065a774fc496ad91adb1920b7a\",\"parentId\":\"8ac5d5065a774fc496ad91adb1920b7a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":873,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8ac5d5065a774fc496ad91adb1920b7a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"de062bf2-9c16-11e8-9f6f-8d95b66a59e0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:57:25.854Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b8256cf15a0343a48dc1926bccea260b\",\"parentId\":\"b8256cf15a0343a48dc1926bccea260b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":171,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"b8256cf15a0343a48dc1926bccea260b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c69335b9-9c16-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:56:49.387Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e60909391e9d4b57aec575bc9bfbd4d7\",\"parentId\":\"e60909391e9d4b57aec575bc9bfbd4d7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":565,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"e60909391e9d4b57aec575bc9bfbd4d7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c902fd5a-9c16-11e8-bda8-b77fb87599da\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:56:48.629Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e9ca88c87cca42d8aac460c5b0d82bd8\",\"parentId\":\"e9ca88c87cca42d8aac460c5b0d82bd8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":493,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"e9ca88c87cca42d8aac460c5b0d82bd8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c19681f1-9c16-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:56:43.967Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a7d6d90cfb9a4c08a4c5b1fca03ec2cc\",\"parentId\":\"a7d6d90cfb9a4c08a4c5b1fca03ec2cc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1130,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"a7d6d90cfb9a4c08a4c5b1fca03ec2cc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bc8beb4a-9c16-11e8-9b2d-fff542f82f2f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:56:43.861Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d380c73fa662426080b30f1601afdaca\",\"parentId\":\"d380c73fa662426080b30f1601afdaca\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":532,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"d380c73fa662426080b30f1601afdaca\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b44d52d1-9c16-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:56:15.502Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d81895839f1d4b538b758680dc929404\",\"parentId\":\"d81895839f1d4b538b758680dc929404\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":417,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"d81895839f1d4b538b758680dc929404\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5c142dc7-9c16-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:54:04.811Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"23a76802d34f4594bcb873ea0e81d50f\",\"parentId\":\"23a76802d34f4594bcb873ea0e81d50f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":866,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"23a76802d34f4594bcb873ea0e81d50f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"62b36e2b-9c16-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:54:03.495Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2dcd5dbd6cdc4475a7901c6a19ee94bd\",\"parentId\":\"2dcd5dbd6cdc4475a7901c6a19ee94bd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":262,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"2dcd5dbd6cdc4475a7901c6a19ee94bd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"48a88ff6-9c16-11e8-b832-21aa99c1c16e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:53:34.062Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"797617d26ca343b993d6907e3a3c7e59\",\"parentId\":\"797617d26ca343b993d6907e3a3c7e59\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":417,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"797617d26ca343b993d6907e3a3c7e59\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"43339e62-9c16-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:53:18.228Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a8bd104e507f44a98db5e7ddf1d2a3da\",\"parentId\":\"a8bd104e507f44a98db5e7ddf1d2a3da\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":525,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"a8bd104e507f44a98db5e7ddf1d2a3da\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3ea05a9b-9c16-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:53:12.066Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a0cc1bc44ffb44c59b285f9b93bf9299\",\"parentId\":\"a0cc1bc44ffb44c59b285f9b93bf9299\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":980,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"a0cc1bc44ffb44c59b285f9b93bf9299\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"44bc3a08-9c16-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:53:07.672Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d5abe7fa41ce4b078d50fa2e139fc696\",\"parentId\":\"d5abe7fa41ce4b078d50fa2e139fc696\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":446,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"d5abe7fa41ce4b078d50fa2e139fc696\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"21964582-9c16-11e8-9f6f-8d95b66a59e0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:52:25.834Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8d4ec306c01c4529887eaf66e0e4954a\",\"parentId\":\"8d4ec306c01c4529887eaf66e0e4954a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":207,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"8d4ec306c01c4529887eaf66e0e4954a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0d4cf1bb-9c16-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:51:48.552Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"879c720f35d347f2a2e7ce31edf101c7\",\"parentId\":\"879c720f35d347f2a2e7ce31edf101c7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":434,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"879c720f35d347f2a2e7ce31edf101c7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"17ce4e0a-9c16-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:51:43.953Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8837dcf25bcc4350a38b85d434d28051\",\"parentId\":\"8837dcf25bcc4350a38b85d434d28051\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1185,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"8837dcf25bcc4350a38b85d434d28051\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"14bd16cd-9c16-11e8-84d5-397f86fb22d7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:51:43.852Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f8f7c6d8cfb14318934a139f24071a29\",\"parentId\":\"f8f7c6d8cfb14318934a139f24071a29\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":506,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f8f7c6d8cfb14318934a139f24071a29\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b4d6ea7e-9c15-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:49:04.807Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7a544fe2ab4d4115be5848477c4a9044\",\"parentId\":\"7a544fe2ab4d4115be5848477c4a9044\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1152,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"7a544fe2ab4d4115be5848477c4a9044\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b9b1bed5-9c15-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:49:03.474Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b9862db5073c406ca4dbd8bda9fcb45c\",\"parentId\":\"b9862db5073c406ca4dbd8bda9fcb45c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":227,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"b9862db5073c406ca4dbd8bda9fcb45c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a0440a55-9c15-11e8-b832-21aa99c1c16e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:48:34.056Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d431092b0b8b4ba1b3089167dab91197\",\"parentId\":\"d431092b0b8b4ba1b3089167dab91197\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":538,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"d431092b0b8b4ba1b3089167dab91197\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"88e315c5-9c15-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:48:07.663Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4ef1180218ae496b9dcf2a0cbfe310b6\",\"parentId\":\"4ef1180218ae496b9dcf2a0cbfe310b6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":436,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"4ef1180218ae496b9dcf2a0cbfe310b6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"781071fe-9c15-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:47:42.562Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4468fcd3a40b44329141c8995028c671\",\"parentId\":\"4468fcd3a40b44329141c8995028c671\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":381,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"4468fcd3a40b44329141c8995028c671\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"78174ffc-9c15-11e8-9f6f-8d95b66a59e0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:47:25.815Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"09641e87d8334bc89149997f465b134b\",\"parentId\":\"09641e87d8334bc89149997f465b134b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":343,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"09641e87d8334bc89149997f465b134b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5d49e46e-9c15-11e8-a88e-c548ea64983b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:46:43.947Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ce98489fe5334993bd35ad3519811ebb\",\"parentId\":\"ce98489fe5334993bd35ad3519811ebb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1156,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"ce98489fe5334993bd35ad3519811ebb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"57e546a7-9c15-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:46:43.842Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b0b7b4d72d644f60a0d927d71b88d889\",\"parentId\":\"b0b7b4d72d644f60a0d927d71b88d889\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":550,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"b0b7b4d72d644f60a0d927d71b88d889\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"36983106-9c15-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:45:45.371Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5ef7ed4248a44efcb2adb4469314092b\",\"parentId\":\"5ef7ed4248a44efcb2adb4469314092b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":280,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5ef7ed4248a44efcb2adb4469314092b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3b032c21-9c15-11e8-bb07-c9a850f113fc\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:45:44.978Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3485c7646e45413385388de3811b9e92\",\"parentId\":\"3485c7646e45413385388de3811b9e92\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":434,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3485c7646e45413385388de3811b9e92\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"36e8e8c7-9c15-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:45:43.693Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5f32a7a281aa46ba8b1eb877730f67ae\",\"parentId\":\"5f32a7a281aa46ba8b1eb877730f67ae\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":992,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5f32a7a281aa46ba8b1eb877730f67ae\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fb5300e7-9c14-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:44:04.799Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2aa547f3ddcb4014a57a526e4376bb96\",\"parentId\":\"2aa547f3ddcb4014a57a526e4376bb96\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":873,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"2aa547f3ddcb4014a57a526e4376bb96\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"eb12b1d9-9c14-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:43:34.858Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4c25c142528f4e1e976f80f100694186\",\"parentId\":\"4c25c142528f4e1e976f80f100694186\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":758,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"4c25c142528f4e1e976f80f100694186\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e5258351-9c14-11e8-b832-21aa99c1c16e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:43:34.033Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ccca32a321c2431d89013dca1bc02ed9\",\"parentId\":\"ccca32a321c2431d89013dca1bc02ed9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":578,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ccca32a321c2431d89013dca1bc02ed9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e0dda063-9c14-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:43:07.648Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e98b0e8a8c5b43e3bcb47464fe6ee3aa\",\"parentId\":\"e98b0e8a8c5b43e3bcb47464fe6ee3aa\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":406,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"e98b0e8a8c5b43e3bcb47464fe6ee3aa\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ce686ff3-9c14-11e8-b6ec-198244cd2be9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:42:42.555Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"017792b6528a4e31967f52368dada77f\",\"parentId\":\"017792b6528a4e31967f52368dada77f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":392,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"017792b6528a4e31967f52368dada77f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bc24fe23-9c14-11e8-893b-2175ae469ccf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:42:25.781Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"50dd860af47043d2a922b0b6887a5008\",\"parentId\":\"50dd860af47043d2a922b0b6887a5008\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":179,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"50dd860af47043d2a922b0b6887a5008\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b48bcd68-9c14-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:41:43.933Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4fef9a22dac440939dead546b4e030b8\",\"parentId\":\"4fef9a22dac440939dead546b4e030b8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1137,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"4fef9a22dac440939dead546b4e030b8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b10feceb-9c14-11e8-817d-fbbbcd5a46c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:41:43.832Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05cfc50c5aa9453ba0a7227e588ff1c8\",\"parentId\":\"05cfc50c5aa9453ba0a7227e588ff1c8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":526,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"05cfc50c5aa9453ba0a7227e588ff1c8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"906aafb0-9c14-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:40:44.976Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"412521113ba4437782e117b15965218a\",\"parentId\":\"412521113ba4437782e117b15965218a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":475,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"412521113ba4437782e117b15965218a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"797c5387-9c14-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:40:19.190Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a0f334644d664f8c8bc911dd3f2472d8\",\"parentId\":\"a0f334644d664f8c8bc911dd3f2472d8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":503,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"a0f334644d664f8c8bc911dd3f2472d8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"424076f0-9c14-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:39:04.790Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"81a6492f763a4d109fbf294244d229e3\",\"parentId\":\"81a6492f763a4d109fbf294244d229e3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":852,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"81a6492f763a4d109fbf294244d229e3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"42eac068-9c14-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:38:34.840Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fc8c62789e3a469e823aeccc1173d974\",\"parentId\":\"fc8c62789e3a469e823aeccc1173d974\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":501,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"fc8c62789e3a469e823aeccc1173d974\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3d3ee0b5-9c14-11e8-b0a7-7d175f2d85c0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:38:34.013Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"538f459460474bc083fd4261a5165075\",\"parentId\":\"538f459460474bc083fd4261a5165075\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":451,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"538f459460474bc083fd4261a5165075\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"26ffd726-9c14-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:38:07.629Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"14a3f330850447b085d02416b9955ba3\",\"parentId\":\"14a3f330850447b085d02416b9955ba3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":437,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"14a3f330850447b085d02416b9955ba3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"121ab806-9c14-11e8-bda8-b77fb87599da\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:37:42.547Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"493f617241234d7fb9174757c0889cf0\",\"parentId\":\"493f617241234d7fb9174757c0889cf0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":426,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"493f617241234d7fb9174757c0889cf0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"14857677-9c14-11e8-b3c6-873d539facca\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:37:25.765Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"22fedf2cd2ee4f21bdf0ff118b470b8f\",\"parentId\":\"22fedf2cd2ee4f21bdf0ff118b470b8f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":172,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"22fedf2cd2ee4f21bdf0ff118b470b8f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f88111ee-9c13-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:36:43.880Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c23b3df105ca47c899fbe1ab57ee9c59\",\"parentId\":\"c23b3df105ca47c899fbe1ab57ee9c59\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":995,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"c23b3df105ca47c899fbe1ab57ee9c59\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f4f6d97b-9c13-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:36:43.830Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7bc5c030abdc4f4092a4d80497a0268a\",\"parentId\":\"7bc5c030abdc4f4092a4d80497a0268a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":502,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"7bc5c030abdc4f4092a4d80497a0268a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d29609b0-9c13-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:35:44.964Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"61232c5c19d64d92b6c4e438c91381d5\",\"parentId\":\"61232c5c19d64d92b6c4e438c91381d5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":684,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"61232c5c19d64d92b6c4e438c91381d5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bc020212-9c13-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:35:19.159Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c9ff22d4e1744baea0d7c886189ade1c\",\"parentId\":\"c9ff22d4e1744baea0d7c886189ade1c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":355,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"c9ff22d4e1744baea0d7c886189ade1c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9b2b5533-9c13-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:34:04.751Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"da71ecff537849aa92d4b776a3d10aeb\",\"parentId\":\"da71ecff537849aa92d4b776a3d10aeb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":855,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"da71ecff537849aa92d4b776a3d10aeb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"98303d71-9c13-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:33:52.549Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e637ea48e6dd46cea88d0aba7a3f9b32\",\"parentId\":\"e637ea48e6dd46cea88d0aba7a3f9b32\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":509,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"e637ea48e6dd46cea88d0aba7a3f9b32\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"873158ff-9c13-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:33:37.070Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"172d58fd6072419da00866b7b7b7ffd2\",\"parentId\":\"172d58fd6072419da00866b7b7b7ffd2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":409,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"172d58fd6072419da00866b7b7b7ffd2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"85cb87a2-9c13-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:33:34.897Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a7385b256aca4b239c774cd2401edfde\",\"parentId\":\"a7385b256aca4b239c774cd2401edfde\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":650,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"a7385b256aca4b239c774cd2401edfde\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"813f96d9-9c13-11e8-b0a7-7d175f2d85c0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:33:33.981Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3b2db345afd448d8817f590412706254\",\"parentId\":\"3b2db345afd448d8817f590412706254\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":430,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3b2db345afd448d8817f590412706254\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"57b08d59-9c13-11e8-893b-2175ae469ccf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:32:25.748Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5d7dbf849cb54eebac626bd3f59a1ad1\",\"parentId\":\"5d7dbf849cb54eebac626bd3f59a1ad1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":178,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"5d7dbf849cb54eebac626bd3f59a1ad1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"48612d8f-9c13-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:32:00.507Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c44c8af0800546e29e218d083b8c7678\",\"parentId\":\"c44c8af0800546e29e218d083b8c7678\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":617,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"c44c8af0800546e29e218d083b8c7678\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4e8746ae-9c13-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:31:49.120Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ef0be699b9954b00a87ea010acb08276\",\"parentId\":\"ef0be699b9954b00a87ea010acb08276\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":640,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"ef0be699b9954b00a87ea010acb08276\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4ef23d12-9c13-11e8-a88e-c548ea64983b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:31:43.985Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d439bba640b34695be62621d3e458a52\",\"parentId\":\"d439bba640b34695be62621d3e458a52\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1043,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"d439bba640b34695be62621d3e458a52\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3e8a6958-9c13-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:31:41.773Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"dffd24e95cb14684af7dd8c8bb04c4e8\",\"parentId\":\"dffd24e95cb14684af7dd8c8bb04c4e8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":933,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"dffd24e95cb14684af7dd8c8bb04c4e8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"129e35ac-9c13-11e8-bcf7-a7cf70afbe0f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:30:19.139Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9f7e7670a68b4b7282dde26ea347716d\",\"parentId\":\"9f7e7670a68b4b7282dde26ea347716d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":222,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"9f7e7670a68b4b7282dde26ea347716d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dd90d16e-9c12-11e8-b67b-c3b9a633ddd4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:28:52.537Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"08b81b3cf1d441edae5392cca0c0e037\",\"parentId\":\"08b81b3cf1d441edae5392cca0c0e037\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":526,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"08b81b3cf1d441edae5392cca0c0e037\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d8dbadab-9c12-11e8-b1b4-a55fb265815b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:28:37.063Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a07fe200c78b4b8ea6e86b0dfd343568\",\"parentId\":\"a07fe200c78b4b8ea6e86b0dfd343568\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":534,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"a07fe200c78b4b8ea6e86b0dfd343568\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d2e816c2-9c12-11e8-842e-e9a619b82275\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:28:33.963Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"00c1c65ede434e5b8c892322e80f2f9b\",\"parentId\":\"00c1c65ede434e5b8c892322e80f2f9b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":524,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"00c1c65ede434e5b8c892322e80f2f9b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c5d3da23-9c12-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:28:07.081Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"98e6ddbd8b0648c0ad15c03c2224c379\",\"parentId\":\"98e6ddbd8b0648c0ad15c03c2224c379\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":430,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"98e6ddbd8b0648c0ad15c03c2224c379\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"aef31237-9c12-11e8-9107-b99d516d201f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:27:25.732Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6eb5ad4713b542809c45951b3b6df703\",\"parentId\":\"6eb5ad4713b542809c45951b3b6df703\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":185,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"6eb5ad4713b542809c45951b3b6df703\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a351c727-9c12-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:27:20.108Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5f6f018a259a4924aefbc606d350f49c\",\"parentId\":\"5f6f018a259a4924aefbc606d350f49c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":951,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5f6f018a259a4924aefbc606d350f49c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"917f3f63-9c12-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:26:49.082Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"aac4c19f6534474f987dd02285c63570\",\"parentId\":\"aac4c19f6534474f987dd02285c63570\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":675,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"aac4c19f6534474f987dd02285c63570\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"93c389df-9c12-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:26:43.863Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"41bbfaeae53f4f4da952edf7f6ee0d96\",\"parentId\":\"41bbfaeae53f4f4da952edf7f6ee0d96\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1123,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"41bbfaeae53f4f4da952edf7f6ee0d96\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9863c611-9c12-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:26:41.759Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ef2d14b549eb41328a67693e16b55957\",\"parentId\":\"ef2d14b549eb41328a67693e16b55957\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":906,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"ef2d14b549eb41328a67693e16b55957\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"68701411-9c12-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:25:19.117Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"621943a2d4af4ba4abc78b2612dbf8fe\",\"parentId\":\"621943a2d4af4ba4abc78b2612dbf8fe\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":314,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"621943a2d4af4ba4abc78b2612dbf8fe\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2357a16c-9c12-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:23:52.514Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e7defbecba604ae99eabefab28ee7041\",\"parentId\":\"e7defbecba604ae99eabefab28ee7041\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":556,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"e7defbecba604ae99eabefab28ee7041\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"17b4f683-9c12-11e8-842e-e9a619b82275\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:23:33.936Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2ccb42e7e126458c8e3514aec39d96f6\",\"parentId\":\"2ccb42e7e126458c8e3514aec39d96f6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":603,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"2ccb42e7e126458c8e3514aec39d96f6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1bf3b186-9c12-11e8-865a-3d2ec8e2aa6d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:23:29.054Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"59cd71f98bdb412096833e3a20191522\",\"parentId\":\"59cd71f98bdb412096833e3a20191522\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":429,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"59cd71f98bdb412096833e3a20191522\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0b481ddf-9c12-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:23:07.062Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"48dc2c76be0d4c82ba3efb4a39455bf8\",\"parentId\":\"48dc2c76be0d4c82ba3efb4a39455bf8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":390,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"48dc2c76be0d4c82ba3efb4a39455bf8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f5529fdd-9c11-11e8-893b-2175ae469ccf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:22:25.721Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f0bf1a5caa2e4a1385b6bfa46b9678ae\",\"parentId\":\"f0bf1a5caa2e4a1385b6bfa46b9678ae\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":174,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f0bf1a5caa2e4a1385b6bfa46b9678ae\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f9d716be-9c11-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:22:20.096Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"47270c1ac32141c189c54474b790ba9f\",\"parentId\":\"47270c1ac32141c189c54474b790ba9f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":649,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"47270c1ac32141c189c54474b790ba9f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d7d445b4-9c11-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:21:43.885Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cb69eda8e56a4ef19744c8720a33720c\",\"parentId\":\"cb69eda8e56a4ef19744c8720a33720c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":779,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"cb69eda8e56a4ef19744c8720a33720c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"de7162b7-9c11-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:21:41.745Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"760d9e6b7dbc4e0c85bb78c422b1c74a\",\"parentId\":\"760d9e6b7dbc4e0c85bb78c422b1c74a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":980,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"760d9e6b7dbc4e0c85bb78c422b1c74a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7ab688b8-9c11-11e8-817d-fbbbcd5a46c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:18:52.494Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9cb224665e73445ab5107fbcf5aa11a8\",\"parentId\":\"9cb224665e73445ab5107fbcf5aa11a8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":543,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9cb224665e73445ab5107fbcf5aa11a8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6f7efb1c-9c11-11e8-bcbe-453ef415fced\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:18:33.876Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"499ec5ac5912453c8f5fca09a893bfef\",\"parentId\":\"499ec5ac5912453c8f5fca09a893bfef\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":640,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"499ec5ac5912453c8f5fca09a893bfef\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"72e2235e-9c11-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:18:29.041Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8cad2bcf25dd48749aea8e8ade7d8543\",\"parentId\":\"8cad2bcf25dd48749aea8e8ade7d8543\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":358,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8cad2bcf25dd48749aea8e8ade7d8543\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6253b458-9c11-11e8-bb07-c9a850f113fc\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:18:13.844Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"61bacafb36f040a9842b4e74af6997c8\",\"parentId\":\"61bacafb36f040a9842b4e74af6997c8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":581,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"61bacafb36f040a9842b4e74af6997c8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"62b58341-9c11-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:18:07.056Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ecd6f17b30594ae4bc3bdb24e92fcef5\",\"parentId\":\"ecd6f17b30594ae4bc3bdb24e92fcef5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1047,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ecd6f17b30594ae4bc3bdb24e92fcef5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4d9eccf2-9c11-11e8-893b-2175ae469ccf\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:17:25.700Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"61f9010c07cb4c19af04f793f7edd7b6\",\"parentId\":\"61f9010c07cb4c19af04f793f7edd7b6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":181,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"61f9010c07cb4c19af04f793f7edd7b6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3be76e68-9c11-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:17:20.083Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ed014d0c5d3449169895176b4eb6d7c5\",\"parentId\":\"ed014d0c5d3449169895176b4eb6d7c5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":722,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"ed014d0c5d3449169895176b4eb6d7c5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2efc171a-9c11-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:16:43.813Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f3e872fe60b74ac9ae8f1f2c106b5a08\",\"parentId\":\"f3e872fe60b74ac9ae8f1f2c106b5a08\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1205,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f3e872fe60b74ac9ae8f1f2c106b5a08\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2504aad7-9c11-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:16:41.727Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"04e58e0c8ec545f5bc7f939557c5478e\",\"parentId\":\"04e58e0c8ec545f5bc7f939557c5478e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1404,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"04e58e0c8ec545f5bc7f939557c5478e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"165b4f97-9c11-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:16:15.729Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b8ce8030f9e547f6a2c7a22a4ebc0e05\",\"parentId\":\"b8ce8030f9e547f6a2c7a22a4ebc0e05\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":230,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"b8ce8030f9e547f6a2c7a22a4ebc0e05\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bf31ecbb-9c10-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:13:52.474Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f2ca5d46f0c2475ab10b74b7e5abb3af\",\"parentId\":\"f2ca5d46f0c2475ab10b74b7e5abb3af\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":523,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f2ca5d46f0c2475ab10b74b7e5abb3af\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b4afa5b1-9c10-11e8-9b62-174d9c81068d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:13:33.858Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1a179dacd5d944fca122962954070dff\",\"parentId\":\"1a179dacd5d944fca122962954070dff\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":545,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"1a179dacd5d944fca122962954070dff\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b8e75c3d-9c10-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:13:29.033Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e8d067a0f4034be696061075feb2ae1c\",\"parentId\":\"e8d067a0f4034be696061075feb2ae1c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":393,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"e8d067a0f4034be696061075feb2ae1c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b7496376-9c10-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:13:13.832Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5e176fc2c12a4a02aaf69a3bad75a83b\",\"parentId\":\"5e176fc2c12a4a02aaf69a3bad75a83b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":667,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"5e176fc2c12a4a02aaf69a3bad75a83b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a7ee6b93-9c10-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:13:07.038Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b179657e91874e808c704e5e1bfde78a\",\"parentId\":\"b179657e91874e808c704e5e1bfde78a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":526,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b179657e91874e808c704e5e1bfde78a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9282b71a-9c10-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:12:20.065Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"200ccc7dfe94461b89fac2a10bba69bc\",\"parentId\":\"200ccc7dfe94461b89fac2a10bba69bc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":769,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"200ccc7dfe94461b89fac2a10bba69bc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"73f9a3a1-9c10-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:11:43.786Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7d067e3469b748efb9fb145c511b4735\",\"parentId\":\"7d067e3469b748efb9fb145c511b4735\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1233,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"7d067e3469b748efb9fb145c511b4735\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7d017fca-9c10-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:11:41.719Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c741399e7e5447d0b0cc80f1463402a2\",\"parentId\":\"c741399e7e5447d0b0cc80f1463402a2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1041,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"c741399e7e5447d0b0cc80f1463402a2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6ef1f33a-9c10-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:11:15.703Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"49d0a1710eca46519ba2237be47bea34\",\"parentId\":\"49d0a1710eca46519ba2237be47bea34\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":282,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"49d0a1710eca46519ba2237be47bea34\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"30b04c03-9c10-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:09:30.233Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9f552f5d88114cdaafba5c8149a10658\",\"parentId\":\"9f552f5d88114cdaafba5c8149a10658\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":315,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9f552f5d88114cdaafba5c8149a10658\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"18519675-9c10-11e8-b67b-c3b9a633ddd4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:08:52.467Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0f6f6d9c237a41d79816bf3f595b5b3a\",\"parentId\":\"0f6f6d9c237a41d79816bf3f595b5b3a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":602,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"0f6f6d9c237a41d79816bf3f595b5b3a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0c762805-9c10-11e8-9b62-174d9c81068d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:08:33.843Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"15a412638c30439a85eaf15cb419b363\",\"parentId\":\"15a412638c30439a85eaf15cb419b363\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":545,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"15a412638c30439a85eaf15cb419b363\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ff1922ce-9c0f-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:08:29.017Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8d0139f0791c4ab49e025d4f2e8bb441\",\"parentId\":\"8d0139f0791c4ab49e025d4f2e8bb441\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":411,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8d0139f0791c4ab49e025d4f2e8bb441\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f811aac1-9c0f-11e8-bb07-c9a850f113fc\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:08:13.820Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05cafed0d07845f991b3eaffffeed3a3\",\"parentId\":\"05cafed0d07845f991b3eaffffeed3a3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":569,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"05cafed0d07845f991b3eaffffeed3a3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0041c4b7-9c10-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:08:07.016Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bb268c7849ea472f923d72deb86d6367\",\"parentId\":\"bb268c7849ea472f923d72deb86d6367\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":399,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"bb268c7849ea472f923d72deb86d6367\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d5e6914c-9c0f-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:07:20.040Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"37da2a1f1b3843a780eaaf9bc19cc9fd\",\"parentId\":\"37da2a1f1b3843a780eaaf9bc19cc9fd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":514,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"37da2a1f1b3843a780eaaf9bc19cc9fd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ca7110d6-9c0f-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:06:43.779Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"245fa9f14f504041bb2271bce002009b\",\"parentId\":\"245fa9f14f504041bb2271bce002009b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1296,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"245fa9f14f504041bb2271bce002009b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c237a806-9c0f-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:06:41.689Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"893380496d6541bfb7fa8e3aa6338bce\",\"parentId\":\"893380496d6541bfb7fa8e3aa6338bce\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":769,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"893380496d6541bfb7fa8e3aa6338bce\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b3ee952b-9c0f-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:06:15.674Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"10b9913e4f33487cb739036162d193a1\",\"parentId\":\"10b9913e4f33487cb739036162d193a1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":225,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"10b9913e4f33487cb739036162d193a1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"93c84c48-9c0f-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:05:06.079Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0f3eb8c193564f6cbfc4156ed0d45719\",\"parentId\":\"0f3eb8c193564f6cbfc4156ed0d45719\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":487,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"0f3eb8c193564f6cbfc4156ed0d45719\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"744f811c-9c0f-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:04:30.218Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e0399da8bb66473a9271c46806738a50\",\"parentId\":\"e0399da8bb66473a9271c46806738a50\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":231,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"e0399da8bb66473a9271c46806738a50\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"524bc58d-9c0f-11e8-bcbe-453ef415fced\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:03:33.786Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0bdb5121e6414cd0b746bf9798b9f1f3\",\"parentId\":\"0bdb5121e6414cd0b746bf9798b9f1f3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":447,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"0bdb5121e6414cd0b746bf9798b9f1f3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"56b253df-9c0f-11e8-bf57-75bc844edc27\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:03:29.013Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"476f19c500e4490183a323dcd7e0bcae\",\"parentId\":\"476f19c500e4490183a323dcd7e0bcae\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":380,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"476f19c500e4490183a323dcd7e0bcae\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4e62cba9-9c0f-11e8-921f-813686c85e36\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:03:13.819Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3ed7db691faa4a8f9dcc6d3b24f50073\",\"parentId\":\"3ed7db691faa4a8f9dcc6d3b24f50073\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":551,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3ed7db691faa4a8f9dcc6d3b24f50073\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"44d67d7f-9c0f-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:03:06.998Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"34aaa9dd0d6a4cc39976505a108107e3\",\"parentId\":\"34aaa9dd0d6a4cc39976505a108107e3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":699,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"34aaa9dd0d6a4cc39976505a108107e3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2bac133a-9c0f-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:02:20.024Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8dbaacbb9d4540e298aba71c97852e86\",\"parentId\":\"8dbaacbb9d4540e298aba71c97852e86\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":637,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8dbaacbb9d4540e298aba71c97852e86\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0bdc27a3-9c0f-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:01:43.748Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"363cede8bd9c4510a2955001bab1dba0\",\"parentId\":\"363cede8bd9c4510a2955001bab1dba0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1184,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"363cede8bd9c4510a2955001bab1dba0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1a9dc5b6-9c0f-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:01:41.658Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5c7c8d9a05754ba289d6c55dfbc17012\",\"parentId\":\"5c7c8d9a05754ba289d6c55dfbc17012\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":922,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"5c7c8d9a05754ba289d6c55dfbc17012\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0c675067-9c0f-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:01:15.653Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"db56f818093e42eda91056a42b861db5\",\"parentId\":\"db56f818093e42eda91056a42b861db5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":391,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"db56f818093e42eda91056a42b861db5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"da0d9ac6-9c0e-11e8-817d-fbbbcd5a46c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T20:00:06.063Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d7189eabbb064d4584d5c941f4b1ed29\",\"parentId\":\"d7189eabbb064d4584d5c941f4b1ed29\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":499,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"d7189eabbb064d4584d5c941f4b1ed29\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cdf264c7-9c0e-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:59:54.432Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"61406638357044fa8c5cb20169baf39f\",\"parentId\":\"61406638357044fa8c5cb20169baf39f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":616,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"61406638357044fa8c5cb20169baf39f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ca45b00a-9c0e-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:59:30.202Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"13230bd006504fd797b48c1ebf784ee0\",\"parentId\":\"13230bd006504fd797b48c1ebf784ee0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":200,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"13230bd006504fd797b48c1ebf784ee0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c06ec4c3-9c0e-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:59:21.856Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3f6c86f51fb04f779f475a8a65122f6b\",\"parentId\":\"3f6c86f51fb04f779f475a8a65122f6b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":382,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"3f6c86f51fb04f779f475a8a65122f6b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ae5c9b68-9c0e-11e8-bcf7-a7cf70afbe0f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:58:45.133Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"53b00710462941dda921989b5bdb79f9\",\"parentId\":\"53b00710462941dda921989b5bdb79f9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":230,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"53b00710462941dda921989b5bdb79f9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a9ebd3c2-9c0e-11e8-9eff-a109d95fc575\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:58:33.770Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"002137a8c75d4488b7006c02d3487442\",\"parentId\":\"002137a8c75d4488b7006c02d3487442\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":557,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"002137a8c75d4488b7006c02d3487442\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"916f849e-9c0e-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:58:13.807Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"169e103f0858408ba13efea5a0d091cc\",\"parentId\":\"169e103f0858408ba13efea5a0d091cc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":641,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"169e103f0858408ba13efea5a0d091cc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a85f4ca-9c0e-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:58:06.980Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"19fe1e3e35ec4a649620b5fd1acde934\",\"parentId\":\"19fe1e3e35ec4a649620b5fd1acde934\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":484,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"19fe1e3e35ec4a649620b5fd1acde934\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"62fb946a-9c0e-11e8-a88e-c548ea64983b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:56:43.746Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6dba7600cf474a0e977c28854fd4c19e\",\"parentId\":\"6dba7600cf474a0e977c28854fd4c19e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1192,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"6dba7600cf474a0e977c28854fd4c19e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1fe92b69-9c0e-11e8-b67b-c3b9a633ddd4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:55:06.051Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6aece2e1b00d42ef854899011a41454a\",\"parentId\":\"6aece2e1b00d42ef854899011a41454a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":513,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"6aece2e1b00d42ef854899011a41454a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"25425776-9c0e-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:54:54.403Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"36ca5bb4e8cf483da359090e7b838abf\",\"parentId\":\"36ca5bb4e8cf483da359090e7b838abf\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":596,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"36ca5bb4e8cf483da359090e7b838abf\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0d44ade7-9c0e-11e8-bf39-53a7085b0f9e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:54:30.180Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1ad843bbf6cb4b81b99706eaf5ca0cc8\",\"parentId\":\"1ad843bbf6cb4b81b99706eaf5ca0cc8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":165,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"1ad843bbf6cb4b81b99706eaf5ca0cc8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"034d1a70-9c0e-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:54:21.837Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1bc8128889ad4230b791d36968e1c519\",\"parentId\":\"1bc8128889ad4230b791d36968e1c519\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":471,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"1bc8128889ad4230b791d36968e1c519\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0417e4b3-9c0e-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:54:02.038Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"819fe7bdf14c4c5b8f11c82f767e548d\",\"parentId\":\"819fe7bdf14c4c5b8f11c82f767e548d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":482,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"819fe7bdf14c4c5b8f11c82f767e548d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f07f6a47-9c0d-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:53:45.102Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cc0ec633bc8c4bef8c59f4202ec2ab93\",\"parentId\":\"cc0ec633bc8c4bef8c59f4202ec2ab93\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":249,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"cc0ec633bc8c4bef8c59f4202ec2ab93\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fc1b5e00-9c0d-11e8-921f-813686c85e36\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:53:38.366Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"22304283ceb64eaa8c1d4409eebcba7e\",\"parentId\":\"22304283ceb64eaa8c1d4409eebcba7e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":641,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"22304283ceb64eaa8c1d4409eebcba7e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ea29b582-9c0d-11e8-bcbe-453ef415fced\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:53:33.737Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bcd18c0a13204845a53ee2fc88e99917\",\"parentId\":\"bcd18c0a13204845a53ee2fc88e99917\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":561,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"bcd18c0a13204845a53ee2fc88e99917\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e1ec0756-9c0d-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:53:06.972Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b7616b5d816f473dbaed7190ff8b14e1\",\"parentId\":\"b7616b5d816f473dbaed7190ff8b14e1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":424,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b7616b5d816f473dbaed7190ff8b14e1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a677d832-9c0d-11e8-a88e-c548ea64983b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:51:43.711Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f9039174fae3440f952c1a810b470efc\",\"parentId\":\"f9039174fae3440f952c1a810b470efc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1104,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f9039174fae3440f952c1a810b470efc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"77e0f735-9c0d-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:50:06.038Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"175a4e0aa8244ab0b82228d53b55d505\",\"parentId\":\"175a4e0aa8244ab0b82228d53b55d505\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":553,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"175a4e0aa8244ab0b82228d53b55d505\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"685997a1-9c0d-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:49:54.392Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5752138d347848ec9a061dd758b13c6a\",\"parentId\":\"5752138d347848ec9a061dd758b13c6a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":579,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5752138d347848ec9a061dd758b13c6a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"61fdefe5-9c0d-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:49:30.169Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"336d40ed5a8243eaacdcbd0c5a4dd0a0\",\"parentId\":\"336d40ed5a8243eaacdcbd0c5a4dd0a0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":162,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"336d40ed5a8243eaacdcbd0c5a4dd0a0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5a594e0c-9c0d-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:49:21.827Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6d1a7123b1c14b6dadd50c1dbf7974c1\",\"parentId\":\"6d1a7123b1c14b6dadd50c1dbf7974c1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":402,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"6d1a7123b1c14b6dadd50c1dbf7974c1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4b303b6e-9c0d-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:49:02.003Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7e87cec585d44bd28050f22db9838ced\",\"parentId\":\"7e87cec585d44bd28050f22db9838ced\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":927,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"7e87cec585d44bd28050f22db9838ced\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"46ae8363-9c0d-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:48:45.082Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3d46b0bf617e439e80418e60020e3cb7\",\"parentId\":\"3d46b0bf617e439e80418e60020e3cb7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":235,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"3d46b0bf617e439e80418e60020e3cb7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3da017f8-9c0d-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:48:38.363Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"edb284baf4e340539ad3bbd79fea076f\",\"parentId\":\"edb284baf4e340539ad3bbd79fea076f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":814,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"edb284baf4e340539ad3bbd79fea076f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3b9b950f-9c0d-11e8-9b62-174d9c81068d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:48:33.713Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bb5355fc50e5415a8f11c94c4b7e4d14\",\"parentId\":\"bb5355fc50e5415a8f11c94c4b7e4d14\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":826,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"bb5355fc50e5415a8f11c94c4b7e4d14\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2754d933-9c0d-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:48:06.955Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2e106bf293e94902aca33b149009258c\",\"parentId\":\"2e106bf293e94902aca33b149009258c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":566,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"2e106bf293e94902aca33b149009258c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fde53e84-9c0c-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:46:43.695Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1a1dc60919d945da8261996d2db34870\",\"parentId\":\"1a1dc60919d945da8261996d2db34870\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1150,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"1a1dc60919d945da8261996d2db34870\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"bbda0be0-9c0c-11e8-817d-fbbbcd5a46c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:45:06.037Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9ad9c33675784d05b59b2333876aeaa5\",\"parentId\":\"9ad9c33675784d05b59b2333876aeaa5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":544,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9ad9c33675784d05b59b2333876aeaa5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"be68f415-9c0c-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:44:54.372Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8c6c90b1cd4d483497834a7224f97d63\",\"parentId\":\"8c6c90b1cd4d483497834a7224f97d63\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":561,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8c6c90b1cd4d483497834a7224f97d63\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a54df400-9c0c-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:44:30.154Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6e66813b95d44486b88366fbce9f9f97\",\"parentId\":\"6e66813b95d44486b88366fbce9f9f97\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":390,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"6e66813b95d44486b88366fbce9f9f97\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9ea45342-9c0c-11e8-865a-3d2ec8e2aa6d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:44:21.811Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"aaa55208afaa494cb46aa1cb0155547a\",\"parentId\":\"aaa55208afaa494cb46aa1cb0155547a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":392,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"aaa55208afaa494cb46aa1cb0155547a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a3430861-9c0c-11e8-a9a2-39905d81bd02\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:44:01.995Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"42711471d3bf4219b185c66933775cb7\",\"parentId\":\"42711471d3bf4219b185c66933775cb7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":789,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"42711471d3bf4219b185c66933775cb7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8b6d592d-9c0c-11e8-bf79-2b169bd74634\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:43:45.045Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d82f2e1425c84672a45218e43e92e521\",\"parentId\":\"d82f2e1425c84672a45218e43e92e521\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":278,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"d82f2e1425c84672a45218e43e92e521\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"90e2e739-9c0c-11e8-9d77-7f7e86b117ef\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:43:42.212Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9eac46a6821d4960ba3dd7a8ecb02941\",\"parentId\":\"9eac46a6821d4960ba3dd7a8ecb02941\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":659,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9eac46a6821d4960ba3dd7a8ecb02941\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"947ef933-9c0c-11e8-bb07-c9a850f113fc\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:43:38.351Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"58613d56bed84ad7b4fb046c21fe884b\",\"parentId\":\"58613d56bed84ad7b4fb046c21fe884b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":589,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"58613d56bed84ad7b4fb046c21fe884b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7fa5c173-9c0c-11e8-b2ac-1d393478e562\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:43:06.946Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"76aba82ace0248cf8dff2523078b566c\",\"parentId\":\"76aba82ace0248cf8dff2523078b566c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":569,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"76aba82ace0248cf8dff2523078b566c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6b7880a9-9c0c-11e8-8de0-6fa5b6e21021\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:42:27.986Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5c08bdc0a04842099741385a18755678\",\"parentId\":\"5c08bdc0a04842099741385a18755678\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":365,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"5c08bdc0a04842099741385a18755678\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"50f39004-9c0c-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:41:43.698Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"077857726e4f425598c7fcc2d5e273d5\",\"parentId\":\"077857726e4f425598c7fcc2d5e273d5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1115,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"077857726e4f425598c7fcc2d5e273d5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"146cb7db-9c0c-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:40:06.032Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4a6edcbc500343668d06c296abc538a0\",\"parentId\":\"4a6edcbc500343668d06c296abc538a0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":590,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"4a6edcbc500343668d06c296abc538a0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ff689f7b-9c0b-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:39:54.362Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"da0a40170b794e3e8e2cc5d5810dd324\",\"parentId\":\"da0a40170b794e3e8e2cc5d5810dd324\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":670,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"da0a40170b794e3e8e2cc5d5810dd324\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f76821a8-9c0b-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:39:30.148Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"0e2dc355d98f4b3bb67a51e950b5e6b4\",\"parentId\":\"0e2dc355d98f4b3bb67a51e950b5e6b4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":253,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"0e2dc355d98f4b3bb67a51e950b5e6b4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e3849395-9c0b-11e8-a195-37370a8955e9\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:38:45.014Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"70598990197049fc97573f35ed8a1274\",\"parentId\":\"70598990197049fc97573f35ed8a1274\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":275,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"70598990197049fc97573f35ed8a1274\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d6616392-9c0b-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:38:42.184Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"500edeb809674df8814cb30c8c52c085\",\"parentId\":\"500edeb809674df8814cb30c8c52c085\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":360,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"500edeb809674df8814cb30c8c52c085\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d520f419-9c0b-11e8-bb07-c9a850f113fc\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:38:38.341Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"de6171f314114419b57c865f16cd1cd9\",\"parentId\":\"de6171f314114419b57c865f16cd1cd9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":846,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"de6171f314114419b57c865f16cd1cd9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b1440be0-9c0b-11e8-a195-0d9181f148f6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:37:27.977Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fa5c8a8ac7804af88bdce1cc14a20b8a\",\"parentId\":\"fa5c8a8ac7804af88bdce1cc14a20b8a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":366,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"fa5c8a8ac7804af88bdce1cc14a20b8a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a9ce6845-9c0b-11e8-865a-3d2ec8e2aa6d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:37:26.231Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"deea74442ef94d9190472dce252b53a1\",\"parentId\":\"deea74442ef94d9190472dce252b53a1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":129,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"deea74442ef94d9190472dce252b53a1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"94c8c8db-9c0b-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:36:43.669Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"db20fb567dfa48eb8f1d74d73cacaa2d\",\"parentId\":\"db20fb567dfa48eb8f1d74d73cacaa2d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1188,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"db20fb567dfa48eb8f1d74d73cacaa2d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"796c1637-9c0b-11e8-ad7f-d18cc94d7e7d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:36:04.015Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"254137f2bf8d437c991e6f9dc2be0eff\",\"parentId\":\"254137f2bf8d437c991e6f9dc2be0eff\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":363,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"254137f2bf8d437c991e6f9dc2be0eff\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5a486f91-9c0b-11e8-b67b-c3b9a633ddd4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:35:06.018Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"30c68258c3484b0d9d374cfa2af2bdcb\",\"parentId\":\"30c68258c3484b0d9d374cfa2af2bdcb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":513,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"30c68258c3484b0d9d374cfa2af2bdcb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"43223a83-9c0b-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:34:20.625Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"72c61a65e8f844589d852abb3f748dbe\",\"parentId\":\"72c61a65e8f844589d852abb3f748dbe\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1004,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"72c61a65e8f844589d852abb3f748dbe\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"42b54770-9c0b-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:34:09.175Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3ba166dd9003469c9fcb52d97431b2c3\",\"parentId\":\"3ba166dd9003469c9fcb52d97431b2c3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":520,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3ba166dd9003469c9fcb52d97431b2c3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"27c31694-9c0b-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:33:44.984Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2501a61aee8d47588833dcf33d0f85c0\",\"parentId\":\"2501a61aee8d47588833dcf33d0f85c0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":302,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"2501a61aee8d47588833dcf33d0f85c0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2a058c44-9c0b-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:33:38.317Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d66954a5135543378ccc85a158493480\",\"parentId\":\"d66954a5135543378ccc85a158493480\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":638,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"d66954a5135543378ccc85a158493480\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f671f711-9c0a-11e8-9bd3-b1c5126a1508\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:32:27.969Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"dd7b27a2b0774e67abed5112d3c482a3\",\"parentId\":\"dd7b27a2b0774e67abed5112d3c482a3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":383,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"dd7b27a2b0774e67abed5112d3c482a3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"007a2ba8-9c0b-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:32:26.223Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"576ddee0b9124b1d823fb75cc4e3ee62\",\"parentId\":\"576ddee0b9124b1d823fb75cc4e3ee62\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":416,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"576ddee0b9124b1d823fb75cc4e3ee62\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"efaabbf3-9c0a-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:31:54.618Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f461270882d240c29190f24def66f371\",\"parentId\":\"f461270882d240c29190f24def66f371\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":531,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"f461270882d240c29190f24def66f371\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dcbb7991-9c0a-11e8-a0d5-5336200ad40f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:31:44.847Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1465b9fb32774cd69309ef71275e8b62\",\"parentId\":\"1465b9fb32774cd69309ef71275e8b62\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":254,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"1465b9fb32774cd69309ef71275e8b62\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d734fcce-9c0a-11e8-817d-fbbbcd5a46c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:31:33.010Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"eb604308d5e740a3afc70a6bd83ce4d0\",\"parentId\":\"eb604308d5e740a3afc70a6bd83ce4d0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":509,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"eb604308d5e740a3afc70a6bd83ce4d0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d17aec38-9c0a-11e8-9bd3-b1c5126a1508\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:31:17.429Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b5b4faf861474f91a5149f76f105fe50\",\"parentId\":\"b5b4faf861474f91a5149f76f105fe50\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":406,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b5b4faf861474f91a5149f76f105fe50\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a492f310-9c0a-11e8-bf39-53a7085b0f9e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:30:01.462Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9c200e330fee4ee384609ab2e2c43440\",\"parentId\":\"9c200e330fee4ee384609ab2e2c43440\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":156,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9c200e330fee4ee384609ab2e2c43440\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9361b42a-9c0a-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:29:39.079Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1bd4468b792141218d70970e5e1741af\",\"parentId\":\"1bd4468b792141218d70970e5e1741af\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":829,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"1bd4468b792141218d70970e5e1741af\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"878fe2c9-9c0a-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:29:20.612Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e29eddfae78440c59be948a893111d47\",\"parentId\":\"e29eddfae78440c59be948a893111d47\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1020,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"e29eddfae78440c59be948a893111d47\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8988305f-9c0a-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:29:16.506Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8b3a393efac64835a3344f9e76953ae4\",\"parentId\":\"8b3a393efac64835a3344f9e76953ae4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":770,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"8b3a393efac64835a3344f9e76953ae4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"549dbdfc-9c0a-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:27:56.417Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3e911b8f08cc4edfa761dd8aea042702\",\"parentId\":\"3e911b8f08cc4edfa761dd8aea042702\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1303,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"3e911b8f08cc4edfa761dd8aea042702\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4537c93c-9c0a-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:27:26.219Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1716545e5b8c46a2af606c4467bd0daf\",\"parentId\":\"1716545e5b8c46a2af606c4467bd0daf\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":428,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"1716545e5b8c46a2af606c4467bd0daf\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"347cf339-9c0a-11e8-bcf7-a7cf70afbe0f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:26:44.823Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c27da2e2935148d8b341ff77d4ffea14\",\"parentId\":\"c27da2e2935148d8b341ff77d4ffea14\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":527,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"c27da2e2935148d8b341ff77d4ffea14\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2976fd14-9c0a-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:26:33.004Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"10aab1ee5b894ff783d5374402373893\",\"parentId\":\"10aab1ee5b894ff783d5374402373893\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":517,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"10aab1ee5b894ff783d5374402373893\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2bb506af-9c0a-11e8-85b8-ade65cb3fdfe\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:26:29.866Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"15a5420691614cf6b35b566c1cae9f45\",\"parentId\":\"15a5420691614cf6b35b566c1cae9f45\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":408,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"15a5420691614cf6b35b566c1cae9f45\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"291be50a-9c0a-11e8-9460-a9fd50409a2e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:26:17.359Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b9cae0ea8e514b26bc5ccf50f0967d36\",\"parentId\":\"b9cae0ea8e514b26bc5ccf50f0967d36\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":368,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"b9cae0ea8e514b26bc5ccf50f0967d36\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fc441880-9c09-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:25:01.446Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"37ab576143944707956b00b60ab33773\",\"parentId\":\"37ab576143944707956b00b60ab33773\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":214,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"37ab576143944707956b00b60ab33773\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e873ec37-9c09-11e8-921f-813686c85e36\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:24:39.071Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8e428de62b0f4c639b8034c244dd1f63\",\"parentId\":\"8e428de62b0f4c639b8034c244dd1f63\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1062,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8e428de62b0f4c639b8034c244dd1f63\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"de23d8f7-9c09-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:24:20.592Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e031f03b21024537971a92764f995d2c\",\"parentId\":\"e031f03b21024537971a92764f995d2c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":900,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"e031f03b21024537971a92764f995d2c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cf50d57d-9c09-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:24:16.493Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"43e3de49b2c4442793b620ae8bfcc79c\",\"parentId\":\"43e3de49b2c4442793b620ae8bfcc79c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":929,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"43e3de49b2c4442793b620ae8bfcc79c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"cf50d568-9c09-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:23:48.961Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"60097ee4db814981b78e302a65f6a00c\",\"parentId\":\"60097ee4db814981b78e302a65f6a00c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":534,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"60097ee4db814981b78e302a65f6a00c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"aa60f65f-9c09-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:22:56.401Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9594fb0b343d406e8146a2af647ba2f5\",\"parentId\":\"9594fb0b343d406e8146a2af647ba2f5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1354,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9594fb0b343d406e8146a2af647ba2f5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9c15724d-9c09-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:22:26.206Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"daa9a570c9614e9eab81ae34240073b7\",\"parentId\":\"daa9a570c9614e9eab81ae34240073b7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":404,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"daa9a570c9614e9eab81ae34240073b7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6f3875e9-9c09-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:21:32.987Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c600ec396a864709b5394fca474acab6\",\"parentId\":\"c600ec396a864709b5394fca474acab6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":491,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"c600ec396a864709b5394fca474acab6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"71218144-9c09-11e8-85b8-ade65cb3fdfe\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:21:29.850Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d0fd491f1ae5401db137ecbbe09642af\",\"parentId\":\"d0fd491f1ae5401db137ecbbe09642af\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":588,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"d0fd491f1ae5401db137ecbbe09642af\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5bae0552-9c09-11e8-8de0-6fa5b6e21021\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:20:50.348Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7713025c7cc441f3864f1ed9ea0b9473\",\"parentId\":\"7713025c7cc441f3864f1ed9ea0b9473\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":452,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"7713025c7cc441f3864f1ed9ea0b9473\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"40e4df4f-9c09-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:20:01.419Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5b65beaed0104cafa3a732f0a4b03e7b\",\"parentId\":\"5b65beaed0104cafa3a732f0a4b03e7b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":199,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"5b65beaed0104cafa3a732f0a4b03e7b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2c24d49c-9c09-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:19:39.049Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8f4a2e2ca60a48da9ba82b94db70b2bd\",\"parentId\":\"8f4a2e2ca60a48da9ba82b94db70b2bd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":915,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8f4a2e2ca60a48da9ba82b94db70b2bd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2440b7f0-9c09-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:19:26.451Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fdcbca2198154332bc148e7efb508025\",\"parentId\":\"fdcbca2198154332bc148e7efb508025\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":832,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"fdcbca2198154332bc148e7efb508025\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1575078e-9c09-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:18:48.948Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"71cfacdb03d341b9a12a5b243db5e9ff\",\"parentId\":\"71cfacdb03d341b9a12a5b243db5e9ff\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":526,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"71cfacdb03d341b9a12a5b243db5e9ff\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"015fbbc6-9c09-11e8-8656-f305697fcf06\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:18:25.303Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7b7aacb82f994c5c9261e3a658269edc\",\"parentId\":\"7b7aacb82f994c5c9261e3a658269edc\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":278,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"7b7aacb82f994c5c9261e3a658269edc\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"eef25374-9c08-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:17:56.386Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"db642271a72b4341b02636aaca5e3109\",\"parentId\":\"db642271a72b4341b02636aaca5e3109\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1420,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"db642271a72b4341b02636aaca5e3109\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c7fc9272-9c08-11e8-85b8-ade65cb3fdfe\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:16:29.809Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6cb6b543318b435cbcee2afe3538115d\",\"parentId\":\"6cb6b543318b435cbcee2afe3538115d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":758,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"6cb6b543318b435cbcee2afe3538115d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b217ddb4-9c08-11e8-9460-a9fd50409a2e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:15:50.321Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5adbef764e754111afeeb1b0718ddf59\",\"parentId\":\"5adbef764e754111afeeb1b0718ddf59\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":443,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"5adbef764e754111afeeb1b0718ddf59\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a214e600-9c08-11e8-86d5-23761112b5a0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:15:49.424Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7c711c5b6e294671b70d1d37a5979ce8\",\"parentId\":\"7c711c5b6e294671b70d1d37a5979ce8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":259,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"7c711c5b6e294671b70d1d37a5979ce8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"951e1c60-9c08-11e8-bf57-75bc844edc27\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:15:28.763Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"47408a654c9e4c3fada955ca5e7b376e\",\"parentId\":\"47408a654c9e4c3fada955ca5e7b376e\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":382,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"47408a654c9e4c3fada955ca5e7b376e\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"85857f14-9c08-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:15:01.407Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cac13480d6574dacb5ea5054e1dfb02c\",\"parentId\":\"cac13480d6574dacb5ea5054e1dfb02c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":186,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"cac13480d6574dacb5ea5054e1dfb02c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7c0d0765-9c08-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:14:38.253Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"75b5d02fd5d34d34b2c578f9e5f6abec\",\"parentId\":\"75b5d02fd5d34d34b2c578f9e5f6abec\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":551,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"75b5d02fd5d34d34b2c578f9e5f6abec\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7c071361-9c08-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:14:26.439Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fd5c70072c394c8ca89e694a4eb10b05\",\"parentId\":\"fd5c70072c394c8ca89e694a4eb10b05\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1316,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"fd5c70072c394c8ca89e694a4eb10b05\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5a58f1d9-9c08-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:13:48.938Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"06c8dceb017f4378950ab04997419a4a\",\"parentId\":\"06c8dceb017f4378950ab04997419a4a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":624,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"06c8dceb017f4378950ab04997419a4a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"47b4c22b-9c08-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:12:56.346Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d2c754ccc94d48488020a50be83c8896\",\"parentId\":\"d2c754ccc94d48488020a50be83c8896\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1184,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"d2c754ccc94d48488020a50be83c8896\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"332871bc-9c08-11e8-bd30-c3165bb98b46\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:12:34.717Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d6f8b30ec98b47efb5375216a1a51db4\",\"parentId\":\"d6f8b30ec98b47efb5375216a1a51db4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":369,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"d6f8b30ec98b47efb5375216a1a51db4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"241111df-9c08-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:12:12.698Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"909ff3e490b9480a9f143d90c1b39f75\",\"parentId\":\"909ff3e490b9480a9f143d90c1b39f75\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":972,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"909ff3e490b9480a9f143d90c1b39f75\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f78e1caa-9c07-11e8-9bd3-b1c5126a1508\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:10:50.289Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7039a1ed56ba460e849dd28cfd3b4278\",\"parentId\":\"7039a1ed56ba460e849dd28cfd3b4278\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":368,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"7039a1ed56ba460e849dd28cfd3b4278\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f8b118e8-9c07-11e8-8656-f305697fcf06\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:10:49.394Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3662356cc0e74217bf05999865f9f41f\",\"parentId\":\"3662356cc0e74217bf05999865f9f41f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":283,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"3662356cc0e74217bf05999865f9f41f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d85da52d-9c07-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:10:05.637Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c65eb902ef7a4d00ac585a0dda1761ed\",\"parentId\":\"c65eb902ef7a4d00ac585a0dda1761ed\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":376,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"c65eb902ef7a4d00ac585a0dda1761ed\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"dcadc5c2-9c07-11e8-bf39-53a7085b0f9e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:10:01.389Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"12f368b262cf4632bc64726601d1a948\",\"parentId\":\"12f368b262cf4632bc64726601d1a948\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":195,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"12f368b262cf4632bc64726601d1a948\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d4e37265-9c07-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:09:38.255Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"642023a86528478ab5487a037895a6bd\",\"parentId\":\"642023a86528478ab5487a037895a6bd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":501,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"642023a86528478ab5487a037895a6bd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c0b128d3-9c07-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:09:26.421Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"7e893872d05843ca8d6da5a9bae4aaed\",\"parentId\":\"7e893872d05843ca8d6da5a9bae4aaed\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1229,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"7e893872d05843ca8d6da5a9bae4aaed\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b227b16e-9c07-11e8-9afb-d994ee7854aa\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:08:48.928Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"651c298e16884d7b94feb86ef5844d92\",\"parentId\":\"651c298e16884d7b94feb86ef5844d92\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":626,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"651c298e16884d7b94feb86ef5844d92\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a1c9ef3d-9c07-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:08:38.879Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"811eac1d08e74f25a439d3aed238fc94\",\"parentId\":\"811eac1d08e74f25a439d3aed238fc94\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1264,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"811eac1d08e74f25a439d3aed238fc94\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"99a8f0d3-9c07-11e8-a195-0d9181f148f6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:08:27.099Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ba2b9b0bb47a44129ebe243739ef0911\",\"parentId\":\"ba2b9b0bb47a44129ebe243739ef0911\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":412,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"ba2b9b0bb47a44129ebe243739ef0911\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8c62cf3b-9c07-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:07:56.335Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"6ebb1d4a8eb346689611e0d0f529a271\",\"parentId\":\"6ebb1d4a8eb346689611e0d0f529a271\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1513,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"6ebb1d4a8eb346689611e0d0f529a271\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8abee337-9c07-11e8-af2a-03563b914287\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:07:34.699Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5229fb9a51d4414aa4f6f1997f0d9474\",\"parentId\":\"5229fb9a51d4414aa4f6f1997f0d9474\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":604,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"5229fb9a51d4414aa4f6f1997f0d9474\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"406587e3-9c07-11e8-af2a-03563b914287\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:05:27.971Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9aabec3eace54544991092b0f7241079\",\"parentId\":\"9aabec3eace54544991092b0f7241079\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":410,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9aabec3eace54544991092b0f7241079\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2dd99b23-9c07-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:05:05.621Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5f1bdf9d2a0a43c8bfd2f75fc8c06457\",\"parentId\":\"5f1bdf9d2a0a43c8bfd2f75fc8c06457\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":448,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"5f1bdf9d2a0a43c8bfd2f75fc8c06457\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2c3365c2-9c07-11e8-accb-07f60549bb58\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:05:01.361Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ecbb6d9268524105a59de05c19e76ed4\",\"parentId\":\"ecbb6d9268524105a59de05c19e76ed4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":155,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"ecbb6d9268524105a59de05c19e76ed4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"27801655-9c07-11e8-8656-f305697fcf06\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:04:49.364Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"95fbf79df5714d5b81f6a01f769e18a7\",\"parentId\":\"95fbf79df5714d5b81f6a01f769e18a7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":283,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"95fbf79df5714d5b81f6a01f769e18a7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"18f7b07e-9c07-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:04:38.236Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05f2973084fe460ba7e802cc5af8173b\",\"parentId\":\"05f2973084fe460ba7e802cc5af8173b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":555,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"05f2973084fe460ba7e802cc5af8173b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1a60b660-9c07-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:04:29.911Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"75598ef5fc5f4441b1482c761a0a69a3\",\"parentId\":\"75598ef5fc5f4441b1482c761a0a69a3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":794,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"75598ef5fc5f4441b1482c761a0a69a3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"186fe313-9c07-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:04:26.400Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2dbfdb50bfc445019add667ab1ddaeba\",\"parentId\":\"2dbfdb50bfc445019add667ab1ddaeba\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1565,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"2dbfdb50bfc445019add667ab1ddaeba\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f6e6122d-9c06-11e8-abb2-05db691697f7\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:03:38.839Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ee67d7ef48794fd4b33961f59af8f5bd\",\"parentId\":\"ee67d7ef48794fd4b33961f59af8f5bd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1265,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"ee67d7ef48794fd4b33961f59af8f5bd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f29aad08-9c06-11e8-a195-0d9181f148f6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:03:27.078Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"fa8caa64077a4090bda51f9b139a6d68\",\"parentId\":\"fa8caa64077a4090bda51f9b139a6d68\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":375,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"fa8caa64077a4090bda51f9b139a6d68\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f3f38649-9c06-11e8-bf39-53a7085b0f9e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:03:22.190Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ca813b21c839476e8961d246b811841f\",\"parentId\":\"ca813b21c839476e8961d246b811841f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":280,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"ca813b21c839476e8961d246b811841f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"84a19977-9c06-11e8-af2a-03563b914287\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:00:27.968Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f7ea9703aa3b4975bab7868559548b23\",\"parentId\":\"f7ea9703aa3b4975bab7868559548b23\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":407,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f7ea9703aa3b4975bab7868559548b23\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7279776f-9c06-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T19:00:05.587Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"de64b2e9fba9405faaca04cc4ea34577\",\"parentId\":\"de64b2e9fba9405faaca04cc4ea34577\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":391,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"de64b2e9fba9405faaca04cc4ea34577\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5f2bc17b-9c06-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:59:38.225Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"a2297dd692274918a79c5e37f998b100\",\"parentId\":\"a2297dd692274918a79c5e37f998b100\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":487,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"a2297dd692274918a79c5e37f998b100\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5dd58056-9c06-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:59:30.339Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8c763828f26248cea4a22d01d7122880\",\"parentId\":\"8c763828f26248cea4a22d01d7122880\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1301,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"8c763828f26248cea4a22d01d7122880\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5fc01202-9c06-11e8-86c6-8978d4443282\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:59:29.882Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"d87040a0b5cc4962b011c396f7ff6640\",\"parentId\":\"d87040a0b5cc4962b011c396f7ff6640\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":615,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"d87040a0b5cc4962b011c396f7ff6640\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5db4d932-9c06-11e8-8e8a-fd378332c84e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:59:26.390Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2f9128ef90874ff58cd6667d0cf02a47\",\"parentId\":\"2f9128ef90874ff58cd6667d0cf02a47\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1277,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"2f9128ef90874ff58cd6667d0cf02a47\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4b3ee516-9c06-11e8-900e-1706d9247e64\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:58:38.835Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f0912cbf09234334a7e1b5cbfde31a14\",\"parentId\":\"f0912cbf09234334a7e1b5cbfde31a14\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1147,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"f0912cbf09234334a7e1b5cbfde31a14\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4373f613-9c06-11e8-8d1f-59dfbfdf59a4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:58:37.987Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5fc55bccb38041e982415289fde32fd3\",\"parentId\":\"5fc55bccb38041e982415289fde32fd3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":299,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5fc55bccb38041e982415289fde32fd3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"38eec942-9c06-11e8-8de0-6fa5b6e21021\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:58:27.076Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"29b8f56c63e54f1bb5f479c7e4892af8\",\"parentId\":\"29b8f56c63e54f1bb5f479c7e4892af8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":415,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"29b8f56c63e54f1bb5f479c7e4892af8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3906488a-9c06-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:58:22.169Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"baf728ebdae5456e917cf6b5b96df99c\",\"parentId\":\"baf728ebdae5456e917cf6b5b96df99c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":171,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"baf728ebdae5456e917cf6b5b96df99c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"db4dd244-9c05-11e8-9fcd-89b8eea1fc08\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:55:27.954Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f16592946eeb4bfeae4ea6b3f4f95345\",\"parentId\":\"f16592946eeb4bfeae4ea6b3f4f95345\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":401,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"f16592946eeb4bfeae4ea6b3f4f95345\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ca248283-9c05-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:55:05.595Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"508e1cde660c4c2bafaadda7673752b0\",\"parentId\":\"508e1cde660c4c2bafaadda7673752b0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":407,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"508e1cde660c4c2bafaadda7673752b0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b53aa8c9-9c05-11e8-a7cd-5fdb5f33325d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:54:38.208Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"68f5fe42a22f4cbb9cc9c73a577e7567\",\"parentId\":\"68f5fe42a22f4cbb9cc9c73a577e7567\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":607,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"68f5fe42a22f4cbb9cc9c73a577e7567\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b52d1409-9c05-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:54:30.338Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"4304037dd2cd4b32843dd65c76458e48\",\"parentId\":\"4304037dd2cd4b32843dd65c76458e48\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1374,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"4304037dd2cd4b32843dd65c76458e48\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b80dc5f9-9c05-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:54:29.843Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5ae9856cf58540a38e0f370c95eb9f0b\",\"parentId\":\"5ae9856cf58540a38e0f370c95eb9f0b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":546,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"5ae9856cf58540a38e0f370c95eb9f0b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b1cbe7a6-9c05-11e8-8096-87a8da948233\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:54:26.369Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8312d7cd30174fd5a833554cbdcf5ed0\",\"parentId\":\"8312d7cd30174fd5a833554cbdcf5ed0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1372,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"8312d7cd30174fd5a833554cbdcf5ed0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"900c3a2a-9c05-11e8-82dd-9b9ea1b23bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:53:38.802Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5d82999732884a1ba1b8b4c506dd138d\",\"parentId\":\"5d82999732884a1ba1b8b4c506dd138d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1052,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"5d82999732884a1ba1b8b4c506dd138d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9a1dbdbb-9c05-11e8-8656-f305697fcf06\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:53:37.956Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"093c43f0bce049d4bc0094f972f2cf9d\",\"parentId\":\"093c43f0bce049d4bc0094f972f2cf9d\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":324,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"093c43f0bce049d4bc0094f972f2cf9d\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"91542322-9c05-11e8-a195-0d9181f148f6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:53:27.055Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"681455503f5a4601888609bf0e853f8c\",\"parentId\":\"681455503f5a4601888609bf0e853f8c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":373,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"681455503f5a4601888609bf0e853f8c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8f222837-9c05-11e8-accb-07f60549bb58\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:53:22.149Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05dd6b32206c4b6f829371026bd0a2fb\",\"parentId\":\"05dd6b32206c4b6f829371026bd0a2fb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":179,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"05dd6b32206c4b6f829371026bd0a2fb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1e4ad40b-9c05-11e8-af2a-03563b914287\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:50:27.947Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"40093da0df7b4870b91ba59ee85460c7\",\"parentId\":\"40093da0df7b4870b91ba59ee85460c7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":935,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"40093da0df7b4870b91ba59ee85460c7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"0d54a22f-9c05-11e8-865a-3d2ec8e2aa6d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:50:05.570Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bc7a3d779f65400badbf02bc26be0010\",\"parentId\":\"bc7a3d779f65400badbf02bc26be0010\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":423,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"bc7a3d779f65400badbf02bc26be0010\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"01f73d9c-9c05-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:49:38.189Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"2888d8b5fabf45a7ab4df12695631380\",\"parentId\":\"2888d8b5fabf45a7ab4df12695631380\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":593,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"2888d8b5fabf45a7ab4df12695631380\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f8a1b6d5-9c04-11e8-bf43-19a2819df99d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:49:30.246Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"e87675b86bd542b680cd291681795ce3\",\"parentId\":\"e87675b86bd542b680cd291681795ce3\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1129,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"e87675b86bd542b680cd291681795ce3\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"fdebeea2-9c04-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:49:29.824Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"accca17e60b640a3969b5e5a5a7dc4f2\",\"parentId\":\"accca17e60b640a3969b5e5a5a7dc4f2\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":899,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"accca17e60b640a3969b5e5a5a7dc4f2\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"f5c0ddeb-9c04-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:49:26.357Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"5d0803d704da4e3e9263f31bfbbbc74c\",\"parentId\":\"5d0803d704da4e3e9263f31bfbbbc74c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1432,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"5d0803d704da4e3e9263f31bfbbbc74c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e6397e91-9c04-11e8-a114-590757cc185d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:48:38.785Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f6a2f2f22b0141389fe1a479e20a94a0\",\"parentId\":\"f6a2f2f22b0141389fe1a479e20a94a0\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1317,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"f6a2f2f22b0141389fe1a479e20a94a0\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d70596d8-9c04-11e8-a195-0d9181f148f6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:48:27.036Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"f189e9d10fcb41b0a413e9a2373b921f\",\"parentId\":\"f189e9d10fcb41b0a413e9a2373b921f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":371,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"f189e9d10fcb41b0a413e9a2373b921f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"d40aa690-9c04-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:48:22.138Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"64aae6742a364c76a7cd1b38b15fad0f\",\"parentId\":\"64aae6742a364c76a7cd1b38b15fad0f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":163,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"64aae6742a364c76a7cd1b38b15fad0f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"c0ef994b-9c04-11e8-8330-d1d668da7243\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:48:02.733Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"590e0b825af04ee3b0c86e8117210b94\",\"parentId\":\"590e0b825af04ee3b0c86e8117210b94\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":224,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"590e0b825af04ee3b0c86e8117210b94\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"73706cdb-9c04-11e8-9fcd-89b8eea1fc08\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:45:27.924Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"36900c5033ae4bb083419593a2a3ddf7\",\"parentId\":\"36900c5033ae4bb083419593a2a3ddf7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":510,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"36900c5033ae4bb083419593a2a3ddf7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"6528e023-9c04-11e8-865a-3d2ec8e2aa6d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:45:05.490Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bdb40b6dce904180bc71ce117677c38b\",\"parentId\":\"bdb40b6dce904180bc71ce117677c38b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":394,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"bdb40b6dce904180bc71ce117677c38b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"569b7150-9c04-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:44:50.328Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"c9a25ed00a2e478182dd3b8052b4f8ae\",\"parentId\":\"c9a25ed00a2e478182dd3b8052b4f8ae\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1706,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"c9a25ed00a2e478182dd3b8052b4f8ae\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"5d1c067b-9c04-11e8-86d5-23761112b5a0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:44:48.678Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"75aa465c3e054dd8881193603e77aac9\",\"parentId\":\"75aa465c3e054dd8881193603e77aac9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":231,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"75aa465c3e054dd8881193603e77aac9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4856cb40-9c04-11e8-b54a-470f600a1bf3\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:44:38.157Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"05139bf763674c6cbb0dbfe4fb73de07\",\"parentId\":\"05139bf763674c6cbb0dbfe4fb73de07\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":549,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"05139bf763674c6cbb0dbfe4fb73de07\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"46c974a0-9c04-11e8-a88e-c548ea64983b\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:44:30.234Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cbadde7651ec4c91a46931c2db4bf7c1\",\"parentId\":\"cbadde7651ec4c91a46931c2db4bf7c1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1340,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"cbadde7651ec4c91a46931c2db4bf7c1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"4cbc4830-9c04-11e8-91b4-27f3ccfc7151\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:44:26.334Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"790278faf07f4594a856bb9f7f1afb26\",\"parentId\":\"790278faf07f4594a856bb9f7f1afb26\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1279,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"790278faf07f4594a856bb9f7f1afb26\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3b48d030-9c04-11e8-8306-7f8eb99ec056\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:43:38.748Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"df627177049b478a839ee9dcd066a357\",\"parentId\":\"df627177049b478a839ee9dcd066a357\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1069,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"df627177049b478a839ee9dcd066a357\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1b89d477-9c04-11e8-9bd3-b1c5126a1508\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:43:27.019Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"49f96fc9428744348e6805333ab6e5c6\",\"parentId\":\"49f96fc9428744348e6805333ab6e5c6\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":361,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"49f96fc9428744348e6805333ab6e5c6\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"2aae534e-9c04-11e8-a4fd-05f1f2482ba1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:43:22.133Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"264ae86b70184b4488a7f1a8474085b1\",\"parentId\":\"264ae86b70184b4488a7f1a8474085b1\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":390,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"264ae86b70184b4488a7f1a8474085b1\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"a9da21ab-9c03-11e8-a846-bfed24e2ba8f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:40:05.478Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"bf7c835c613d4c7aba7e339ff1d0a3da\",\"parentId\":\"bf7c835c613d4c7aba7e339ff1d0a3da\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":386,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"bf7c835c613d4c7aba7e339ff1d0a3da\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9d5ea2ad-9c03-11e8-8330-d1d668da7243\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:39:48.652Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"06f7ef08274b419c9bb64910083753da\",\"parentId\":\"06f7ef08274b419c9bb64910083753da\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":274,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"06f7ef08274b419c9bb64910083753da\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"94d10014-9c03-11e8-b915-a9a5dcdb3ede\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:39:30.231Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"true\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9a915b2936834f32b76f55cf69efde50\",\"parentId\":\"9a915b2936834f32b76f55cf69efde50\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1311,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"9a915b2936834f32b76f55cf69efde50\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8a3b57f2-9c03-11e8-8306-7f8eb99ec056\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:39:17.579Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8009c39ac46c4c5fb372cc67de3881e5\",\"parentId\":\"8009c39ac46c4c5fb372cc67de3881e5\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":777,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8009c39ac46c4c5fb372cc67de3881e5\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"8b729f6e-9c03-11e8-b67b-c3b9a633ddd4\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:39:14.597Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"9132b63751474125bad0e764ab995a8b\",\"parentId\":\"9132b63751474125bad0e764ab995a8b\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":506,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"9132b63751474125bad0e764ab995a8b\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7d67f577-9c03-11e8-bba1-f5063e075283\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:38:55.823Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"123bad2263524aa181bf9779541b6ef9\",\"parentId\":\"123bad2263524aa181bf9779541b6ef9\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1178,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"123bad2263524aa181bf9779541b6ef9\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"79624b76-9c03-11e8-85b8-ade65cb3fdfe\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:38:45.648Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"ef7acbb84ab844c0b078867bbe4c077a\",\"parentId\":\"ef7acbb84ab844c0b078867bbe4c077a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":415,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"ef7acbb84ab844c0b078867bbe4c077a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"73a3ce15-9c03-11e8-9460-a9fd50409a2e\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:38:27.002Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"3f02a569ff1043e286067795fa047481\",\"parentId\":\"3f02a569ff1043e286067795fa047481\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":400,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"3f02a569ff1043e286067795fa047481\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"67c579df-9c03-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:38:22.126Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"75e58aa3483746d5acee1ee02841d26a\",\"parentId\":\"75e58aa3483746d5acee1ee02841d26a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":154,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"75e58aa3483746d5acee1ee02841d26a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"67c579d6-9c03-11e8-998a-975e67e62013\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:38:06.380Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"561fbb32265c42cb9df101a357f119a8\",\"parentId\":\"561fbb32265c42cb9df101a357f119a8\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":198,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"561fbb32265c42cb9df101a357f119a8\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"3ef02323-9c03-11e8-8306-7f8eb99ec056\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:37:16.507Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"8eaea90af30b4782873e9a8405920b62\",\"parentId\":\"8eaea90af30b4782873e9a8405920b62\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1006,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"8eaea90af30b4782873e9a8405920b62\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"34a87475-9c03-11e8-921c-75e8818ccd6f\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:36:41.022Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"44e2f9b58a6a4a5a89f1425642a858d4\",\"parentId\":\"44e2f9b58a6a4a5a89f1425642a858d4\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":480,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"44e2f9b58a6a4a5a89f1425642a858d4\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1b64dd34-9c03-11e8-af2a-03563b914287\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:36:04.341Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"110a33b1fd514b6fb1cc2d58b19d79dd\",\"parentId\":\"110a33b1fd514b6fb1cc2d58b19d79dd\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":378,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"110a33b1fd514b6fb1cc2d58b19d79dd\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}},{\"id\":\"1418bb03-9c03-11e8-871e-77990189403a\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:36:00.421Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"60621b6bdd234fda9d741fccab7f4425\",\"parentId\":\"60621b6bdd234fda9d741fccab7f4425\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1144,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"60621b6bdd234fda9d741fccab7f4425\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"10648cb7-9c03-11e8-ac66-0b589ff193b6\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:35:49.955Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"1ec67b2c9cb645d0a884285e7cddd341\",\"parentId\":\"1ec67b2c9cb645d0a884285e7cddd341\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1078,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"1ec67b2c9cb645d0a884285e7cddd341\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"02189301-9c03-11e8-a514-29ed875fce99\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:35:05.468Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"414631c38b784a7d9763846459c15d7f\",\"parentId\":\"414631c38b784a7d9763846459c15d7f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":390,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"414631c38b784a7d9763846459c15d7f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"e13e1536-9c02-11e8-86d5-23761112b5a0\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:34:20.410Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"52d07f307eb1478ca9229cba012e5b9c\",\"parentId\":\"52d07f307eb1478ca9229cba012e5b9c\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":245,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"52d07f307eb1478ca9229cba012e5b9c\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"ce0e6e6b-9c02-11e8-878e-7597a14cc9ea\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:33:55.812Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-ca-sjc-azr\",\"WebtestLocationId\":\"us-ca-sjc-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"cea9a95f707a4ebfa4b204895a95408f\",\"parentId\":\"cea9a95f707a4ebfa4b204895a95408f\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":595,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"West US\",\"id\":\"cea9a95f707a4ebfa4b204895a95408f\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Jose\",\"stateOrProvince\":\"California\",\"countryOrRegion\":\"United States\"}},{\"id\":\"b97d3bd1-9c02-11e8-9bd3-b1c5126a1508\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:33:26.984Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-fl-mia-edge\",\"WebtestLocationId\":\"us-fl-mia-edge\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"732abffa87444cc7a72c359c43c57352\",\"parentId\":\"732abffa87444cc7a72c359c43c57352\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":372,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"Central US\",\"id\":\"732abffa87444cc7a72c359c43c57352\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Des Moines\",\"stateOrProvince\":\"Iowa\",\"countryOrRegion\":\"United States\"}},{\"id\":\"accddb91-9c02-11e8-accb-07f60549bb58\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:33:06.327Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-tx-sn1-azr\",\"WebtestLocationId\":\"us-tx-sn1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b0be46fd5a044f1bb667c402146fde7a\",\"parentId\":\"b0be46fd5a044f1bb667c402146fde7a\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":174,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"South Central US\",\"id\":\"b0be46fd5a044f1bb667c402146fde7a\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"San Antonio\",\"stateOrProvince\":\"Texas\",\"countryOrRegion\":\"United States\"}},{\"id\":\"9516d7d6-9c02-11e8-a114-590757cc185d\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:32:16.510Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"microsoft-ace-test\",\"SyntheticMonitorId\":\"default_microsoft-ace-test_us-il-ch1-azr\",\"WebtestLocationId\":\"us-il-ch1-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"43ae45f4473447af85b0a0d7692160e7\",\"parentId\":\"43ae45f4473447af85b0a0d7692160e7\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"microsoft\",\"success\":\"1\",\"duration\":1071,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"North Central US\",\"id\":\"43ae45f4473447af85b0a0d7692160e7\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Chicago\",\"stateOrProvince\":\"Illinois\",\"countryOrRegion\":\"United States\"}},{\"id\":\"7b74cdb2-9c02-11e8-b233-7db7ba4000c1\",\"count\":1,\"type\":\"availabilityResult\",\"timestamp\":\"2018-08-09T18:31:41.001Z\",\"customDimensions\":{\"FullTestResultAvailable\":\"false\",\"WebtestArmResourceName\":\"google-ace-test\",\"SyntheticMonitorId\":\"default_google-ace-test_us-va-ash-azr\",\"WebtestLocationId\":\"us-va-ash-azr\"},\"customMeasurements\":null,\"operation\":{\"name\":\"\",\"id\":\"b3044e9ac67c4229aa89f47729604eeb\",\"parentId\":\"b3044e9ac67c4229aa89f47729604eeb\",\"syntheticSource\":\"\"},\"session\":{\"id\":\"\"},\"user\":{\"id\":\"\",\"accountId\":\"\",\"authenticatedId\":\"\"},\"cloud\":{\"roleName\":\"\",\"roleInstance\":\"\"},\"ai\":{\"iKey\":\"1145833f-6099-4855-9cb1-557cea26389e\",\"appName\":\"ace-test\",\"appId\":\"578f0e27-12e9-4631-bc02-50b965da2633\",\"sdkVersion\":\"\"},\"availabilityResult\":{\"name\":\"google\",\"success\":\"1\",\"duration\":542,\"performanceBucket\":\"\",\"message\":\"Passed\",\"location\":\"East US\",\"id\":\"b3044e9ac67c4229aa89f47729604eeb\",\"size\":null},\"application\":{\"version\":\"\"},\"client\":{\"model\":\"\",\"os\":\"\",\"type\":\"PC\",\"browser\":\"\",\"ip\":\"0.0.0.0\",\"city\":\"Boydton\",\"stateOrProvince\":\"Virginia\",\"countryOrRegion\":\"United States\"}}]}", + "odata-version" : "4.0;" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canGetMetric.json b/applicationinsights/data-plane/target/test-classes/session-records/canGetMetric.json new file mode 100644 index 0000000000000..0e79acd5da61d --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canGetMetric.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/metrics/availabilityResults%2FavailabilityPercentage", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:06 GMT", + "content-length" : "136", + "server" : "nginx", + "vary" : "Accept, Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.2e3fb352-9c0b-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8", + "Body" : "{\"value\":{\"start\":\"2018-08-09T10:40:06.455Z\",\"end\":\"2018-08-09T22:40:06.455Z\",\"availabilityResults/availabilityPercentage\":{\"avg\":100}}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canGetMetricsMetadata.json b/applicationinsights/data-plane/target/test-classes/session-records/canGetMetricsMetadata.json new file mode 100644 index 0000000000000..db180db087994 --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canGetMetricsMetadata.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/metrics/metadata", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:07 GMT", + "server" : "nginx", + "content-length" : "25243", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.86153470-9c0b-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8", + "Body" : "{\"metrics\":{\"requests/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Server requests\",\"supportedGroupBy\":{\"all\":[\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"requests/duration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Server response time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"requests/failed\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Failed requests\",\"supportedGroupBy\":{\"all\":[\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"pageViews/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Page views\",\"supportedGroupBy\":{\"all\":[\"pageView/name\",\"pageView/urlPath\",\"pageView/urlHost\",\"pageView/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"pageViews/duration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Page view load time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"pageView/name\",\"pageView/urlPath\",\"pageView/urlHost\",\"pageView/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"browserTimings/networkDuration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Page load network connect time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"browserTimings/sendDuration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Send request time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"browserTimings/receiveDuration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Receiving response time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"browserTimings/processingDuration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Client processing time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"browserTimings/totalDuration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Browser page load time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"users/count\":{\"supportedAggregations\":[\"unique\"],\"displayName\":\"Users\",\"supportedGroupBy\":{\"all\":[\"trace/severityLevel\",\"type\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"user/authenticated\",\"pageView/name\",\"pageView/urlPath\",\"pageView/urlHost\",\"pageView/performanceBucket\",\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"customEvent/name\",\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\",\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\"]},\"defaultAggregation\":\"unique\"},\"users/authenticated\":{\"supportedAggregations\":[\"unique\"],\"displayName\":\"Users, authenticated\",\"supportedGroupBy\":{\"all\":[\"trace/severityLevel\",\"type\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"user/authenticated\",\"pageView/name\",\"pageView/urlPath\",\"pageView/urlHost\",\"pageView/performanceBucket\",\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"customEvent/name\",\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\",\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\"]},\"defaultAggregation\":\"unique\"},\"sessions/count\":{\"supportedAggregations\":[\"unique\"],\"displayName\":\"Sessions\",\"supportedGroupBy\":{\"all\":[\"trace/severityLevel\",\"type\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"request/source\",\"request/name\",\"request/urlHost\",\"request/urlPath\",\"request/success\",\"request/resultCode\",\"request/performanceBucket\",\"user/authenticated\",\"pageView/name\",\"pageView/urlPath\",\"pageView/urlHost\",\"pageView/performanceBucket\",\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"customEvent/name\",\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\",\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"browserTiming/name\",\"browserTiming/urlHost\",\"browserTiming/urlPath\",\"browserTiming/performanceBucket\"]},\"defaultAggregation\":\"unique\"},\"customEvents/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Events\",\"supportedGroupBy\":{\"all\":[\"customEvent/name\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"dependencies/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Dependency calls\",\"supportedGroupBy\":{\"all\":[\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"dependencies/failed\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Dependency failures\",\"supportedGroupBy\":{\"all\":[\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"dependencies/duration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Dependency duration\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"dependency/target\",\"dependency/type\",\"dependency/name\",\"dependency/success\",\"dependency/resultCode\",\"dependency/performanceBucket\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"exceptions/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Exceptions\",\"supportedGroupBy\":{\"all\":[\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"exceptions/browser\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Browser exceptions\",\"supportedGroupBy\":{\"all\":[\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"exceptions/server\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Server exceptions\",\"supportedGroupBy\":{\"all\":[\"exception/problemId\",\"exception/handledAt\",\"exception/type\",\"exception/assembly\",\"exception/method\",\"exception/severityLevel\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"},\"availabilityResults/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Availability test results count\",\"supportedGroupBy\":{\"all\":[\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\"]},\"defaultAggregation\":\"sum\"},\"availabilityResults/duration\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"Test duration\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\"]},\"defaultAggregation\":\"avg\"},\"availabilityResults/availabilityPercentage\":{\"supportedAggregations\":[\"avg\",\"count\"],\"displayName\":\"Availability\",\"units\":\"percent\",\"supportedGroupBy\":{\"all\":[\"availabilityResult/name\",\"availabilityResult/location\",\"availabilityResult/success\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\",\"customDimensions/FullTestResultAvailable\",\"customDimensions/WebtestArmResourceName\",\"customDimensions/SyntheticMonitorId\",\"customDimensions/WebtestLocationId\"]},\"defaultAggregation\":\"avg\"},\"billingMeters/telemetryCount\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Data point count\",\"supportedGroupBy\":{\"all\":[\"billing/telemetryItemSource\",\"billing/telemetryItemType\"]},\"defaultAggregation\":\"sum\"},\"billingMeters/telemetrySize\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Data point volume\",\"units\":\"bytes\",\"supportedGroupBy\":{\"all\":[\"billing/telemetryItemSource\",\"billing/telemetryItemType\"]},\"defaultAggregation\":\"sum\"},\"performanceCounters/requestExecutionTime\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"sum\",\"count\"],\"displayName\":\"ASP.NET request execution time\",\"units\":\"ms\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/requestsPerSecond\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"ASP.NET request rate\",\"units\":\"perSec\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/requestsInQueue\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"ASP.NET requests in application queue\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/memoryAvailableBytes\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Available memory\",\"units\":\"bytes\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/exceptionsPerSecond\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Exception rate\",\"units\":\"perSec\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/processCpuPercentage\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Process CPU\",\"units\":\"percent\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/processCpuPercentageTotal\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Process CPU (all cores)\",\"units\":\"percent\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/processIOBytesPerSecond\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Process IO rate\",\"units\":\"bytesPerSec\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/processPrivateBytes\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Process private bytes\",\"units\":\"bytes\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"performanceCounters/processorCpuPercentage\":{\"supportedAggregations\":[\"avg\",\"min\",\"max\",\"count\"],\"displayName\":\"Processor time\",\"units\":\"percent\",\"supportedGroupBy\":{\"all\":[\"performanceCounter/name\",\"performanceCounter/category\",\"performanceCounter/counter\",\"performanceCounter/instance\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"user/authenticated\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"avg\"},\"traces/count\":{\"supportedAggregations\":[\"sum\"],\"displayName\":\"Traces\",\"supportedGroupBy\":{\"all\":[\"trace/severityLevel\",\"operation/name\",\"operation/synthetic\",\"operation/syntheticSource\",\"application/version\",\"client/type\",\"client/model\",\"client/os\",\"client/city\",\"client/stateOrProvince\",\"client/countryOrRegion\",\"client/browser\",\"cloud/roleName\",\"cloud/roleInstance\"]},\"defaultAggregation\":\"sum\"}},\"dimensions\":{\"request/source\":{\"displayName\":\"Request source\"},\"request/name\":{\"displayName\":\"Request name\"},\"request/urlHost\":{\"displayName\":\"Request URL host\"},\"request/urlPath\":{\"displayName\":\"Request URL path\"},\"request/success\":{\"displayName\":\"Successful request\"},\"request/resultCode\":{\"displayName\":\"Response code\"},\"request/performanceBucket\":{\"displayName\":\"Performance\"},\"operation/name\":{\"displayName\":\"Operation name\"},\"operation/synthetic\":{\"displayName\":\"Real or synthetic traffic\"},\"operation/syntheticSource\":{\"displayName\":\"Source of synthetic traffic\"},\"user/authenticated\":{\"displayName\":\"Authenticated user\"},\"application/version\":{\"displayName\":\"Application version\"},\"client/type\":{\"displayName\":\"Device type\"},\"client/model\":{\"displayName\":\"Device model\"},\"client/os\":{\"displayName\":\"Operating system\"},\"client/city\":{\"displayName\":\"City\"},\"client/stateOrProvince\":{\"displayName\":\"State or province\"},\"client/countryOrRegion\":{\"displayName\":\"Country or region\"},\"client/browser\":{\"displayName\":\"Browser version\"},\"cloud/roleName\":{\"displayName\":\"Cloud role name\"},\"cloud/roleInstance\":{\"displayName\":\"Cloud role instance\"},\"pageView/name\":{\"displayName\":\"View page name\"},\"pageView/urlPath\":{\"displayName\":\"Page view URL path\"},\"pageView/urlHost\":{\"displayName\":\"Page view URL host\"},\"pageView/performanceBucket\":{\"displayName\":\"Performance\"},\"browserTiming/name\":{\"displayName\":\"Name\"},\"browserTiming/urlHost\":{\"displayName\":\"Url host\"},\"browserTiming/urlPath\":{\"displayName\":\"Url path\"},\"browserTiming/performanceBucket\":{\"displayName\":\"Performance Bucket\"},\"trace/severityLevel\":{\"displayName\":\"Severity level\"},\"type\":{\"displayName\":\"Telemetry type\"},\"dependency/target\":{\"displayName\":\"Base name\"},\"dependency/type\":{\"displayName\":\"Dependency type\"},\"dependency/name\":{\"displayName\":\"Remote dependency name\"},\"dependency/success\":{\"displayName\":\"Dependency call status\"},\"dependency/resultCode\":{\"displayName\":\"Result code\"},\"dependency/performanceBucket\":{\"displayName\":\"Performance\"},\"customEvent/name\":{\"displayName\":\"Event name\"},\"availabilityResult/name\":{\"displayName\":\"Test name\"},\"availabilityResult/location\":{\"displayName\":\"Run location\"},\"availabilityResult/success\":{\"displayName\":\"Test result\"},\"customDimensions/FullTestResultAvailable\":{\"displayName\":\"FullTestResultAvailable\"},\"customDimensions/WebtestArmResourceName\":{\"displayName\":\"WebtestArmResourceName\"},\"customDimensions/SyntheticMonitorId\":{\"displayName\":\"SyntheticMonitorId\"},\"customDimensions/WebtestLocationId\":{\"displayName\":\"WebtestLocationId\"},\"exception/problemId\":{\"displayName\":\"Problem Id\"},\"exception/handledAt\":{\"displayName\":\"Handled at\"},\"exception/type\":{\"displayName\":\"Exception type\"},\"exception/assembly\":{\"displayName\":\"Assembly\"},\"exception/method\":{\"displayName\":\"Failed method\"},\"exception/severityLevel\":{\"displayName\":\"Severity level\"},\"billing/telemetryItemSource\":{\"displayName\":\"Telemetry item source\"},\"billing/telemetryItemType\":{\"displayName\":\"Telemetry item type\"},\"performanceCounter/name\":{\"displayName\":\"Name\"},\"performanceCounter/category\":{\"displayName\":\"Category name\"},\"performanceCounter/counter\":{\"displayName\":\"Counter\"},\"performanceCounter/instance\":{\"displayName\":\"Instance name\"}}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canGetMultipleMetrics.json b/applicationinsights/data-plane/target/test-classes/session-records/canGetMultipleMetrics.json new file mode 100644 index 0000000000000..49c6856c2e197 --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canGetMultipleMetrics.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/metrics", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:06 GMT", + "content-length" : "326", + "server" : "nginx", + "vary" : "Accept, Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.a45669e9-9c0b-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8", + "Body" : "[{\"id\":\"1\",\"status\":200,\"body\":{\"value\":{\"start\":\"2018-08-09T10:40:06.767Z\",\"end\":\"2018-08-09T22:40:06.767Z\",\"availabilityResults/availabilityPercentage\":{\"avg\":100}}}},{\"id\":\"2\",\"status\":200,\"body\":{\"value\":{\"start\":\"2018-08-09T10:40:06.767Z\",\"end\":\"2018-08-09T22:40:06.767Z\",\"availabilityResults/duration\":{\"avg\":565.44}}}}]" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/data-plane/target/test-classes/session-records/canQuery.json b/applicationinsights/data-plane/target/test-classes/session-records/canQuery.json new file mode 100644 index 0000000000000..a9d48d6a30f2b --- /dev/null +++ b/applicationinsights/data-plane/target/test-classes/session-records/canQuery.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "http://localhost:1234/apps/578f0e27-12e9-4631-bc02-50b965da2633/query", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:a868cd1346b534e1d19791216fab6df609d09c66b0f97bd640af4913ad89527e Java:10.0.1 (ApplicationInsightsDataClient, v1)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Thu, 09 Aug 2018 22:40:06 GMT", + "server" : "nginx", + "content-length" : "2158", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "access-control-expose-headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", + "via" : "1.1 draft-ai-green.2e3db77c-9c0b-11e8-9972-70b3d5800001", + "access-control-allow-origin" : "*", + "x-content-type-options" : "nosniff", + "content-type" : "application/json; charset=utf-8", + "Body" : "{\"tables\":[{\"name\":\"PrimaryResult\",\"columns\":[{\"name\":\"timestamp\",\"type\":\"datetime\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"location\",\"type\":\"string\"},{\"name\":\"success\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"real\"},{\"name\":\"duration\",\"type\":\"real\"},{\"name\":\"performanceBucket\",\"type\":\"string\"},{\"name\":\"itemType\",\"type\":\"string\"},{\"name\":\"customDimensions\",\"type\":\"dynamic\"},{\"name\":\"customMeasurements\",\"type\":\"dynamic\"},{\"name\":\"operation_Name\",\"type\":\"string\"},{\"name\":\"operation_Id\",\"type\":\"string\"},{\"name\":\"operation_ParentId\",\"type\":\"string\"},{\"name\":\"operation_SyntheticSource\",\"type\":\"string\"},{\"name\":\"session_Id\",\"type\":\"string\"},{\"name\":\"user_Id\",\"type\":\"string\"},{\"name\":\"user_AuthenticatedId\",\"type\":\"string\"},{\"name\":\"user_AccountId\",\"type\":\"string\"},{\"name\":\"application_Version\",\"type\":\"string\"},{\"name\":\"client_Type\",\"type\":\"string\"},{\"name\":\"client_Model\",\"type\":\"string\"},{\"name\":\"client_OS\",\"type\":\"string\"},{\"name\":\"client_IP\",\"type\":\"string\"},{\"name\":\"client_City\",\"type\":\"string\"},{\"name\":\"client_StateOrProvince\",\"type\":\"string\"},{\"name\":\"client_CountryOrRegion\",\"type\":\"string\"},{\"name\":\"client_Browser\",\"type\":\"string\"},{\"name\":\"cloud_RoleName\",\"type\":\"string\"},{\"name\":\"cloud_RoleInstance\",\"type\":\"string\"},{\"name\":\"appId\",\"type\":\"string\"},{\"name\":\"appName\",\"type\":\"string\"},{\"name\":\"iKey\",\"type\":\"string\"},{\"name\":\"sdkVersion\",\"type\":\"string\"},{\"name\":\"itemId\",\"type\":\"string\"},{\"name\":\"itemCount\",\"type\":\"int\"}],\"rows\":[[\"2018-07-20T02:43:09.732Z\",\"7cba736d5c7d4bb5add37c2a86ae6563\",\"microsoft\",\"North Central US\",\"1\",\"Passed\",null,511,\"\",\"availabilityResult\",\"{\\\"FullTestResultAvailable\\\":\\\"false\\\",\\\"WebtestArmResourceName\\\":\\\"microsoft-ace-test\\\",\\\"SyntheticMonitorId\\\":\\\"default_microsoft-ace-test_us-il-ch1-azr\\\",\\\"WebtestLocationId\\\":\\\"us-il-ch1-azr\\\"}\",null,\"\",\"7cba736d5c7d4bb5add37c2a86ae6563\",\"7cba736d5c7d4bb5add37c2a86ae6563\",\"\",\"\",\"\",\"\",\"\",\"\",\"PC\",\"\",\"\",\"0.0.0.0\",\"Chicago\",\"Illinois\",\"United States\",\"\",\"\",\"\",\"578f0e27-12e9-4631-bc02-50b965da2633\",\"ace-test\",\"1145833f-6099-4855-9cb1-557cea26389e\",\"\",\"b16bfd7d-8bc6-11e8-8d3c-adce706bdafe\",1]]}]}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/applicationinsights/resource-manager/v2015_05_01/pom.xml b/applicationinsights/resource-manager/v2015_05_01/pom.xml index d50b542733c0b..5f0e22dfdf85a 100644 --- a/applicationinsights/resource-manager/v2015_05_01/pom.xml +++ b/applicationinsights/resource-manager/v2015_05_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-insights diff --git a/appservice/resource-manager/v2016_03_01/pom.xml b/appservice/resource-manager/v2016_03_01/pom.xml index 3b0ce6270735a..f6d54f5eeb3d8 100644 --- a/appservice/resource-manager/v2016_03_01/pom.xml +++ b/appservice/resource-manager/v2016_03_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-appservice diff --git a/appservice/resource-manager/v2016_08_01/pom.xml b/appservice/resource-manager/v2016_08_01/pom.xml index 93fc2dbeffd6e..77aadf2d9ebff 100644 --- a/appservice/resource-manager/v2016_08_01/pom.xml +++ b/appservice/resource-manager/v2016_08_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-appservice diff --git a/appservice/resource-manager/v2016_09_01/pom.xml b/appservice/resource-manager/v2016_09_01/pom.xml index 36a495194768d..5f7cedf844d19 100644 --- a/appservice/resource-manager/v2016_09_01/pom.xml +++ b/appservice/resource-manager/v2016_09_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-appservice diff --git a/appservice/resource-manager/v2018_02_01/pom.xml b/appservice/resource-manager/v2018_02_01/pom.xml index d53f6aa68a766..ee0d32b6ea451 100644 --- a/appservice/resource-manager/v2018_02_01/pom.xml +++ b/appservice/resource-manager/v2018_02_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-appservice diff --git a/archive/azure-mgmt-containerinstance/pom.xml b/archive/azure-mgmt-containerinstance/pom.xml index e7f82c2083f0f..6aa5db16c36ed 100644 --- a/archive/azure-mgmt-containerinstance/pom.xml +++ b/archive/azure-mgmt-containerinstance/pom.xml @@ -61,11 +61,6 @@ azure-client-authentication test - - com.microsoft.azure - azure-mgmt-storage - 1.3.1-SNAPSHOT - com.microsoft.azure azure-mgmt-resources diff --git a/authorization/resource-manager/v2015_07_01/pom.xml b/authorization/resource-manager/v2015_07_01/pom.xml index 159ceb13fe890..34e3ed9029030 100644 --- a/authorization/resource-manager/v2015_07_01/pom.xml +++ b/authorization/resource-manager/v2015_07_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.authorization.v2015_07_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-authorization - 1.0.0-beta-1 - jar - Microsoft Azure SDK for Authorization Management - This package contains Microsoft Authorization Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.authorization.v2015_07_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-authorization + 1.0.0-beta + jar + Microsoft Azure SDK for Authorization Management + This package contains Microsoft Authorization Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ClassicAdministratorProperties.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ClassicAdministratorProperties.java index e3eb75781eceb..bff2c9f529d6b 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ClassicAdministratorProperties.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ClassicAdministratorProperties.java @@ -27,7 +27,7 @@ public class ClassicAdministratorProperties { private String role; /** - * Get the emailAddress value. + * Get the email address of the administrator. * * @return the emailAddress value */ @@ -36,7 +36,7 @@ public String emailAddress() { } /** - * Set the emailAddress value. + * Set the email address of the administrator. * * @param emailAddress the emailAddress value to set * @return the ClassicAdministratorProperties object itself. @@ -47,7 +47,7 @@ public ClassicAdministratorProperties withEmailAddress(String emailAddress) { } /** - * Get the role value. + * Get the role of the administrator. * * @return the role value */ @@ -56,7 +56,7 @@ public String role() { } /** - * Set the role value. + * Set the role of the administrator. * * @param role the role value to set * @return the ClassicAdministratorProperties object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ProviderOperation.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ProviderOperation.java index 516e35ad30eb3..2dcf21d9d89ae 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ProviderOperation.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ProviderOperation.java @@ -45,7 +45,7 @@ public class ProviderOperation { private Object properties; /** - * Get the name value. + * Get the operation name. * * @return the name value */ @@ -54,7 +54,7 @@ public String name() { } /** - * Set the name value. + * Set the operation name. * * @param name the name value to set * @return the ProviderOperation object itself. @@ -65,7 +65,7 @@ public ProviderOperation withName(String name) { } /** - * Get the displayName value. + * Get the operation display name. * * @return the displayName value */ @@ -74,7 +74,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set the operation display name. * * @param displayName the displayName value to set * @return the ProviderOperation object itself. @@ -85,7 +85,7 @@ public ProviderOperation withDisplayName(String displayName) { } /** - * Get the description value. + * Get the operation description. * * @return the description value */ @@ -94,7 +94,7 @@ public String description() { } /** - * Set the description value. + * Set the operation description. * * @param description the description value to set * @return the ProviderOperation object itself. @@ -105,7 +105,7 @@ public ProviderOperation withDescription(String description) { } /** - * Get the origin value. + * Get the operation origin. * * @return the origin value */ @@ -114,7 +114,7 @@ public String origin() { } /** - * Set the origin value. + * Set the operation origin. * * @param origin the origin value to set * @return the ProviderOperation object itself. @@ -125,7 +125,7 @@ public ProviderOperation withOrigin(String origin) { } /** - * Get the properties value. + * Get the operation properties. * * @return the properties value */ @@ -134,7 +134,7 @@ public Object properties() { } /** - * Set the properties value. + * Set the operation properties. * * @param properties the properties value to set * @return the ProviderOperation object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ResourceType.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ResourceType.java index 43058913c697f..53a0bfa0a1698 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ResourceType.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/ResourceType.java @@ -34,7 +34,7 @@ public class ResourceType { private List operations; /** - * Get the name value. + * Get the resource type name. * * @return the name value */ @@ -43,7 +43,7 @@ public String name() { } /** - * Set the name value. + * Set the resource type name. * * @param name the name value to set * @return the ResourceType object itself. @@ -54,7 +54,7 @@ public ResourceType withName(String name) { } /** - * Get the displayName value. + * Get the resource type display name. * * @return the displayName value */ @@ -63,7 +63,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set the resource type display name. * * @param displayName the displayName value to set * @return the ResourceType object itself. @@ -74,7 +74,7 @@ public ResourceType withDisplayName(String displayName) { } /** - * Get the operations value. + * Get the resource type operations. * * @return the operations value */ @@ -83,7 +83,7 @@ public List operations() { } /** - * Set the operations value. + * Set the resource type operations. * * @param operations the operations value to set * @return the ResourceType object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignment.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignment.java index 54b1220aa7745..266a33ff66b8a 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignment.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignment.java @@ -44,7 +44,7 @@ public interface RoleAssignment extends HasInner, Indexable /** * The entirety of the RoleAssignment definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithScope, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithScope, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -63,6 +63,7 @@ interface Blank extends WithProvider { interface WithProvider { /** * Specifies . + * @return the next definition stage */ WithScope withExistingProvider(); } @@ -73,8 +74,22 @@ interface WithProvider { interface WithScope { /** * Specifies scope. + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource + * @return the next definition stage */ - WithCreate withScope(String scope); + WithProperties withScope(String scope); + } + + /** + * The stage of the roleassignment definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Role assignment properties + * @return the next definition stage + */ + WithCreate withProperties(RoleAssignmentProperties properties); } /** @@ -88,12 +103,24 @@ interface WithCreate extends Creatable { /** * The template for a RoleAssignment update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithProperties { } /** * Grouping of RoleAssignment update stages. */ interface UpdateStages { + /** + * The stage of the roleassignment update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Role assignment properties + * @return the next update stage + */ + Update withProperties(RoleAssignmentProperties properties); + } + } } diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentCreateParameters.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentCreateParameters.java index 8b441f76a52f2..94292f6ee6a82 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentCreateParameters.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentCreateParameters.java @@ -17,11 +17,11 @@ public class RoleAssignmentCreateParameters { /** * Role assignment properties. */ - @JsonProperty(value = "properties") + @JsonProperty(value = "properties", required = true) private RoleAssignmentProperties properties; /** - * Get the properties value. + * Get role assignment properties. * * @return the properties value */ @@ -30,7 +30,7 @@ public RoleAssignmentProperties properties() { } /** - * Set the properties value. + * Set role assignment properties. * * @param properties the properties value to set * @return the RoleAssignmentCreateParameters object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentFilter.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentFilter.java index 84b49ad13e852..e8ea9b579c18c 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentFilter.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentFilter.java @@ -21,7 +21,7 @@ public class RoleAssignmentFilter { private String principalId; /** - * Get the principalId value. + * Get returns role assignment of the specific principal. * * @return the principalId value */ @@ -30,7 +30,7 @@ public String principalId() { } /** - * Set the principalId value. + * Set returns role assignment of the specific principal. * * @param principalId the principalId value to set * @return the RoleAssignmentFilter object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentProperties.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentProperties.java index 914f72e423569..da7d7c7c8b190 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentProperties.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentProperties.java @@ -17,7 +17,7 @@ public class RoleAssignmentProperties { /** * The role definition ID used in the role assignment. */ - @JsonProperty(value = "roleDefinitionId") + @JsonProperty(value = "roleDefinitionId", required = true) private String roleDefinitionId; /** @@ -25,11 +25,11 @@ public class RoleAssignmentProperties { * Active Directory. It can point to a user, service principal, or security * group. */ - @JsonProperty(value = "principalId") + @JsonProperty(value = "principalId", required = true) private String principalId; /** - * Get the roleDefinitionId value. + * Get the role definition ID used in the role assignment. * * @return the roleDefinitionId value */ @@ -38,7 +38,7 @@ public String roleDefinitionId() { } /** - * Set the roleDefinitionId value. + * Set the role definition ID used in the role assignment. * * @param roleDefinitionId the roleDefinitionId value to set * @return the RoleAssignmentProperties object itself. @@ -49,7 +49,7 @@ public RoleAssignmentProperties withRoleDefinitionId(String roleDefinitionId) { } /** - * Get the principalId value. + * Get the principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group. * * @return the principalId value */ @@ -58,7 +58,7 @@ public String principalId() { } /** - * Set the principalId value. + * Set the principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group. * * @param principalId the principalId value to set * @return the RoleAssignmentProperties object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentPropertiesWithScope.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentPropertiesWithScope.java index b8ae30c87e006..451a9ed2d3f7f 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentPropertiesWithScope.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignmentPropertiesWithScope.java @@ -33,7 +33,7 @@ public class RoleAssignmentPropertiesWithScope { private String principalId; /** - * Get the scope value. + * Get the role assignment scope. * * @return the scope value */ @@ -42,7 +42,7 @@ public String scope() { } /** - * Set the scope value. + * Set the role assignment scope. * * @param scope the scope value to set * @return the RoleAssignmentPropertiesWithScope object itself. @@ -53,7 +53,7 @@ public RoleAssignmentPropertiesWithScope withScope(String scope) { } /** - * Get the roleDefinitionId value. + * Get the role definition ID. * * @return the roleDefinitionId value */ @@ -62,7 +62,7 @@ public String roleDefinitionId() { } /** - * Set the roleDefinitionId value. + * Set the role definition ID. * * @param roleDefinitionId the roleDefinitionId value to set * @return the RoleAssignmentPropertiesWithScope object itself. @@ -73,7 +73,7 @@ public RoleAssignmentPropertiesWithScope withRoleDefinitionId(String roleDefinit } /** - * Get the principalId value. + * Get the principal ID. * * @return the principalId value */ @@ -82,7 +82,7 @@ public String principalId() { } /** - * Set the principalId value. + * Set the principal ID. * * @param principalId the principalId value to set * @return the RoleAssignmentPropertiesWithScope object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignments.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignments.java index 5cfd88b2899e9..33509fae2d68f 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignments.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleAssignments.java @@ -39,7 +39,7 @@ public interface RoleAssignments extends SupportsCreating deleteAsync(String scope, String roleAssignmentName); /** * Get the specified role assignment. @@ -58,16 +58,17 @@ public interface RoleAssignments extends SupportsCreating deleteByIdAsync(String roleAssignmentId); /** * Creates a role assignment by ID. * * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * @param properties Role assignment properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable createByIdAsync(String roleAssignmentId); + Observable createByIdAsync(String roleAssignmentId, RoleAssignmentProperties properties); /** * Gets a role assignment by ID. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinition.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinition.java index aa2307a08a40f..05c3456f5f3d7 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinition.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinition.java @@ -17,6 +17,8 @@ import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.authorization.v2015_07_01.implementation.AuthorizationManager; +import java.util.List; +import com.microsoft.azure.management.authorization.v2015_07_01.implementation.PermissionInner; /** * Type representing RoleDefinition. @@ -45,7 +47,7 @@ public interface RoleDefinition extends HasInner, Indexable /** * The entirety of the RoleDefinition definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -64,8 +66,22 @@ interface Blank extends WithScope { interface WithScope { /** * Specifies scope. + * @param scope The scope of the role definition + * @return the next definition stage */ - WithCreate withScope(String scope); + WithProperties withScope(String scope); + } + + /** + * The stage of the roledefinition definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Role definition properties + * @return the next definition stage + */ + WithCreate withProperties(RoleDefinitionProperties properties); } /** @@ -79,12 +95,24 @@ interface WithCreate extends Creatable { /** * The template for a RoleDefinition update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithProperties { } /** * Grouping of RoleDefinition update stages. */ interface UpdateStages { + /** + * The stage of the roledefinition update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Role definition properties + * @return the next update stage + */ + Update withProperties(RoleDefinitionProperties properties); + } + } } diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionFilter.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionFilter.java index 41c7b5672f683..05ecf284bb63e 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionFilter.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionFilter.java @@ -21,7 +21,7 @@ public class RoleDefinitionFilter { private String roleName; /** - * Get the roleName value. + * Get returns role definition with the specific name. * * @return the roleName value */ @@ -30,7 +30,7 @@ public String roleName() { } /** - * Set the roleName value. + * Set returns role definition with the specific name. * * @param roleName the roleName value to set * @return the RoleDefinitionFilter object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionProperties.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionProperties.java index 6b27aa0a56839..9035cdf86e746 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionProperties.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitionProperties.java @@ -47,7 +47,7 @@ public class RoleDefinitionProperties { private List assignableScopes; /** - * Get the roleName value. + * Get the role name. * * @return the roleName value */ @@ -56,7 +56,7 @@ public String roleName() { } /** - * Set the roleName value. + * Set the role name. * * @param roleName the roleName value to set * @return the RoleDefinitionProperties object itself. @@ -67,7 +67,7 @@ public RoleDefinitionProperties withRoleName(String roleName) { } /** - * Get the description value. + * Get the role definition description. * * @return the description value */ @@ -76,7 +76,7 @@ public String description() { } /** - * Set the description value. + * Set the role definition description. * * @param description the description value to set * @return the RoleDefinitionProperties object itself. @@ -87,7 +87,7 @@ public RoleDefinitionProperties withDescription(String description) { } /** - * Get the type value. + * Get the role type. * * @return the type value */ @@ -96,7 +96,7 @@ public String type() { } /** - * Set the type value. + * Set the role type. * * @param type the type value to set * @return the RoleDefinitionProperties object itself. @@ -107,7 +107,7 @@ public RoleDefinitionProperties withType(String type) { } /** - * Get the permissions value. + * Get role definition permissions. * * @return the permissions value */ @@ -116,7 +116,7 @@ public List permissions() { } /** - * Set the permissions value. + * Set role definition permissions. * * @param permissions the permissions value to set * @return the RoleDefinitionProperties object itself. @@ -127,7 +127,7 @@ public RoleDefinitionProperties withPermissions(List permission } /** - * Get the assignableScopes value. + * Get role definition assignable scopes. * * @return the assignableScopes value */ @@ -136,7 +136,7 @@ public List assignableScopes() { } /** - * Set the assignableScopes value. + * Set role definition assignable scopes. * * @param assignableScopes the assignableScopes value to set * @return the RoleDefinitionProperties object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitions.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitions.java index 166743c2b597b..dea84accf81af 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitions.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/RoleDefinitions.java @@ -26,7 +26,7 @@ public interface RoleDefinitions extends SupportsCreating deleteAsync(String scope, String roleDefinitionId); /** * Get role definition by name (GUID). diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManagementClientImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManagementClientImpl.java index 242aee21eeb90..de1757b192e51 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManagementClientImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManagementClientImpl.java @@ -51,11 +51,11 @@ public AuthorizationManagementClientImpl withSubscriptionId(String subscriptionI return this; } - /** The API version to use for the operation. */ + /** The API version to use for this operation. */ private String apiVersion; /** - * Gets The API version to use for the operation. + * Gets The API version to use for this operation. * * @return the apiVersion value. */ @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public AuthorizationManagementClientImpl withAcceptLanguage(String acceptLanguag return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public AuthorizationManagementClientImpl withLongRunningOperationRetryTimeout(in return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -132,19 +132,6 @@ public AuthorizationManagementClientImpl withGenerateClientRequestId(boolean gen return this; } - /** - * The ClassicAdministratorsInner object to access its operations. - */ - private ClassicAdministratorsInner classicAdministrators; - - /** - * Gets the ClassicAdministratorsInner object to access its operations. - * @return the ClassicAdministratorsInner object. - */ - public ClassicAdministratorsInner classicAdministrators() { - return this.classicAdministrators; - } - /** * The PermissionsInner object to access its operations. */ @@ -197,6 +184,19 @@ public RoleDefinitionsInner roleDefinitions() { return this.roleDefinitions; } + /** + * The ClassicAdministratorsInner object to access its operations. + */ + private ClassicAdministratorsInner classicAdministrators; + + /** + * Gets the ClassicAdministratorsInner object to access its operations. + * @return the ClassicAdministratorsInner object. + */ + public ClassicAdministratorsInner classicAdministrators() { + return this.classicAdministrators; + } + /** * Initializes an instance of AuthorizationManagementClient client. * @@ -232,11 +232,11 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; - this.classicAdministrators = new ClassicAdministratorsInner(restClient().retrofit(), this); this.permissions = new PermissionsInner(restClient().retrofit(), this); this.providerOperationsMetadatas = new ProviderOperationsMetadatasInner(restClient().retrofit(), this); this.roleAssignments = new RoleAssignmentsInner(restClient().retrofit(), this); this.roleDefinitions = new RoleDefinitionsInner(restClient().retrofit(), this); + this.classicAdministrators = new ClassicAdministratorsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -247,6 +247,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "AuthorizationManagementClient", "2015-07-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AuthorizationManagementClient", "2015-07-01"); } } diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManager.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManager.java index 7db8bddf7dfd9..2f96613e2d2de 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManager.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/AuthorizationManager.java @@ -16,11 +16,11 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.authorization.v2015_07_01.ClassicAdministrators; import com.microsoft.azure.management.authorization.v2015_07_01.Permissions; import com.microsoft.azure.management.authorization.v2015_07_01.ProviderOperationsMetadatas; import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignments; import com.microsoft.azure.management.authorization.v2015_07_01.RoleDefinitions; +import com.microsoft.azure.management.authorization.v2015_07_01.ClassicAdministrators; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -28,11 +28,11 @@ * Entry point to Azure Authorization resource management. */ public final class AuthorizationManager extends ManagerCore { - private ClassicAdministrators classicAdministrators; private Permissions permissions; private ProviderOperationsMetadatas providerOperationsMetadatas; private RoleAssignments roleAssignments; private RoleDefinitions roleDefinitions; + private ClassicAdministrators classicAdministrators; /** * Get a Configurable instance that can be used to create AuthorizationManager with optional configuration. * @@ -80,16 +80,6 @@ public interface Configurable extends AzureConfigurable { AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } - /** - * @return Entry point to manage ClassicAdministrators. - */ - public ClassicAdministrators classicAdministrators() { - if (this.classicAdministrators == null) { - this.classicAdministrators = new ClassicAdministratorsImpl(this); - } - return this.classicAdministrators; - } - /** * @return Entry point to manage Permissions. */ @@ -130,6 +120,16 @@ public RoleDefinitions roleDefinitions() { return this.roleDefinitions; } + /** + * @return Entry point to manage ClassicAdministrators. + */ + public ClassicAdministrators classicAdministrators() { + if (this.classicAdministrators == null) { + this.classicAdministrators = new ClassicAdministratorsImpl(this); + } + return this.classicAdministrators; + } + /** * The implementation for Configurable interface. */ diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorInner.java index 960ce37b97c2a..7f18e66102350 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorInner.java @@ -40,7 +40,7 @@ public class ClassicAdministratorInner { private ClassicAdministratorProperties properties; /** - * Get the id value. + * Get the ID of the administrator. * * @return the id value */ @@ -49,7 +49,7 @@ public String id() { } /** - * Set the id value. + * Set the ID of the administrator. * * @param id the id value to set * @return the ClassicAdministratorInner object itself. @@ -60,7 +60,7 @@ public ClassicAdministratorInner withId(String id) { } /** - * Get the name value. + * Get the name of the administrator. * * @return the name value */ @@ -69,7 +69,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the administrator. * * @param name the name value to set * @return the ClassicAdministratorInner object itself. @@ -80,7 +80,7 @@ public ClassicAdministratorInner withName(String name) { } /** - * Get the type value. + * Get the type of the administrator. * * @return the type value */ @@ -89,7 +89,7 @@ public String type() { } /** - * Set the type value. + * Set the type of the administrator. * * @param type the type value to set * @return the ClassicAdministratorInner object itself. @@ -100,7 +100,7 @@ public ClassicAdministratorInner withType(String type) { } /** - * Get the properties value. + * Get properties for the classic administrator. * * @return the properties value */ @@ -109,7 +109,7 @@ public ClassicAdministratorProperties properties() { } /** - * Set the properties value. + * Set properties for the classic administrator. * * @param properties the properties value to set * @return the ClassicAdministratorInner object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorsImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorsImpl.java index a5b62e090fead..1875e44be030e 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorsImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ClassicAdministratorsImpl.java @@ -37,7 +37,8 @@ public Observable listAsync(final String apiVersion) { public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public ClassicAdministrator call(ClassicAdministratorInner inner) { return new ClassicAdministratorImpl(inner, manager()); diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionInner.java index e926a88761182..70d897f38dc6a 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionInner.java @@ -28,7 +28,7 @@ public class PermissionInner { private List notActions; /** - * Get the actions value. + * Get allowed actions. * * @return the actions value */ @@ -37,7 +37,7 @@ public List actions() { } /** - * Set the actions value. + * Set allowed actions. * * @param actions the actions value to set * @return the PermissionInner object itself. @@ -48,7 +48,7 @@ public PermissionInner withActions(List actions) { } /** - * Get the notActions value. + * Get denied actions. * * @return the notActions value */ @@ -57,7 +57,7 @@ public List notActions() { } /** - * Set the notActions value. + * Set denied actions. * * @param notActions the notActions value to set * @return the PermissionInner object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionsImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionsImpl.java index af0f288fac5c6..99ca623ba0979 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionsImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/PermissionsImpl.java @@ -37,7 +37,8 @@ public Observable listForResourceAsync(final String resourceGroupNam public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public Permission call(PermissionInner inner) { return new PermissionImpl(inner, manager()); @@ -54,7 +55,8 @@ public Observable listByResourceGroupAsync(final String resourceGrou public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public Permission call(PermissionInner inner) { return new PermissionImpl(inner, manager()); diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadataInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadataInner.java index 30e3110e6115e..bcf0a7c91218e 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadataInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadataInner.java @@ -54,7 +54,7 @@ public class ProviderOperationsMetadataInner { private List operations; /** - * Get the id value. + * Get the provider id. * * @return the id value */ @@ -63,7 +63,7 @@ public String id() { } /** - * Set the id value. + * Set the provider id. * * @param id the id value to set * @return the ProviderOperationsMetadataInner object itself. @@ -74,7 +74,7 @@ public ProviderOperationsMetadataInner withId(String id) { } /** - * Get the name value. + * Get the provider name. * * @return the name value */ @@ -83,7 +83,7 @@ public String name() { } /** - * Set the name value. + * Set the provider name. * * @param name the name value to set * @return the ProviderOperationsMetadataInner object itself. @@ -94,7 +94,7 @@ public ProviderOperationsMetadataInner withName(String name) { } /** - * Get the type value. + * Get the provider type. * * @return the type value */ @@ -103,7 +103,7 @@ public String type() { } /** - * Set the type value. + * Set the provider type. * * @param type the type value to set * @return the ProviderOperationsMetadataInner object itself. @@ -114,7 +114,7 @@ public ProviderOperationsMetadataInner withType(String type) { } /** - * Get the displayName value. + * Get the provider display name. * * @return the displayName value */ @@ -123,7 +123,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set the provider display name. * * @param displayName the displayName value to set * @return the ProviderOperationsMetadataInner object itself. @@ -134,7 +134,7 @@ public ProviderOperationsMetadataInner withDisplayName(String displayName) { } /** - * Get the resourceTypes value. + * Get the provider resource types. * * @return the resourceTypes value */ @@ -143,7 +143,7 @@ public List resourceTypes() { } /** - * Set the resourceTypes value. + * Set the provider resource types. * * @param resourceTypes the resourceTypes value to set * @return the ProviderOperationsMetadataInner object itself. @@ -154,7 +154,7 @@ public ProviderOperationsMetadataInner withResourceTypes(List reso } /** - * Get the operations value. + * Get the provider operations. * * @return the operations value */ @@ -163,7 +163,7 @@ public List operations() { } /** - * Set the operations value. + * Set the provider operations. * * @param operations the operations value to set * @return the ProviderOperationsMetadataInner object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadatasImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadatasImpl.java index 9ef4374e93263..6a5123cf61e0f 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadatasImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/ProviderOperationsMetadatasImpl.java @@ -49,7 +49,8 @@ public Observable listAsync(final String apiVersion) public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public ProviderOperationsMetadata call(ProviderOperationsMetadataInner inner) { return new ProviderOperationsMetadataImpl(inner, manager()); diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentImpl.java index 5054ca743196d..1732a7c3279c8 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentImpl.java @@ -11,12 +11,16 @@ import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignment; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; +import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignmentProperties; import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignmentPropertiesWithScope; +import rx.functions.Func1; class RoleAssignmentImpl extends CreatableUpdatableImpl implements RoleAssignment, RoleAssignment.Definition, RoleAssignment.Update { private final AuthorizationManager manager; private String scope; private String roleAssignmentName; + private RoleAssignmentProperties cproperties; + private RoleAssignmentProperties uproperties; RoleAssignmentImpl(String name, AuthorizationManager manager) { super(name, new RoleAssignmentInner()); @@ -24,6 +28,8 @@ class RoleAssignmentImpl extends CreatableUpdatableImpl createResourceAsync() { RoleAssignmentsInner client = this.manager().inner().roleAssignments(); - return client.createAsync(this.scope, this.roleAssignmentName) + return client.createAsync(this.scope, this.roleAssignmentName, this.cproperties) + .map(new Func1() { + @Override + public RoleAssignmentInner call(RoleAssignmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { RoleAssignmentsInner client = this.manager().inner().roleAssignments(); - return client.createAsync(this.scope, this.roleAssignmentName) + return client.createAsync(this.scope, this.roleAssignmentName, this.uproperties) + .map(new Func1() { + @Override + public RoleAssignmentInner call(RoleAssignmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @@ -67,6 +89,10 @@ public boolean isInCreateMode() { return this.inner().id() == null; } + private void resetCreateUpdateParameters() { + this.cproperties = new RoleAssignmentProperties(); + this.uproperties = new RoleAssignmentProperties(); + } @Override public String id() { @@ -99,4 +125,14 @@ public RoleAssignmentImpl withScope(String scope) { return this; } + @Override + public RoleAssignmentImpl withProperties(RoleAssignmentProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + } diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentInner.java index 0785899f77b81..d712b7c215110 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentInner.java @@ -40,7 +40,7 @@ public class RoleAssignmentInner { private RoleAssignmentPropertiesWithScope properties; /** - * Get the id value. + * Get the role assignment ID. * * @return the id value */ @@ -49,7 +49,7 @@ public String id() { } /** - * Get the name value. + * Get the role assignment name. * * @return the name value */ @@ -58,7 +58,7 @@ public String name() { } /** - * Get the type value. + * Get the role assignment type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Get the properties value. + * Get role assignment properties. * * @return the properties value */ @@ -76,7 +76,7 @@ public RoleAssignmentPropertiesWithScope properties() { } /** - * Set the properties value. + * Set role assignment properties. * * @param properties the properties value to set * @return the RoleAssignmentInner object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsImpl.java index 5594ab890264f..3542de7f8bb2c 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsImpl.java @@ -11,11 +11,11 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignments; -import rx.Completable; import rx.functions.Func1; import rx.Observable; import com.microsoft.azure.Page; import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignment; +import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignmentProperties; class RoleAssignmentsImpl extends WrapperImpl implements RoleAssignments { private final AuthorizationManager manager; @@ -51,7 +51,8 @@ public Observable listForResourceAsync(final String resourceGrou public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public RoleAssignment call(RoleAssignmentInner inner) { return new RoleAssignmentImpl(inner, manager()); @@ -60,9 +61,15 @@ public RoleAssignment call(RoleAssignmentInner inner) { } @Override - public Completable deleteAsync(String scope, String roleAssignmentName) { + public Observable deleteAsync(String scope, String roleAssignmentName) { RoleAssignmentsInner client = this.inner(); - return client.deleteAsync(scope, roleAssignmentName).toCompletable(); + return client.deleteAsync(scope, roleAssignmentName) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); } @Override @@ -78,15 +85,21 @@ public RoleAssignment call(RoleAssignmentInner inner) { } @Override - public Completable deleteByIdAsync(String roleAssignmentId) { + public Observable deleteByIdAsync(String roleAssignmentId) { RoleAssignmentsInner client = this.inner(); - return client.deleteByIdAsync(roleAssignmentId).toCompletable(); + return client.deleteByIdAsync(roleAssignmentId) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); } @Override - public Observable createByIdAsync(String roleAssignmentId) { + public Observable createByIdAsync(String roleAssignmentId, RoleAssignmentProperties properties) { RoleAssignmentsInner client = this.inner(); - return client.createByIdAsync(roleAssignmentId) + return client.createByIdAsync(roleAssignmentId, properties) .map(new Func1() { @Override public RoleAssignment call(RoleAssignmentInner inner) { @@ -116,7 +129,8 @@ public Observable listByResourceGroupAsync(final String resource public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public RoleAssignment call(RoleAssignmentInner inner) { return new RoleAssignmentImpl(inner, manager()); @@ -133,7 +147,8 @@ public Observable listAsync() { public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public RoleAssignment call(RoleAssignmentInner inner) { return new RoleAssignmentImpl(inner, manager()); @@ -150,7 +165,8 @@ public Observable listForScopeAsync(final String scope) { public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public RoleAssignment call(RoleAssignmentInner inner) { return new RoleAssignmentImpl(inner, manager()); diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java index 5262b3a53cfc6..67a00ca66d688 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java @@ -728,85 +728,6 @@ private ServiceResponse deleteDelegate(Response createAsync(String scope, String roleAssignmentName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(scope, roleAssignmentName), serviceCallback); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RoleAssignmentInner object - */ - public Observable createAsync(String scope, String roleAssignmentName) { - return createWithServiceResponseAsync(scope, roleAssignmentName).map(new Func1, RoleAssignmentInner>() { - @Override - public RoleAssignmentInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RoleAssignmentInner object - */ - public Observable> createWithServiceResponseAsync(String scope, String roleAssignmentName) { - if (scope == null) { - throw new IllegalArgumentException("Parameter scope is required and cannot be null."); - } - if (roleAssignmentName == null) { - throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final RoleAssignmentProperties properties = null; - RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters(); - parameters.withProperties(null); - return service.create(scope, roleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Creates a role assignment. * @@ -873,6 +794,9 @@ public Observable> createWithServiceRespons if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } Validator.validate(properties); RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters(); parameters.withProperties(properties); @@ -1056,78 +980,6 @@ private ServiceResponse deleteByIdDelegate(Response createByIdAsync(String roleAssignmentId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createByIdWithServiceResponseAsync(roleAssignmentId), serviceCallback); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RoleAssignmentInner object - */ - public Observable createByIdAsync(String roleAssignmentId) { - return createByIdWithServiceResponseAsync(roleAssignmentId).map(new Func1, RoleAssignmentInner>() { - @Override - public RoleAssignmentInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RoleAssignmentInner object - */ - public Observable> createByIdWithServiceResponseAsync(String roleAssignmentId) { - if (roleAssignmentId == null) { - throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final RoleAssignmentProperties properties = null; - RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters(); - parameters.withProperties(null); - return service.createById(roleAssignmentId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createByIdDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Creates a role assignment by ID. * @@ -1187,6 +1039,9 @@ public Observable> createByIdWithServiceRes if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } Validator.validate(properties); RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters(); parameters.withProperties(properties); diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionImpl.java index 8ccbb48b121eb..ac4f77c3aafc6 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionImpl.java @@ -13,10 +13,14 @@ import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; import com.microsoft.azure.management.authorization.v2015_07_01.RoleDefinitionProperties; +import java.util.List; +import rx.functions.Func1; class RoleDefinitionImpl extends CreatableUpdatableImpl implements RoleDefinition, RoleDefinition.Definition, RoleDefinition.Update { private String scope; private String roleDefinitionId; + private RoleDefinitionProperties cproperties; + private RoleDefinitionProperties uproperties; private final AuthorizationManager manager; RoleDefinitionImpl(String name, AuthorizationManager manager) { @@ -25,6 +29,8 @@ class RoleDefinitionImpl extends CreatableUpdatableImpl createResourceAsync() { RoleDefinitionsInner client = this.manager().inner().roleDefinitions(); - return client.createOrUpdateAsync(this.scope, this.roleDefinitionId) + return client.createOrUpdateAsync(this.scope, this.roleDefinitionId, this.cproperties) + .map(new Func1() { + @Override + public RoleDefinitionInner call(RoleDefinitionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { RoleDefinitionsInner client = this.manager().inner().roleDefinitions(); - return client.createOrUpdateAsync(this.scope, this.roleDefinitionId) + return client.createOrUpdateAsync(this.scope, this.roleDefinitionId, this.uproperties) + .map(new Func1() { + @Override + public RoleDefinitionInner call(RoleDefinitionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @@ -68,6 +90,10 @@ public boolean isInCreateMode() { return this.inner().id() == null; } + private void resetCreateUpdateParameters() { + this.cproperties = new RoleDefinitionProperties(); + this.uproperties = new RoleDefinitionProperties(); + } @Override public String id() { @@ -95,4 +121,14 @@ public RoleDefinitionImpl withScope(String scope) { return this; } + @Override + public RoleDefinitionImpl withProperties(RoleDefinitionProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + } diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionInner.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionInner.java index 9e9ebbd70bff7..b9051b7e60a70 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionInner.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionInner.java @@ -40,7 +40,7 @@ public class RoleDefinitionInner { private RoleDefinitionProperties properties; /** - * Get the id value. + * Get the role definition ID. * * @return the id value */ @@ -49,7 +49,7 @@ public String id() { } /** - * Get the name value. + * Get the role definition name. * * @return the name value */ @@ -58,7 +58,7 @@ public String name() { } /** - * Get the type value. + * Get the role definition type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Get the properties value. + * Get role definition properties. * * @return the properties value */ @@ -76,7 +76,7 @@ public RoleDefinitionProperties properties() { } /** - * Set the properties value. + * Set role definition properties. * * @param properties the properties value to set * @return the RoleDefinitionInner object itself. diff --git a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsImpl.java b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsImpl.java index 3e209b725f8db..9f870bb615ab4 100644 --- a/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsImpl.java +++ b/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsImpl.java @@ -11,7 +11,6 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.authorization.v2015_07_01.RoleDefinitions; -import rx.Completable; import rx.functions.Func1; import rx.Observable; import com.microsoft.azure.Page; @@ -43,9 +42,15 @@ private RoleDefinitionImpl wrapModel(String name) { } @Override - public Completable deleteAsync(String scope, String roleDefinitionId) { + public Observable deleteAsync(String scope, String roleDefinitionId) { RoleDefinitionsInner client = this.inner(); - return client.deleteAsync(scope, roleDefinitionId).toCompletable(); + return client.deleteAsync(scope, roleDefinitionId) + .map(new Func1() { + @Override + public RoleDefinition call(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + }); } @Override @@ -81,7 +86,8 @@ public Observable listAsync(final String scope) { public Iterable call(Page page) { return page.items(); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public RoleDefinition call(RoleDefinitionInner inner) { return new RoleDefinitionImpl(inner, manager()); diff --git a/authorization/resource-manager/v2015_07_01/src/test/java/com/microsoft/azure/management/authorization/v2015_07_01/AuthorizationTest.java b/authorization/resource-manager/v2015_07_01/src/test/java/com/microsoft/azure/management/authorization/v2015_07_01/AuthorizationTest.java deleted file mode 100644 index 2fa25dc769bb4..0000000000000 --- a/authorization/resource-manager/v2015_07_01/src/test/java/com/microsoft/azure/management/authorization/v2015_07_01/AuthorizationTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.authorization.v2015_07_01; -import com.microsoft.azure.arm.core.TestBase; -import com.microsoft.azure.management.authorization.v2015_07_01.implementation.AuthorizationManager; -import com.microsoft.azure.management.resources.implementation.ResourceManager; -import com.microsoft.rest.RestClient; -import com.microsoft.azure.arm.utils.SdkContext; -import org.junit.Test; -import org.junit.Assert; -import com.microsoft.azure.arm.resources.Region; -import com.microsoft.azure.management.resources.ResourceGroup; - -public class AuthorizationTest extends TestBase { - protected static ResourceManager resourceManager; - protected static AuthorizationManager authorizationManager; - private static String rgName; - @Override - protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { - resourceManager = ResourceManager - .authenticate(restClient) - .withSubscription(defaultSubscription); - authorizationManager = AuthorizationManager - .authenticate(restClient, defaultSubscription); - } - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - @Test - public void firstTest() { - rgName = SdkContext.randomResourceName("rg", 20); - ResourceGroup group = resourceManager.resourceGroups() - .define(rgName) - .withRegion(Region.US_WEST.toString()) - .create(); - Assert.assertNotNull(group); - } -} diff --git a/authorization/resource-manager/v2018_09_01_preview/pom.xml b/authorization/resource-manager/v2018_09_01_preview/pom.xml new file mode 100644 index 0000000000000..38dd550f1ea5c --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.authorization.v2018_09_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-authorization + 1.0.0-beta + jar + Microsoft Azure SDK for Authorization Management + This package contains Microsoft Authorization Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrator.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrator.java new file mode 100644 index 0000000000000..a6b0bc42b7ac0 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrator.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.ClassicAdministratorInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; + +/** + * Type representing ClassicAdministrator. + */ +public interface ClassicAdministrator extends HasInner, HasManager { + /** + * @return the emailAddress value. + */ + String emailAddress(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the role value. + */ + String role(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrators.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrators.java new file mode 100644 index 0000000000000..1e44a421cb617 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ClassicAdministrators.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.ClassicAdministratorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClassicAdministrators. + */ +public interface ClassicAdministrators extends SupportsListing, HasInner { +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignment.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignment.java new file mode 100644 index 0000000000000..7dea987f17149 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignment.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.DenyAssignmentInner; +import java.util.List; + +/** + * Type representing DenyAssignment. + */ +public interface DenyAssignment extends HasInner, HasManager { + /** + * @return the denyAssignmentName value. + */ + String denyAssignmentName(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the doNotApplyToChildScopes value. + */ + Boolean doNotApplyToChildScopes(); + + /** + * @return the excludePrincipals value. + */ + List excludePrincipals(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isSystemProtected value. + */ + Boolean isSystemProtected(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the permissions value. + */ + List permissions(); + + /** + * @return the principals value. + */ + List principals(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentFilter.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentFilter.java new file mode 100644 index 0000000000000..327bdd687668d --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentFilter.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deny Assignments filter. + */ +public class DenyAssignmentFilter { + /** + * Return deny assignment with specified name. + */ + @JsonProperty(value = "denyAssignmentName") + private String denyAssignmentName; + + /** + * Return all deny assignments where the specified principal is listed in + * the principals list of deny assignments. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * Return all deny assignments where the specified principal is listed + * either in the principals list or exclude principals list of deny + * assignments. + */ + @JsonProperty(value = "gdprExportPrincipalId") + private String gdprExportPrincipalId; + + /** + * Get return deny assignment with specified name. + * + * @return the denyAssignmentName value + */ + public String denyAssignmentName() { + return this.denyAssignmentName; + } + + /** + * Set return deny assignment with specified name. + * + * @param denyAssignmentName the denyAssignmentName value to set + * @return the DenyAssignmentFilter object itself. + */ + public DenyAssignmentFilter withDenyAssignmentName(String denyAssignmentName) { + this.denyAssignmentName = denyAssignmentName; + return this; + } + + /** + * Get return all deny assignments where the specified principal is listed in the principals list of deny assignments. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set return all deny assignments where the specified principal is listed in the principals list of deny assignments. + * + * @param principalId the principalId value to set + * @return the DenyAssignmentFilter object itself. + */ + public DenyAssignmentFilter withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get return all deny assignments where the specified principal is listed either in the principals list or exclude principals list of deny assignments. + * + * @return the gdprExportPrincipalId value + */ + public String gdprExportPrincipalId() { + return this.gdprExportPrincipalId; + } + + /** + * Set return all deny assignments where the specified principal is listed either in the principals list or exclude principals list of deny assignments. + * + * @param gdprExportPrincipalId the gdprExportPrincipalId value to set + * @return the DenyAssignmentFilter object itself. + */ + public DenyAssignmentFilter withGdprExportPrincipalId(String gdprExportPrincipalId) { + this.gdprExportPrincipalId = gdprExportPrincipalId; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentPermission.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentPermission.java new file mode 100644 index 0000000000000..03154686f2167 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignmentPermission.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deny assignment permissions. + */ +public class DenyAssignmentPermission { + /** + * Actions to which the deny assignment does not grant access. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Actions to exclude from that the deny assignment does not grant access. + */ + @JsonProperty(value = "notActions") + private List notActions; + + /** + * Data actions to which the deny assignment does not grant access. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /** + * Data actions to exclude from that the deny assignment does not grant + * access. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /** + * Get actions to which the deny assignment does not grant access. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set actions to which the deny assignment does not grant access. + * + * @param actions the actions value to set + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get actions to exclude from that the deny assignment does not grant access. + * + * @return the notActions value + */ + public List notActions() { + return this.notActions; + } + + /** + * Set actions to exclude from that the deny assignment does not grant access. + * + * @param notActions the notActions value to set + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withNotActions(List notActions) { + this.notActions = notActions; + return this; + } + + /** + * Get data actions to which the deny assignment does not grant access. + * + * @return the dataActions value + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set data actions to which the deny assignment does not grant access. + * + * @param dataActions the dataActions value to set + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get data actions to exclude from that the deny assignment does not grant access. + * + * @return the notDataActions value + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set data actions to exclude from that the deny assignment does not grant access. + * + * @param notDataActions the notDataActions value to set + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignments.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignments.java new file mode 100644 index 0000000000000..ba68b8c0fb9cb --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/DenyAssignments.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import rx.Observable; + +/** + * Type representing DenyAssignments. + */ +public interface DenyAssignments { + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName); + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String scope, String denyAssignmentId); + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByIdAsync(String denyAssignmentId); + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + + /** + * Gets all deny assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listForScopeAsync(final String scope); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permission.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permission.java new file mode 100644 index 0000000000000..8db22450020d7 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permission.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.PermissionInner; +import java.util.List; + +/** + * Type representing Permission. + */ +public interface Permission extends HasInner, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the dataActions value. + */ + List dataActions(); + + /** + * @return the notActions value. + */ + List notActions(); + + /** + * @return the notDataActions value. + */ + List notDataActions(); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permissions.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permissions.java new file mode 100644 index 0000000000000..8d4f72d1f4427 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Permissions.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import rx.Observable; + +/** + * Type representing Permissions. + */ +public interface Permissions { + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName); + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Principal.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Principal.java new file mode 100644 index 0000000000000..5fe04225c7533 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/Principal.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deny assignment principal. + */ +public class Principal { + /** + * Object ID of the Azure AD principal (user, group, or service principal) + * to which the deny assignment applies. An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal + * type as 'Everyone' represents all users, groups and service principals. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Type of object represented by principal id (user, group, or service + * principal). An empty guid '00000000-0000-0000-0000-000000000000' as + * principal id and principal type as 'Everyone' represents all users, + * groups and service principals. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get object ID of the Azure AD principal (user, group, or service principal) to which the deny assignment applies. An empty guid '00000000-0000-0000-0000-000000000000' as principal id and principal type as 'Everyone' represents all users, groups and service principals. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get type of object represented by principal id (user, group, or service principal). An empty guid '00000000-0000-0000-0000-000000000000' as principal id and principal type as 'Everyone' represents all users, groups and service principals. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/PrincipalType.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/PrincipalType.java new file mode 100644 index 0000000000000..9747a36c36c93 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/PrincipalType.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrincipalType. + */ +public final class PrincipalType extends ExpandableStringEnum { + /** Static value User for PrincipalType. */ + public static final PrincipalType USER = fromString("User"); + + /** Static value Group for PrincipalType. */ + public static final PrincipalType GROUP = fromString("Group"); + + /** Static value ServicePrincipal for PrincipalType. */ + public static final PrincipalType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** Static value Unknown for PrincipalType. */ + public static final PrincipalType UNKNOWN = fromString("Unknown"); + + /** Static value DirectoryRoleTemplate for PrincipalType. */ + public static final PrincipalType DIRECTORY_ROLE_TEMPLATE = fromString("DirectoryRoleTemplate"); + + /** Static value ForeignGroup for PrincipalType. */ + public static final PrincipalType FOREIGN_GROUP = fromString("ForeignGroup"); + + /** Static value Application for PrincipalType. */ + public static final PrincipalType APPLICATION = fromString("Application"); + + /** Static value MSI for PrincipalType. */ + public static final PrincipalType MSI = fromString("MSI"); + + /** Static value DirectoryObjectOrGroup for PrincipalType. */ + public static final PrincipalType DIRECTORY_OBJECT_OR_GROUP = fromString("DirectoryObjectOrGroup"); + + /** Static value Everyone for PrincipalType. */ + public static final PrincipalType EVERYONE = fromString("Everyone"); + + /** + * Creates or finds a PrincipalType from its string representation. + * @param name a name to look for + * @return the corresponding PrincipalType + */ + @JsonCreator + public static PrincipalType fromString(String name) { + return fromString(name, PrincipalType.class); + } + + /** + * @return known PrincipalType values + */ + public static Collection values() { + return values(PrincipalType.class); + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperation.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperation.java new file mode 100644 index 0000000000000..3dea27c277c17 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperation.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation. + */ +public class ProviderOperation { + /** + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The operation display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The operation origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * The operation properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * The dataAction flag to specify the operation type. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get the operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name. + * + * @param name the name value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operation display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the operation display name. + * + * @param displayName the displayName value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the operation description. + * + * @param description the description value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the operation origin. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the operation origin. + * + * @param origin the origin value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the operation properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the operation properties. + * + * @param properties the properties value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the dataAction flag to specify the operation type. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the dataAction flag to specify the operation type. + * + * @param isDataAction the isDataAction value to set + * @return the ProviderOperation object itself. + */ + public ProviderOperation withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadata.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadata.java new file mode 100644 index 0000000000000..de4c7474f3c2c --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadata.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.ProviderOperationsMetadataInner; +import java.util.List; + +/** + * Type representing ProviderOperationsMetadata. + */ +public interface ProviderOperationsMetadata extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operations value. + */ + List operations(); + + /** + * @return the resourceTypes value. + */ + List resourceTypes(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadatas.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadatas.java new file mode 100644 index 0000000000000..54b77c14eed56 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ProviderOperationsMetadatas.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.ProviderOperationsMetadatasInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProviderOperationsMetadatas. + */ +public interface ProviderOperationsMetadatas extends HasInner { + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceProviderNamespace); + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ResourceType.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ResourceType.java new file mode 100644 index 0000000000000..dbbf15cd3c5ea --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/ResourceType.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource Type. + */ +public class ResourceType { + /** + * The resource type name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The resource type display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The resource type operations. + */ + @JsonProperty(value = "operations") + private List operations; + + /** + * Get the resource type name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the resource type name. + * + * @param name the name value to set + * @return the ResourceType object itself. + */ + public ResourceType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the resource type display name. + * + * @param displayName the displayName value to set + * @return the ResourceType object itself. + */ + public ResourceType withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the resource type operations. + * + * @return the operations value + */ + public List operations() { + return this.operations; + } + + /** + * Set the resource type operations. + * + * @param operations the operations value to set + * @return the ResourceType object itself. + */ + public ResourceType withOperations(List operations) { + this.operations = operations; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignment.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignment.java new file mode 100644 index 0000000000000..c94e33be441fb --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignment.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.RoleAssignmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; + +/** + * Type representing RoleAssignment. + */ +public interface RoleAssignment extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the canDelegate value. + */ + Boolean canDelegate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the RoleAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithScope, DefinitionStages.WithPrincipalId, DefinitionStages.WithRoleDefinitionId, DefinitionStages.WithCreate { + } + + /** + * Grouping of RoleAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RoleAssignment definition. + */ + interface Blank extends WithProvider { + } + + /** + * The stage of the roleassignment definition allowing to specify Provider. + */ + interface WithProvider { + /** + * Specifies . + * @return the next definition stage + */ + WithScope withExistingProvider(); + } + + /** + * The stage of the roleassignment definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource + * @return the next definition stage + */ + WithPrincipalId withScope(String scope); + } + + /** + * The stage of the roleassignment definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @param principalId The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group + * @return the next definition stage + */ + WithRoleDefinitionId withPrincipalId(String principalId); + } + + /** + * The stage of the roleassignment definition allowing to specify RoleDefinitionId. + */ + interface WithRoleDefinitionId { + /** + * Specifies roleDefinitionId. + * @param roleDefinitionId The role definition ID used in the role assignment + * @return the next definition stage + */ + WithCreate withRoleDefinitionId(String roleDefinitionId); + } + + /** + * The stage of the roleassignment definition allowing to specify CanDelegate. + */ + interface WithCanDelegate { + /** + * Specifies canDelegate. + * @param canDelegate The delgation flag used for creating a role assignment + * @return the next definition stage + */ + WithCreate withCanDelegate(Boolean canDelegate); + } + + /** + * The stage of the roleassignment definition allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType The principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' + * @return the next definition stage + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCanDelegate, DefinitionStages.WithPrincipalType { + } + } + /** + * The template for a RoleAssignment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCanDelegate, UpdateStages.WithPrincipalType { + } + + /** + * Grouping of RoleAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the roleassignment update allowing to specify CanDelegate. + */ + interface WithCanDelegate { + /** + * Specifies canDelegate. + * @param canDelegate The delgation flag used for creating a role assignment + * @return the next update stage + */ + Update withCanDelegate(Boolean canDelegate); + } + + /** + * The stage of the roleassignment update allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType The principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' + * @return the next update stage + */ + Update withPrincipalType(PrincipalType principalType); + } + + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentCreateParameters.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentCreateParameters.java new file mode 100644 index 0000000000000..1d03f6918fff5 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentCreateParameters.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Role assignment create parameters. + */ +@JsonFlatten +public class RoleAssignmentCreateParameters { + /** + * The role definition ID used in the role assignment. + */ + @JsonProperty(value = "properties.roleDefinitionId", required = true) + private String roleDefinitionId; + + /** + * The principal ID assigned to the role. This maps to the ID inside the + * Active Directory. It can point to a user, service principal, or security + * group. + */ + @JsonProperty(value = "properties.principalId", required = true) + private String principalId; + + /** + * The principal type of the assigned principal ID. Possible values + * include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + * 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + * 'DirectoryObjectOrGroup', 'Everyone'. + */ + @JsonProperty(value = "properties.principalType") + private PrincipalType principalType; + + /** + * The delgation flag used for creating a role assignment. + */ + @JsonProperty(value = "properties.canDelegate") + private Boolean canDelegate; + + /** + * Get the role definition ID used in the role assignment. + * + * @return the roleDefinitionId value + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the role definition ID used in the role assignment. + * + * @param roleDefinitionId the roleDefinitionId value to set + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group. + * + * @param principalId the principalId value to set + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone'. + * + * @return the principalType value + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone'. + * + * @param principalType the principalType value to set + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the delgation flag used for creating a role assignment. + * + * @return the canDelegate value + */ + public Boolean canDelegate() { + return this.canDelegate; + } + + /** + * Set the delgation flag used for creating a role assignment. + * + * @param canDelegate the canDelegate value to set + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withCanDelegate(Boolean canDelegate) { + this.canDelegate = canDelegate; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentFilter.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentFilter.java new file mode 100644 index 0000000000000..9c6dbc3123489 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignmentFilter.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Role Assignments filter. + */ +public class RoleAssignmentFilter { + /** + * Returns role assignment of the specific principal. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * The Delegation flag for the roleassignment. + */ + @JsonProperty(value = "canDelegate") + private Boolean canDelegate; + + /** + * Get returns role assignment of the specific principal. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set returns role assignment of the specific principal. + * + * @param principalId the principalId value to set + * @return the RoleAssignmentFilter object itself. + */ + public RoleAssignmentFilter withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the Delegation flag for the roleassignment. + * + * @return the canDelegate value + */ + public Boolean canDelegate() { + return this.canDelegate; + } + + /** + * Set the Delegation flag for the roleassignment. + * + * @param canDelegate the canDelegate value to set + * @return the RoleAssignmentFilter object itself. + */ + public RoleAssignmentFilter withCanDelegate(Boolean canDelegate) { + this.canDelegate = canDelegate; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignments.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignments.java new file mode 100644 index 0000000000000..b2239fbf4be6a --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleAssignments.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.RoleAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RoleAssignments. + */ +public interface RoleAssignments extends SupportsCreating, HasInner { + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName); + + /** + * Deletes a role assignment. + * + * @param scope The scope of the role assignment to delete. + * @param roleAssignmentName The name of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String scope, String roleAssignmentName); + + /** + * Get the specified role assignment. + * + * @param scope The scope of the role assignment. + * @param roleAssignmentName The name of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String scope, String roleAssignmentName); + + /** + * Deletes a role assignment. + * + * @param roleId The ID of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteByIdAsync(String roleId); + + /** + * Creates a role assignment by ID. + * + * @param roleId The ID of the role assignment to create. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createByIdAsync(String roleId, RoleAssignmentCreateParameters parameters); + + /** + * Gets a role assignment by ID. + * + * @param roleId The ID of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByIdAsync(String roleId); + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + + /** + * Gets all role assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listForScopeAsync(final String scope); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinition.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinition.java new file mode 100644 index 0000000000000..f261e50aa074e --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinition.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.RoleDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.AuthorizationManager; +import java.util.List; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.PermissionInner; + +/** + * Type representing RoleDefinition. + */ +public interface RoleDefinition extends HasInner, Indexable, Updatable, Refreshable, HasManager { + /** + * @return the assignableScopes value. + */ + List assignableScopes(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the permissions value. + */ + List permissions(); + + /** + * @return the roleName value. + */ + String roleName(); + + /** + * @return the roleType value. + */ + String roleType(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the RoleDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * Grouping of RoleDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RoleDefinition definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the roledefinition definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of the role definition + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the roledefinition definition allowing to specify AssignableScopes. + */ + interface WithAssignableScopes { + /** + * Specifies assignableScopes. + * @param assignableScopes Role definition assignable scopes + * @return the next definition stage + */ + WithCreate withAssignableScopes(List assignableScopes); + } + + /** + * The stage of the roledefinition definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The role definition description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the roledefinition definition allowing to specify Permissions. + */ + interface WithPermissions { + /** + * Specifies permissions. + * @param permissions Role definition permissions + * @return the next definition stage + */ + WithCreate withPermissions(List permissions); + } + + /** + * The stage of the roledefinition definition allowing to specify RoleName. + */ + interface WithRoleName { + /** + * Specifies roleName. + * @param roleName The role name + * @return the next definition stage + */ + WithCreate withRoleName(String roleName); + } + + /** + * The stage of the roledefinition definition allowing to specify RoleType. + */ + interface WithRoleType { + /** + * Specifies roleType. + * @param roleType The role type + * @return the next definition stage + */ + WithCreate withRoleType(String roleType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAssignableScopes, DefinitionStages.WithDescription, DefinitionStages.WithPermissions, DefinitionStages.WithRoleName, DefinitionStages.WithRoleType { + } + } + /** + * The template for a RoleDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAssignableScopes, UpdateStages.WithDescription, UpdateStages.WithPermissions, UpdateStages.WithRoleName, UpdateStages.WithRoleType { + } + + /** + * Grouping of RoleDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the roledefinition update allowing to specify AssignableScopes. + */ + interface WithAssignableScopes { + /** + * Specifies assignableScopes. + * @param assignableScopes Role definition assignable scopes + * @return the next update stage + */ + Update withAssignableScopes(List assignableScopes); + } + + /** + * The stage of the roledefinition update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The role definition description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the roledefinition update allowing to specify Permissions. + */ + interface WithPermissions { + /** + * Specifies permissions. + * @param permissions Role definition permissions + * @return the next update stage + */ + Update withPermissions(List permissions); + } + + /** + * The stage of the roledefinition update allowing to specify RoleName. + */ + interface WithRoleName { + /** + * Specifies roleName. + * @param roleName The role name + * @return the next update stage + */ + Update withRoleName(String roleName); + } + + /** + * The stage of the roledefinition update allowing to specify RoleType. + */ + interface WithRoleType { + /** + * Specifies roleType. + * @param roleType The role type + * @return the next update stage + */ + Update withRoleType(String roleType); + } + + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitionFilter.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitionFilter.java new file mode 100644 index 0000000000000..568a8794e59ab --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitionFilter.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Role Definitions filter. + */ +public class RoleDefinitionFilter { + /** + * Returns role definition with the specific name. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /** + * Returns role definition with the specific type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get returns role definition with the specific name. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + + /** + * Set returns role definition with the specific name. + * + * @param roleName the roleName value to set + * @return the RoleDefinitionFilter object itself. + */ + public RoleDefinitionFilter withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get returns role definition with the specific type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set returns role definition with the specific type. + * + * @param type the type value to set + * @return the RoleDefinitionFilter object itself. + */ + public RoleDefinitionFilter withType(String type) { + this.type = type; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitions.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitions.java new file mode 100644 index 0000000000000..bf72c9bc914a0 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/RoleDefinitions.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation.RoleDefinitionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RoleDefinitions. + */ +public interface RoleDefinitions extends SupportsCreating, HasInner { + /** + * Deletes a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String scope, String roleDefinitionId); + + /** + * Get role definition by name (GUID). + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String scope, String roleDefinitionId); + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByIdAsync(String roleId); + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String scope); + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManagementClientImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManagementClientImpl.java new file mode 100644 index 0000000000000..77a3552978671 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManagementClientImpl.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AuthorizationManagementClientImpl class. + */ +public class AuthorizationManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AuthorizationManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AuthorizationManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AuthorizationManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AuthorizationManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClassicAdministratorsInner object to access its operations. + */ + private ClassicAdministratorsInner classicAdministrators; + + /** + * Gets the ClassicAdministratorsInner object to access its operations. + * @return the ClassicAdministratorsInner object. + */ + public ClassicAdministratorsInner classicAdministrators() { + return this.classicAdministrators; + } + + /** + * The ProviderOperationsMetadatasInner object to access its operations. + */ + private ProviderOperationsMetadatasInner providerOperationsMetadatas; + + /** + * Gets the ProviderOperationsMetadatasInner object to access its operations. + * @return the ProviderOperationsMetadatasInner object. + */ + public ProviderOperationsMetadatasInner providerOperationsMetadatas() { + return this.providerOperationsMetadatas; + } + + /** + * The RoleAssignmentsInner object to access its operations. + */ + private RoleAssignmentsInner roleAssignments; + + /** + * Gets the RoleAssignmentsInner object to access its operations. + * @return the RoleAssignmentsInner object. + */ + public RoleAssignmentsInner roleAssignments() { + return this.roleAssignments; + } + + /** + * The PermissionsInner object to access its operations. + */ + private PermissionsInner permissions; + + /** + * Gets the PermissionsInner object to access its operations. + * @return the PermissionsInner object. + */ + public PermissionsInner permissions() { + return this.permissions; + } + + /** + * The RoleDefinitionsInner object to access its operations. + */ + private RoleDefinitionsInner roleDefinitions; + + /** + * Gets the RoleDefinitionsInner object to access its operations. + * @return the RoleDefinitionsInner object. + */ + public RoleDefinitionsInner roleDefinitions() { + return this.roleDefinitions; + } + + /** + * The DenyAssignmentsInner object to access its operations. + */ + private DenyAssignmentsInner denyAssignments; + + /** + * Gets the DenyAssignmentsInner object to access its operations. + * @return the DenyAssignmentsInner object. + */ + public DenyAssignmentsInner denyAssignments() { + return this.denyAssignments; + } + + /** + * Initializes an instance of AuthorizationManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AuthorizationManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AuthorizationManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AuthorizationManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AuthorizationManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AuthorizationManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.classicAdministrators = new ClassicAdministratorsInner(restClient().retrofit(), this); + this.providerOperationsMetadatas = new ProviderOperationsMetadatasInner(restClient().retrofit(), this); + this.roleAssignments = new RoleAssignmentsInner(restClient().retrofit(), this); + this.permissions = new PermissionsInner(restClient().retrofit(), this); + this.roleDefinitions = new RoleDefinitionsInner(restClient().retrofit(), this); + this.denyAssignments = new DenyAssignmentsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AuthorizationManagementClient", "2018-09-01-preiew"); + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManager.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManager.java new file mode 100644 index 0000000000000..cdf0e699de2b0 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/AuthorizationManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrators; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadatas; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Authorization resource management. + */ +public final class AuthorizationManager extends ManagerCore { + private ClassicAdministrators classicAdministrators; + private ProviderOperationsMetadatas providerOperationsMetadatas; + private RoleAssignments roleAssignments; + private Permissions permissions; + private RoleDefinitions roleDefinitions; + private DenyAssignments denyAssignments; + /** + * Get a Configurable instance that can be used to create AuthorizationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AuthorizationManager.ConfigurableImpl(); + } + /** + * Creates an instance of AuthorizationManager that exposes Authorization resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the AuthorizationManager + */ + public static AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new AuthorizationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of AuthorizationManager that exposes Authorization resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the AuthorizationManager + */ + public static AuthorizationManager authenticate(RestClient restClient, String subscriptionId) { + return new AuthorizationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AuthorizationManager that exposes Authorization management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Authorization management API entry points that work across subscriptions + */ + AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ClassicAdministrators. + */ + public ClassicAdministrators classicAdministrators() { + if (this.classicAdministrators == null) { + this.classicAdministrators = new ClassicAdministratorsImpl(this); + } + return this.classicAdministrators; + } + + /** + * @return Entry point to manage ProviderOperationsMetadatas. + */ + public ProviderOperationsMetadatas providerOperationsMetadatas() { + if (this.providerOperationsMetadatas == null) { + this.providerOperationsMetadatas = new ProviderOperationsMetadatasImpl(this); + } + return this.providerOperationsMetadatas; + } + + /** + * @return Entry point to manage RoleAssignments. + */ + public RoleAssignments roleAssignments() { + if (this.roleAssignments == null) { + this.roleAssignments = new RoleAssignmentsImpl(this); + } + return this.roleAssignments; + } + + /** + * @return Entry point to manage Permissions. + */ + public Permissions permissions() { + if (this.permissions == null) { + this.permissions = new PermissionsImpl(this); + } + return this.permissions; + } + + /** + * @return Entry point to manage RoleDefinitions. + */ + public RoleDefinitions roleDefinitions() { + if (this.roleDefinitions == null) { + this.roleDefinitions = new RoleDefinitionsImpl(this); + } + return this.roleDefinitions; + } + + /** + * @return Entry point to manage DenyAssignments. + */ + public DenyAssignments denyAssignments() { + if (this.denyAssignments == null) { + this.denyAssignments = new DenyAssignmentsImpl(this); + } + return this.denyAssignments; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AuthorizationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private AuthorizationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AuthorizationManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorImpl.java new file mode 100644 index 0000000000000..416a1234f1bef --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrator; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ClassicAdministratorImpl extends WrapperImpl implements ClassicAdministrator { + private final AuthorizationManager manager; + + ClassicAdministratorImpl(ClassicAdministratorInner inner, AuthorizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + + + @Override + public String emailAddress() { + return this.inner().emailAddress(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String role() { + return this.inner().role(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorInner.java new file mode 100644 index 0000000000000..037f212ed2cbf --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorInner.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Classic Administrators. + */ +@JsonFlatten +public class ClassicAdministratorInner { + /** + * The ID of the administrator. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the administrator. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The type of the administrator. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The email address of the administrator. + */ + @JsonProperty(value = "properties.emailAddress") + private String emailAddress; + + /** + * The role of the administrator. + */ + @JsonProperty(value = "properties.role") + private String role; + + /** + * Get the ID of the administrator. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the administrator. + * + * @param id the id value to set + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the administrator. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the administrator. + * + * @param name the name value to set + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the administrator. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the administrator. + * + * @param type the type value to set + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the email address of the administrator. + * + * @return the emailAddress value + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the email address of the administrator. + * + * @param emailAddress the emailAddress value to set + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get the role of the administrator. + * + * @return the role value + */ + public String role() { + return this.role; + } + + /** + * Set the role of the administrator. + * + * @param role the role value to set + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withRole(String role) { + this.role = role; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsImpl.java new file mode 100644 index 0000000000000..8291c80fec832 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrators; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrator; + +class ClassicAdministratorsImpl extends WrapperImpl implements ClassicAdministrators { + private PagedListConverter converter; + private final AuthorizationManager manager; + + ClassicAdministratorsImpl(AuthorizationManager manager) { + super(manager.inner().classicAdministrators()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(ClassicAdministratorInner inner) { + return Observable.just((ClassicAdministrator) wrapModel(inner)); + } + }; + } + + public AuthorizationManager manager() { + return this.manager; + } + + private ClassicAdministratorImpl wrapModel(ClassicAdministratorInner inner) { + return new ClassicAdministratorImpl(inner, manager()); + } + + @Override + public PagedList list() { + ClassicAdministratorsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + ClassicAdministratorsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ClassicAdministrator call(ClassicAdministratorInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsInner.java new file mode 100644 index 0000000000000..25e2b3886d873 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ClassicAdministratorsInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ClassicAdministrators. + */ +public class ClassicAdministratorsInner { + /** The Retrofit service to perform REST calls. */ + private ClassicAdministratorsService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ClassicAdministratorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClassicAdministratorsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(ClassicAdministratorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClassicAdministrators to be + * used by Retrofit to perform actually REST calls. + */ + interface ClassicAdministratorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrators list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.ClassicAdministrators listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClassicAdministratorInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClassicAdministratorInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClassicAdministratorInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClassicAdministratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2015-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClassicAdministratorInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClassicAdministratorInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClassicAdministratorInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets service administrator, account administrator, and co-administrators for the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClassicAdministratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentImpl.java new file mode 100644 index 0000000000000..efdc3105b5599 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignment; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Principal; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignmentPermission; + +class DenyAssignmentImpl extends WrapperImpl implements DenyAssignment { + private final AuthorizationManager manager; + DenyAssignmentImpl(DenyAssignmentInner inner, AuthorizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public String denyAssignmentName() { + return this.inner().denyAssignmentName(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public Boolean doNotApplyToChildScopes() { + return this.inner().doNotApplyToChildScopes(); + } + + @Override + public List excludePrincipals() { + return this.inner().excludePrincipals(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isSystemProtected() { + return this.inner().isSystemProtected(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List permissions() { + return this.inner().permissions(); + } + + @Override + public List principals() { + return this.inner().principals(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentInner.java new file mode 100644 index 0000000000000..71a29e51c5745 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentInner.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignmentPermission; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Principal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Deny Assignment. + */ +@JsonFlatten +public class DenyAssignmentInner { + /** + * The deny assignment ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The deny assignment name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The deny assignment type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The display name of the deny assignment. + */ + @JsonProperty(value = "properties.denyAssignmentName") + private String denyAssignmentName; + + /** + * The description of the deny assignment. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * An array of permissions that are denied by the deny assignment. + */ + @JsonProperty(value = "properties.permissions") + private List permissions; + + /** + * The deny assignment scope. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * Determines if the deny assignment applies to child scopes. Default value + * is false. + */ + @JsonProperty(value = "properties.doNotApplyToChildScopes") + private Boolean doNotApplyToChildScopes; + + /** + * Array of principals to which the deny assignment applies. + */ + @JsonProperty(value = "properties.principals") + private List principals; + + /** + * Array of principals to which the deny assignment does not apply. + */ + @JsonProperty(value = "properties.excludePrincipals") + private List excludePrincipals; + + /** + * Specifies whether this deny assignment was created by Azure and cannot + * be edited or deleted. + */ + @JsonProperty(value = "properties.isSystemProtected") + private Boolean isSystemProtected; + + /** + * Get the deny assignment ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the deny assignment name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the deny assignment type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the display name of the deny assignment. + * + * @return the denyAssignmentName value + */ + public String denyAssignmentName() { + return this.denyAssignmentName; + } + + /** + * Set the display name of the deny assignment. + * + * @param denyAssignmentName the denyAssignmentName value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDenyAssignmentName(String denyAssignmentName) { + this.denyAssignmentName = denyAssignmentName; + return this; + } + + /** + * Get the description of the deny assignment. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the deny assignment. + * + * @param description the description value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get an array of permissions that are denied by the deny assignment. + * + * @return the permissions value + */ + public List permissions() { + return this.permissions; + } + + /** + * Set an array of permissions that are denied by the deny assignment. + * + * @param permissions the permissions value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the deny assignment scope. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the deny assignment scope. + * + * @param scope the scope value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get determines if the deny assignment applies to child scopes. Default value is false. + * + * @return the doNotApplyToChildScopes value + */ + public Boolean doNotApplyToChildScopes() { + return this.doNotApplyToChildScopes; + } + + /** + * Set determines if the deny assignment applies to child scopes. Default value is false. + * + * @param doNotApplyToChildScopes the doNotApplyToChildScopes value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDoNotApplyToChildScopes(Boolean doNotApplyToChildScopes) { + this.doNotApplyToChildScopes = doNotApplyToChildScopes; + return this; + } + + /** + * Get array of principals to which the deny assignment applies. + * + * @return the principals value + */ + public List principals() { + return this.principals; + } + + /** + * Set array of principals to which the deny assignment applies. + * + * @param principals the principals value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withPrincipals(List principals) { + this.principals = principals; + return this; + } + + /** + * Get array of principals to which the deny assignment does not apply. + * + * @return the excludePrincipals value + */ + public List excludePrincipals() { + return this.excludePrincipals; + } + + /** + * Set array of principals to which the deny assignment does not apply. + * + * @param excludePrincipals the excludePrincipals value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withExcludePrincipals(List excludePrincipals) { + this.excludePrincipals = excludePrincipals; + return this; + } + + /** + * Get specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + * + * @return the isSystemProtected value + */ + public Boolean isSystemProtected() { + return this.isSystemProtected; + } + + /** + * Set specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + * + * @param isSystemProtected the isSystemProtected value to set + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withIsSystemProtected(Boolean isSystemProtected) { + this.isSystemProtected = isSystemProtected; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsImpl.java new file mode 100644 index 0000000000000..286574d2ea8c2 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsImpl.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignment; + +class DenyAssignmentsImpl extends WrapperImpl implements DenyAssignments { + private final AuthorizationManager manager; + + DenyAssignmentsImpl(AuthorizationManager manager) { + super(manager.inner().denyAssignments()); + this.manager = manager; + } + + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + DenyAssignmentsInner client = this.inner(); + return client.listForResourceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String scope, String denyAssignmentId) { + DenyAssignmentsInner client = this.inner(); + return client.getAsync(scope, denyAssignmentId) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByIdAsync(String denyAssignmentId) { + DenyAssignmentsInner client = this.inner(); + return client.getByIdAsync(denyAssignmentId) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + DenyAssignmentsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + DenyAssignmentsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listForScopeAsync(final String scope) { + DenyAssignmentsInner client = this.inner(); + return client.listForScopeAsync(scope) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DenyAssignment call(DenyAssignmentInner inner) { + return new DenyAssignmentImpl(inner, manager()); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java new file mode 100644 index 0000000000000..887bf27ef6655 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java @@ -0,0 +1,1644 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DenyAssignments. + */ +public class DenyAssignmentsInner implements InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DenyAssignmentsService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of DenyAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DenyAssignmentsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(DenyAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DenyAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface DenyAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listForResource" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments") + Observable> listForResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments get" }) + @GET("{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}") + Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("denyAssignmentId") String denyAssignmentId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments getById" }) + @GET("{denyAssignmentId}") + Observable> getById(@Path(value = "denyAssignmentId", encoded = true) String denyAssignmentId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listForScope" }) + @GET("{scope}/providers/Microsoft.Authorization/denyAssignments") + Observable> listForScope(@Path(value = "scope", encoded = true) String scope, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listForResourceNext" }) + @GET + Observable> listForResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.DenyAssignments listForScopeNext" }) + @GET + Observable> listForScopeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + final String filter = null; + return service.listForResource(this.client.subscriptionId(), resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. + ServiceResponse> * @param parentResourcePath The parent resource identity. + ServiceResponse> * @param resourceType The resource type of the resource. + ServiceResponse> * @param resourceName The name of the resource to get deny assignments for. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.listForResource(this.client.subscriptionId(), resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + final String filter = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all deny assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all deny assignments for the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all deny assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + final String filter = null; + return service.list(this.client.subscriptionId(), apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList list(final String filter) { + ServiceResponse> response = listSinglePageAsync(filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listAsync(final String filter) { + return listWithServiceResponseAsync(filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter) { + return listSinglePageAsync(filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.list(this.client.subscriptionId(), apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DenyAssignmentInner object if successful. + */ + public DenyAssignmentInner get(String scope, String denyAssignmentId) { + return getWithServiceResponseAsync(scope, denyAssignmentId).toBlocking().single().body(); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String scope, String denyAssignmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, denyAssignmentId), serviceCallback); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DenyAssignmentInner object + */ + public Observable getAsync(String scope, String denyAssignmentId) { + return getWithServiceResponseAsync(scope, denyAssignmentId).map(new Func1, DenyAssignmentInner>() { + @Override + public DenyAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DenyAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String scope, String denyAssignmentId) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (denyAssignmentId == null) { + throw new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.get(scope, denyAssignmentId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DenyAssignmentInner object if successful. + */ + public DenyAssignmentInner getById(String denyAssignmentId) { + return getByIdWithServiceResponseAsync(denyAssignmentId).toBlocking().single().body(); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny assignments. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByIdAsync(String denyAssignmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByIdWithServiceResponseAsync(denyAssignmentId), serviceCallback); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DenyAssignmentInner object + */ + public Observable getByIdAsync(String denyAssignmentId) { + return getByIdWithServiceResponseAsync(denyAssignmentId).map(new Func1, DenyAssignmentInner>() { + @Override + public DenyAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DenyAssignmentInner object + */ + public Observable> getByIdWithServiceResponseAsync(String denyAssignmentId) { + if (denyAssignmentId == null) { + throw new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.getById(denyAssignmentId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForScope(final String scope) { + ServiceResponse> response = listForScopeSinglePageAsync(scope).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeSinglePageAsync(scope), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForScopeAsync(final String scope) { + return listForScopeWithServiceResponseAsync(scope) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForScopeWithServiceResponseAsync(final String scope) { + return listForScopeSinglePageAsync(scope) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeSinglePageAsync(final String scope) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + final String filter = null; + return service.listForScope(scope, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForScope(final String scope, final String filter) { + ServiceResponse> response = listForScopeSinglePageAsync(scope, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeAsync(final String scope, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeSinglePageAsync(scope, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForScopeAsync(final String scope, final String filter) { + return listForScopeWithServiceResponseAsync(scope, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForScopeWithServiceResponseAsync(final String scope, final String filter) { + return listForScopeSinglePageAsync(scope, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + ServiceResponse> * @param scope The scope of the deny assignments. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and below the scope for the specified principal. This filter is different from the principalId filter as it returns not only those deny assignments that contain the specified principal is the Principals list but also those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeSinglePageAsync(final String scope, final String filter) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-07-01-preview"; + return service.listForScope(scope, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deny assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForResourceNext(final String nextPageLink) { + ServiceResponse> response = listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForResourceNextAsync(final String nextPageLink) { + return listForResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listForResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deny assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all deny assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all deny assignments for the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deny assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DenyAssignmentInner> object if successful. + */ + public PagedList listForScopeNext(final String nextPageLink) { + ServiceResponse> response = listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets deny assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets deny assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable> listForScopeNextAsync(final String nextPageLink) { + return listForScopeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DenyAssignmentInner> object + */ + public Observable>> listForScopeNextWithServiceResponseAsync(final String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets deny assignments for a scope. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DenyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listForScopeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForScopeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/IdParsingUtils.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..09d80e98ebcf5 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PageImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..f7c350095f400 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionImpl.java new file mode 100644 index 0000000000000..2fd2a9698a728 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Permission; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PermissionImpl extends WrapperImpl implements Permission { + private final AuthorizationManager manager; + PermissionImpl(PermissionInner inner, AuthorizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public List dataActions() { + return this.inner().dataActions(); + } + + @Override + public List notActions() { + return this.inner().notActions(); + } + + @Override + public List notDataActions() { + return this.inner().notDataActions(); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionInner.java new file mode 100644 index 0000000000000..769e62f64ff79 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionInner.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Role definition permissions. + */ +public class PermissionInner { + /** + * Allowed actions. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Denied actions. + */ + @JsonProperty(value = "notActions") + private List notActions; + + /** + * Allowed Data actions. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /** + * Denied Data actions. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /** + * Get allowed actions. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set allowed actions. + * + * @param actions the actions value to set + * @return the PermissionInner object itself. + */ + public PermissionInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get denied actions. + * + * @return the notActions value + */ + public List notActions() { + return this.notActions; + } + + /** + * Set denied actions. + * + * @param notActions the notActions value to set + * @return the PermissionInner object itself. + */ + public PermissionInner withNotActions(List notActions) { + this.notActions = notActions; + return this; + } + + /** + * Get allowed Data actions. + * + * @return the dataActions value + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set allowed Data actions. + * + * @param dataActions the dataActions value to set + * @return the PermissionInner object itself. + */ + public PermissionInner withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get denied Data actions. + * + * @return the notDataActions value + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set denied Data actions. + * + * @param notDataActions the notDataActions value to set + * @return the PermissionInner object itself. + */ + public PermissionInner withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsImpl.java new file mode 100644 index 0000000000000..c46e07fa13efd --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Permission; + +class PermissionsImpl extends WrapperImpl implements Permissions { + private final AuthorizationManager manager; + + PermissionsImpl(AuthorizationManager manager) { + super(manager.inner().permissions()); + this.manager = manager; + } + + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + PermissionsInner client = this.inner(); + return client.listForResourceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Permission call(PermissionInner inner) { + return new PermissionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + PermissionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Permission call(PermissionInner inner) { + return new PermissionImpl(inner, manager()); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsInner.java new file mode 100644 index 0000000000000..babe3db4f91e7 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/PermissionsInner.java @@ -0,0 +1,557 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Permissions. + */ +public class PermissionsInner { + /** The Retrofit service to perform REST calls. */ + private PermissionsService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of PermissionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PermissionsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(PermissionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Permissions to be + * used by Retrofit to perform actually REST calls. + */ + interface PermissionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions listForResource" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions") + Observable> listForResource(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.Permissions listForResourceNext" }) + @GET + Observable> listForResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PermissionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all permissions the caller has for a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PermissionInner> object if successful. + */ + public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all permissions the caller has for a resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. + ServiceResponse> * @param parentResourcePath The parent resource identity. + ServiceResponse> * @param resourceType The resource type of the resource. + ServiceResponse> * @param resourceName The name of the resource to get the permissions for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PermissionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all permissions the caller has for a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PermissionInner> object if successful. + */ + public PagedList listForResourceNext(final String nextPageLink) { + ServiceResponse> response = listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable> listForResourceNextAsync(final String nextPageLink) { + return listForResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PermissionInner> object + */ + public Observable>> listForResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all permissions the caller has for a resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listForResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataImpl.java new file mode 100644 index 0000000000000..b6b7c0a0ffc6e --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadata; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperation; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ResourceType; + +class ProviderOperationsMetadataImpl extends WrapperImpl implements ProviderOperationsMetadata { + private final AuthorizationManager manager; + ProviderOperationsMetadataImpl(ProviderOperationsMetadataInner inner, AuthorizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List operations() { + return this.inner().operations(); + } + + @Override + public List resourceTypes() { + return this.inner().resourceTypes(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataInner.java new file mode 100644 index 0000000000000..a79e2db5cf41f --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadataInner.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ResourceType; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provider Operations metadata. + */ +public class ProviderOperationsMetadataInner { + /** + * The provider id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The provider name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The provider type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The provider display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The provider resource types. + */ + @JsonProperty(value = "resourceTypes") + private List resourceTypes; + + /** + * The provider operations. + */ + @JsonProperty(value = "operations") + private List operations; + + /** + * Get the provider id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the provider id. + * + * @param id the id value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the provider name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the provider name. + * + * @param name the name value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provider type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the provider type. + * + * @param type the type value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the provider display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the provider display name. + * + * @param displayName the displayName value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the provider resource types. + * + * @return the resourceTypes value + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the provider resource types. + * + * @param resourceTypes the resourceTypes value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the provider operations. + * + * @return the operations value + */ + public List operations() { + return this.operations; + } + + /** + * Set the provider operations. + * + * @param operations the operations value to set + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withOperations(List operations) { + this.operations = operations; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasImpl.java new file mode 100644 index 0000000000000..0f6b4e1766a6d --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadatas; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadata; + +class ProviderOperationsMetadatasImpl extends WrapperImpl implements ProviderOperationsMetadatas { + private final AuthorizationManager manager; + + ProviderOperationsMetadatasImpl(AuthorizationManager manager) { + super(manager.inner().providerOperationsMetadatas()); + this.manager = manager; + } + + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceProviderNamespace) { + ProviderOperationsMetadatasInner client = this.inner(); + return client.getAsync(resourceProviderNamespace) + .map(new Func1() { + @Override + public ProviderOperationsMetadata call(ProviderOperationsMetadataInner inner) { + return new ProviderOperationsMetadataImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + ProviderOperationsMetadatasInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProviderOperationsMetadata call(ProviderOperationsMetadataInner inner) { + return new ProviderOperationsMetadataImpl(inner, manager()); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasInner.java new file mode 100644 index 0000000000000..f87f1506b2a55 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/ProviderOperationsMetadatasInner.java @@ -0,0 +1,534 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProviderOperationsMetadatas. + */ +public class ProviderOperationsMetadatasInner { + /** The Retrofit service to perform REST calls. */ + private ProviderOperationsMetadatasService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ProviderOperationsMetadatasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProviderOperationsMetadatasInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(ProviderOperationsMetadatasService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProviderOperationsMetadatas to be + * used by Retrofit to perform actually REST calls. + */ + interface ProviderOperationsMetadatasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadatas get" }) + @GET("providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}") + Observable> get(@Path("resourceProviderNamespace") String resourceProviderNamespace, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadatas list" }) + @GET("providers/Microsoft.Authorization/providerOperations") + Observable> list(@Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.ProviderOperationsMetadatas listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProviderOperationsMetadataInner object if successful. + */ + public ProviderOperationsMetadataInner get(String resourceProviderNamespace) { + return getWithServiceResponseAsync(resourceProviderNamespace).toBlocking().single().body(); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceProviderNamespace, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceProviderNamespace), serviceCallback); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProviderOperationsMetadataInner object + */ + public Observable getAsync(String resourceProviderNamespace) { + return getWithServiceResponseAsync(resourceProviderNamespace).map(new Func1, ProviderOperationsMetadataInner>() { + @Override + public ProviderOperationsMetadataInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProviderOperationsMetadataInner object + */ + public Observable> getWithServiceResponseAsync(String resourceProviderNamespace) { + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + final String expand = null; + return service.get(resourceProviderNamespace, apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProviderOperationsMetadataInner object if successful. + */ + public ProviderOperationsMetadataInner get(String resourceProviderNamespace, String expand) { + return getWithServiceResponseAsync(resourceProviderNamespace, expand).toBlocking().single().body(); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceProviderNamespace, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceProviderNamespace, expand), serviceCallback); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProviderOperationsMetadataInner object + */ + public Observable getAsync(String resourceProviderNamespace, String expand) { + return getWithServiceResponseAsync(resourceProviderNamespace, expand).map(new Func1, ProviderOperationsMetadataInner>() { + @Override + public ProviderOperationsMetadataInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProviderOperationsMetadataInner object + */ + public Observable> getWithServiceResponseAsync(String resourceProviderNamespace, String expand) { + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.get(resourceProviderNamespace, apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProviderOperationsMetadataInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProviderOperationsMetadataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2018-01-01-preview"; + final String expand = null; + return service.list(apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProviderOperationsMetadataInner> object if successful. + */ + public PagedList list(final String expand) { + ServiceResponse> response = listSinglePageAsync(expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable> listAsync(final String expand) { + return listWithServiceResponseAsync(expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable>> listWithServiceResponseAsync(final String expand) { + return listSinglePageAsync(expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + ServiceResponse> * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProviderOperationsMetadataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String expand) { + final String apiVersion = "2018-01-01-preview"; + return service.list(apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProviderOperationsMetadataInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProviderOperationsMetadataInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets provider operations metadata for all resource providers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProviderOperationsMetadataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentImpl.java new file mode 100644 index 0000000000000..5fd31a21099fd --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignmentCreateParameters; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.PrincipalType; +import rx.functions.Func1; + +class RoleAssignmentImpl extends CreatableUpdatableImpl implements RoleAssignment, RoleAssignment.Definition, RoleAssignment.Update { + private final AuthorizationManager manager; + private String scope; + private String roleAssignmentName; + private RoleAssignmentCreateParameters createOrUpdateParameter; + + RoleAssignmentImpl(String name, AuthorizationManager manager) { + super(name, new RoleAssignmentInner()); + this.manager = manager; + // Set resource name + this.roleAssignmentName = name; + // + this.createOrUpdateParameter = new RoleAssignmentCreateParameters(); + } + + RoleAssignmentImpl(RoleAssignmentInner inner, AuthorizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.roleAssignmentName = inner.name(); + // set resource ancestor and positional variables + this.roleAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "roleAssignments"); + this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0); + // + this.createOrUpdateParameter = new RoleAssignmentCreateParameters(); + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoleAssignmentsInner client = this.manager().inner().roleAssignments(); + return client.createAsync(this.scope, this.roleAssignmentName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public RoleAssignmentInner call(RoleAssignmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoleAssignmentsInner client = this.manager().inner().roleAssignments(); + return client.createAsync(this.scope, this.roleAssignmentName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public RoleAssignmentInner call(RoleAssignmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoleAssignmentsInner client = this.manager().inner().roleAssignments(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new RoleAssignmentCreateParameters(); + } + + @Override + public Boolean canDelegate() { + return this.inner().canDelegate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String principalId() { + return this.inner().principalId(); + } + + @Override + public String roleDefinitionId() { + return this.inner().roleDefinitionId(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RoleAssignmentImpl withExistingProvider() { + return this; + } + + @Override + public RoleAssignmentImpl withScope(String scope) { + this.scope = scope; + return this; + } + + @Override + public RoleAssignmentImpl withPrincipalId(String principalId) { + this.createOrUpdateParameter.withPrincipalId(principalId); + return this; + } + + @Override + public RoleAssignmentImpl withRoleDefinitionId(String roleDefinitionId) { + this.createOrUpdateParameter.withRoleDefinitionId(roleDefinitionId); + return this; + } + + @Override + public RoleAssignmentImpl withCanDelegate(Boolean canDelegate) { + this.createOrUpdateParameter.withCanDelegate(canDelegate); + return this; + } + + @Override + public RoleAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.createOrUpdateParameter.withPrincipalType(principalType); + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentInner.java new file mode 100644 index 0000000000000..cf55ba4fe6b32 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Role Assignments. + */ +@JsonFlatten +public class RoleAssignmentInner { + /** + * The role assignment ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The role assignment name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The role assignment type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The role assignment scope. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The role definition ID. + */ + @JsonProperty(value = "properties.roleDefinitionId") + private String roleDefinitionId; + + /** + * The principal ID. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /** + * The Delegation flag for the roleassignment. + */ + @JsonProperty(value = "properties.canDelegate") + private Boolean canDelegate; + + /** + * Get the role assignment ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the role assignment name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the role assignment type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the role assignment scope. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the role assignment scope. + * + * @param scope the scope value to set + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the role definition ID. + * + * @return the roleDefinitionId value + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principal ID. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal ID. + * + * @param principalId the principalId value to set + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the Delegation flag for the roleassignment. + * + * @return the canDelegate value + */ + public Boolean canDelegate() { + return this.canDelegate; + } + + /** + * Set the Delegation flag for the roleassignment. + * + * @param canDelegate the canDelegate value to set + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withCanDelegate(Boolean canDelegate) { + this.canDelegate = canDelegate; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsImpl.java new file mode 100644 index 0000000000000..ed97f5261414c --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignment; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignmentCreateParameters; + +class RoleAssignmentsImpl extends WrapperImpl implements RoleAssignments { + private final AuthorizationManager manager; + + RoleAssignmentsImpl(AuthorizationManager manager) { + super(manager.inner().roleAssignments()); + this.manager = manager; + } + + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public RoleAssignmentImpl define(String name) { + return wrapModel(name); + } + + private RoleAssignmentImpl wrapModel(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + + private RoleAssignmentImpl wrapModel(String name) { + return new RoleAssignmentImpl(name, this.manager()); + } + + @Override + public Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + RoleAssignmentsInner client = this.inner(); + return client.listForResourceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteAsync(String scope, String roleAssignmentName) { + RoleAssignmentsInner client = this.inner(); + return client.deleteAsync(scope, roleAssignmentName) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String scope, String roleAssignmentName) { + RoleAssignmentsInner client = this.inner(); + return client.getAsync(scope, roleAssignmentName) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteByIdAsync(String roleId) { + RoleAssignmentsInner client = this.inner(); + return client.deleteByIdAsync(roleId) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable createByIdAsync(String roleId, RoleAssignmentCreateParameters parameters) { + RoleAssignmentsInner client = this.inner(); + return client.createByIdAsync(roleId, parameters) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByIdAsync(String roleId) { + RoleAssignmentsInner client = this.inner(); + return client.getByIdAsync(roleId) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + RoleAssignmentsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + RoleAssignmentsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listForScopeAsync(final String scope) { + RoleAssignmentsInner client = this.inner(); + return client.listForScopeAsync(scope) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RoleAssignment call(RoleAssignmentInner inner) { + return new RoleAssignmentImpl(inner, manager()); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsInner.java new file mode 100644 index 0000000000000..62e94e4ba771e --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsInner.java @@ -0,0 +1,1992 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignmentCreateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RoleAssignments. + */ +public class RoleAssignmentsInner implements InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RoleAssignmentsService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoleAssignmentsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(RoleAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RoleAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface RoleAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listForResource" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments") + Observable> listForResource(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments delete" }) + @HTTP(path = "{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "scope", encoded = true) String scope, @Path("roleAssignmentName") String roleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments create" }) + @PUT("{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") + Observable> create(@Path(value = "scope", encoded = true) String scope, @Path("roleAssignmentName") String roleAssignmentName, @Body RoleAssignmentCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments get" }) + @GET("{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") + Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("roleAssignmentName") String roleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments deleteById" }) + @HTTP(path = "{roleId}", method = "DELETE", hasBody = true) + Observable> deleteById(@Path(value = "roleId", encoded = true) String roleId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments createById" }) + @PUT("{roleId}") + Observable> createById(@Path(value = "roleId", encoded = true) String roleId, @Body RoleAssignmentCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments getById" }) + @GET("{roleId}") + Observable> getById(@Path(value = "roleId", encoded = true) String roleId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listForScope" }) + @GET("{scope}/providers/Microsoft.Authorization/roleAssignments") + Observable> listForScope(@Path(value = "scope", encoded = true) String scope, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listForResourceNext" }) + @GET + Observable> listForResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleAssignments listForScopeNext" }) + @GET + Observable> listForScopeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + final String filter = null; + return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get role assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. + ServiceResponse> * @param parentResourcePath The parent resource identity. + ServiceResponse> * @param resourceType The resource type of the resource. + ServiceResponse> * @param resourceName The name of the resource to get role assignments for. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + final String filter = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a role assignment. + * + * @param scope The scope of the role assignment to delete. + * @param roleAssignmentName The name of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner delete(String scope, String roleAssignmentName) { + return deleteWithServiceResponseAsync(scope, roleAssignmentName).toBlocking().single().body(); + } + + /** + * Deletes a role assignment. + * + * @param scope The scope of the role assignment to delete. + * @param roleAssignmentName The name of the role assignment to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String scope, String roleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, roleAssignmentName), serviceCallback); + } + + /** + * Deletes a role assignment. + * + * @param scope The scope of the role assignment to delete. + * @param roleAssignmentName The name of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable deleteAsync(String scope, String roleAssignmentName) { + return deleteWithServiceResponseAsync(scope, roleAssignmentName).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a role assignment. + * + * @param scope The scope of the role assignment to delete. + * @param roleAssignmentName The name of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> deleteWithServiceResponseAsync(String scope, String roleAssignmentName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleAssignmentName == null) { + throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.delete(scope, roleAssignmentName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a role assignment. + * + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner create(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + return createWithServiceResponseAsync(scope, roleAssignmentName, parameters).toBlocking().single().body(); + } + + /** + * Creates a role assignment. + * + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(scope, roleAssignmentName, parameters), serviceCallback); + } + + /** + * Creates a role assignment. + * + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable createAsync(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + return createWithServiceResponseAsync(scope, roleAssignmentName, parameters).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a role assignment. + * + * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> createWithServiceResponseAsync(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleAssignmentName == null) { + throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-09-01-preview"; + return service.create(scope, roleAssignmentName, parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified role assignment. + * + * @param scope The scope of the role assignment. + * @param roleAssignmentName The name of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner get(String scope, String roleAssignmentName) { + return getWithServiceResponseAsync(scope, roleAssignmentName).toBlocking().single().body(); + } + + /** + * Get the specified role assignment. + * + * @param scope The scope of the role assignment. + * @param roleAssignmentName The name of the role assignment to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String scope, String roleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, roleAssignmentName), serviceCallback); + } + + /** + * Get the specified role assignment. + * + * @param scope The scope of the role assignment. + * @param roleAssignmentName The name of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable getAsync(String scope, String roleAssignmentName) { + return getWithServiceResponseAsync(scope, roleAssignmentName).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified role assignment. + * + * @param scope The scope of the role assignment. + * @param roleAssignmentName The name of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String scope, String roleAssignmentName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleAssignmentName == null) { + throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.get(scope, roleAssignmentName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a role assignment. + * + * @param roleId The ID of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner deleteById(String roleId) { + return deleteByIdWithServiceResponseAsync(roleId).toBlocking().single().body(); + } + + /** + * Deletes a role assignment. + * + * @param roleId The ID of the role assignment to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteByIdAsync(String roleId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteByIdWithServiceResponseAsync(roleId), serviceCallback); + } + + /** + * Deletes a role assignment. + * + * @param roleId The ID of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable deleteByIdAsync(String roleId) { + return deleteByIdWithServiceResponseAsync(roleId).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a role assignment. + * + * @param roleId The ID of the role assignment to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> deleteByIdWithServiceResponseAsync(String roleId) { + if (roleId == null) { + throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.deleteById(roleId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a role assignment by ID. + * + * @param roleId The ID of the role assignment to create. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner createById(String roleId, RoleAssignmentCreateParameters parameters) { + return createByIdWithServiceResponseAsync(roleId, parameters).toBlocking().single().body(); + } + + /** + * Creates a role assignment by ID. + * + * @param roleId The ID of the role assignment to create. + * @param parameters Parameters for the role assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createByIdAsync(String roleId, RoleAssignmentCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createByIdWithServiceResponseAsync(roleId, parameters), serviceCallback); + } + + /** + * Creates a role assignment by ID. + * + * @param roleId The ID of the role assignment to create. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable createByIdAsync(String roleId, RoleAssignmentCreateParameters parameters) { + return createByIdWithServiceResponseAsync(roleId, parameters).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a role assignment by ID. + * + * @param roleId The ID of the role assignment to create. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> createByIdWithServiceResponseAsync(String roleId, RoleAssignmentCreateParameters parameters) { + if (roleId == null) { + throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-09-01-preview"; + return service.createById(roleId, parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a role assignment by ID. + * + * @param roleId The ID of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleAssignmentInner object if successful. + */ + public RoleAssignmentInner getById(String roleId) { + return getByIdWithServiceResponseAsync(roleId).toBlocking().single().body(); + } + + /** + * Gets a role assignment by ID. + * + * @param roleId The ID of the role assignment to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByIdAsync(String roleId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByIdWithServiceResponseAsync(roleId), serviceCallback); + } + + /** + * Gets a role assignment by ID. + * + * @param roleId The ID of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable getByIdAsync(String roleId) { + return getByIdWithServiceResponseAsync(roleId).map(new Func1, RoleAssignmentInner>() { + @Override + public RoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a role assignment by ID. + * + * @param roleId The ID of the role assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleAssignmentInner object + */ + public Observable> getByIdWithServiceResponseAsync(String roleId) { + if (roleId == null) { + throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.getById(roleId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all role assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all role assignments for the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all role assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + final String filter = null; + return service.list(this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList list(final String filter) { + ServiceResponse> response = listSinglePageAsync(filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all role assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all role assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listAsync(final String filter) { + return listWithServiceResponseAsync(filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter) { + return listSinglePageAsync(filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.list(this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForScope(final String scope) { + ServiceResponse> response = listForScopeSinglePageAsync(scope).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeSinglePageAsync(scope), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForScopeAsync(final String scope) { + return listForScopeWithServiceResponseAsync(scope) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForScopeWithServiceResponseAsync(final String scope) { + return listForScopeSinglePageAsync(scope) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeSinglePageAsync(final String scope) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + final String filter = null; + return service.listForScope(scope, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForScope(final String scope, final String filter) { + ServiceResponse> response = listForScopeSinglePageAsync(scope, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeAsync(final String scope, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeSinglePageAsync(scope, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForScopeAsync(final String scope, final String filter) { + return listForScopeWithServiceResponseAsync(scope, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a scope. + * + * @param scope The scope of the role assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForScopeWithServiceResponseAsync(final String scope, final String filter) { + return listForScopeSinglePageAsync(scope, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a scope. + * + ServiceResponse> * @param scope The scope of the role assignments. + ServiceResponse> * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeSinglePageAsync(final String scope, final String filter) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-09-01-preview"; + return service.listForScope(scope, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets role assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForResourceNext(final String nextPageLink) { + ServiceResponse> response = listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForResourceNextAsync(final String nextPageLink) { + return listForResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listForResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listForResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets role assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all role assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all role assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all role assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all role assignments for the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets role assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleAssignmentInner> object if successful. + */ + public PagedList listForScopeNext(final String nextPageLink) { + ServiceResponse> response = listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets role assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listForScopeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForScopeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets role assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable> listForScopeNextAsync(final String nextPageLink) { + return listForScopeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets role assignments for a scope. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleAssignmentInner> object + */ + public Observable>> listForScopeNextWithServiceResponseAsync(final String nextPageLink) { + return listForScopeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listForScopeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets role assignments for a scope. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleAssignmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForScopeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listForScopeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForScopeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForScopeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionImpl.java new file mode 100644 index 0000000000000..534bc1d2a5c1d --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinition; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.Permission; + +class RoleDefinitionImpl extends CreatableUpdatableImpl implements RoleDefinition, RoleDefinition.Definition, RoleDefinition.Update { + private String scope; + private String roleDefinitionId; + private final AuthorizationManager manager; + + RoleDefinitionImpl(String name, AuthorizationManager manager) { + super(name, new RoleDefinitionInner()); + this.manager = manager; + // Set resource name + this.roleDefinitionId = name; + // + } + + RoleDefinitionImpl(RoleDefinitionInner inner, AuthorizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.roleDefinitionId = inner.name(); + // set resource ancestor and positional variables + this.roleDefinitionId = IdParsingUtils.getValueFromIdByName(inner.id(), "roleDefinitions"); + this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0); + // set other parameters for create and update + } + + @Override + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoleDefinitionsInner client = this.manager().inner().roleDefinitions(); + return client.createOrUpdateAsync(this.scope, this.roleDefinitionId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoleDefinitionsInner client = this.manager().inner().roleDefinitions(); + return client.createOrUpdateAsync(this.scope, this.roleDefinitionId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoleDefinitionsInner client = this.manager().inner().roleDefinitions(); + return client.getAsync(this.scope, this.roleDefinitionId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List assignableScopes() { + return this.inner().assignableScopes(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List permissions() { + List lst = new ArrayList(); + if (this.inner().permissions() != null) { + for (PermissionInner inner : this.inner().permissions()) { + lst.add( new PermissionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String roleName() { + return this.inner().roleName(); + } + + @Override + public String roleType() { + return this.inner().roleType(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RoleDefinitionImpl withScope(String scope) { + this.scope = scope; + return this; + } + + @Override + public RoleDefinitionImpl withAssignableScopes(List assignableScopes) { + this.inner().withAssignableScopes(assignableScopes); + return this; + } + + @Override + public RoleDefinitionImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public RoleDefinitionImpl withPermissions(List permissions) { + this.inner().withPermissions(permissions); + return this; + } + + @Override + public RoleDefinitionImpl withRoleName(String roleName) { + this.inner().withRoleName(roleName); + return this; + } + + @Override + public RoleDefinitionImpl withRoleType(String roleType) { + this.inner().withRoleType(roleType); + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionInner.java new file mode 100644 index 0000000000000..8e5d2224353a8 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Role definition. + */ +@JsonFlatten +public class RoleDefinitionInner { + /** + * The role definition ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The role definition name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The role definition type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The role name. + */ + @JsonProperty(value = "properties.roleName") + private String roleName; + + /** + * The role definition description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The role type. + */ + @JsonProperty(value = "properties.type") + private String roleType; + + /** + * Role definition permissions. + */ + @JsonProperty(value = "properties.permissions") + private List permissions; + + /** + * Role definition assignable scopes. + */ + @JsonProperty(value = "properties.assignableScopes") + private List assignableScopes; + + /** + * Get the role definition ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the role definition name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the role definition type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the role name. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the role name. + * + * @param roleName the roleName value to set + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the role definition description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the role definition description. + * + * @param description the description value to set + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the role type. + * + * @return the roleType value + */ + public String roleType() { + return this.roleType; + } + + /** + * Set the role type. + * + * @param roleType the roleType value to set + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withRoleType(String roleType) { + this.roleType = roleType; + return this; + } + + /** + * Get role definition permissions. + * + * @return the permissions value + */ + public List permissions() { + return this.permissions; + } + + /** + * Set role definition permissions. + * + * @param permissions the permissions value to set + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get role definition assignable scopes. + * + * @return the assignableScopes value + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set role definition assignable scopes. + * + * @param assignableScopes the assignableScopes value to set + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsImpl.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsImpl.java new file mode 100644 index 0000000000000..4202f268384c0 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinition; + +class RoleDefinitionsImpl extends WrapperImpl implements RoleDefinitions { + private final AuthorizationManager manager; + + RoleDefinitionsImpl(AuthorizationManager manager) { + super(manager.inner().roleDefinitions()); + this.manager = manager; + } + + public AuthorizationManager manager() { + return this.manager; + } + + @Override + public RoleDefinitionImpl define(String name) { + return wrapModel(name); + } + + private RoleDefinitionImpl wrapModel(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + + private RoleDefinitionImpl wrapModel(String name) { + return new RoleDefinitionImpl(name, this.manager()); + } + + @Override + public Observable deleteAsync(String scope, String roleDefinitionId) { + RoleDefinitionsInner client = this.inner(); + return client.deleteAsync(scope, roleDefinitionId) + .map(new Func1() { + @Override + public RoleDefinition call(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String scope, String roleDefinitionId) { + RoleDefinitionsInner client = this.inner(); + return client.getAsync(scope, roleDefinitionId) + .map(new Func1() { + @Override + public RoleDefinition call(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByIdAsync(String roleId) { + RoleDefinitionsInner client = this.inner(); + return client.getByIdAsync(roleId) + .map(new Func1() { + @Override + public RoleDefinition call(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String scope) { + RoleDefinitionsInner client = this.inner(); + return client.listAsync(scope) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RoleDefinition call(RoleDefinitionInner inner) { + return new RoleDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java new file mode 100644 index 0000000000000..940b950761188 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java @@ -0,0 +1,746 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RoleDefinitions. + */ +public class RoleDefinitionsInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private RoleDefinitionsService service; + /** The service client containing this operation class. */ + private AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoleDefinitionsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) { + this.service = retrofit.create(RoleDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RoleDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface RoleDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions delete" }) + @HTTP(path = "{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "scope", encoded = true) String scope, @Path("roleDefinitionId") String roleDefinitionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions get" }) + @GET("{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") + Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("roleDefinitionId") String roleDefinitionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions createOrUpdate" }) + @PUT("{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") + Observable> createOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("roleDefinitionId") String roleDefinitionId, @Body RoleDefinitionInner roleDefinition, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions list" }) + @GET("{scope}/providers/Microsoft.Authorization/roleDefinitions") + Observable> list(@Path(value = "scope", encoded = true) String scope, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions getById" }) + @GET("{roleId}") + Observable> getById(@Path(value = "roleId", encoded = true) String roleId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.RoleDefinitions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleDefinitionInner object if successful. + */ + public RoleDefinitionInner delete(String scope, String roleDefinitionId) { + return deleteWithServiceResponseAsync(scope, roleDefinitionId).toBlocking().single().body(); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String scope, String roleDefinitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, roleDefinitionId), serviceCallback); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable deleteAsync(String scope, String roleDefinitionId) { + return deleteWithServiceResponseAsync(scope, roleDefinitionId).map(new Func1, RoleDefinitionInner>() { + @Override + public RoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable> deleteWithServiceResponseAsync(String scope, String roleDefinitionId) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.delete(scope, roleDefinitionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get role definition by name (GUID). + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleDefinitionInner object if successful. + */ + public RoleDefinitionInner get(String scope, String roleDefinitionId) { + return getWithServiceResponseAsync(scope, roleDefinitionId).toBlocking().single().body(); + } + + /** + * Get role definition by name (GUID). + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String scope, String roleDefinitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, roleDefinitionId), serviceCallback); + } + + /** + * Get role definition by name (GUID). + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable getAsync(String scope, String roleDefinitionId) { + return getWithServiceResponseAsync(scope, roleDefinitionId).map(new Func1, RoleDefinitionInner>() { + @Override + public RoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get role definition by name (GUID). + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String scope, String roleDefinitionId) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.get(scope, roleDefinitionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleDefinitionInner object if successful. + */ + public RoleDefinitionInner createOrUpdate(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + return createOrUpdateWithServiceResponseAsync(scope, roleDefinitionId, roleDefinition).toBlocking().single().body(); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(scope, roleDefinitionId, roleDefinition), serviceCallback); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable createOrUpdateAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + return createOrUpdateWithServiceResponseAsync(scope, roleDefinitionId, roleDefinition).map(new Func1, RoleDefinitionInner>() { + @Override + public RoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the role definition. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (roleDefinition == null) { + throw new IllegalArgumentException("Parameter roleDefinition is required and cannot be null."); + } + Validator.validate(roleDefinition); + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdate(scope, roleDefinitionId, roleDefinition, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleDefinitionInner> object if successful. + */ + public PagedList list(final String scope) { + ServiceResponse> response = listSinglePageAsync(scope).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String scope, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(scope), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable> listAsync(final String scope) { + return listWithServiceResponseAsync(scope) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String scope) { + return listSinglePageAsync(scope) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String scope) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + final String filter = null; + return service.list(scope, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleDefinitionInner> object if successful. + */ + public PagedList list(final String scope, final String filter) { + ServiceResponse> response = listSinglePageAsync(scope, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String scope, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(scope, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable> listAsync(final String scope, final String filter) { + return listWithServiceResponseAsync(scope, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the role definition. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String scope, final String filter) { + return listSinglePageAsync(scope, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + ServiceResponse> * @param scope The scope of the role definition. + ServiceResponse> * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String scope, final String filter) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.list(scope, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleDefinitionInner object if successful. + */ + public RoleDefinitionInner getById(String roleId) { + return getByIdWithServiceResponseAsync(roleId).toBlocking().single().body(); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByIdAsync(String roleId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByIdWithServiceResponseAsync(roleId), serviceCallback); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable getByIdAsync(String roleId) { + return getByIdWithServiceResponseAsync(roleId).map(new Func1, RoleDefinitionInner>() { + @Override + public RoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleDefinitionInner object + */ + public Observable> getByIdWithServiceResponseAsync(String roleId) { + if (roleId == null) { + throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.getById(roleId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/package-info.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..5ad8cffb5b2f7 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AuthorizationManagementClient. + */ +package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation; diff --git a/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/package-info.java b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/package-info.java new file mode 100644 index 0000000000000..e9edecaa7f119 --- /dev/null +++ b/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AuthorizationManagementClient. + */ +package com.microsoft.azure.management.authorization.v2018_09_01_preview; diff --git a/automation/resource-manager/v2015_10_31/pom.xml b/automation/resource-manager/v2015_10_31/pom.xml index 2ab8c2d553902..182fb8021ab43 100644 --- a/automation/resource-manager/v2015_10_31/pom.xml +++ b/automation/resource-manager/v2015_10_31/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-automation diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/pom.xml b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/pom.xml new file mode 100644 index 0000000000000..a46d042d06604 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.azuredatabasemigrationservice.v2017_11_15_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datamigration + 1.0.0-beta + jar + Microsoft Azure SDK for DataMigration Management + This package contains Microsoft DataMigration Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiError.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiError.java new file mode 100644 index 0000000000000..bbfa915685b09 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiError.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information. + */ +public class ApiError { + /** + * Error information in OData format. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get error information in OData format. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set error information in OData format. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiErrorException.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiErrorException.java new file mode 100644 index 0000000000000..81997de67cfdc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AuthenticationType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AuthenticationType.java new file mode 100644 index 0000000000000..8bbe4a0f2a83c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AuthenticationType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AuthenticationType. + */ +public enum AuthenticationType { + /** Enum value None. */ + NONE("None"), + + /** Enum value WindowsAuthentication. */ + WINDOWS_AUTHENTICATION("WindowsAuthentication"), + + /** Enum value SqlAuthentication. */ + SQL_AUTHENTICATION("SqlAuthentication"), + + /** Enum value ActiveDirectoryIntegrated. */ + ACTIVE_DIRECTORY_INTEGRATED("ActiveDirectoryIntegrated"), + + /** Enum value ActiveDirectoryPassword. */ + ACTIVE_DIRECTORY_PASSWORD("ActiveDirectoryPassword"); + + /** The actual serialized value for a AuthenticationType instance. */ + private String value; + + AuthenticationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AuthenticationType instance. + * + * @param value the serialized value to parse. + * @return the parsed AuthenticationType object, or null if unable to parse. + */ + @JsonCreator + public static AuthenticationType fromString(String value) { + AuthenticationType[] items = AuthenticationType.values(); + for (AuthenticationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSku.java new file mode 100644 index 0000000000000..52b2944305523 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSku.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.AvailableServiceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; + +/** + * Type representing AvailableServiceSku. + */ +public interface AvailableServiceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + AvailableServiceSkuCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + AvailableServiceSkuSku sku(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuCapacity.java new file mode 100644 index 0000000000000..d8f311cccf0a6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuCapacity.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A description of the scaling capacities of the SKU. + */ +public class AvailableServiceSkuCapacity { + /** + * The minimum capacity, usually 0 or 1. + */ + @JsonProperty(value = "minimum") + private Integer minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /** + * The scalability approach. Possible values include: 'none', 'manual', + * 'automatic'. + */ + @JsonProperty(value = "scaleType") + private ServiceScalability scaleType; + + /** + * Get the minimum capacity, usually 0 or 1. + * + * @return the minimum value + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Set the minimum capacity, usually 0 or 1. + * + * @param minimum the minimum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMinimum(Integer minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum capacity. + * + * @param maximum the maximum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the default capacity. + * + * @param defaultProperty the defaultProperty value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @return the scaleType value + */ + public ServiceScalability scaleType() { + return this.scaleType; + } + + /** + * Set the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @param scaleType the scaleType value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withScaleType(ServiceScalability scaleType) { + this.scaleType = scaleType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuSku.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuSku.java new file mode 100644 index 0000000000000..c1654d4deb180 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/AvailableServiceSkuSku.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU name, tier, etc. + */ +public class AvailableServiceSkuSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SKU family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * SKU size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get sKU family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set sKU family. + * + * @param family the family value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get sKU size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set sKU size. + * + * @param size the size value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * + * @param tier the tier value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskInput.java new file mode 100644 index 0000000000000..19a113439e668 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +public class ConnectToSourceSqlServerTaskInput { + /** + * Connection information for Source SQL Server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Permission group for validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB'. + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /** + * Get connection information for Source SQL Server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for Source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB'. + * + * @return the checkPermissionsGroup value + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB'. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCheckPermissionsGroup(ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutput.java new file mode 100644 index 0000000000000..e79e91adafa06 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutput.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ConnectToSourceSqlServerTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = ConnectToSourceSqlServerTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TaskLevelOutput", value = ConnectToSourceSqlServerTaskOutputTaskLevel.class) +}) +public class ConnectToSourceSqlServerTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..4f000d7863abd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Database level output for the task that validates connection to SQL Server + * and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Database name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * The list of database files. + */ + @JsonProperty(value = "databaseFiles", access = JsonProperty.Access.WRITE_ONLY) + private List databaseFiles; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseCompatLevel compatibilityLevel; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseState databaseState; + + /** + * Get database name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get the list of database files. + * + * @return the databaseFiles value + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java new file mode 100644 index 0000000000000..c49a3d3715b4e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Task level output for the task that validates connection to SQL Server and + * also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TaskLevelOutput") +public class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskProperties.java new file mode 100644 index 0000000000000..ed1ef75de6e3f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToSourceSqlServerTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer") +public class ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskInput.java new file mode 100644 index 0000000000000..f0feacd8a9d07 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskInput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskInput { + /** + * Connection information for target SQL DB. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for target SQL DB. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlDbTaskInput object itself. + */ + public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskOutput.java new file mode 100644 index 0000000000000..355b84db7e111 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskOutput.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Version of the target server. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get version of the target server. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskProperties.java new file mode 100644 index 0000000000000..b3f729ec22b62 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectToTargetSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb") +public class ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withInput(ConnectToTargetSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectionInfo.java new file mode 100644 index 0000000000000..117eaee261d8a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ConnectionInfo.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the connection properties of a server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class) +}) +public class ConnectionInfo { + /** + * User name. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * Password credential. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set user name. + * + * @param userName the userName value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get password credential. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password credential. + * + * @param password the password value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataIntegrityValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataIntegrityValidationResult.java new file mode 100644 index 0000000000000..96017df12086a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataIntegrityValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for checksum based Data Integrity validation results. + */ +public class DataIntegrityValidationResult { + /** + * List of failed table names of source and target pair. + */ + @JsonProperty(value = "failedObjects") + private Map failedObjects; + + /** + * List of errors that happened while performing data integrity validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of failed table names of source and target pair. + * + * @return the failedObjects value + */ + public Map failedObjects() { + return this.failedObjects; + } + + /** + * Set list of failed table names of source and target pair. + * + * @param failedObjects the failedObjects value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withFailedObjects(Map failedObjects) { + this.failedObjects = failedObjects; + return this; + } + + /** + * Get list of errors that happened while performing data integrity validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing data integrity validation. + * + * @param validationErrors the validationErrors value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataItemMigrationSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataItemMigrationSummaryResult.java new file mode 100644 index 0000000000000..1ee65c34adda3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataItemMigrationSummaryResult.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Basic summary of a data item migration. + */ +public class DataItemMigrationSummaryResult { + /** + * Name of the item. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationError.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationError.java new file mode 100644 index 0000000000000..b0ce87718b1ef --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationError.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Task errors. + */ +public class DataMigrationError { + /** + * Error description. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Possible values include: 'Default', 'Warning', 'Error'. + */ + @JsonProperty(value = "type") + private ErrorType type; + + /** + * Get error description. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get possible values include: 'Default', 'Warning', 'Error'. + * + * @return the type value + */ + public ErrorType type() { + return this.type; + } + + /** + * Set possible values include: 'Default', 'Warning', 'Error'. + * + * @param type the type value to set + * @return the DataMigrationError object itself. + */ + public DataMigrationError withType(ErrorType type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationProjectMetadata.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationProjectMetadata.java new file mode 100644 index 0000000000000..bf38592d996f2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationProjectMetadata.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common metadata for migration projects. + */ +public class DataMigrationProjectMetadata { + /** + * Source server name. + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /** + * Source server port number. + */ + @JsonProperty(value = "sourceServerPort", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerPort; + + /** + * Source username. + */ + @JsonProperty(value = "sourceUsername", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUsername; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerName; + + /** + * Target username. + */ + @JsonProperty(value = "targetUsername", access = JsonProperty.Access.WRITE_ONLY) + private String targetUsername; + + /** + * Target database name. + */ + @JsonProperty(value = "targetDbName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDbName; + + /** + * Whether target connection is Windows authentication. + */ + @JsonProperty(value = "targetUsingWinAuth", access = JsonProperty.Access.WRITE_ONLY) + private Boolean targetUsingWinAuth; + + /** + * List of tables selected for migration. + */ + @JsonProperty(value = "selectedMigrationTables", access = JsonProperty.Access.WRITE_ONLY) + private List selectedMigrationTables; + + /** + * Get source server name. + * + * @return the sourceServerName value + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get source server port number. + * + * @return the sourceServerPort value + */ + public String sourceServerPort() { + return this.sourceServerPort; + } + + /** + * Get source username. + * + * @return the sourceUsername value + */ + public String sourceUsername() { + return this.sourceUsername; + } + + /** + * Get target server name. + * + * @return the targetServerName value + */ + public String targetServerName() { + return this.targetServerName; + } + + /** + * Get target username. + * + * @return the targetUsername value + */ + public String targetUsername() { + return this.targetUsername; + } + + /** + * Get target database name. + * + * @return the targetDbName value + */ + public String targetDbName() { + return this.targetDbName; + } + + /** + * Get whether target connection is Windows authentication. + * + * @return the targetUsingWinAuth value + */ + public Boolean targetUsingWinAuth() { + return this.targetUsingWinAuth; + } + + /** + * Get list of tables selected for migration. + * + * @return the selectedMigrationTables value + */ + public List selectedMigrationTables() { + return this.selectedMigrationTables; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationService.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationService.java new file mode 100644 index 0000000000000..cd081b0129b79 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationService.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationServiceInner; + +/** + * Type representing DataMigrationService. + */ +public interface DataMigrationService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the provisioningState value. + */ + ServiceProvisioningState provisioningState(); + + /** + * @return the publicKey value. + */ + String publicKey(); + + /** + * @return the sku value. + */ + ServiceSku sku(); + + /** + * @return the virtualSubnetId value. + */ + String virtualSubnetId(); + + /** + * The entirety of the DataMigrationService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithVirtualSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataMigrationService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataMigrationService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataMigrationService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datamigrationservice definition allowing to specify VirtualSubnetId. + */ + interface WithVirtualSubnetId { + /** + * Specifies virtualSubnetId. + * @param virtualSubnetId The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + * @return the next definition stage +*/ + WithCreate withVirtualSubnetId(String virtualSubnetId); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next definition stage + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the datamigrationservice definition allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next definition stage + */ + WithCreate withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next definition stage + */ + WithCreate withSku(ServiceSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithKind, DefinitionStages.WithPublicKey, DefinitionStages.WithSku { + } + } + /** + * The template for a DataMigrationService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithPublicKey, UpdateStages.WithSku { + } + + /** + * Grouping of DataMigrationService update stages. + */ + interface UpdateStages { + /** + * The stage of the datamigrationservice update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the datamigrationservice update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next update stage + */ + Update withKind(String kind); + } + + /** + * The stage of the datamigrationservice update allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next update stage + */ + Update withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next update stage + */ + Update withSku(ServiceSku sku); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationServiceStatusResponse.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationServiceStatusResponse.java new file mode 100644 index 0000000000000..fe0c05fe34685 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DataMigrationServiceStatusResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationServiceStatusResponseInner; +import java.util.List; + +/** + * Type representing DataMigrationServiceStatusResponse. + */ +public interface DataMigrationServiceStatusResponse extends HasInner, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the supportedTaskTypes value. + */ + List supportedTaskTypes(); + + /** + * @return the vmSize value. + */ + String vmSize(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Database.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Database.java new file mode 100644 index 0000000000000..9fd23b6cb3f37 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Database.java @@ -0,0 +1,463 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a single database. + */ +public class Database { + /** + * Unique identifier for the database. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel") + private DatabaseCompatLevel compatibilityLevel; + + /** + * Collation name of the database. + */ + @JsonProperty(value = "collation") + private String collation; + + /** + * Name of the server. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Fully qualified name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Install id of the database. + */ + @JsonProperty(value = "installId") + private String installId; + + /** + * Version of the server. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** + * Edition of the server. + */ + @JsonProperty(value = "serverEdition") + private String serverEdition; + + /** + * Product level of the server (RTM, SP, CTP). + */ + @JsonProperty(value = "serverLevel") + private String serverLevel; + + /** + * Default path of the data files. + */ + @JsonProperty(value = "serverDefaultDataPath") + private String serverDefaultDataPath; + + /** + * Default path of the log files. + */ + @JsonProperty(value = "serverDefaultLogPath") + private String serverDefaultLogPath; + + /** + * Default path of the backup folder. + */ + @JsonProperty(value = "serverDefaultBackupPath") + private String serverDefaultBackupPath; + + /** + * Number of cores on the server. + */ + @JsonProperty(value = "serverCoreCount") + private Integer serverCoreCount; + + /** + * Number of cores on the server that have VISIBLE ONLINE status. + */ + @JsonProperty(value = "serverVisibleOnlineCoreCount") + private Integer serverVisibleOnlineCoreCount; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState") + private DatabaseState databaseState; + + /** + * The unique Server Id. + */ + @JsonProperty(value = "serverId") + private String serverId; + + /** + * Get unique identifier for the database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for the database. + * + * @param id the id value to set + * @return the Database object itself. + */ + public Database withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the Database object itself. + */ + public Database withName(String name) { + this.name = name; + return this; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the Database object itself. + */ + public Database withCompatibilityLevel(DatabaseCompatLevel compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get collation name of the database. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set collation name of the database. + * + * @param collation the collation value to set + * @return the Database object itself. + */ + public Database withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set name of the server. + * + * @param serverName the serverName value to set + * @return the Database object itself. + */ + public Database withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get fully qualified name. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified name. + * + * @param fqdn the fqdn value to set + * @return the Database object itself. + */ + public Database withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get install id of the database. + * + * @return the installId value + */ + public String installId() { + return this.installId; + } + + /** + * Set install id of the database. + * + * @param installId the installId value to set + * @return the Database object itself. + */ + public Database withInstallId(String installId) { + this.installId = installId; + return this; + } + + /** + * Get version of the server. + * + * @return the serverVersion value + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set version of the server. + * + * @param serverVersion the serverVersion value to set + * @return the Database object itself. + */ + public Database withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get edition of the server. + * + * @return the serverEdition value + */ + public String serverEdition() { + return this.serverEdition; + } + + /** + * Set edition of the server. + * + * @param serverEdition the serverEdition value to set + * @return the Database object itself. + */ + public Database withServerEdition(String serverEdition) { + this.serverEdition = serverEdition; + return this; + } + + /** + * Get product level of the server (RTM, SP, CTP). + * + * @return the serverLevel value + */ + public String serverLevel() { + return this.serverLevel; + } + + /** + * Set product level of the server (RTM, SP, CTP). + * + * @param serverLevel the serverLevel value to set + * @return the Database object itself. + */ + public Database withServerLevel(String serverLevel) { + this.serverLevel = serverLevel; + return this; + } + + /** + * Get default path of the data files. + * + * @return the serverDefaultDataPath value + */ + public String serverDefaultDataPath() { + return this.serverDefaultDataPath; + } + + /** + * Set default path of the data files. + * + * @param serverDefaultDataPath the serverDefaultDataPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultDataPath(String serverDefaultDataPath) { + this.serverDefaultDataPath = serverDefaultDataPath; + return this; + } + + /** + * Get default path of the log files. + * + * @return the serverDefaultLogPath value + */ + public String serverDefaultLogPath() { + return this.serverDefaultLogPath; + } + + /** + * Set default path of the log files. + * + * @param serverDefaultLogPath the serverDefaultLogPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultLogPath(String serverDefaultLogPath) { + this.serverDefaultLogPath = serverDefaultLogPath; + return this; + } + + /** + * Get default path of the backup folder. + * + * @return the serverDefaultBackupPath value + */ + public String serverDefaultBackupPath() { + return this.serverDefaultBackupPath; + } + + /** + * Set default path of the backup folder. + * + * @param serverDefaultBackupPath the serverDefaultBackupPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultBackupPath(String serverDefaultBackupPath) { + this.serverDefaultBackupPath = serverDefaultBackupPath; + return this; + } + + /** + * Get number of cores on the server. + * + * @return the serverCoreCount value + */ + public Integer serverCoreCount() { + return this.serverCoreCount; + } + + /** + * Set number of cores on the server. + * + * @param serverCoreCount the serverCoreCount value to set + * @return the Database object itself. + */ + public Database withServerCoreCount(Integer serverCoreCount) { + this.serverCoreCount = serverCoreCount; + return this; + } + + /** + * Get number of cores on the server that have VISIBLE ONLINE status. + * + * @return the serverVisibleOnlineCoreCount value + */ + public Integer serverVisibleOnlineCoreCount() { + return this.serverVisibleOnlineCoreCount; + } + + /** + * Set number of cores on the server that have VISIBLE ONLINE status. + * + * @param serverVisibleOnlineCoreCount the serverVisibleOnlineCoreCount value to set + * @return the Database object itself. + */ + public Database withServerVisibleOnlineCoreCount(Integer serverVisibleOnlineCoreCount) { + this.serverVisibleOnlineCoreCount = serverVisibleOnlineCoreCount; + return this; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + + /** + * Set state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @param databaseState the databaseState value to set + * @return the Database object itself. + */ + public Database withDatabaseState(DatabaseState databaseState) { + this.databaseState = databaseState; + return this; + } + + /** + * Get the unique Server Id. + * + * @return the serverId value + */ + public String serverId() { + return this.serverId; + } + + /** + * Set the unique Server Id. + * + * @param serverId the serverId value to set + * @return the Database object itself. + */ + public Database withServerId(String serverId) { + this.serverId = serverId; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseCompatLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseCompatLevel.java new file mode 100644 index 0000000000000..f7dee1e630ce9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseCompatLevel.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DatabaseCompatLevel. + */ +public enum DatabaseCompatLevel { + /** Enum value CompatLevel80. */ + COMPAT_LEVEL80("CompatLevel80"), + + /** Enum value CompatLevel90. */ + COMPAT_LEVEL90("CompatLevel90"), + + /** Enum value CompatLevel100. */ + COMPAT_LEVEL100("CompatLevel100"), + + /** Enum value CompatLevel110. */ + COMPAT_LEVEL110("CompatLevel110"), + + /** Enum value CompatLevel120. */ + COMPAT_LEVEL120("CompatLevel120"), + + /** Enum value CompatLevel130. */ + COMPAT_LEVEL130("CompatLevel130"), + + /** Enum value CompatLevel140. */ + COMPAT_LEVEL140("CompatLevel140"); + + /** The actual serialized value for a DatabaseCompatLevel instance. */ + private String value; + + DatabaseCompatLevel(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseCompatLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseCompatLevel object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseCompatLevel fromString(String value) { + DatabaseCompatLevel[] items = DatabaseCompatLevel.values(); + for (DatabaseCompatLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInfo.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInfo.java new file mode 100644 index 0000000000000..4dde5012ae718 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInfo.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information. + */ +public class DatabaseFileInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB") + private Double sizeMB; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set name of the database. + * + * @param databaseName the databaseName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Set size of the file in megabytes. + * + * @param sizeMB the sizeMB value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withSizeMB(Double sizeMB) { + this.sizeMB = sizeMB; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInput.java new file mode 100644 index 0000000000000..e4ea692b00e9f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileInput.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information for input. + */ +public class DatabaseFileInput { + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileType.java new file mode 100644 index 0000000000000..9b7901462a097 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseFileType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DatabaseFileType. + */ +public enum DatabaseFileType { + /** Enum value Rows. */ + ROWS("Rows"), + + /** Enum value Log. */ + LOG("Log"), + + /** Enum value Filestream. */ + FILESTREAM("Filestream"), + + /** Enum value NotSupported. */ + NOT_SUPPORTED("NotSupported"), + + /** Enum value Fulltext. */ + FULLTEXT("Fulltext"); + + /** The actual serialized value for a DatabaseFileType instance. */ + private String value; + + DatabaseFileType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseFileType instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseFileType object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseFileType fromString(String value) { + DatabaseFileType[] items = DatabaseFileType.values(); + for (DatabaseFileType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseInfo.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseInfo.java new file mode 100644 index 0000000000000..663b48d39dbb0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Project Database Details. + */ +public class DatabaseInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "sourceDatabaseName", required = true) + private String sourceDatabaseName; + + /** + * Get name of the database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set name of the database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set + * @return the DatabaseInfo object itself. + */ + public DatabaseInfo withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseMigrationStage.java new file mode 100644 index 0000000000000..b7e3ab0321949 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseMigrationStage.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DatabaseMigrationStage. + */ +public enum DatabaseMigrationStage { + /** Enum value None. */ + NONE("None"), + + /** Enum value Initialize. */ + INITIALIZE("Initialize"), + + /** Enum value Backup. */ + BACKUP("Backup"), + + /** Enum value FileCopy. */ + FILE_COPY("FileCopy"), + + /** Enum value Restore. */ + RESTORE("Restore"), + + /** Enum value Completed. */ + COMPLETED("Completed"); + + /** The actual serialized value for a DatabaseMigrationStage instance. */ + private String value; + + DatabaseMigrationStage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseMigrationStage instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseMigrationStage object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseMigrationStage fromString(String value) { + DatabaseMigrationStage[] items = DatabaseMigrationStage.values(); + for (DatabaseMigrationStage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseObjectName.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseObjectName.java new file mode 100644 index 0000000000000..24d86c5abb1d0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseObjectName.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A representation of the name of an object in a database. + */ +public class DatabaseObjectName { + /** + * The unescaped name of the database containing the object. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * The unescaped name of the object. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * The unescaped name of the schema containing the object. + */ + @JsonProperty(value = "schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /** + * Type of the object in the database. Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Get the unescaped name of the database containing the object. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the unescaped name of the object. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the unescaped name of the schema containing the object. + * + * @return the schemaName value + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the DatabaseObjectName object itself. + */ + public DatabaseObjectName withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseState.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseState.java new file mode 100644 index 0000000000000..8be73021dae3d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseState.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DatabaseState. + */ +public enum DatabaseState { + /** Enum value Online. */ + ONLINE("Online"), + + /** Enum value Restoring. */ + RESTORING("Restoring"), + + /** Enum value Recovering. */ + RECOVERING("Recovering"), + + /** Enum value RecoveryPending. */ + RECOVERY_PENDING("RecoveryPending"), + + /** Enum value Suspect. */ + SUSPECT("Suspect"), + + /** Enum value Emergency. */ + EMERGENCY("Emergency"), + + /** Enum value Offline. */ + OFFLINE("Offline"), + + /** Enum value Copying. */ + COPYING("Copying"), + + /** Enum value OfflineSecondary. */ + OFFLINE_SECONDARY("OfflineSecondary"); + + /** The actual serialized value for a DatabaseState instance. */ + private String value; + + DatabaseState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseState instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseState object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseState fromString(String value) { + DatabaseState[] items = DatabaseState.values(); + for (DatabaseState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseSummaryResult.java new file mode 100644 index 0000000000000..858cd0aeab19d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseSummaryResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Summary of database results in the migration. + */ +public class DatabaseSummaryResult extends DataItemMigrationSummaryResult { + /** + * Size of the database in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Get size of the database in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseTable.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseTable.java new file mode 100644 index 0000000000000..8a3f0231ec341 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/DatabaseTable.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Table properties. + */ +public class DatabaseTable { + /** + * Indicates whether table is empty or not. + */ + @JsonProperty(value = "hasRows", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasRows; + + /** + * Schema-qualified name of the table. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get indicates whether table is empty or not. + * + * @return the hasRows value + */ + public Boolean hasRows() { + return this.hasRows; + } + + /** + * Get schema-qualified name of the table. + * + * @return the name value + */ + public String name() { + return this.name; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ErrorType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ErrorType.java new file mode 100644 index 0000000000000..6eaeb24c41289 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ErrorType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ErrorType. + */ +public enum ErrorType { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value Warning. */ + WARNING("Warning"), + + /** Enum value Error. */ + ERROR("Error"); + + /** The actual serialized value for a ErrorType instance. */ + private String value; + + ErrorType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ErrorType instance. + * + * @param value the serialized value to parse. + * @return the parsed ErrorType object, or null if unable to parse. + */ + @JsonCreator + public static ErrorType fromString(String value) { + ErrorType[] items = ErrorType.values(); + for (ErrorType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ExecutionStatistics.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ExecutionStatistics.java new file mode 100644 index 0000000000000..da4cd6d72f224 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ExecutionStatistics.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ExecutionStatistics { + /** + * No. of query executions. + */ + @JsonProperty(value = "executionCount") + private Long executionCount; + + /** + * CPU Time in millisecond(s) for the query execution. + */ + @JsonProperty(value = "cpuTimeMs") + private Double cpuTimeMs; + + /** + * Time taken in millisecond(s) for executing the query. + */ + @JsonProperty(value = "elapsedTimeMs") + private Double elapsedTimeMs; + + /** + * Dictionary of sql query execution wait types and the respective + * statistics. + */ + @JsonProperty(value = "waitStats") + private Map waitStats; + + /** + * Indicates whether the query resulted in an error. + */ + @JsonProperty(value = "hasErrors") + private Boolean hasErrors; + + /** + * List of sql Errors. + */ + @JsonProperty(value = "sqlErrors") + private List sqlErrors; + + /** + * Get no. of query executions. + * + * @return the executionCount value + */ + public Long executionCount() { + return this.executionCount; + } + + /** + * Set no. of query executions. + * + * @param executionCount the executionCount value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withExecutionCount(Long executionCount) { + this.executionCount = executionCount; + return this; + } + + /** + * Get cPU Time in millisecond(s) for the query execution. + * + * @return the cpuTimeMs value + */ + public Double cpuTimeMs() { + return this.cpuTimeMs; + } + + /** + * Set cPU Time in millisecond(s) for the query execution. + * + * @param cpuTimeMs the cpuTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withCpuTimeMs(Double cpuTimeMs) { + this.cpuTimeMs = cpuTimeMs; + return this; + } + + /** + * Get time taken in millisecond(s) for executing the query. + * + * @return the elapsedTimeMs value + */ + public Double elapsedTimeMs() { + return this.elapsedTimeMs; + } + + /** + * Set time taken in millisecond(s) for executing the query. + * + * @param elapsedTimeMs the elapsedTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withElapsedTimeMs(Double elapsedTimeMs) { + this.elapsedTimeMs = elapsedTimeMs; + return this; + } + + /** + * Get dictionary of sql query execution wait types and the respective statistics. + * + * @return the waitStats value + */ + public Map waitStats() { + return this.waitStats; + } + + /** + * Set dictionary of sql query execution wait types and the respective statistics. + * + * @param waitStats the waitStats value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withWaitStats(Map waitStats) { + this.waitStats = waitStats; + return this; + } + + /** + * Get indicates whether the query resulted in an error. + * + * @return the hasErrors value + */ + public Boolean hasErrors() { + return this.hasErrors; + } + + /** + * Set indicates whether the query resulted in an error. + * + * @param hasErrors the hasErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withHasErrors(Boolean hasErrors) { + this.hasErrors = hasErrors; + return this; + } + + /** + * Get list of sql Errors. + * + * @return the sqlErrors value + */ + public List sqlErrors() { + return this.sqlErrors; + } + + /** + * Set list of sql Errors. + * + * @param sqlErrors the sqlErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withSqlErrors(List sqlErrors) { + this.sqlErrors = sqlErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskInput.java new file mode 100644 index 0000000000000..96e8c27e99882 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskInput { + /** + * Connection information for SQL Server. + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /** + * List of database names to collect tables for. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get connection information for SQL Server. + * + * @return the connectionInfo value + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get list of database names to collect tables for. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set list of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskOutput.java new file mode 100644 index 0000000000000..be68ecd7e8486 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskOutput.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Mapping from database name to list of tables. + */ + @JsonProperty(value = "databasesToTables", access = JsonProperty.Access.WRITE_ONLY) + private Map> databasesToTables; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get mapping from database name to list of tables. + * + * @return the databasesToTables value + */ + public Map> databasesToTables() { + return this.databasesToTables; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskProperties.java new file mode 100644 index 0000000000000..d60ec5e8be433 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/GetUserTablesSqlTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that collects user tables for the given list of + * databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.Sql") +public class GetUserTablesSqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private GetUserTablesSqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public GetUserTablesSqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withInput(GetUserTablesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbDatabaseInput.java new file mode 100644 index 0000000000000..12d6da9bf0600 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB migration task inputs. + */ +public class MigrateSqlServerSqlDbDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Whether to set database read only before migration. + */ + @JsonProperty(value = "makeSourceDbReadOnly") + private Boolean makeSourceDbReadOnly; + + /** + * Mapping of source to target tables. + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. Note: Target database will be truncated before starting migration. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. Note: Target database will be truncated before starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get whether to set database read only before migration. + * + * @return the makeSourceDbReadOnly value + */ + public Boolean makeSourceDbReadOnly() { + return this.makeSourceDbReadOnly; + } + + /** + * Set whether to set database read only before migration. + * + * @param makeSourceDbReadOnly the makeSourceDbReadOnly value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withMakeSourceDbReadOnly(Boolean makeSourceDbReadOnly) { + this.makeSourceDbReadOnly = makeSourceDbReadOnly; + return this; + } + + /** + * Get mapping of source to target tables. + * + * @return the tableMap value + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set mapping of source to target tables. + * + * @param tableMap the tableMap value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskInput.java new file mode 100644 index 0000000000000..acf44f3441e83 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskInput.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +public class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Options for enabling various post migration validations. Available + * options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of + * queries picked up automatically either from the Query Plan Cache or + * Query Store and execute them and compares the execution time between the + * source and target database. + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @return the validationOptions value + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @param validationOptions the validationOptions value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutput.java new file mode 100644 index 0000000000000..94367d9f9d2fc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbTaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..4b2aac2a05896 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Database level result for Sql Server to Azure Sql DB migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration stage that this database is in. Possible values include: + * 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Number of objects. + */ + @JsonProperty(value = "numberOfObjects", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjects; + + /** + * Number of successfully completed objects. + */ + @JsonProperty(value = "numberOfObjectsCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjectsCompleted; + + /** + * Number of database/object errors. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long errorCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Summary of object results in the migration. + */ + @JsonProperty(value = "objectSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map objectSummary; + + /** + * Get name of the item. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration stage that this database is in. Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + * + * @return the stage value + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get number of objects. + * + * @return the numberOfObjects value + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get number of database/object errors. + * + * @return the errorCount value + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get summary of object results in the migration. + * + * @return the objectSummary value + */ + public Map objectSummary() { + return this.objectSummary; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputError.java new file mode 100644 index 0000000000000..ccbe0d6db50b0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Task errors for Sql Server to Azure Sql DB migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..d75f3c51685c9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Migration level result for Sql server to Azure Sql DB migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Duration of task execution in seconds. + */ + @JsonProperty(value = "durationInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long durationInSeconds; + + /** + * Current status of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Migration status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Selected databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Summary of database results in the migration. + */ + @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map databaseSummary; + + /** + * Migration Report Result, provides unique url for downloading your + * migration report. + */ + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get duration of task execution in seconds. + * + * @return the durationInSeconds value + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get current status of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get migration status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get selected databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get summary of database results in the migration. + * + * @return the databaseSummary value + */ + public Map databaseSummary() { + return this.databaseSummary; + } + + /** + * Get migration Report Result, provides unique url for downloading your migration report. + * + * @return the migrationReportResult value + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set migration Report Result, provides unique url for downloading your migration report. + * + * @param migrationReportResult the migrationReportResult value to set + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult(MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java new file mode 100644 index 0000000000000..56fd7b0fd968d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Table level result for Sql Server to Azure Sql DB migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskProperties.java new file mode 100644 index 0000000000000..488c6150f211d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrateSqlServerSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.SqlDb") +public class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withInput(MigrateSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationReportResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationReportResult.java new file mode 100644 index 0000000000000..0580f6cf71fc9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationReportResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration validation report result, contains the url for downloading the + * generated report. + */ +public class MigrationReportResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The url of the report. + */ + @JsonProperty(value = "reportUrl") + private String reportUrl; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set migration validation result identifier. + * + * @param id the id value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the url of the report. + * + * @return the reportUrl value + */ + public String reportUrl() { + return this.reportUrl; + } + + /** + * Set the url of the report. + * + * @param reportUrl the reportUrl value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withReportUrl(String reportUrl) { + this.reportUrl = reportUrl; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationState.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationState.java new file mode 100644 index 0000000000000..f46b6c9732103 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MigrationState. + */ +public enum MigrationState { + /** Enum value None. */ + NONE("None"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Warning. */ + WARNING("Warning"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Skipped. */ + SKIPPED("Skipped"), + + /** Enum value Stopped. */ + STOPPED("Stopped"); + + /** The actual serialized value for a MigrationState instance. */ + private String value; + + MigrationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MigrationState instance. + * + * @param value the serialized value to parse. + * @return the parsed MigrationState object, or null if unable to parse. + */ + @JsonCreator + public static MigrationState fromString(String value) { + MigrationState[] items = MigrationState.values(); + for (MigrationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationStatus.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationStatus.java new file mode 100644 index 0000000000000..a7f126dbefae5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationStatus.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MigrationStatus. + */ +public enum MigrationStatus { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value Connecting. */ + CONNECTING("Connecting"), + + /** Enum value SourceAndTargetSelected. */ + SOURCE_AND_TARGET_SELECTED("SourceAndTargetSelected"), + + /** Enum value SelectLogins. */ + SELECT_LOGINS("SelectLogins"), + + /** Enum value Configured. */ + CONFIGURED("Configured"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Error. */ + ERROR("Error"), + + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value CompletedWithWarnings. */ + COMPLETED_WITH_WARNINGS("CompletedWithWarnings"); + + /** The actual serialized value for a MigrationStatus instance. */ + private String value; + + MigrationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MigrationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed MigrationStatus object, or null if unable to parse. + */ + @JsonCreator + public static MigrationStatus fromString(String value) { + MigrationStatus[] items = MigrationStatus.values(); + for (MigrationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationTableMetadata.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationTableMetadata.java new file mode 100644 index 0000000000000..3c8a3752fccf4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationTableMetadata.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for tables selected in migration project. + */ +public class MigrationTableMetadata { + /** + * Source table name. + */ + @JsonProperty(value = "sourceTableName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceTableName; + + /** + * Target table name. + */ + @JsonProperty(value = "targetTableName", access = JsonProperty.Access.WRITE_ONLY) + private String targetTableName; + + /** + * Get source table name. + * + * @return the sourceTableName value + */ + public String sourceTableName() { + return this.sourceTableName; + } + + /** + * Get target table name. + * + * @return the targetTableName value + */ + public String targetTableName() { + return this.targetTableName; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseLevelResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseLevelResult.java new file mode 100644 index 0000000000000..067198e5f4716 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database level validation results. + */ +public class MigrationValidationDatabaseLevelResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Provides data integrity validation result between the source and target + * tables that are migrated. + */ + @JsonProperty(value = "dataIntegrityValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private DataIntegrityValidationResult dataIntegrityValidationResult; + + /** + * Provides schema comparison result between source and target database. + */ + @JsonProperty(value = "schemaValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private SchemaComparisonValidationResult schemaValidationResult; + + /** + * Results of some of the query execution result between source and target + * database. + */ + @JsonProperty(value = "queryAnalysisValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private QueryAnalysisValidationResult queryAnalysisValidationResult; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get provides data integrity validation result between the source and target tables that are migrated. + * + * @return the dataIntegrityValidationResult value + */ + public DataIntegrityValidationResult dataIntegrityValidationResult() { + return this.dataIntegrityValidationResult; + } + + /** + * Get provides schema comparison result between source and target database. + * + * @return the schemaValidationResult value + */ + public SchemaComparisonValidationResult schemaValidationResult() { + return this.schemaValidationResult; + } + + /** + * Get results of some of the query execution result between source and target database. + * + * @return the queryAnalysisValidationResult value + */ + public QueryAnalysisValidationResult queryAnalysisValidationResult() { + return this.queryAnalysisValidationResult; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseSummaryResult.java new file mode 100644 index 0000000000000..b5dff707283ef --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationDatabaseSummaryResult.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Database level summary result. + */ +public class MigrationValidationDatabaseSummaryResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationOptions.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationOptions.java new file mode 100644 index 0000000000000..1cfddeb08a956 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationOptions.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Types of validations to run after the migration. + */ +public class MigrationValidationOptions { + /** + * Allows to compare the schema information between source and target. + */ + @JsonProperty(value = "enableSchemaValidation") + private Boolean enableSchemaValidation; + + /** + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + */ + @JsonProperty(value = "enableDataIntegrityValidation") + private Boolean enableDataIntegrityValidation; + + /** + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and + * target databases for the extracted queries. + */ + @JsonProperty(value = "enableQueryAnalysisValidation") + private Boolean enableQueryAnalysisValidation; + + /** + * Get allows to compare the schema information between source and target. + * + * @return the enableSchemaValidation value + */ + public Boolean enableSchemaValidation() { + return this.enableSchemaValidation; + } + + /** + * Set allows to compare the schema information between source and target. + * + * @param enableSchemaValidation the enableSchemaValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableSchemaValidation(Boolean enableSchemaValidation) { + this.enableSchemaValidation = enableSchemaValidation; + return this; + } + + /** + * Get allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @return the enableDataIntegrityValidation value + */ + public Boolean enableDataIntegrityValidation() { + return this.enableDataIntegrityValidation; + } + + /** + * Set allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @param enableDataIntegrityValidation the enableDataIntegrityValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableDataIntegrityValidation(Boolean enableDataIntegrityValidation) { + this.enableDataIntegrityValidation = enableDataIntegrityValidation; + return this; + } + + /** + * Get allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @return the enableQueryAnalysisValidation value + */ + public Boolean enableQueryAnalysisValidation() { + return this.enableQueryAnalysisValidation; + } + + /** + * Set allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @param enableQueryAnalysisValidation the enableQueryAnalysisValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableQueryAnalysisValidation(Boolean enableQueryAnalysisValidation) { + this.enableQueryAnalysisValidation = enableQueryAnalysisValidation; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationResult.java new file mode 100644 index 0000000000000..f3c55de12ccd8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/MigrationValidationResult.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Result. + */ +public class MigrationValidationResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Validation summary results for each database. + */ + @JsonProperty(value = "summaryResults") + private Map summaryResults; + + /** + * Current status of validation at the migration level. Status from the + * database validation result status will be aggregated here. Possible + * values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get validation summary results for each database. + * + * @return the summaryResults value + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set validation summary results for each database. + * + * @param summaryResults the summaryResults value to set + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult withSummaryResults(Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get current status of validation at the migration level. Status from the database validation result status will be aggregated here. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityRequest.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..72935b5eea747 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource type and proposed name. + */ +public class NameAvailabilityRequest { + /** + * The proposed resource name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The resource type chain (e.g. virtualMachines/extensions). + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the proposed resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the proposed resource name. + * + * @param name the name value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type chain (e.g. virtualMachines/extensions). + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type chain (e.g. virtualMachines/extensions). + * + * @param type the type value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityResponse.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityResponse.java new file mode 100644 index 0000000000000..e14f682ae36f0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameAvailabilityResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.NameAvailabilityResponseInner; + +/** + * Type representing NameAvailabilityResponse. + */ +public interface NameAvailabilityResponse extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + NameCheckFailureReason reason(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameCheckFailureReason.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameCheckFailureReason.java new file mode 100644 index 0000000000000..86344f7f1bba5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/NameCheckFailureReason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NameCheckFailureReason. + */ +public enum NameCheckFailureReason { + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"), + + /** Enum value Invalid. */ + INVALID("Invalid"); + + /** The actual serialized value for a NameCheckFailureReason instance. */ + private String value; + + NameCheckFailureReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameCheckFailureReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameCheckFailureReason object, or null if unable to parse. + */ + @JsonCreator + public static NameCheckFailureReason fromString(String value) { + NameCheckFailureReason[] items = NameCheckFailureReason.values(); + for (NameCheckFailureReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ODataError.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ODataError.java new file mode 100644 index 0000000000000..9056fd9f8560c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ODataError.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information in OData format. + */ +public class ODataError { + /** + * The machine-readable description of the error, such as 'InvalidRequest' + * or 'InternalServerError'. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The human-readable description of the error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Inner errors that caused this error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the human-readable description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the human-readable description of the error. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get inner errors that caused this error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set inner errors that caused this error. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ObjectType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ObjectType.java new file mode 100644 index 0000000000000..c8635331808a9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ObjectType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ObjectType. + */ +public enum ObjectType { + /** Enum value StoredProcedures. */ + STORED_PROCEDURES("StoredProcedures"), + + /** Enum value Table. */ + TABLE("Table"), + + /** Enum value User. */ + USER("User"), + + /** Enum value View. */ + VIEW("View"), + + /** Enum value Function. */ + FUNCTION("Function"); + + /** The actual serialized value for a ObjectType instance. */ + private String value; + + ObjectType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ObjectType instance. + * + * @param value the serialized value to parse. + * @return the parsed ObjectType object, or null if unable to parse. + */ + @JsonCreator + public static ObjectType fromString(String value) { + ObjectType[] items = ObjectType.values(); + for (ObjectType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Operations.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Operations.java new file mode 100644 index 0000000000000..678a7d4f37be0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Project.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Project.java new file mode 100644 index 0000000000000..aee85f559fe44 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Project.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ProjectInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import java.util.Map; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Project. + */ +public interface Project extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the databasesInfo value. + */ + List databasesInfo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProjectProvisioningState provisioningState(); + + /** + * @return the sourceConnectionInfo value. + */ + ConnectionInfo sourceConnectionInfo(); + + /** + * @return the sourcePlatform value. + */ + ProjectSourcePlatform sourcePlatform(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the targetConnectionInfo value. + */ + ConnectionInfo targetConnectionInfo(); + + /** + * @return the targetPlatform value. + */ + ProjectTargetPlatform targetPlatform(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Project definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithService, DefinitionStages.WithLocation, DefinitionStages.WithSourcePlatform, DefinitionStages.WithTargetPlatform, DefinitionStages.WithCreate { + } + + /** + * Grouping of Project definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Project definition. + */ + interface Blank extends WithService { + } + + /** + * The stage of the project definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies groupName, serviceName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @return the next definition stage + */ + WithLocation withExistingService(String groupName, String serviceName); + } + + /** + * The stage of the project definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithSourcePlatform withLocation(String location); + } + + /** + * The stage of the project definition allowing to specify SourcePlatform. + */ + interface WithSourcePlatform { + /** + * Specifies sourcePlatform. + * @param sourcePlatform Source platform for the project. Possible values include: 'SQL', 'Unknown' + * @return the next definition stage + */ + WithTargetPlatform withSourcePlatform(ProjectSourcePlatform sourcePlatform); + } + + /** + * The stage of the project definition allowing to specify TargetPlatform. + */ + interface WithTargetPlatform { + /** + * Specifies targetPlatform. + * @param targetPlatform Target platform for the project. Possible values include: 'SQLDB', 'Unknown' + * @return the next definition stage + */ + WithCreate withTargetPlatform(ProjectTargetPlatform targetPlatform); + } + + /** + * The stage of the project definition allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next definition stage + */ + WithCreate withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project definition allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next definition stage + */ + WithCreate withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the project definition allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next definition stage + */ + WithCreate withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDatabasesInfo, DefinitionStages.WithSourceConnectionInfo, DefinitionStages.WithTags, DefinitionStages.WithTargetConnectionInfo { + } + } + /** + * The template for a Project update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDatabasesInfo, UpdateStages.WithSourceConnectionInfo, UpdateStages.WithTags, UpdateStages.WithTargetConnectionInfo { + } + + /** + * Grouping of Project update stages. + */ + interface UpdateStages { + /** + * The stage of the project update allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next update stage + */ + Update withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project update allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next update stage + */ + Update withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the project update allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next update stage + */ + Update withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectProvisioningState.java new file mode 100644 index 0000000000000..6b664e8dc9727 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProjectProvisioningState. + */ +public enum ProjectProvisioningState { + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProjectProvisioningState instance. */ + private String value; + + ProjectProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProjectProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProjectProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProjectProvisioningState fromString(String value) { + ProjectProvisioningState[] items = ProjectProvisioningState.values(); + for (ProjectProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectSourcePlatform.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectSourcePlatform.java new file mode 100644 index 0000000000000..3a52e5964e507 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectSourcePlatform.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProjectSourcePlatform. + */ +public enum ProjectSourcePlatform { + /** Enum value SQL. */ + SQL("SQL"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a ProjectSourcePlatform instance. */ + private String value; + + ProjectSourcePlatform(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProjectSourcePlatform instance. + * + * @param value the serialized value to parse. + * @return the parsed ProjectSourcePlatform object, or null if unable to parse. + */ + @JsonCreator + public static ProjectSourcePlatform fromString(String value) { + ProjectSourcePlatform[] items = ProjectSourcePlatform.values(); + for (ProjectSourcePlatform item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTargetPlatform.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTargetPlatform.java new file mode 100644 index 0000000000000..e83d0e9d82f22 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTargetPlatform.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProjectTargetPlatform. + */ +public enum ProjectTargetPlatform { + /** Enum value SQLDB. */ + SQLDB("SQLDB"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a ProjectTargetPlatform instance. */ + private String value; + + ProjectTargetPlatform(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProjectTargetPlatform instance. + * + * @param value the serialized value to parse. + * @return the parsed ProjectTargetPlatform object, or null if unable to parse. + */ + @JsonCreator + public static ProjectTargetPlatform fromString(String value) { + ProjectTargetPlatform[] items = ProjectTargetPlatform.values(); + for (ProjectTargetPlatform item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTask.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTask.java new file mode 100644 index 0000000000000..9311715350ac2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTask.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ProjectTaskInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; + +/** + * Type representing ProjectTask. + */ +public interface ProjectTask extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProjectTaskProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ProjectTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProject, DefinitionStages.WithCreate { + } + + /** + * Grouping of ProjectTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ProjectTask definition. + */ + interface Blank extends WithProject { + } + + /** + * The stage of the projecttask definition allowing to specify Project. + */ + interface WithProject { + /** + * Specifies groupName, serviceName, projectName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @return the next definition stage + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + + /** + * The stage of the projecttask definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the projecttask definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next definition stage + */ + WithCreate withProperties(ProjectTaskProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties { + } + } + /** + * The template for a ProjectTask update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of ProjectTask update stages. + */ + interface UpdateStages { + /** + * The stage of the projecttask update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the projecttask update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next update stage + */ + Update withProperties(ProjectTaskProperties properties); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTaskProperties.java new file mode 100644 index 0000000000000..0c844548cee8d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ProjectTaskProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for all types of DMS task properties. If task is not supported by + * current client, this object is returned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class) +}) +public class ProjectTaskProperties { + /** + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * The state of the task. This is ignored if submitted. Possible values + * include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + * 'Failed', 'FailedInputValidation', 'Faulted'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TaskState state; + + /** + * Get array of errors. This is ignored if submitted. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Get the state of the task. This is ignored if submitted. Possible values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted'. + * + * @return the state value + */ + public TaskState state() { + return this.state; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Projects.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Projects.java new file mode 100644 index 0000000000000..1252370f5eb54 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Projects.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ProjectsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Projects. + */ +public interface Projects extends SupportsCreating, HasInner { + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName); + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName); + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryAnalysisValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryAnalysisValidationResult.java new file mode 100644 index 0000000000000..767995f57dce0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryAnalysisValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for query analysis comparison between the source and target. + */ +public class QueryAnalysisValidationResult { + /** + * List of queries executed and it's execution results in source and + * target. + */ + @JsonProperty(value = "queryResults") + private QueryExecutionResult queryResults; + + /** + * Errors that are part of the execution. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of queries executed and it's execution results in source and target. + * + * @return the queryResults value + */ + public QueryExecutionResult queryResults() { + return this.queryResults; + } + + /** + * Set list of queries executed and it's execution results in source and target. + * + * @param queryResults the queryResults value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) { + this.queryResults = queryResults; + return this; + } + + /** + * Get errors that are part of the execution. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set errors that are part of the execution. + * + * @param validationErrors the validationErrors value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryExecutionResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryExecutionResult.java new file mode 100644 index 0000000000000..d022c4dc08fb3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QueryExecutionResult.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes query analysis results for execution in source and target. + */ +public class QueryExecutionResult { + /** + * Query text retrieved from the source server. + */ + @JsonProperty(value = "queryText") + private String queryText; + + /** + * Total no. of statements in the batch. + */ + @JsonProperty(value = "statementsInBatch") + private Long statementsInBatch; + + /** + * Query analysis result from the source. + */ + @JsonProperty(value = "sourceResult") + private ExecutionStatistics sourceResult; + + /** + * Query analysis result from the target. + */ + @JsonProperty(value = "targetResult") + private ExecutionStatistics targetResult; + + /** + * Get query text retrieved from the source server. + * + * @return the queryText value + */ + public String queryText() { + return this.queryText; + } + + /** + * Set query text retrieved from the source server. + * + * @param queryText the queryText value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + + /** + * Get total no. of statements in the batch. + * + * @return the statementsInBatch value + */ + public Long statementsInBatch() { + return this.statementsInBatch; + } + + /** + * Set total no. of statements in the batch. + * + * @param statementsInBatch the statementsInBatch value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withStatementsInBatch(Long statementsInBatch) { + this.statementsInBatch = statementsInBatch; + return this; + } + + /** + * Get query analysis result from the source. + * + * @return the sourceResult value + */ + public ExecutionStatistics sourceResult() { + return this.sourceResult; + } + + /** + * Set query analysis result from the source. + * + * @param sourceResult the sourceResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withSourceResult(ExecutionStatistics sourceResult) { + this.sourceResult = sourceResult; + return this; + } + + /** + * Get query analysis result from the target. + * + * @return the targetResult value + */ + public ExecutionStatistics targetResult() { + return this.targetResult; + } + + /** + * Set query analysis result from the target. + * + * @param targetResult the targetResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withTargetResult(ExecutionStatistics targetResult) { + this.targetResult = targetResult; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Quota.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Quota.java new file mode 100644 index 0000000000000..e59a86b4e9fd7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Quota.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.QuotaInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; + +/** + * Type representing Quota. + */ +public interface Quota extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + QuotaName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QuotaName.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QuotaName.java new file mode 100644 index 0000000000000..226178015d05f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/QuotaName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name of the quota. + */ +public class QuotaName { + /** + * The localized name of the quota. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * The unlocalized name (or ID) of the quota. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the localized name of the quota. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the quota. + * + * @param localizedValue the localizedValue value to set + * @return the QuotaName object itself. + */ + public QuotaName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get the unlocalized name (or ID) of the quota. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the unlocalized name (or ID) of the quota. + * + * @param value the value value to set + * @return the QuotaName object itself. + */ + public QuotaName withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ReportableException.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ReportableException.java new file mode 100644 index 0000000000000..351e75a27dd50 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ReportableException.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Exception object for all custom exceptions. + */ +public class ReportableException { + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The path to the file where exception occurred. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * The line number where exception occurred. + */ + @JsonProperty(value = "lineNumber") + private String lineNumber; + + /** + * Coded numerical value that is assigned to a specific exception. + */ + @JsonProperty(value = "hResult") + private Integer hResult; + + /** + * Stack trace. + */ + @JsonProperty(value = "stackTrace") + private String stackTrace; + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ReportableException object itself. + */ + public ReportableException withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the path to the file where exception occurred. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the path to the file where exception occurred. + * + * @param filePath the filePath value to set + * @return the ReportableException object itself. + */ + public ReportableException withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the line number where exception occurred. + * + * @return the lineNumber value + */ + public String lineNumber() { + return this.lineNumber; + } + + /** + * Set the line number where exception occurred. + * + * @param lineNumber the lineNumber value to set + * @return the ReportableException object itself. + */ + public ReportableException withLineNumber(String lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * Get coded numerical value that is assigned to a specific exception. + * + * @return the hResult value + */ + public Integer hResult() { + return this.hResult; + } + + /** + * Set coded numerical value that is assigned to a specific exception. + * + * @param hResult the hResult value to set + * @return the ReportableException object itself. + */ + public ReportableException withHResult(Integer hResult) { + this.hResult = hResult; + return this; + } + + /** + * Get stack trace. + * + * @return the stackTrace value + */ + public String stackTrace() { + return this.stackTrace; + } + + /** + * Set stack trace. + * + * @param stackTrace the stackTrace value to set + * @return the ReportableException object itself. + */ + public ReportableException withStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSku.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSku.java new file mode 100644 index 0000000000000..d3f74f364cb6b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSku.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ResourceSkuInner; +import java.util.List; + +/** + * Type representing ResourceSku. + */ +public interface ResourceSku extends HasInner, HasManager { + /** + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * @return the costs value. + */ + List costs(); + + /** + * @return the family value. + */ + String family(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the size value. + */ + String size(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapabilities.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..3adf85e70de04 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapabilities.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes The SKU capabilites object. + */ +public class ResourceSkuCapabilities { + /** + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get an invariant to describe the feature. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get an invariant if the feature is measured by quantity. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacity.java new file mode 100644 index 0000000000000..c240b071ffe55 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacity.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuCapacity { + /** + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /** + * The scale type applicable to the SKU. Possible values include: + * 'Automatic', 'Manual', 'None'. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum capacity. + * + * @return the minimum value + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scale type applicable to the SKU. Possible values include: 'Automatic', 'Manual', 'None'. + * + * @return the scaleType value + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacityScaleType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacityScaleType.java new file mode 100644 index 0000000000000..eb4c6eae092c6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCapacityScaleType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceSkuCapacityScaleType. + */ +public enum ResourceSkuCapacityScaleType { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value Manual. */ + MANUAL("Manual"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceSkuCapacityScaleType instance. */ + private String value; + + ResourceSkuCapacityScaleType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuCapacityScaleType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuCapacityScaleType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String value) { + ResourceSkuCapacityScaleType[] items = ResourceSkuCapacityScaleType.values(); + for (ResourceSkuCapacityScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCosts.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCosts.java new file mode 100644 index 0000000000000..f3d9da5002370 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuCosts.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes metadata for retrieving price info. + */ +public class ResourceSkuCosts { + /** + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterID; + + /** + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /** + * An invariant to show the extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get used for querying price from commerce. + * + * @return the meterID value + */ + public String meterID() { + return this.meterID; + } + + /** + * Get the multiplier is needed to extend the base metered cost. + * + * @return the quantity value + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get an invariant to show the extended unit. + * + * @return the extendedUnit value + */ + public String extendedUnit() { + return this.extendedUnit; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictions.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..0106e38e2d446 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictions.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuRestrictions { + /** + * The type of restrictions. Possible values include: 'location'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsType type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason code for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type of restrictions. Possible values include: 'location'. + * + * @return the type value + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason code for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsReasonCode.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..63e3528c9f323 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceSkuRestrictionsReasonCode. + */ +public enum ResourceSkuRestrictionsReasonCode { + /** Enum value QuotaId. */ + QUOTA_ID("QuotaId"), + + /** Enum value NotAvailableForSubscription. */ + NOT_AVAILABLE_FOR_SUBSCRIPTION("NotAvailableForSubscription"); + + /** The actual serialized value for a ResourceSkuRestrictionsReasonCode instance. */ + private String value; + + ResourceSkuRestrictionsReasonCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuRestrictionsReasonCode instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuRestrictionsReasonCode object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String value) { + ResourceSkuRestrictionsReasonCode[] items = ResourceSkuRestrictionsReasonCode.values(); + for (ResourceSkuRestrictionsReasonCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..69f9c3d13d605 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkuRestrictionsType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceSkuRestrictionsType. + */ +public enum ResourceSkuRestrictionsType { + /** Enum value location. */ + LOCATION("location"); + + /** The actual serialized value for a ResourceSkuRestrictionsType instance. */ + private String value; + + ResourceSkuRestrictionsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuRestrictionsType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuRestrictionsType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String value) { + ResourceSkuRestrictionsType[] items = ResourceSkuRestrictionsType.values(); + for (ResourceSkuRestrictionsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkus.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkus.java new file mode 100644 index 0000000000000..05cf544a09d1a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ResourceSkus.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ResourceSkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourceSkus. + */ +public interface ResourceSkus extends HasInner { + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResult.java new file mode 100644 index 0000000000000..82d803d9adbe8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResult.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for schema comparison between the source and target. + */ +public class SchemaComparisonValidationResult { + /** + * List of schema differences between the source and target databases. + */ + @JsonProperty(value = "schemaDifferences") + private SchemaComparisonValidationResultType schemaDifferences; + + /** + * List of errors that happened while performing schema compare validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Count of source database objects. + */ + @JsonProperty(value = "sourceDatabaseObjectCount") + private Map sourceDatabaseObjectCount; + + /** + * Count of target database objects. + */ + @JsonProperty(value = "targetDatabaseObjectCount") + private Map targetDatabaseObjectCount; + + /** + * Get list of schema differences between the source and target databases. + * + * @return the schemaDifferences value + */ + public SchemaComparisonValidationResultType schemaDifferences() { + return this.schemaDifferences; + } + + /** + * Set list of schema differences between the source and target databases. + * + * @param schemaDifferences the schemaDifferences value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSchemaDifferences(SchemaComparisonValidationResultType schemaDifferences) { + this.schemaDifferences = schemaDifferences; + return this; + } + + /** + * Get list of errors that happened while performing schema compare validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing schema compare validation. + * + * @param validationErrors the validationErrors value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get count of source database objects. + * + * @return the sourceDatabaseObjectCount value + */ + public Map sourceDatabaseObjectCount() { + return this.sourceDatabaseObjectCount; + } + + /** + * Set count of source database objects. + * + * @param sourceDatabaseObjectCount the sourceDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSourceDatabaseObjectCount(Map sourceDatabaseObjectCount) { + this.sourceDatabaseObjectCount = sourceDatabaseObjectCount; + return this; + } + + /** + * Get count of target database objects. + * + * @return the targetDatabaseObjectCount value + */ + public Map targetDatabaseObjectCount() { + return this.targetDatabaseObjectCount; + } + + /** + * Set count of target database objects. + * + * @param targetDatabaseObjectCount the targetDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withTargetDatabaseObjectCount(Map targetDatabaseObjectCount) { + this.targetDatabaseObjectCount = targetDatabaseObjectCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResultType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResultType.java new file mode 100644 index 0000000000000..c48e5bef87c72 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SchemaComparisonValidationResultType.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class SchemaComparisonValidationResultType { + /** + * Name of the object that has the difference. + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Type of the object that has the difference. e.g + * (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Update action type with respect to target. Possible values include: + * 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + */ + @JsonProperty(value = "updateAction") + private UpdateActionType updateAction; + + /** + * Get name of the object that has the difference. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Set name of the object that has the difference. + * + * @param objectName the objectName value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Get type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @return the updateAction value + */ + public UpdateActionType updateAction() { + return this.updateAction; + } + + /** + * Set update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @param updateAction the updateAction value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withUpdateAction(UpdateActionType updateAction) { + this.updateAction = updateAction; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServerLevelPermissionsGroup.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServerLevelPermissionsGroup.java new file mode 100644 index 0000000000000..e8e0f426d2f5b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServerLevelPermissionsGroup.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServerLevelPermissionsGroup. + */ +public enum ServerLevelPermissionsGroup { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value MigrationFromSqlServerToAzureDB. */ + MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB("MigrationFromSqlServerToAzureDB"); + + /** The actual serialized value for a ServerLevelPermissionsGroup instance. */ + private String value; + + ServerLevelPermissionsGroup(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServerLevelPermissionsGroup instance. + * + * @param value the serialized value to parse. + * @return the parsed ServerLevelPermissionsGroup object, or null if unable to parse. + */ + @JsonCreator + public static ServerLevelPermissionsGroup fromString(String value) { + ServerLevelPermissionsGroup[] items = ServerLevelPermissionsGroup.values(); + for (ServerLevelPermissionsGroup item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperation.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperation.java new file mode 100644 index 0000000000000..df930bb13102e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ServiceOperationInner; + +/** + * Type representing ServiceOperation. + */ +public interface ServiceOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + ServiceOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperationDisplay.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperationDisplay.java new file mode 100644 index 0000000000000..f62c52eaa5992 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceOperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display text. + */ +public class ServiceOperationDisplay { + /** + * The localized resource provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The localized resource type name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The localized operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The localized operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the localized resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the localized resource provider name. + * + * @param provider the provider value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the localized resource type name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the localized resource type name. + * + * @param resource the resource value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the localized operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the localized operation name. + * + * @param operation the operation value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the localized operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the localized operation description. + * + * @param description the description value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceProvisioningState.java new file mode 100644 index 0000000000000..62335e27472a1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceProvisioningState.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServiceProvisioningState. + */ +public enum ServiceProvisioningState { + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deploying. */ + DEPLOYING("Deploying"), + + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value FailedToStart. */ + FAILED_TO_START("FailedToStart"), + + /** Enum value FailedToStop. */ + FAILED_TO_STOP("FailedToStop"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a ServiceProvisioningState instance. */ + private String value; + + ServiceProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServiceProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ServiceProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ServiceProvisioningState fromString(String value) { + ServiceProvisioningState[] items = ServiceProvisioningState.values(); + for (ServiceProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceScalability.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceScalability.java new file mode 100644 index 0000000000000..182d62389894c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceScalability.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServiceScalability. + */ +public enum ServiceScalability { + /** Enum value none. */ + NONE("none"), + + /** Enum value manual. */ + MANUAL("manual"), + + /** Enum value automatic. */ + AUTOMATIC("automatic"); + + /** The actual serialized value for a ServiceScalability instance. */ + private String value; + + ServiceScalability(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServiceScalability instance. + * + * @param value the serialized value to parse. + * @return the parsed ServiceScalability object, or null if unable to parse. + */ + @JsonCreator + public static ServiceScalability fromString(String value) { + ServiceScalability[] items = ServiceScalability.values(); + for (ServiceScalability item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceSku.java new file mode 100644 index 0000000000000..14e14b7e7e4e8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ServiceSku.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Azure SKU instance. + */ +public class ServiceSku { + /** + * The unique name of the SKU, such as 'P3'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The SKU family, used when the service has multiple performance classes + * within a tier, such as 'A', 'D', etc. for virtual machines. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The size of the SKU, used when the name alone does not denote a service + * size or when a SKU has multiple performance classes within a family, + * e.g. 'A1' for virtual machines. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The capacity of the SKU, if it supports scaling. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the unique name of the SKU, such as 'P3'. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the SKU, such as 'P3'. + * + * @param name the name value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * + * @param tier the tier value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @param family the family value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @param size the size value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the capacity of the SKU, if it supports scaling. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the SKU, if it supports scaling. + * + * @param capacity the capacity value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Services.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Services.java new file mode 100644 index 0000000000000..f55e9556ad202 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Services.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSku; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkStatusAsync(String groupName, String serviceName); + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String groupName, String serviceName); + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String groupName, String serviceName); + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters); + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusAsync(final String groupName, final String serviceName); + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Severity.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Severity.java new file mode 100644 index 0000000000000..9d606031b8cc4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Severity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Severity. + */ +public enum Severity { + /** Enum value Message. */ + MESSAGE("Message"), + + /** Enum value Warning. */ + WARNING("Warning"), + + /** Enum value Error. */ + ERROR("Error"); + + /** The actual serialized value for a Severity instance. */ + private String value; + + Severity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Severity instance. + * + * @param value the serialized value to parse. + * @return the parsed Severity object, or null if unable to parse. + */ + @JsonCreator + public static Severity fromString(String value) { + Severity[] items = Severity.values(); + for (Severity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlConnectionInfo.java new file mode 100644 index 0000000000000..5b7e55e8ed6a6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlConnectionInfo.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information for connecting to SQL database server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SqlConnectionInfo") +public class SqlConnectionInfo extends ConnectionInfo { + /** + * Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /** + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /** + * Whether to encrypt the connection. + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /** + * Additional connection settings. + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /** + * Whether to trust the server certificate. + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /** + * Get data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @return the dataSource value + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @param dataSource the dataSource value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @return the authentication value + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @param authentication the authentication value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get whether to encrypt the connection. + * + * @return the encryptConnection value + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get additional connection settings. + * + * @return the additionalSettings value + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set additional connection settings. + * + * @param additionalSettings the additionalSettings value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get whether to trust the server certificate. + * + * @return the trustServerCertificate value + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlMigrationTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlMigrationTaskInput.java new file mode 100644 index 0000000000000..6c1742b095f39 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/SqlMigrationTaskInput.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for migration task input. + */ +public class SqlMigrationTaskInput { + /** + * Information for connecting to source. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/TaskState.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/TaskState.java new file mode 100644 index 0000000000000..17b452a2b346a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/TaskState.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TaskState. + */ +public enum TaskState { + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value Queued. */ + QUEUED("Queued"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value FailedInputValidation. */ + FAILED_INPUT_VALIDATION("FailedInputValidation"), + + /** Enum value Faulted. */ + FAULTED("Faulted"); + + /** The actual serialized value for a TaskState instance. */ + private String value; + + TaskState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TaskState instance. + * + * @param value the serialized value to parse. + * @return the parsed TaskState object, or null if unable to parse. + */ + @JsonCreator + public static TaskState fromString(String value) { + TaskState[] items = TaskState.values(); + for (TaskState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Tasks.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Tasks.java new file mode 100644 index 0000000000000..30d6f9399eb77 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Tasks.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.TasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tasks. + */ +public interface Tasks extends SupportsCreating, HasInner { + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName, final String projectName); + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/UpdateActionType.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/UpdateActionType.java new file mode 100644 index 0000000000000..b4b55f36f8196 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/UpdateActionType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UpdateActionType. + */ +public enum UpdateActionType { + /** Enum value DeletedOnTarget. */ + DELETED_ON_TARGET("DeletedOnTarget"), + + /** Enum value ChangedOnTarget. */ + CHANGED_ON_TARGET("ChangedOnTarget"), + + /** Enum value AddedOnTarget. */ + ADDED_ON_TARGET("AddedOnTarget"); + + /** The actual serialized value for a UpdateActionType instance. */ + private String value; + + UpdateActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpdateActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed UpdateActionType object, or null if unable to parse. + */ + @JsonCreator + public static UpdateActionType fromString(String value) { + UpdateActionType[] items = UpdateActionType.values(); + for (UpdateActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Usages.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Usages.java new file mode 100644 index 0000000000000..b2dbcac06d48f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/Usages.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationError.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationError.java new file mode 100644 index 0000000000000..c8c671776936a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ValidationError { + /** + * Error Text. + */ + @JsonProperty(value = "text") + private String text; + + /** + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error'. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /** + * Get error Text. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Set error Text. + * + * @param text the text value to set + * @return the ValidationError object itself. + */ + public ValidationError withText(String text) { + this.text = text; + return this; + } + + /** + * Get severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Set severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @param severity the severity value to set + * @return the ValidationError object itself. + */ + public ValidationError withSeverity(Severity severity) { + this.severity = severity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationStatus.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationStatus.java new file mode 100644 index 0000000000000..141c675fae4ec --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/ValidationStatus.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ValidationStatus. + */ +public enum ValidationStatus { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value NotStarted. */ + NOT_STARTED("NotStarted"), + + /** Enum value Initialized. */ + INITIALIZED("Initialized"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value CompletedWithIssues. */ + COMPLETED_WITH_ISSUES("CompletedWithIssues"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Stopped. */ + STOPPED("Stopped"); + + /** The actual serialized value for a ValidationStatus instance. */ + private String value; + + ValidationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ValidationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed ValidationStatus object, or null if unable to parse. + */ + @JsonCreator + public static ValidationStatus fromString(String value) { + ValidationStatus[] items = ValidationStatus.values(); + for (ValidationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/WaitStatistics.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/WaitStatistics.java new file mode 100644 index 0000000000000..f717015e3b752 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/WaitStatistics.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Wait statistics gathered during query batch execution. + */ +public class WaitStatistics { + /** + * Type of the Wait. + */ + @JsonProperty(value = "waitType") + private String waitType; + + /** + * Total wait time in millisecond(s). + */ + @JsonProperty(value = "waitTimeMs") + private Double waitTimeMs; + + /** + * Total no. of waits. + */ + @JsonProperty(value = "waitCount") + private Long waitCount; + + /** + * Get type of the Wait. + * + * @return the waitType value + */ + public String waitType() { + return this.waitType; + } + + /** + * Set type of the Wait. + * + * @param waitType the waitType value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitType(String waitType) { + this.waitType = waitType; + return this; + } + + /** + * Get total wait time in millisecond(s). + * + * @return the waitTimeMs value + */ + public Double waitTimeMs() { + return this.waitTimeMs; + } + + /** + * Set total wait time in millisecond(s). + * + * @param waitTimeMs the waitTimeMs value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitTimeMs(Double waitTimeMs) { + this.waitTimeMs = waitTimeMs; + return this; + } + + /** + * Get total no. of waits. + * + * @return the waitCount value + */ + public Long waitCount() { + return this.waitCount; + } + + /** + * Set total no. of waits. + * + * @param waitCount the waitCount value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitCount(Long waitCount) { + this.waitCount = waitCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuImpl.java new file mode 100644 index 0000000000000..aa37860397428 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSkuSku; + +class AvailableServiceSkuImpl extends WrapperImpl implements AvailableServiceSku { + private final DataMigrationManager manager; + + AvailableServiceSkuImpl(AvailableServiceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public AvailableServiceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public AvailableServiceSkuSku sku() { + return this.inner().sku(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuInner.java new file mode 100644 index 0000000000000..4bce2c0cd08f2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/AvailableServiceSkuInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSkuSku; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSkuCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the available service SKU. + */ +public class AvailableServiceSkuInner { + /** + * The resource type, including the provider namespace. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * SKU name, tier, etc. + */ + @JsonProperty(value = "sku") + private AvailableServiceSkuSku sku; + + /** + * A description of the scaling capacities of the SKU. + */ + @JsonProperty(value = "capacity") + private AvailableServiceSkuCapacity capacity; + + /** + * Get the resource type, including the provider namespace. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resource type, including the provider namespace. + * + * @param resourceType the resourceType value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get sKU name, tier, etc. + * + * @return the sku value + */ + public AvailableServiceSkuSku sku() { + return this.sku; + } + + /** + * Set sKU name, tier, etc. + * + * @param sku the sku value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withSku(AvailableServiceSkuSku sku) { + this.sku = sku; + return this; + } + + /** + * Get a description of the scaling capacities of the SKU. + * + * @return the capacity value + */ + public AvailableServiceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Set a description of the scaling capacities of the SKU. + * + * @param capacity the capacity value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withCapacity(AvailableServiceSkuCapacity capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationManager.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationManager.java new file mode 100644 index 0000000000000..58ed4a844aa70 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkus; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Usages; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataMigration resource management. + */ +public final class DataMigrationManager extends ManagerCore { + private ResourceSkus resourceSkus; + private Services services; + private Tasks tasks; + private Projects projects; + private Usages usages; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DataMigrationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataMigrationManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataMigrationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(RestClient restClient, String subscriptionId) { + return new DataMigrationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataMigrationManager that exposes DataMigration management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataMigration management API entry points that work across subscriptions + */ + DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ResourceSkus. + */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(this); + } + return this.resourceSkus; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage Tasks. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(this); + } + return this.tasks; + } + + /** + * @return Entry point to manage Projects. + */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(this); + } + return this.projects; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataMigrationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataMigrationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataMigrationServiceClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceClientImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceClientImpl.java new file mode 100644 index 0000000000000..59c73179890ad --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceClientImpl.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataMigrationServiceClientImpl class. + */ +public class DataMigrationServiceClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Version of the API. */ + private String apiVersion; + + /** + * Gets Version of the API. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Identifier of the subscription. */ + private String subscriptionId; + + /** + * Gets Identifier of the subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Identifier of the subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ResourceSkusInner object to access its operations. + */ + private ResourceSkusInner resourceSkus; + + /** + * Gets the ResourceSkusInner object to access its operations. + * @return the ResourceSkusInner object. + */ + public ResourceSkusInner resourceSkus() { + return this.resourceSkus; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The TasksInner object to access its operations. + */ + private TasksInner tasks; + + /** + * Gets the TasksInner object to access its operations. + * @return the TasksInner object. + */ + public TasksInner tasks() { + return this.tasks; + } + + /** + * The ProjectsInner object to access its operations. + */ + private ProjectsInner projects; + + /** + * Gets the ProjectsInner object to access its operations. + * @return the ProjectsInner object. + */ + public ProjectsInner projects() { + return this.projects; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataMigrationServiceClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-11-15-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.tasks = new TasksInner(restClient().retrofit(), this); + this.projects = new ProjectsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataMigrationServiceClient", "2017-11-15-preview"); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceImpl.java new file mode 100644 index 0000000000000..abd25917156b0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DataMigrationService; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceSku; + +class DataMigrationServiceImpl extends GroupableResourceCoreImpl implements DataMigrationService, DataMigrationService.Definition, DataMigrationService.Update { + DataMigrationServiceImpl(String name, DataMigrationServiceInner inner, DataMigrationManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public ServiceProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publicKey() { + return this.inner().publicKey(); + } + + @Override + public ServiceSku sku() { + return this.inner().sku(); + } + + @Override + public String virtualSubnetId() { + return this.inner().virtualSubnetId(); + } + + @Override + public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { + this.inner().withVirtualSubnetId(virtualSubnetId); + return this; + } + + @Override + public DataMigrationServiceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public DataMigrationServiceImpl withKind(String kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public DataMigrationServiceImpl withPublicKey(String publicKey) { + this.inner().withPublicKey(publicKey); + return this; + } + + @Override + public DataMigrationServiceImpl withSku(ServiceSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceInner.java new file mode 100644 index 0000000000000..dfd19788f8c93 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A Data Migration Service resource. + */ +@JsonFlatten +public class DataMigrationServiceInner extends Resource { + /** + * HTTP strong entity tag value. Ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The resource kind. Only 'vm' (the default) is supported. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The resource's provisioning state. Possible values include: 'Accepted', + * 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceProvisioningState provisioningState; + + /** + * The public key of the service, used to encrypt secrets sent to the + * service. + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /** + * The ID of the Microsoft.Network/virtualNetworks/subnets resource to + * which the service should be joined. + */ + @JsonProperty(value = "properties.virtualSubnetId", required = true) + private String virtualSubnetId; + + /** + * Service SKU. + */ + @JsonProperty(value = "sku") + private ServiceSku sku; + + /** + * Get hTTP strong entity tag value. Ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. Ignored if submitted. + * + * @param etag the etag value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the resource kind. Only 'vm' (the default) is supported. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the resource kind. Only 'vm' (the default) is supported. + * + * @param kind the kind value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the resource's provisioning state. Possible values include: 'Accepted', 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the public key of the service, used to encrypt secrets sent to the service. + * + * @param publicKey the publicKey value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @return the virtualSubnetId value + */ + public String virtualSubnetId() { + return this.virtualSubnetId; + } + + /** + * Set the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @param virtualSubnetId the virtualSubnetId value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualSubnetId(String virtualSubnetId) { + this.virtualSubnetId = virtualSubnetId; + return this; + } + + /** + * Get service SKU. + * + * @return the sku value + */ + public ServiceSku sku() { + return this.sku; + } + + /** + * Set service SKU. + * + * @param sku the sku value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withSku(ServiceSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java new file mode 100644 index 0000000000000..26f30009f2918 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DataMigrationServiceStatusResponseImpl extends WrapperImpl implements DataMigrationServiceStatusResponse { + private final DataMigrationManager manager; + DataMigrationServiceStatusResponseImpl(DataMigrationServiceStatusResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public List supportedTaskTypes() { + return this.inner().supportedTaskTypes(); + } + + @Override + public String vmSize() { + return this.inner().vmSize(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseInner.java new file mode 100644 index 0000000000000..a6bc33e1d6020 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/DataMigrationServiceStatusResponseInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service health status. + */ +public class DataMigrationServiceStatusResponseInner { + /** + * The DMS instance agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * The machine-readable status, such as 'Initializing', 'Offline', + * 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop' or 'Failed'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The services virtual machine size, such as 'Standard_D2_v2'. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * The list of supported task types. + */ + @JsonProperty(value = "supportedTaskTypes") + private List supportedTaskTypes; + + /** + * Get the DMS instance agent version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the DMS instance agent version. + * + * @param agentVersion the agentVersion value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @param status the status value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the services virtual machine size, such as 'Standard_D2_v2'. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the services virtual machine size, such as 'Standard_D2_v2'. + * + * @param vmSize the vmSize value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the list of supported task types. + * + * @return the supportedTaskTypes value + */ + public List supportedTaskTypes() { + return this.supportedTaskTypes; + } + + /** + * Set the list of supported task types. + * + * @param supportedTaskTypes the supportedTaskTypes value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withSupportedTaskTypes(List supportedTaskTypes) { + this.supportedTaskTypes = supportedTaskTypes; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/IdParsingUtils.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ecb85cfc8638e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..88c5af985ee97 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameAvailabilityResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameCheckFailureReason; + +class NameAvailabilityResponseImpl extends WrapperImpl implements NameAvailabilityResponse { + private final DataMigrationManager manager; + NameAvailabilityResponseImpl(NameAvailabilityResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public NameCheckFailureReason reason() { + return this.inner().reason(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..003376ae10b44 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/NameAvailabilityResponseInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameCheckFailureReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Indicates whether a proposed resource name is available. + */ +public class NameAvailabilityResponseInner { + /** + * If true, the name is valid and available. If false, 'reason' describes + * why not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, if nameAvailable is false. + * Possible values include: 'AlreadyExists', 'Invalid'. + */ + @JsonProperty(value = "reason") + private NameCheckFailureReason reason; + + /** + * The localized reason why the name is not available, if nameAvailable is + * false. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get if true, the name is valid and available. If false, 'reason' describes why not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set if true, the name is valid and available. If false, 'reason' describes why not. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @return the reason value + */ + public NameCheckFailureReason reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @param reason the reason value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withReason(NameCheckFailureReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the localized reason why the name is not available, if nameAvailable is false. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the localized reason why the name is not available, if nameAvailable is false. + * + * @param message the message value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c043c22e9c36c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceOperation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataMigrationManager manager; + + OperationsImpl(DataMigrationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceOperation call(ServiceOperationInner inner) { + return new ServiceOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..c92b09b51d0eb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Operations list" }) + @GET("providers/Microsoft.DataMigration/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/PageImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..a5855615641b8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectImpl.java new file mode 100644 index 0000000000000..29a4a92bce158 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Project; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectProvisioningState; + +class ProjectImpl extends CreatableUpdatableImpl implements Project, Project.Definition, Project.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + + ProjectImpl(String name, DataMigrationManager manager) { + super(name, new ProjectInner()); + this.manager = manager; + // Set resource name + this.projectName = name; + // + } + + ProjectImpl(ProjectInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.projectName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.getAsync(this.groupName, this.serviceName, this.projectName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List databasesInfo() { + return this.inner().databasesInfo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionInfo sourceConnectionInfo() { + return this.inner().sourceConnectionInfo(); + } + + @Override + public ProjectSourcePlatform sourcePlatform() { + return this.inner().sourcePlatform(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public ConnectionInfo targetConnectionInfo() { + return this.inner().targetConnectionInfo(); + } + + @Override + public ProjectTargetPlatform targetPlatform() { + return this.inner().targetPlatform(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectImpl withExistingService(String groupName, String serviceName) { + this.groupName = groupName; + this.serviceName = serviceName; + return this; + } + + @Override + public ProjectImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.inner().withSourcePlatform(sourcePlatform); + return this; + } + + @Override + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.inner().withTargetPlatform(targetPlatform); + return this; + } + + @Override + public ProjectImpl withDatabasesInfo(List databasesInfo) { + this.inner().withDatabasesInfo(databasesInfo); + return this; + } + + @Override + public ProjectImpl withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.inner().withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + @Override + public ProjectImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public ProjectImpl withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.inner().withTargetConnectionInfo(targetConnectionInfo); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectInner.java new file mode 100644 index 0000000000000..f5cca7436b038 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectInner.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A project resource. + */ +@JsonFlatten +public class ProjectInner extends Resource { + /** + * Source platform for the project. Possible values include: 'SQL', + * 'Unknown'. + */ + @JsonProperty(value = "properties.sourcePlatform", required = true) + private ProjectSourcePlatform sourcePlatform; + + /** + * Target platform for the project. Possible values include: 'SQLDB', + * 'Unknown'. + */ + @JsonProperty(value = "properties.targetPlatform", required = true) + private ProjectTargetPlatform targetPlatform; + + /** + * UTC Date and time when project was created. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Information for connecting to source. + */ + @JsonProperty(value = "properties.sourceConnectionInfo") + private ConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "properties.targetConnectionInfo") + private ConnectionInfo targetConnectionInfo; + + /** + * List of DatabaseInfo. + */ + @JsonProperty(value = "properties.databasesInfo") + private List databasesInfo; + + /** + * The project's provisioning state. Possible values include: 'Deleting', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProjectProvisioningState provisioningState; + + /** + * Get source platform for the project. Possible values include: 'SQL', 'Unknown'. + * + * @return the sourcePlatform value + */ + public ProjectSourcePlatform sourcePlatform() { + return this.sourcePlatform; + } + + /** + * Set source platform for the project. Possible values include: 'SQL', 'Unknown'. + * + * @param sourcePlatform the sourcePlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.sourcePlatform = sourcePlatform; + return this; + } + + /** + * Get target platform for the project. Possible values include: 'SQLDB', 'Unknown'. + * + * @return the targetPlatform value + */ + public ProjectTargetPlatform targetPlatform() { + return this.targetPlatform; + } + + /** + * Set target platform for the project. Possible values include: 'SQLDB', 'Unknown'. + * + * @param targetPlatform the targetPlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get uTC Date and time when project was created. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public ConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public ConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get list of DatabaseInfo. + * + * @return the databasesInfo value + */ + public List databasesInfo() { + return this.databasesInfo; + } + + /** + * Set list of DatabaseInfo. + * + * @param databasesInfo the databasesInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withDatabasesInfo(List databasesInfo) { + this.databasesInfo = databasesInfo; + return this; + } + + /** + * Get the project's provisioning state. Possible values include: 'Deleting', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProjectProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskImpl.java new file mode 100644 index 0000000000000..25a8d164da3e1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTask; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTaskProperties; + +class ProjectTaskImpl extends CreatableUpdatableImpl implements ProjectTask, ProjectTask.Definition, ProjectTask.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + private String taskName; + + ProjectTaskImpl(String name, DataMigrationManager manager) { + super(name, new ProjectTaskInner()); + this.manager = manager; + // Set resource name + this.taskName = name; + // + } + + ProjectTaskImpl(ProjectTaskInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + this.taskName = IdParsingUtils.getValueFromIdByName(inner.id(), "tasks"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.getAsync(this.groupName, this.serviceName, this.projectName, this.taskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectTaskProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectTaskImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + @Override + public ProjectTaskImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ProjectTaskImpl withProperties(ProjectTaskProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskInner.java new file mode 100644 index 0000000000000..ab099fa4f3dbd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectTaskInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTaskProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A task resource. + */ +public class ProjectTaskInner extends ProxyResource { + /** + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Custom task properties. + */ + @JsonProperty(value = "properties") + private ProjectTaskProperties properties; + + /** + * Get hTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get custom task properties. + * + * @return the properties value + */ + public ProjectTaskProperties properties() { + return this.properties; + } + + /** + * Set custom task properties. + * + * @param properties the properties value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withProperties(ProjectTaskProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsImpl.java new file mode 100644 index 0000000000000..b04cf2514dbc5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Project; + +class ProjectsImpl extends WrapperImpl implements Projects { + private final DataMigrationManager manager; + + ProjectsImpl(DataMigrationManager manager) { + super(manager.inner().projects()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectImpl define(String name) { + return wrapModel(name); + } + + private ProjectImpl wrapModel(ProjectInner inner) { + return new ProjectImpl(inner, manager()); + } + + private ProjectImpl wrapModel(String name) { + return new ProjectImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName) { + ProjectsInner client = this.inner(); + return client.listAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsInner.java new file mode 100644 index 0000000000000..cf8c188e1e3bc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ProjectsInner.java @@ -0,0 +1,834 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Projects. + */ +public class ProjectsInner { + /** The Retrofit service to perform REST calls. */ + private ProjectsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ProjectsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProjectsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ProjectsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Projects to be + * used by Retrofit to perform actually REST calls. + */ + interface ProjectsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Projects listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName) { + return listWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner get(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner update(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaImpl.java new file mode 100644 index 0000000000000..2f5f61fba839b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Quota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.QuotaName; + +class QuotaImpl extends WrapperImpl implements Quota { + private final DataMigrationManager manager; + + QuotaImpl(QuotaInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public QuotaName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaInner.java new file mode 100644 index 0000000000000..8d3de71e113fc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/QuotaInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.QuotaName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a quota for or usage details about a resource. + */ +public class QuotaInner { + /** + * The current value of the quota. If null or missing, the current value + * cannot be determined in the context of the request. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /** + * The resource ID of the quota object. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The maximum value of the quota. If null or missing, the quota has no + * maximum, in which case it merely tracks usage. + */ + @JsonProperty(value = "limit") + private Double limit; + + /** + * The name of the quota. + */ + @JsonProperty(value = "name") + private QuotaName name; + + /** + * The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @param currentValue the currentValue value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the resource ID of the quota object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the quota object. + * + * @param id the id value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Set the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @param limit the limit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the quota. + * + * @return the name value + */ + public QuotaName name() { + return this.name; + } + + /** + * Set the name of the quota. + * + * @param name the name value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withName(QuotaName name) { + this.name = name; + return this; + } + + /** + * Get the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @param unit the unit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..a0c8a6490ac2b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuRestrictions; + +class ResourceSkuImpl extends WrapperImpl implements ResourceSku { + private final DataMigrationManager manager; + ResourceSkuImpl(ResourceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public List apiVersions() { + return this.inner().apiVersions(); + } + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public ResourceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public List costs() { + return this.inner().costs(); + } + + @Override + public String family() { + return this.inner().family(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String size() { + return this.inner().size(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuInner.java new file mode 100644 index 0000000000000..f6938080a361c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkuInner.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCapacity; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an available DMS SKU. + */ +public class ResourceSkuInner { + /** + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Specifies the tier of DMS in a scale set. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /** + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /** + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Not used. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /** + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /** + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the type of resource the SKU applies to. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get specifies the tier of DMS in a scale set. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the Size of the SKU. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Get the Family of this particular SKU. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Get the Kind of resources that are supported in this SKU. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Get not used. + * + * @return the capacity value + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the api versions that support this SKU. + * + * @return the apiVersions value + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get metadata for retrieving price info. + * + * @return the costs value + */ + public List costs() { + return this.costs; + } + + /** + * Get a name value pair to describe the capability. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusImpl.java new file mode 100644 index 0000000000000..a9a34b39dcf35 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSku; + +class ResourceSkusImpl extends WrapperImpl implements ResourceSkus { + private final DataMigrationManager manager; + + ResourceSkusImpl(DataMigrationManager manager) { + super(manager.inner().resourceSkus()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + ResourceSkusInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceSku call(ResourceSkuInner inner) { + return new ResourceSkuImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusInner.java new file mode 100644 index 0000000000000..c5ffa3a98c1f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ResourceSkusInner.java @@ -0,0 +1,297 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ResourceSkus. + */ +public class ResourceSkusInner { + /** The Retrofit service to perform REST calls. */ + private ResourceSkusService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ResourceSkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourceSkusInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ResourceSkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourceSkus to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourceSkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ResourceSkus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationImpl.java new file mode 100644 index 0000000000000..06c8fef2eecae --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceOperationDisplay; + +class ServiceOperationImpl extends WrapperImpl implements ServiceOperation { + private final DataMigrationManager manager; + ServiceOperationImpl(ServiceOperationInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ServiceOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationInner.java new file mode 100644 index 0000000000000..4561d24c7a4c2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServiceOperationInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ServiceOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of an action supported by the Data Migration Service. + */ +public class ServiceOperationInner { + /** + * The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized display text. + */ + @JsonProperty(value = "display") + private ServiceOperationDisplay display; + + /** + * Get the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @param name the name value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized display text. + * + * @return the display value + */ + public ServiceOperationDisplay display() { + return this.display; + } + + /** + * Set localized display text. + * + * @param display the display value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..7727bbc168f92 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesImpl.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DataMigrationService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameAvailabilityResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameAvailabilityRequest; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.AvailableServiceSku; + +class ServicesImpl extends GroupableResourcesCoreImpl implements Services { + protected ServicesImpl(DataMigrationManager manager) { + super(manager.inner().services(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataMigrationServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkStatusAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.checkStatusAsync(groupName, serviceName) + .map(new Func1() { + @Override + public DataMigrationServiceStatusResponse call(DataMigrationServiceStatusResponseInner inner) { + return new DataMigrationServiceStatusResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable startAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.startAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Completable stopAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.stopAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkChildrenNameAvailabilityAsync(groupName, serviceName, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + protected DataMigrationServiceImpl wrapModel(DataMigrationServiceInner inner) { + return new DataMigrationServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected DataMigrationServiceImpl wrapModel(String name) { + return new DataMigrationServiceImpl(name, new DataMigrationServiceInner(), this.manager()); + } + + private AvailableServiceSkuImpl wrapAvailableServiceSkuModel(AvailableServiceSkuInner inner) { + return new AvailableServiceSkuImpl(inner, manager()); + } + + @Override + public Observable listSkusAsync(final String groupName, final String serviceName) { + ServicesInner client = this.inner(); + return client.listSkusAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailableServiceSku call(AvailableServiceSkuInner inner) { + return wrapAvailableServiceSkuModel(inner); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesInner.java new file mode 100644 index 0000000000000..bc7d8790b660c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/ServicesInner.java @@ -0,0 +1,2240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.NameAvailabilityRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services checkStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus") + Observable> checkStatus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services listSkus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus") + Observable> listSkus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services checkChildrenNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability") + Observable> checkChildrenNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services listSkusNext" }) + @GET + Observable> listSkusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable getByResourceGroupAsync(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName) { + deleteWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName) { + return deleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName) { + beginDeleteWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName, Boolean deleteRunningTasks) { + beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceStatusResponseInner object if successful. + */ + public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkStatusAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkStatusWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable checkStatusAsync(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceStatusResponseInner>() { + @Override + public DataMigrationServiceStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable> checkStatusWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.checkStatus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkStatusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String groupName, String serviceName) { + startWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String groupName, String serviceName) { + return startWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String groupName, String serviceName) { + beginStartWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String groupName, String serviceName) { + return beginStartWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String groupName, String serviceName) { + stopWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String groupName, String serviceName) { + return stopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String groupName, String serviceName) { + beginStopWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String groupName, String serviceName) { + return beginStopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkus(final String groupName, final String serviceName) { + ServiceResponse> response = listSkusSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusAsync(final String groupName, final String serviceName) { + return listSkusWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSkusSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkChildrenNameAvailabilityWithServiceResponseAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkChildrenNameAvailability(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkChildrenNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkChildrenNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String groupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(groupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String groupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(groupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String groupName) { + return listByResourceGroupWithServiceResponseAsync(groupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String groupName) { + return listByResourceGroupSinglePageAsync(groupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String groupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), groupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkusNext(final String nextPageLink) { + ServiceResponse> response = listSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusNextAsync(final String nextPageLink) { + return listSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusNextWithServiceResponseAsync(final String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSkusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksImpl.java new file mode 100644 index 0000000000000..1c21a5d7b2c55 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksImpl.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ProjectTask; + +class TasksImpl extends WrapperImpl implements Tasks { + private final DataMigrationManager manager; + + TasksImpl(DataMigrationManager manager) { + super(manager.inner().tasks()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectTaskImpl define(String name) { + return wrapModel(name); + } + + private ProjectTaskImpl wrapModel(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + + private ProjectTaskImpl wrapModel(String name) { + return new ProjectTaskImpl(name, this.manager()); + } + + @Override + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.cancelAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName, final String projectName) { + TasksInner client = this.inner(); + return client.listAsync(groupName, serviceName, projectName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName, taskName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksInner.java new file mode 100644 index 0000000000000..ff86d6eb789f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/TasksInner.java @@ -0,0 +1,1223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tasks. + */ +public class TasksInner { + /** The Retrofit service to perform REST calls. */ + private TasksService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of TasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TasksInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(TasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tasks to be + * used by Retrofit to perform actually REST calls. + */ + interface TasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Query("taskType") String taskType, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Tasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName) { + return listWithServiceResponseAsync(groupName, serviceName, projectName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName) { + return listSinglePageAsync(groupName, serviceName, projectName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String taskType = null; + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName, final String taskType) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName, taskType).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName, taskType), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listWithServiceResponseAsync(groupName, serviceName, projectName, taskType) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listSinglePageAsync(groupName, serviceName, projectName, taskType) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + ServiceResponse> * @param projectName Name of the project + ServiceResponse> * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner createOrUpdate(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner update(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> cancelWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancel(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesImpl.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..74a9d65262b6f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Quota; + +class UsagesImpl extends WrapperImpl implements Usages { + private final DataMigrationManager manager; + + UsagesImpl(DataMigrationManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + private QuotaImpl wrapModel(QuotaInner inner) { + return new QuotaImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Quota call(QuotaInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesInner.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesInner.java new file mode 100644 index 0000000000000..96b586289bc60 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/UsagesInner.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + ServiceResponse> * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/package-info.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/package-info.java new file mode 100644 index 0000000000000..9cc7606f0a426 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview.implementation; diff --git a/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/package-info.java b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/package-info.java new file mode 100644 index 0000000000000..ccc9ae1ba6e75 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2017_11_15_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2017_11_15_preview; diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/pom.xml b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/pom.xml new file mode 100644 index 0000000000000..8ecf34adb8983 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.azuredatabasemigrationservice.v2018_03_31_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datamigration + 1.0.0-beta + jar + Microsoft Azure SDK for DataMigration Management + This package contains Microsoft DataMigration Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiError.java new file mode 100644 index 0000000000000..b04d2188a4e79 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiError.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information. + */ +public class ApiError { + /** + * Error information in OData format. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get error information in OData format. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set error information in OData format. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiErrorException.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiErrorException.java new file mode 100644 index 0000000000000..78c416aeaafa2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AuthenticationType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AuthenticationType.java new file mode 100644 index 0000000000000..780b359bdead5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AuthenticationType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationType. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** Static value None for AuthenticationType. */ + public static final AuthenticationType NONE = fromString("None"); + + /** Static value WindowsAuthentication for AuthenticationType. */ + public static final AuthenticationType WINDOWS_AUTHENTICATION = fromString("WindowsAuthentication"); + + /** Static value SqlAuthentication for AuthenticationType. */ + public static final AuthenticationType SQL_AUTHENTICATION = fromString("SqlAuthentication"); + + /** Static value ActiveDirectoryIntegrated for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_INTEGRATED = fromString("ActiveDirectoryIntegrated"); + + /** Static value ActiveDirectoryPassword for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_PASSWORD = fromString("ActiveDirectoryPassword"); + + /** + * Creates or finds a AuthenticationType from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationType + */ + @JsonCreator + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * @return known AuthenticationType values + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSku.java new file mode 100644 index 0000000000000..2e75e643f132f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSku.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.AvailableServiceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; + +/** + * Type representing AvailableServiceSku. + */ +public interface AvailableServiceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + AvailableServiceSkuCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + AvailableServiceSkuSku sku(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuCapacity.java new file mode 100644 index 0000000000000..bba7cb3218fea --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuCapacity.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A description of the scaling capacities of the SKU. + */ +public class AvailableServiceSkuCapacity { + /** + * The minimum capacity, usually 0 or 1. + */ + @JsonProperty(value = "minimum") + private Integer minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /** + * The scalability approach. Possible values include: 'none', 'manual', + * 'automatic'. + */ + @JsonProperty(value = "scaleType") + private ServiceScalability scaleType; + + /** + * Get the minimum capacity, usually 0 or 1. + * + * @return the minimum value + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Set the minimum capacity, usually 0 or 1. + * + * @param minimum the minimum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMinimum(Integer minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum capacity. + * + * @param maximum the maximum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the default capacity. + * + * @param defaultProperty the defaultProperty value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @return the scaleType value + */ + public ServiceScalability scaleType() { + return this.scaleType; + } + + /** + * Set the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @param scaleType the scaleType value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withScaleType(ServiceScalability scaleType) { + this.scaleType = scaleType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuSku.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuSku.java new file mode 100644 index 0000000000000..ade107c33b09f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/AvailableServiceSkuSku.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU name, tier, etc. + */ +public class AvailableServiceSkuSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SKU family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * SKU size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get sKU family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set sKU family. + * + * @param family the family value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get sKU size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set sKU size. + * + * @param size the size value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * + * @param tier the tier value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/BlobShare.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/BlobShare.java new file mode 100644 index 0000000000000..a7569f5284965 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/BlobShare.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob container storage information. + */ +public class BlobShare { + /** + * SAS URI of Azure Storage Account Container. + */ + @JsonProperty(value = "sasUri", required = true) + private String sasUri; + + /** + * Get sAS URI of Azure Storage Account Container. + * + * @return the sasUri value + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set sAS URI of Azure Storage Account Container. + * + * @param sasUri the sasUri value to set + * @return the BlobShare object itself. + */ + public BlobShare withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskInput.java new file mode 100644 index 0000000000000..e113df82329c5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +public class ConnectToSourceSqlServerTaskInput { + /** + * Connection information for Source SQL Server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Permission group for validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB'. + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /** + * Flag for whether to collect logins from source server. + */ + @JsonProperty(value = "CollectLogins") + private Boolean collectLogins; + + /** + * Flag for whether to collect agent jobs from source server. + */ + @JsonProperty(value = "CollectAgentJobs") + private Boolean collectAgentJobs; + + /** + * Get connection information for Source SQL Server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for Source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB'. + * + * @return the checkPermissionsGroup value + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB'. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCheckPermissionsGroup(ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + + /** + * Get flag for whether to collect logins from source server. + * + * @return the collectLogins value + */ + public Boolean collectLogins() { + return this.collectLogins; + } + + /** + * Set flag for whether to collect logins from source server. + * + * @param collectLogins the collectLogins value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectLogins(Boolean collectLogins) { + this.collectLogins = collectLogins; + return this; + } + + /** + * Get flag for whether to collect agent jobs from source server. + * + * @return the collectAgentJobs value + */ + public Boolean collectAgentJobs() { + return this.collectAgentJobs; + } + + /** + * Set flag for whether to collect agent jobs from source server. + * + * @param collectAgentJobs the collectAgentJobs value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAgentJobs) { + this.collectAgentJobs = collectAgentJobs; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutput.java new file mode 100644 index 0000000000000..47223c9ba1756 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ConnectToSourceSqlServerTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = ConnectToSourceSqlServerTaskOutputAgentJobLevel.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = ConnectToSourceSqlServerTaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = ConnectToSourceSqlServerTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TaskLevelOutput", value = ConnectToSourceSqlServerTaskOutputTaskLevel.class) +}) +public class ConnectToSourceSqlServerTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java new file mode 100644 index 0000000000000..3af4277511087 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AgentJob level output for the task that validates connection to SQL Server + * and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +public class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * AgentJob name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of AgentJob. + */ + @JsonProperty(value = "jobCategory", access = JsonProperty.Access.WRITE_ONLY) + private String jobCategory; + + /** + * The state of the original AgentJob. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * The owner of the AgentJob. + */ + @JsonProperty(value = "jobOwner", access = JsonProperty.Access.WRITE_ONLY) + private String jobOwner; + + /** + * UTC Date and time when the AgentJob was last executed. + */ + @JsonProperty(value = "lastExecutedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastExecutedOn; + + /** + * Information about eligiblity of agent job for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get agentJob name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of AgentJob. + * + * @return the jobCategory value + */ + public String jobCategory() { + return this.jobCategory; + } + + /** + * Get the state of the original AgentJob. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the owner of the AgentJob. + * + * @return the jobOwner value + */ + public String jobOwner() { + return this.jobOwner; + } + + /** + * Get uTC Date and time when the AgentJob was last executed. + * + * @return the lastExecutedOn value + */ + public DateTime lastExecutedOn() { + return this.lastExecutedOn; + } + + /** + * Get information about eligiblity of agent job for migration. + * + * @return the migrationEligibility value + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..60572d70e4d17 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Database level output for the task that validates connection to SQL Server + * and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Database name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * The list of database files. + */ + @JsonProperty(value = "databaseFiles", access = JsonProperty.Access.WRITE_ONLY) + private List databaseFiles; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseCompatLevel compatibilityLevel; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseState databaseState; + + /** + * Get database name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get the list of database files. + * + * @return the databaseFiles value + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java new file mode 100644 index 0000000000000..cd3290d8f7b03 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Login level output for the task that validates connection to SQL Server and + * also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +public class ConnectToSourceSqlServerTaskOutputLoginLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Login name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of login. Possible values include: 'WindowsUser', + * 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', + * 'ExternalUser', 'ExternalGroup'. + */ + @JsonProperty(value = "loginType", access = JsonProperty.Access.WRITE_ONLY) + private LoginType loginType; + + /** + * The default database for the login. + */ + @JsonProperty(value = "defaultDatabase", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDatabase; + + /** + * The state of the login. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Information about eligiblity of login for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get login name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of login. Possible values include: 'WindowsUser', 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', 'ExternalUser', 'ExternalGroup'. + * + * @return the loginType value + */ + public LoginType loginType() { + return this.loginType; + } + + /** + * Get the default database for the login. + * + * @return the defaultDatabase value + */ + public String defaultDatabase() { + return this.defaultDatabase; + } + + /** + * Get the state of the login. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get information about eligiblity of login for migration. + * + * @return the migrationEligibility value + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java new file mode 100644 index 0000000000000..94c441018a211 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Task level output for the task that validates connection to SQL Server and + * also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TaskLevelOutput") +public class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Source logins as a map from login name to login id. + */ + @JsonProperty(value = "Logins", access = JsonProperty.Access.WRITE_ONLY) + private Map logins; + + /** + * Source agent jobs as a map from agent job name to id. + */ + @JsonProperty(value = "AgentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Map agentJobs; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get source logins as a map from login name to login id. + * + * @return the logins value + */ + public Map logins() { + return this.logins; + } + + /** + * Get source agent jobs as a map from agent job name to id. + * + * @return the agentJobs value + */ + public Map agentJobs() { + return this.agentJobs; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskProperties.java new file mode 100644 index 0000000000000..ca98a69f79fc6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToSourceSqlServerTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer") +public class ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskInput.java new file mode 100644 index 0000000000000..1a2c196f8f1d0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskInput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskInput { + /** + * Connection information for target SQL DB. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for target SQL DB. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlDbTaskInput object itself. + */ + public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskOutput.java new file mode 100644 index 0000000000000..b600b4ac7c24b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskOutput.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Version of the target server. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get version of the target server. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskProperties.java new file mode 100644 index 0000000000000..e5ca7a832423c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb") +public class ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withInput(ConnectToTargetSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskInput.java new file mode 100644 index 0000000000000..90c2745111257 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskInput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to Azure SQL Database Managed + * Instance. + */ +public class ConnectToTargetSqlMITaskInput { + /** + * Connection information for target SQL Server. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for target SQL Server. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL Server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskOutput.java new file mode 100644 index 0000000000000..8940be530da40 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskOutput.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to Azure SQL Database Managed + * Instance. + */ +public class ConnectToTargetSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * List of logins on the target server. + */ + @JsonProperty(value = "Logins", access = JsonProperty.Access.WRITE_ONLY) + private List logins; + + /** + * List of agent jobs on the target server. + */ + @JsonProperty(value = "AgentJobs", access = JsonProperty.Access.WRITE_ONLY) + private List agentJobs; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get list of logins on the target server. + * + * @return the logins value + */ + public List logins() { + return this.logins; + } + + /** + * Get list of agent jobs on the target server. + * + * @return the agentJobs value + */ + public List agentJobs() { + return this.agentJobs; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskProperties.java new file mode 100644 index 0000000000000..49c0ea4cefd5b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectToTargetSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureSqlDbMI") +public class ConnectToTargetSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlMITaskProperties object itself. + */ + public ConnectToTargetSqlMITaskProperties withInput(ConnectToTargetSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectionInfo.java new file mode 100644 index 0000000000000..99aee0c7bfcc2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ConnectionInfo.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the connection properties of a server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class) +}) +public class ConnectionInfo { + /** + * User name. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * Password credential. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set user name. + * + * @param userName the userName value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get password credential. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password credential. + * + * @param password the password value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataIntegrityValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataIntegrityValidationResult.java new file mode 100644 index 0000000000000..e3b0ee50eb3ff --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataIntegrityValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for checksum based Data Integrity validation results. + */ +public class DataIntegrityValidationResult { + /** + * List of failed table names of source and target pair. + */ + @JsonProperty(value = "failedObjects") + private Map failedObjects; + + /** + * List of errors that happened while performing data integrity validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of failed table names of source and target pair. + * + * @return the failedObjects value + */ + public Map failedObjects() { + return this.failedObjects; + } + + /** + * Set list of failed table names of source and target pair. + * + * @param failedObjects the failedObjects value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withFailedObjects(Map failedObjects) { + this.failedObjects = failedObjects; + return this; + } + + /** + * Get list of errors that happened while performing data integrity validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing data integrity validation. + * + * @param validationErrors the validationErrors value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataItemMigrationSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataItemMigrationSummaryResult.java new file mode 100644 index 0000000000000..a98e538e782cb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataItemMigrationSummaryResult.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Basic summary of a data item migration. + */ +public class DataItemMigrationSummaryResult { + /** + * Name of the item. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationError.java new file mode 100644 index 0000000000000..10c90b0402c84 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationError.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Task errors. + */ +public class DataMigrationError { + /** + * Error description. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Type of error. Possible values include: 'Default', 'Warning', 'Error'. + */ + @JsonProperty(value = "type") + private ErrorType type; + + /** + * Get error description. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get type of error. Possible values include: 'Default', 'Warning', 'Error'. + * + * @return the type value + */ + public ErrorType type() { + return this.type; + } + + /** + * Set type of error. Possible values include: 'Default', 'Warning', 'Error'. + * + * @param type the type value to set + * @return the DataMigrationError object itself. + */ + public DataMigrationError withType(ErrorType type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationProjectMetadata.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationProjectMetadata.java new file mode 100644 index 0000000000000..df459a2c4de6b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationProjectMetadata.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common metadata for migration projects. + */ +public class DataMigrationProjectMetadata { + /** + * Source server name. + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /** + * Source server port number. + */ + @JsonProperty(value = "sourceServerPort", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerPort; + + /** + * Source username. + */ + @JsonProperty(value = "sourceUsername", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUsername; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerName; + + /** + * Target username. + */ + @JsonProperty(value = "targetUsername", access = JsonProperty.Access.WRITE_ONLY) + private String targetUsername; + + /** + * Target database name. + */ + @JsonProperty(value = "targetDbName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDbName; + + /** + * Whether target connection is Windows authentication. + */ + @JsonProperty(value = "targetUsingWinAuth", access = JsonProperty.Access.WRITE_ONLY) + private Boolean targetUsingWinAuth; + + /** + * List of tables selected for migration. + */ + @JsonProperty(value = "selectedMigrationTables", access = JsonProperty.Access.WRITE_ONLY) + private List selectedMigrationTables; + + /** + * Get source server name. + * + * @return the sourceServerName value + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get source server port number. + * + * @return the sourceServerPort value + */ + public String sourceServerPort() { + return this.sourceServerPort; + } + + /** + * Get source username. + * + * @return the sourceUsername value + */ + public String sourceUsername() { + return this.sourceUsername; + } + + /** + * Get target server name. + * + * @return the targetServerName value + */ + public String targetServerName() { + return this.targetServerName; + } + + /** + * Get target username. + * + * @return the targetUsername value + */ + public String targetUsername() { + return this.targetUsername; + } + + /** + * Get target database name. + * + * @return the targetDbName value + */ + public String targetDbName() { + return this.targetDbName; + } + + /** + * Get whether target connection is Windows authentication. + * + * @return the targetUsingWinAuth value + */ + public Boolean targetUsingWinAuth() { + return this.targetUsingWinAuth; + } + + /** + * Get list of tables selected for migration. + * + * @return the selectedMigrationTables value + */ + public List selectedMigrationTables() { + return this.selectedMigrationTables; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationService.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationService.java new file mode 100644 index 0000000000000..36352b2dd516d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationService.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationServiceInner; + +/** + * Type representing DataMigrationService. + */ +public interface DataMigrationService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the provisioningState value. + */ + ServiceProvisioningState provisioningState(); + + /** + * @return the publicKey value. + */ + String publicKey(); + + /** + * @return the sku value. + */ + ServiceSku sku(); + + /** + * @return the virtualSubnetId value. + */ + String virtualSubnetId(); + + /** + * The entirety of the DataMigrationService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithVirtualSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataMigrationService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataMigrationService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataMigrationService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datamigrationservice definition allowing to specify VirtualSubnetId. + */ + interface WithVirtualSubnetId { + /** + * Specifies virtualSubnetId. + * @param virtualSubnetId The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + * @return the next definition stage +*/ + WithCreate withVirtualSubnetId(String virtualSubnetId); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next definition stage + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the datamigrationservice definition allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next definition stage + */ + WithCreate withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next definition stage + */ + WithCreate withSku(ServiceSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithKind, DefinitionStages.WithPublicKey, DefinitionStages.WithSku { + } + } + /** + * The template for a DataMigrationService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithPublicKey, UpdateStages.WithSku { + } + + /** + * Grouping of DataMigrationService update stages. + */ + interface UpdateStages { + /** + * The stage of the datamigrationservice update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the datamigrationservice update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next update stage + */ + Update withKind(String kind); + } + + /** + * The stage of the datamigrationservice update allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next update stage + */ + Update withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next update stage + */ + Update withSku(ServiceSku sku); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationServiceStatusResponse.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationServiceStatusResponse.java new file mode 100644 index 0000000000000..cade794d590ba --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DataMigrationServiceStatusResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationServiceStatusResponseInner; +import java.util.List; + +/** + * Type representing DataMigrationServiceStatusResponse. + */ +public interface DataMigrationServiceStatusResponse extends HasInner, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the supportedTaskTypes value. + */ + List supportedTaskTypes(); + + /** + * @return the vmSize value. + */ + String vmSize(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Database.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Database.java new file mode 100644 index 0000000000000..86f287584be7a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Database.java @@ -0,0 +1,463 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a single database. + */ +public class Database { + /** + * Unique identifier for the database. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel") + private DatabaseCompatLevel compatibilityLevel; + + /** + * Collation name of the database. + */ + @JsonProperty(value = "collation") + private String collation; + + /** + * Name of the server. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Fully qualified name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Install id of the database. + */ + @JsonProperty(value = "installId") + private String installId; + + /** + * Version of the server. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** + * Edition of the server. + */ + @JsonProperty(value = "serverEdition") + private String serverEdition; + + /** + * Product level of the server (RTM, SP, CTP). + */ + @JsonProperty(value = "serverLevel") + private String serverLevel; + + /** + * Default path of the data files. + */ + @JsonProperty(value = "serverDefaultDataPath") + private String serverDefaultDataPath; + + /** + * Default path of the log files. + */ + @JsonProperty(value = "serverDefaultLogPath") + private String serverDefaultLogPath; + + /** + * Default path of the backup folder. + */ + @JsonProperty(value = "serverDefaultBackupPath") + private String serverDefaultBackupPath; + + /** + * Number of cores on the server. + */ + @JsonProperty(value = "serverCoreCount") + private Integer serverCoreCount; + + /** + * Number of cores on the server that have VISIBLE ONLINE status. + */ + @JsonProperty(value = "serverVisibleOnlineCoreCount") + private Integer serverVisibleOnlineCoreCount; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState") + private DatabaseState databaseState; + + /** + * The unique Server Id. + */ + @JsonProperty(value = "serverId") + private String serverId; + + /** + * Get unique identifier for the database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for the database. + * + * @param id the id value to set + * @return the Database object itself. + */ + public Database withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the Database object itself. + */ + public Database withName(String name) { + this.name = name; + return this; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the Database object itself. + */ + public Database withCompatibilityLevel(DatabaseCompatLevel compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get collation name of the database. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set collation name of the database. + * + * @param collation the collation value to set + * @return the Database object itself. + */ + public Database withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set name of the server. + * + * @param serverName the serverName value to set + * @return the Database object itself. + */ + public Database withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get fully qualified name. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified name. + * + * @param fqdn the fqdn value to set + * @return the Database object itself. + */ + public Database withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get install id of the database. + * + * @return the installId value + */ + public String installId() { + return this.installId; + } + + /** + * Set install id of the database. + * + * @param installId the installId value to set + * @return the Database object itself. + */ + public Database withInstallId(String installId) { + this.installId = installId; + return this; + } + + /** + * Get version of the server. + * + * @return the serverVersion value + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set version of the server. + * + * @param serverVersion the serverVersion value to set + * @return the Database object itself. + */ + public Database withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get edition of the server. + * + * @return the serverEdition value + */ + public String serverEdition() { + return this.serverEdition; + } + + /** + * Set edition of the server. + * + * @param serverEdition the serverEdition value to set + * @return the Database object itself. + */ + public Database withServerEdition(String serverEdition) { + this.serverEdition = serverEdition; + return this; + } + + /** + * Get product level of the server (RTM, SP, CTP). + * + * @return the serverLevel value + */ + public String serverLevel() { + return this.serverLevel; + } + + /** + * Set product level of the server (RTM, SP, CTP). + * + * @param serverLevel the serverLevel value to set + * @return the Database object itself. + */ + public Database withServerLevel(String serverLevel) { + this.serverLevel = serverLevel; + return this; + } + + /** + * Get default path of the data files. + * + * @return the serverDefaultDataPath value + */ + public String serverDefaultDataPath() { + return this.serverDefaultDataPath; + } + + /** + * Set default path of the data files. + * + * @param serverDefaultDataPath the serverDefaultDataPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultDataPath(String serverDefaultDataPath) { + this.serverDefaultDataPath = serverDefaultDataPath; + return this; + } + + /** + * Get default path of the log files. + * + * @return the serverDefaultLogPath value + */ + public String serverDefaultLogPath() { + return this.serverDefaultLogPath; + } + + /** + * Set default path of the log files. + * + * @param serverDefaultLogPath the serverDefaultLogPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultLogPath(String serverDefaultLogPath) { + this.serverDefaultLogPath = serverDefaultLogPath; + return this; + } + + /** + * Get default path of the backup folder. + * + * @return the serverDefaultBackupPath value + */ + public String serverDefaultBackupPath() { + return this.serverDefaultBackupPath; + } + + /** + * Set default path of the backup folder. + * + * @param serverDefaultBackupPath the serverDefaultBackupPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultBackupPath(String serverDefaultBackupPath) { + this.serverDefaultBackupPath = serverDefaultBackupPath; + return this; + } + + /** + * Get number of cores on the server. + * + * @return the serverCoreCount value + */ + public Integer serverCoreCount() { + return this.serverCoreCount; + } + + /** + * Set number of cores on the server. + * + * @param serverCoreCount the serverCoreCount value to set + * @return the Database object itself. + */ + public Database withServerCoreCount(Integer serverCoreCount) { + this.serverCoreCount = serverCoreCount; + return this; + } + + /** + * Get number of cores on the server that have VISIBLE ONLINE status. + * + * @return the serverVisibleOnlineCoreCount value + */ + public Integer serverVisibleOnlineCoreCount() { + return this.serverVisibleOnlineCoreCount; + } + + /** + * Set number of cores on the server that have VISIBLE ONLINE status. + * + * @param serverVisibleOnlineCoreCount the serverVisibleOnlineCoreCount value to set + * @return the Database object itself. + */ + public Database withServerVisibleOnlineCoreCount(Integer serverVisibleOnlineCoreCount) { + this.serverVisibleOnlineCoreCount = serverVisibleOnlineCoreCount; + return this; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + + /** + * Set state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @param databaseState the databaseState value to set + * @return the Database object itself. + */ + public Database withDatabaseState(DatabaseState databaseState) { + this.databaseState = databaseState; + return this; + } + + /** + * Get the unique Server Id. + * + * @return the serverId value + */ + public String serverId() { + return this.serverId; + } + + /** + * Set the unique Server Id. + * + * @param serverId the serverId value to set + * @return the Database object itself. + */ + public Database withServerId(String serverId) { + this.serverId = serverId; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseCompatLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseCompatLevel.java new file mode 100644 index 0000000000000..52b00c7405c1b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseCompatLevel.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseCompatLevel. + */ +public final class DatabaseCompatLevel extends ExpandableStringEnum { + /** Static value CompatLevel80 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL80 = fromString("CompatLevel80"); + + /** Static value CompatLevel90 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL90 = fromString("CompatLevel90"); + + /** Static value CompatLevel100 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL100 = fromString("CompatLevel100"); + + /** Static value CompatLevel110 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL110 = fromString("CompatLevel110"); + + /** Static value CompatLevel120 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL120 = fromString("CompatLevel120"); + + /** Static value CompatLevel130 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL130 = fromString("CompatLevel130"); + + /** Static value CompatLevel140 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL140 = fromString("CompatLevel140"); + + /** + * Creates or finds a DatabaseCompatLevel from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseCompatLevel + */ + @JsonCreator + public static DatabaseCompatLevel fromString(String name) { + return fromString(name, DatabaseCompatLevel.class); + } + + /** + * @return known DatabaseCompatLevel values + */ + public static Collection values() { + return values(DatabaseCompatLevel.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInfo.java new file mode 100644 index 0000000000000..4ccb35c56b692 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInfo.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information. + */ +public class DatabaseFileInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB") + private Double sizeMB; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set name of the database. + * + * @param databaseName the databaseName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Set size of the file in megabytes. + * + * @param sizeMB the sizeMB value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withSizeMB(Double sizeMB) { + this.sizeMB = sizeMB; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInput.java new file mode 100644 index 0000000000000..da21582377997 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileInput.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information for input. + */ +public class DatabaseFileInput { + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileType.java new file mode 100644 index 0000000000000..87a4d9800a817 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseFileType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseFileType. + */ +public final class DatabaseFileType extends ExpandableStringEnum { + /** Static value Rows for DatabaseFileType. */ + public static final DatabaseFileType ROWS = fromString("Rows"); + + /** Static value Log for DatabaseFileType. */ + public static final DatabaseFileType LOG = fromString("Log"); + + /** Static value Filestream for DatabaseFileType. */ + public static final DatabaseFileType FILESTREAM = fromString("Filestream"); + + /** Static value NotSupported for DatabaseFileType. */ + public static final DatabaseFileType NOT_SUPPORTED = fromString("NotSupported"); + + /** Static value Fulltext for DatabaseFileType. */ + public static final DatabaseFileType FULLTEXT = fromString("Fulltext"); + + /** + * Creates or finds a DatabaseFileType from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseFileType + */ + @JsonCreator + public static DatabaseFileType fromString(String name) { + return fromString(name, DatabaseFileType.class); + } + + /** + * @return known DatabaseFileType values + */ + public static Collection values() { + return values(DatabaseFileType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseInfo.java new file mode 100644 index 0000000000000..03affa8c820db --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Project Database Details. + */ +public class DatabaseInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "sourceDatabaseName", required = true) + private String sourceDatabaseName; + + /** + * Get name of the database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set name of the database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set + * @return the DatabaseInfo object itself. + */ + public DatabaseInfo withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseMigrationStage.java new file mode 100644 index 0000000000000..c51fb51b1d5f2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseMigrationStage.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseMigrationStage. + */ +public final class DatabaseMigrationStage extends ExpandableStringEnum { + /** Static value None for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage NONE = fromString("None"); + + /** Static value Initialize for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value Backup for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage BACKUP = fromString("Backup"); + + /** Static value FileCopy for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage FILE_COPY = fromString("FileCopy"); + + /** Static value Restore for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage RESTORE = fromString("Restore"); + + /** Static value Completed for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a DatabaseMigrationStage from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseMigrationStage + */ + @JsonCreator + public static DatabaseMigrationStage fromString(String name) { + return fromString(name, DatabaseMigrationStage.class); + } + + /** + * @return known DatabaseMigrationStage values + */ + public static Collection values() { + return values(DatabaseMigrationStage.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseObjectName.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseObjectName.java new file mode 100644 index 0000000000000..bfb5a1c36744c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseObjectName.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A representation of the name of an object in a database. + */ +public class DatabaseObjectName { + /** + * The unescaped name of the database containing the object. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * The unescaped name of the object. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * The unescaped name of the schema containing the object. + */ + @JsonProperty(value = "schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /** + * Type of the object in the database. Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Get the unescaped name of the database containing the object. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the unescaped name of the object. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the unescaped name of the schema containing the object. + * + * @return the schemaName value + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the DatabaseObjectName object itself. + */ + public DatabaseObjectName withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseState.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseState.java new file mode 100644 index 0000000000000..22dba20312cb7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseState. + */ +public final class DatabaseState extends ExpandableStringEnum { + /** Static value Online for DatabaseState. */ + public static final DatabaseState ONLINE = fromString("Online"); + + /** Static value Restoring for DatabaseState. */ + public static final DatabaseState RESTORING = fromString("Restoring"); + + /** Static value Recovering for DatabaseState. */ + public static final DatabaseState RECOVERING = fromString("Recovering"); + + /** Static value RecoveryPending for DatabaseState. */ + public static final DatabaseState RECOVERY_PENDING = fromString("RecoveryPending"); + + /** Static value Suspect for DatabaseState. */ + public static final DatabaseState SUSPECT = fromString("Suspect"); + + /** Static value Emergency for DatabaseState. */ + public static final DatabaseState EMERGENCY = fromString("Emergency"); + + /** Static value Offline for DatabaseState. */ + public static final DatabaseState OFFLINE = fromString("Offline"); + + /** Static value Copying for DatabaseState. */ + public static final DatabaseState COPYING = fromString("Copying"); + + /** Static value OfflineSecondary for DatabaseState. */ + public static final DatabaseState OFFLINE_SECONDARY = fromString("OfflineSecondary"); + + /** + * Creates or finds a DatabaseState from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseState + */ + @JsonCreator + public static DatabaseState fromString(String name) { + return fromString(name, DatabaseState.class); + } + + /** + * @return known DatabaseState values + */ + public static Collection values() { + return values(DatabaseState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseSummaryResult.java new file mode 100644 index 0000000000000..c5c75ae323796 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseSummaryResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Summary of database results in the migration. + */ +public class DatabaseSummaryResult extends DataItemMigrationSummaryResult { + /** + * Size of the database in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Get size of the database in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseTable.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseTable.java new file mode 100644 index 0000000000000..1fcec9402dfb7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/DatabaseTable.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Table properties. + */ +public class DatabaseTable { + /** + * Indicates whether table is empty or not. + */ + @JsonProperty(value = "hasRows", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasRows; + + /** + * Schema-qualified name of the table. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get indicates whether table is empty or not. + * + * @return the hasRows value + */ + public Boolean hasRows() { + return this.hasRows; + } + + /** + * Get schema-qualified name of the table. + * + * @return the name value + */ + public String name() { + return this.name; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ErrorType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ErrorType.java new file mode 100644 index 0000000000000..dfc5b712ecfbd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ErrorType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ErrorType. + */ +public final class ErrorType extends ExpandableStringEnum { + /** Static value Default for ErrorType. */ + public static final ErrorType DEFAULT = fromString("Default"); + + /** Static value Warning for ErrorType. */ + public static final ErrorType WARNING = fromString("Warning"); + + /** Static value Error for ErrorType. */ + public static final ErrorType ERROR = fromString("Error"); + + /** + * Creates or finds a ErrorType from its string representation. + * @param name a name to look for + * @return the corresponding ErrorType + */ + @JsonCreator + public static ErrorType fromString(String name) { + return fromString(name, ErrorType.class); + } + + /** + * @return known ErrorType values + */ + public static Collection values() { + return values(ErrorType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ExecutionStatistics.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ExecutionStatistics.java new file mode 100644 index 0000000000000..53c3a39ea0bd3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ExecutionStatistics.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ExecutionStatistics { + /** + * No. of query executions. + */ + @JsonProperty(value = "executionCount") + private Long executionCount; + + /** + * CPU Time in millisecond(s) for the query execution. + */ + @JsonProperty(value = "cpuTimeMs") + private Double cpuTimeMs; + + /** + * Time taken in millisecond(s) for executing the query. + */ + @JsonProperty(value = "elapsedTimeMs") + private Double elapsedTimeMs; + + /** + * Dictionary of sql query execution wait types and the respective + * statistics. + */ + @JsonProperty(value = "waitStats") + private Map waitStats; + + /** + * Indicates whether the query resulted in an error. + */ + @JsonProperty(value = "hasErrors") + private Boolean hasErrors; + + /** + * List of sql Errors. + */ + @JsonProperty(value = "sqlErrors") + private List sqlErrors; + + /** + * Get no. of query executions. + * + * @return the executionCount value + */ + public Long executionCount() { + return this.executionCount; + } + + /** + * Set no. of query executions. + * + * @param executionCount the executionCount value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withExecutionCount(Long executionCount) { + this.executionCount = executionCount; + return this; + } + + /** + * Get cPU Time in millisecond(s) for the query execution. + * + * @return the cpuTimeMs value + */ + public Double cpuTimeMs() { + return this.cpuTimeMs; + } + + /** + * Set cPU Time in millisecond(s) for the query execution. + * + * @param cpuTimeMs the cpuTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withCpuTimeMs(Double cpuTimeMs) { + this.cpuTimeMs = cpuTimeMs; + return this; + } + + /** + * Get time taken in millisecond(s) for executing the query. + * + * @return the elapsedTimeMs value + */ + public Double elapsedTimeMs() { + return this.elapsedTimeMs; + } + + /** + * Set time taken in millisecond(s) for executing the query. + * + * @param elapsedTimeMs the elapsedTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withElapsedTimeMs(Double elapsedTimeMs) { + this.elapsedTimeMs = elapsedTimeMs; + return this; + } + + /** + * Get dictionary of sql query execution wait types and the respective statistics. + * + * @return the waitStats value + */ + public Map waitStats() { + return this.waitStats; + } + + /** + * Set dictionary of sql query execution wait types and the respective statistics. + * + * @param waitStats the waitStats value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withWaitStats(Map waitStats) { + this.waitStats = waitStats; + return this; + } + + /** + * Get indicates whether the query resulted in an error. + * + * @return the hasErrors value + */ + public Boolean hasErrors() { + return this.hasErrors; + } + + /** + * Set indicates whether the query resulted in an error. + * + * @param hasErrors the hasErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withHasErrors(Boolean hasErrors) { + this.hasErrors = hasErrors; + return this; + } + + /** + * Get list of sql Errors. + * + * @return the sqlErrors value + */ + public List sqlErrors() { + return this.sqlErrors; + } + + /** + * Set list of sql Errors. + * + * @param sqlErrors the sqlErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withSqlErrors(List sqlErrors) { + this.sqlErrors = sqlErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/FileShare.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/FileShare.java new file mode 100644 index 0000000000000..41391b29eb87e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/FileShare.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * File share information with Path, Username, and Password. + */ +public class FileShare { + /** + * User name credential to connect to the share location. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * Password credential used to connect to the share location. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The folder path for this share. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /** + * Get user name credential to connect to the share location. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set user name credential to connect to the share location. + * + * @param userName the userName value to set + * @return the FileShare object itself. + */ + public FileShare withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get password credential used to connect to the share location. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password credential used to connect to the share location. + * + * @param password the password value to set + * @return the FileShare object itself. + */ + public FileShare withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the folder path for this share. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the folder path for this share. + * + * @param path the path value to set + * @return the FileShare object itself. + */ + public FileShare withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskInput.java new file mode 100644 index 0000000000000..36dbbe3103d1b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskInput { + /** + * Connection information for SQL Server. + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /** + * List of database names to collect tables for. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get connection information for SQL Server. + * + * @return the connectionInfo value + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get list of database names to collect tables for. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set list of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskOutput.java new file mode 100644 index 0000000000000..baf0a73de79f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskOutput.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Mapping from database name to list of tables. + */ + @JsonProperty(value = "databasesToTables", access = JsonProperty.Access.WRITE_ONLY) + private Map> databasesToTables; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get mapping from database name to list of tables. + * + * @return the databasesToTables value + */ + public Map> databasesToTables() { + return this.databasesToTables; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskProperties.java new file mode 100644 index 0000000000000..24503113ab122 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/GetUserTablesSqlTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that collects user tables for the given list of + * databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.Sql") +public class GetUserTablesSqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private GetUserTablesSqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public GetUserTablesSqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withInput(GetUserTablesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginMigrationStage.java new file mode 100644 index 0000000000000..eb446bd8dab95 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginMigrationStage.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LoginMigrationStage. + */ +public enum LoginMigrationStage { + /** Enum value None. */ + NONE("None"), + + /** Enum value Initialize. */ + INITIALIZE("Initialize"), + + /** Enum value LoginMigration. */ + LOGIN_MIGRATION("LoginMigration"), + + /** Enum value EstablishUserMapping. */ + ESTABLISH_USER_MAPPING("EstablishUserMapping"), + + /** Enum value AssignRoleMembership. */ + ASSIGN_ROLE_MEMBERSHIP("AssignRoleMembership"), + + /** Enum value AssignRoleOwnership. */ + ASSIGN_ROLE_OWNERSHIP("AssignRoleOwnership"), + + /** Enum value EstablishServerPermissions. */ + ESTABLISH_SERVER_PERMISSIONS("EstablishServerPermissions"), + + /** Enum value EstablishObjectPermissions. */ + ESTABLISH_OBJECT_PERMISSIONS("EstablishObjectPermissions"), + + /** Enum value Completed. */ + COMPLETED("Completed"); + + /** The actual serialized value for a LoginMigrationStage instance. */ + private String value; + + LoginMigrationStage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LoginMigrationStage instance. + * + * @param value the serialized value to parse. + * @return the parsed LoginMigrationStage object, or null if unable to parse. + */ + @JsonCreator + public static LoginMigrationStage fromString(String value) { + LoginMigrationStage[] items = LoginMigrationStage.values(); + for (LoginMigrationStage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginType.java new file mode 100644 index 0000000000000..04998a8e9a89d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/LoginType.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LoginType. + */ +public enum LoginType { + /** Enum value WindowsUser. */ + WINDOWS_USER("WindowsUser"), + + /** Enum value WindowsGroup. */ + WINDOWS_GROUP("WindowsGroup"), + + /** Enum value SqlLogin. */ + SQL_LOGIN("SqlLogin"), + + /** Enum value Certificate. */ + CERTIFICATE("Certificate"), + + /** Enum value AsymmetricKey. */ + ASYMMETRIC_KEY("AsymmetricKey"), + + /** Enum value ExternalUser. */ + EXTERNAL_USER("ExternalUser"), + + /** Enum value ExternalGroup. */ + EXTERNAL_GROUP("ExternalGroup"); + + /** The actual serialized value for a LoginType instance. */ + private String value; + + LoginType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LoginType instance. + * + * @param value the serialized value to parse. + * @return the parsed LoginType object, or null if unable to parse. + */ + @JsonCreator + public static LoginType fromString(String value) { + LoginType[] items = LoginType.values(); + for (LoginType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbDatabaseInput.java new file mode 100644 index 0000000000000..7757da3649b48 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB migration task inputs. + */ +public class MigrateSqlServerSqlDbDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Whether to set database read only before migration. + */ + @JsonProperty(value = "makeSourceDbReadOnly") + private Boolean makeSourceDbReadOnly; + + /** + * Mapping of source to target tables. + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. Note: Target database will be truncated before starting migration. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. Note: Target database will be truncated before starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get whether to set database read only before migration. + * + * @return the makeSourceDbReadOnly value + */ + public Boolean makeSourceDbReadOnly() { + return this.makeSourceDbReadOnly; + } + + /** + * Set whether to set database read only before migration. + * + * @param makeSourceDbReadOnly the makeSourceDbReadOnly value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withMakeSourceDbReadOnly(Boolean makeSourceDbReadOnly) { + this.makeSourceDbReadOnly = makeSourceDbReadOnly; + return this; + } + + /** + * Get mapping of source to target tables. + * + * @return the tableMap value + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set mapping of source to target tables. + * + * @param tableMap the tableMap value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskInput.java new file mode 100644 index 0000000000000..b3e4ea38df11b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskInput.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +public class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Options for enabling various post migration validations. Available + * options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of + * queries picked up automatically either from the Query Plan Cache or + * Query Store and execute them and compares the execution time between the + * source and target database. + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @return the validationOptions value + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @param validationOptions the validationOptions value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutput.java new file mode 100644 index 0000000000000..75ba514f50399 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbTaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..345abc1e207d6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration stage that this database is in. Possible values include: + * 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Number of objects. + */ + @JsonProperty(value = "numberOfObjects", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjects; + + /** + * Number of successfully completed objects. + */ + @JsonProperty(value = "numberOfObjectsCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjectsCompleted; + + /** + * Number of database/object errors. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long errorCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Summary of object results in the migration. + */ + @JsonProperty(value = "objectSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map objectSummary; + + /** + * Get name of the item. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration stage that this database is in. Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + * + * @return the stage value + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get number of objects. + * + * @return the numberOfObjects value + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get number of database/object errors. + * + * @return the errorCount value + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get summary of object results in the migration. + * + * @return the objectSummary value + */ + public Map objectSummary() { + return this.objectSummary; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputError.java new file mode 100644 index 0000000000000..445ac7ea53767 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..111731054878c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Duration of task execution in seconds. + */ + @JsonProperty(value = "durationInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long durationInSeconds; + + /** + * Current status of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Migration status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Selected databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Summary of database results in the migration. + */ + @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map databaseSummary; + + /** + * Migration Report Result, provides unique url for downloading your + * migration report. + */ + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get duration of task execution in seconds. + * + * @return the durationInSeconds value + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get current status of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get migration status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get selected databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get summary of database results in the migration. + * + * @return the databaseSummary value + */ + public Map databaseSummary() { + return this.databaseSummary; + } + + /** + * Get migration Report Result, provides unique url for downloading your migration report. + * + * @return the migrationReportResult value + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set migration Report Result, provides unique url for downloading your migration report. + * + * @param migrationReportResult the migrationReportResult value to set + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult(MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java new file mode 100644 index 0000000000000..88b9a44caa5b9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputTableLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskProperties.java new file mode 100644 index 0000000000000..40986d36ca66d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.SqlDb") +public class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withInput(MigrateSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMIDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMIDatabaseInput.java new file mode 100644 index 0000000000000..4249d6faf427f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMIDatabaseInput.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB Managed Instance + * migration task inputs. + */ +public class MigrateSqlServerSqlMIDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Name of the database at destination. + */ + @JsonProperty(value = "restoreDatabaseName", required = true) + private String restoreDatabaseName; + + /** + * Backup file share information for backing up this database. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the database at destination. + * + * @return the restoreDatabaseName value + */ + public String restoreDatabaseName() { + return this.restoreDatabaseName; + } + + /** + * Set name of the database at destination. + * + * @param restoreDatabaseName the restoreDatabaseName value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withRestoreDatabaseName(String restoreDatabaseName) { + this.restoreDatabaseName = restoreDatabaseName; + return this; + } + + /** + * Get backup file share information for backing up this database. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for backing up this database. + * + * @param backupFileShare the backupFileShare value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskInput.java new file mode 100644 index 0000000000000..105a3cb498bf3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskInput.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +public class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Logins to migrate. + */ + @JsonProperty(value = "selectedLogins") + private List selectedLogins; + + /** + * Agent Jobs to migrate. + */ + @JsonProperty(value = "selectedAgentJobs") + private List selectedAgentJobs; + + /** + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get logins to migrate. + * + * @return the selectedLogins value + */ + public List selectedLogins() { + return this.selectedLogins; + } + + /** + * Set logins to migrate. + * + * @param selectedLogins the selectedLogins value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedLogins(List selectedLogins) { + this.selectedLogins = selectedLogins; + return this; + } + + /** + * Get agent Jobs to migrate. + * + * @return the selectedAgentJobs value + */ + public List selectedAgentJobs() { + return this.selectedAgentJobs; + } + + /** + * Set agent Jobs to migrate. + * + * @param selectedAgentJobs the selectedAgentJobs value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedAgentJobs(List selectedAgentJobs) { + this.selectedAgentJobs = selectedAgentJobs; + return this; + } + + /** + * Get backup file share information for all selected databases. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutput.java new file mode 100644 index 0000000000000..09faad931edd9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlMITaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlMITaskOutputError.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = MigrateSqlServerSqlMITaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = MigrateSqlServerSqlMITaskOutputAgentJobLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlMITaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlMITaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java new file mode 100644 index 0000000000000..a53bbf7328184 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputAgentJobLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +public class MigrateSqlServerSqlMITaskOutputAgentJobLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * AgentJob name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The state of the original AgentJob. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Migration errors and warnings per job. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get agentJob name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the state of the original AgentJob. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get migration errors and warnings per job. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..de5ae179b0586 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlMITaskOutputDatabaseLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Size of the database in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Current stage of migration. Possible values include: 'None', + * 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get size of the database in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get current stage of migration. Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + * + * @return the stage value + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputError.java new file mode 100644 index 0000000000000..758b96158c6d1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlMITaskOutputError extends MigrateSqlServerSqlMITaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java new file mode 100644 index 0000000000000..56eb09af7204b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputLoginLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +public class MigrateSqlServerSqlMITaskOutputLoginLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Login name. + */ + @JsonProperty(value = "loginName", access = JsonProperty.Access.WRITE_ONLY) + private String loginName; + + /** + * Current state of login. Possible values include: 'None', 'InProgress', + * 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Current stage of login. Possible values include: 'None', 'Initialize', + * 'LoginMigration', 'EstablishUserMapping', 'AssignRoleMembership', + * 'AssignRoleOwnership', 'EstablishServerPermissions', + * 'EstablishObjectPermissions', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private LoginMigrationStage stage; + + /** + * Login migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Login migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Login migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Login migration errors and warnings per login. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get login name. + * + * @return the loginName value + */ + public String loginName() { + return this.loginName; + } + + /** + * Get current state of login. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get current stage of login. Possible values include: 'None', 'Initialize', 'LoginMigration', 'EstablishUserMapping', 'AssignRoleMembership', 'AssignRoleOwnership', 'EstablishServerPermissions', 'EstablishObjectPermissions', 'Completed'. + * + * @return the stage value + */ + public LoginMigrationStage stage() { + return this.stage; + } + + /** + * Get login migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get login migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get login migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get login migration errors and warnings per login. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..3854e58226e42 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlMITaskOutputMigrationLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current status of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Selected agent jobs as a map from name to id. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Map agentJobs; + + /** + * Selected logins as a map from name to id. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private Map logins; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Map of server role migration results. + */ + @JsonProperty(value = "serverRoleResults", access = JsonProperty.Access.WRITE_ONLY) + private Map serverRoleResults; + + /** + * Map of users to database name of orphaned users. + */ + @JsonProperty(value = "orphanedUsers", access = JsonProperty.Access.WRITE_ONLY) + private Map orphanedUsers; + + /** + * Selected databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current status of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get selected agent jobs as a map from name to id. + * + * @return the agentJobs value + */ + public Map agentJobs() { + return this.agentJobs; + } + + /** + * Get selected logins as a map from name to id. + * + * @return the logins value + */ + public Map logins() { + return this.logins; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get map of server role migration results. + * + * @return the serverRoleResults value + */ + public Map serverRoleResults() { + return this.serverRoleResults; + } + + /** + * Get map of users to database name of orphaned users. + * + * @return the orphanedUsers value + */ + public Map orphanedUsers() { + return this.orphanedUsers; + } + + /** + * Get selected databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskProperties.java new file mode 100644 index 0000000000000..4c13cd2ce9d8a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDbMI") +public class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withInput(MigrateSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlServerDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlServerDatabaseInput.java new file mode 100644 index 0000000000000..7139c79fd744f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrateSqlServerSqlServerDatabaseInput.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to SQL migration task inputs. + */ +public class MigrateSqlServerSqlServerDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of the database at destination. + */ + @JsonProperty(value = "restoreDatabaseName") + private String restoreDatabaseName; + + /** + * Backup file share information for this database. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * The list of database files. + */ + @JsonProperty(value = "databaseFiles") + private List databaseFiles; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the database at destination. + * + * @return the restoreDatabaseName value + */ + public String restoreDatabaseName() { + return this.restoreDatabaseName; + } + + /** + * Set name of the database at destination. + * + * @param restoreDatabaseName the restoreDatabaseName value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withRestoreDatabaseName(String restoreDatabaseName) { + this.restoreDatabaseName = restoreDatabaseName; + return this; + } + + /** + * Get backup file share information for this database. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for this database. + * + * @param backupFileShare the backupFileShare value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the list of database files. + * + * @return the databaseFiles value + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Set the list of database files. + * + * @param databaseFiles the databaseFiles value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withDatabaseFiles(List databaseFiles) { + this.databaseFiles = databaseFiles; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationEligibilityInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationEligibilityInfo.java new file mode 100644 index 0000000000000..ef8c07fab1bc3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationEligibilityInfo.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about migration eligibility of a server object. + */ +public class MigrationEligibilityInfo { + /** + * Whether object is eligible for migration or not. + */ + @JsonProperty(value = "isEligibileForMigration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEligibileForMigration; + + /** + * Information about eligibility failure for the server object. + */ + @JsonProperty(value = "validationMessages", access = JsonProperty.Access.WRITE_ONLY) + private List validationMessages; + + /** + * Get whether object is eligible for migration or not. + * + * @return the isEligibileForMigration value + */ + public Boolean isEligibileForMigration() { + return this.isEligibileForMigration; + } + + /** + * Get information about eligibility failure for the server object. + * + * @return the validationMessages value + */ + public List validationMessages() { + return this.validationMessages; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationReportResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationReportResult.java new file mode 100644 index 0000000000000..1f726f8e9c5cd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationReportResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration validation report result, contains the url for downloading the + * generated report. + */ +public class MigrationReportResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The url of the report. + */ + @JsonProperty(value = "reportUrl") + private String reportUrl; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set migration validation result identifier. + * + * @param id the id value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the url of the report. + * + * @return the reportUrl value + */ + public String reportUrl() { + return this.reportUrl; + } + + /** + * Set the url of the report. + * + * @param reportUrl the reportUrl value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withReportUrl(String reportUrl) { + this.reportUrl = reportUrl; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationState.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationState.java new file mode 100644 index 0000000000000..08e99eb1f92f7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MigrationState. + */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value None for MigrationState. */ + public static final MigrationState NONE = fromString("None"); + + /** Static value InProgress for MigrationState. */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for MigrationState. */ + public static final MigrationState FAILED = fromString("Failed"); + + /** Static value Warning for MigrationState. */ + public static final MigrationState WARNING = fromString("Warning"); + + /** Static value Completed for MigrationState. */ + public static final MigrationState COMPLETED = fromString("Completed"); + + /** Static value Skipped for MigrationState. */ + public static final MigrationState SKIPPED = fromString("Skipped"); + + /** Static value Stopped for MigrationState. */ + public static final MigrationState STOPPED = fromString("Stopped"); + + /** + * Creates or finds a MigrationState from its string representation. + * @param name a name to look for + * @return the corresponding MigrationState + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * @return known MigrationState values + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationStatus.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationStatus.java new file mode 100644 index 0000000000000..f628323e1060f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationStatus.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MigrationStatus. + */ +public final class MigrationStatus extends ExpandableStringEnum { + /** Static value Default for MigrationStatus. */ + public static final MigrationStatus DEFAULT = fromString("Default"); + + /** Static value Connecting for MigrationStatus. */ + public static final MigrationStatus CONNECTING = fromString("Connecting"); + + /** Static value SourceAndTargetSelected for MigrationStatus. */ + public static final MigrationStatus SOURCE_AND_TARGET_SELECTED = fromString("SourceAndTargetSelected"); + + /** Static value SelectLogins for MigrationStatus. */ + public static final MigrationStatus SELECT_LOGINS = fromString("SelectLogins"); + + /** Static value Configured for MigrationStatus. */ + public static final MigrationStatus CONFIGURED = fromString("Configured"); + + /** Static value Running for MigrationStatus. */ + public static final MigrationStatus RUNNING = fromString("Running"); + + /** Static value Error for MigrationStatus. */ + public static final MigrationStatus ERROR = fromString("Error"); + + /** Static value Stopped for MigrationStatus. */ + public static final MigrationStatus STOPPED = fromString("Stopped"); + + /** Static value Completed for MigrationStatus. */ + public static final MigrationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for MigrationStatus. */ + public static final MigrationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * Creates or finds a MigrationStatus from its string representation. + * @param name a name to look for + * @return the corresponding MigrationStatus + */ + @JsonCreator + public static MigrationStatus fromString(String name) { + return fromString(name, MigrationStatus.class); + } + + /** + * @return known MigrationStatus values + */ + public static Collection values() { + return values(MigrationStatus.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationTableMetadata.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationTableMetadata.java new file mode 100644 index 0000000000000..43709d2e40390 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationTableMetadata.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for tables selected in migration project. + */ +public class MigrationTableMetadata { + /** + * Source table name. + */ + @JsonProperty(value = "sourceTableName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceTableName; + + /** + * Target table name. + */ + @JsonProperty(value = "targetTableName", access = JsonProperty.Access.WRITE_ONLY) + private String targetTableName; + + /** + * Get source table name. + * + * @return the sourceTableName value + */ + public String sourceTableName() { + return this.sourceTableName; + } + + /** + * Get target table name. + * + * @return the targetTableName value + */ + public String targetTableName() { + return this.targetTableName; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseLevelResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseLevelResult.java new file mode 100644 index 0000000000000..c627b563ad3d4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database level validation results. + */ +public class MigrationValidationDatabaseLevelResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Provides data integrity validation result between the source and target + * tables that are migrated. + */ + @JsonProperty(value = "dataIntegrityValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private DataIntegrityValidationResult dataIntegrityValidationResult; + + /** + * Provides schema comparison result between source and target database. + */ + @JsonProperty(value = "schemaValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private SchemaComparisonValidationResult schemaValidationResult; + + /** + * Results of some of the query execution result between source and target + * database. + */ + @JsonProperty(value = "queryAnalysisValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private QueryAnalysisValidationResult queryAnalysisValidationResult; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get provides data integrity validation result between the source and target tables that are migrated. + * + * @return the dataIntegrityValidationResult value + */ + public DataIntegrityValidationResult dataIntegrityValidationResult() { + return this.dataIntegrityValidationResult; + } + + /** + * Get provides schema comparison result between source and target database. + * + * @return the schemaValidationResult value + */ + public SchemaComparisonValidationResult schemaValidationResult() { + return this.schemaValidationResult; + } + + /** + * Get results of some of the query execution result between source and target database. + * + * @return the queryAnalysisValidationResult value + */ + public QueryAnalysisValidationResult queryAnalysisValidationResult() { + return this.queryAnalysisValidationResult; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseSummaryResult.java new file mode 100644 index 0000000000000..ac4dfb48973c8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationDatabaseSummaryResult.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Database level summary result. + */ +public class MigrationValidationDatabaseSummaryResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationOptions.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationOptions.java new file mode 100644 index 0000000000000..1f4b5b7ce6586 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationOptions.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Types of validations to run after the migration. + */ +public class MigrationValidationOptions { + /** + * Allows to compare the schema information between source and target. + */ + @JsonProperty(value = "enableSchemaValidation") + private Boolean enableSchemaValidation; + + /** + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + */ + @JsonProperty(value = "enableDataIntegrityValidation") + private Boolean enableDataIntegrityValidation; + + /** + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and + * target databases for the extracted queries. + */ + @JsonProperty(value = "enableQueryAnalysisValidation") + private Boolean enableQueryAnalysisValidation; + + /** + * Get allows to compare the schema information between source and target. + * + * @return the enableSchemaValidation value + */ + public Boolean enableSchemaValidation() { + return this.enableSchemaValidation; + } + + /** + * Set allows to compare the schema information between source and target. + * + * @param enableSchemaValidation the enableSchemaValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableSchemaValidation(Boolean enableSchemaValidation) { + this.enableSchemaValidation = enableSchemaValidation; + return this; + } + + /** + * Get allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @return the enableDataIntegrityValidation value + */ + public Boolean enableDataIntegrityValidation() { + return this.enableDataIntegrityValidation; + } + + /** + * Set allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @param enableDataIntegrityValidation the enableDataIntegrityValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableDataIntegrityValidation(Boolean enableDataIntegrityValidation) { + this.enableDataIntegrityValidation = enableDataIntegrityValidation; + return this; + } + + /** + * Get allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @return the enableQueryAnalysisValidation value + */ + public Boolean enableQueryAnalysisValidation() { + return this.enableQueryAnalysisValidation; + } + + /** + * Set allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @param enableQueryAnalysisValidation the enableQueryAnalysisValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableQueryAnalysisValidation(Boolean enableQueryAnalysisValidation) { + this.enableQueryAnalysisValidation = enableQueryAnalysisValidation; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationResult.java new file mode 100644 index 0000000000000..b750eccf5e6b5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/MigrationValidationResult.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Result. + */ +public class MigrationValidationResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Validation summary results for each database. + */ + @JsonProperty(value = "summaryResults") + private Map summaryResults; + + /** + * Current status of validation at the migration level. Status from the + * database validation result status will be aggregated here. Possible + * values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get validation summary results for each database. + * + * @return the summaryResults value + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set validation summary results for each database. + * + * @param summaryResults the summaryResults value to set + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult withSummaryResults(Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get current status of validation at the migration level. Status from the database validation result status will be aggregated here. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Failed', 'Stopped'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityRequest.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..141d9e53789ab --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource type and proposed name. + */ +public class NameAvailabilityRequest { + /** + * The proposed resource name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The resource type chain (e.g. virtualMachines/extensions). + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the proposed resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the proposed resource name. + * + * @param name the name value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type chain (e.g. virtualMachines/extensions). + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type chain (e.g. virtualMachines/extensions). + * + * @param type the type value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityResponse.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityResponse.java new file mode 100644 index 0000000000000..0fb2e17799b60 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameAvailabilityResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.NameAvailabilityResponseInner; + +/** + * Type representing NameAvailabilityResponse. + */ +public interface NameAvailabilityResponse extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + NameCheckFailureReason reason(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameCheckFailureReason.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameCheckFailureReason.java new file mode 100644 index 0000000000000..ba67edf393acf --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/NameCheckFailureReason.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NameCheckFailureReason. + */ +public final class NameCheckFailureReason extends ExpandableStringEnum { + /** Static value AlreadyExists for NameCheckFailureReason. */ + public static final NameCheckFailureReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** Static value Invalid for NameCheckFailureReason. */ + public static final NameCheckFailureReason INVALID = fromString("Invalid"); + + /** + * Creates or finds a NameCheckFailureReason from its string representation. + * @param name a name to look for + * @return the corresponding NameCheckFailureReason + */ + @JsonCreator + public static NameCheckFailureReason fromString(String name) { + return fromString(name, NameCheckFailureReason.class); + } + + /** + * @return known NameCheckFailureReason values + */ + public static Collection values() { + return values(NameCheckFailureReason.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ODataError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ODataError.java new file mode 100644 index 0000000000000..b4698e513c293 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ODataError.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information in OData format. + */ +public class ODataError { + /** + * The machine-readable description of the error, such as 'InvalidRequest' + * or 'InternalServerError'. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The human-readable description of the error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Inner errors that caused this error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the human-readable description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the human-readable description of the error. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get inner errors that caused this error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set inner errors that caused this error. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ObjectType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ObjectType.java new file mode 100644 index 0000000000000..2df6f85cbe853 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ObjectType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ObjectType. + */ +public final class ObjectType extends ExpandableStringEnum { + /** Static value StoredProcedures for ObjectType. */ + public static final ObjectType STORED_PROCEDURES = fromString("StoredProcedures"); + + /** Static value Table for ObjectType. */ + public static final ObjectType TABLE = fromString("Table"); + + /** Static value User for ObjectType. */ + public static final ObjectType USER = fromString("User"); + + /** Static value View for ObjectType. */ + public static final ObjectType VIEW = fromString("View"); + + /** Static value Function for ObjectType. */ + public static final ObjectType FUNCTION = fromString("Function"); + + /** + * Creates or finds a ObjectType from its string representation. + * @param name a name to look for + * @return the corresponding ObjectType + */ + @JsonCreator + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** + * @return known ObjectType values + */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Operations.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Operations.java new file mode 100644 index 0000000000000..768b2197cef0c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Project.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Project.java new file mode 100644 index 0000000000000..2f39c48468f63 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Project.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ProjectInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import java.util.Map; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Project. + */ +public interface Project extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the databasesInfo value. + */ + List databasesInfo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProjectProvisioningState provisioningState(); + + /** + * @return the sourceConnectionInfo value. + */ + ConnectionInfo sourceConnectionInfo(); + + /** + * @return the sourcePlatform value. + */ + ProjectSourcePlatform sourcePlatform(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the targetConnectionInfo value. + */ + ConnectionInfo targetConnectionInfo(); + + /** + * @return the targetPlatform value. + */ + ProjectTargetPlatform targetPlatform(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Project definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithService, DefinitionStages.WithLocation, DefinitionStages.WithSourcePlatform, DefinitionStages.WithTargetPlatform, DefinitionStages.WithCreate { + } + + /** + * Grouping of Project definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Project definition. + */ + interface Blank extends WithService { + } + + /** + * The stage of the project definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies groupName, serviceName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @return the next definition stage + */ + WithLocation withExistingService(String groupName, String serviceName); + } + + /** + * The stage of the project definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithSourcePlatform withLocation(String location); + } + + /** + * The stage of the project definition allowing to specify SourcePlatform. + */ + interface WithSourcePlatform { + /** + * Specifies sourcePlatform. + * @param sourcePlatform Source platform for the project. Possible values include: 'SQL', 'Unknown' + * @return the next definition stage + */ + WithTargetPlatform withSourcePlatform(ProjectSourcePlatform sourcePlatform); + } + + /** + * The stage of the project definition allowing to specify TargetPlatform. + */ + interface WithTargetPlatform { + /** + * Specifies targetPlatform. + * @param targetPlatform Target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'Unknown' + * @return the next definition stage + */ + WithCreate withTargetPlatform(ProjectTargetPlatform targetPlatform); + } + + /** + * The stage of the project definition allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next definition stage + */ + WithCreate withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project definition allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next definition stage + */ + WithCreate withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the project definition allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next definition stage + */ + WithCreate withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDatabasesInfo, DefinitionStages.WithSourceConnectionInfo, DefinitionStages.WithTags, DefinitionStages.WithTargetConnectionInfo { + } + } + /** + * The template for a Project update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDatabasesInfo, UpdateStages.WithSourceConnectionInfo, UpdateStages.WithTags, UpdateStages.WithTargetConnectionInfo { + } + + /** + * Grouping of Project update stages. + */ + interface UpdateStages { + /** + * The stage of the project update allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next update stage + */ + Update withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project update allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next update stage + */ + Update withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the project update allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next update stage + */ + Update withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectProvisioningState.java new file mode 100644 index 0000000000000..6f018c2a76539 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectProvisioningState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectProvisioningState. + */ +public final class ProjectProvisioningState extends ExpandableStringEnum { + /** Static value Deleting for ProjectProvisioningState. */ + public static final ProjectProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProjectProvisioningState. */ + public static final ProjectProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates or finds a ProjectProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProjectProvisioningState + */ + @JsonCreator + public static ProjectProvisioningState fromString(String name) { + return fromString(name, ProjectProvisioningState.class); + } + + /** + * @return known ProjectProvisioningState values + */ + public static Collection values() { + return values(ProjectProvisioningState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectSourcePlatform.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectSourcePlatform.java new file mode 100644 index 0000000000000..9233f76477d0c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectSourcePlatform.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectSourcePlatform. + */ +public final class ProjectSourcePlatform extends ExpandableStringEnum { + /** Static value SQL for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform SQL = fromString("SQL"); + + /** Static value Unknown for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectSourcePlatform from its string representation. + * @param name a name to look for + * @return the corresponding ProjectSourcePlatform + */ + @JsonCreator + public static ProjectSourcePlatform fromString(String name) { + return fromString(name, ProjectSourcePlatform.class); + } + + /** + * @return known ProjectSourcePlatform values + */ + public static Collection values() { + return values(ProjectSourcePlatform.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTargetPlatform.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTargetPlatform.java new file mode 100644 index 0000000000000..a03dbe37abaf1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTargetPlatform.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectTargetPlatform. + */ +public final class ProjectTargetPlatform extends ExpandableStringEnum { + /** Static value SQLDB for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLDB = fromString("SQLDB"); + + /** Static value SQLMI for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLMI = fromString("SQLMI"); + + /** Static value Unknown for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectTargetPlatform from its string representation. + * @param name a name to look for + * @return the corresponding ProjectTargetPlatform + */ + @JsonCreator + public static ProjectTargetPlatform fromString(String name) { + return fromString(name, ProjectTargetPlatform.class); + } + + /** + * @return known ProjectTargetPlatform values + */ + public static Collection values() { + return values(ProjectTargetPlatform.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTask.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTask.java new file mode 100644 index 0000000000000..cf9da4b3c7c80 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTask.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ProjectTaskInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; + +/** + * Type representing ProjectTask. + */ +public interface ProjectTask extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProjectTaskProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ProjectTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProject, DefinitionStages.WithCreate { + } + + /** + * Grouping of ProjectTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ProjectTask definition. + */ + interface Blank extends WithProject { + } + + /** + * The stage of the projecttask definition allowing to specify Project. + */ + interface WithProject { + /** + * Specifies groupName, serviceName, projectName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @return the next definition stage + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + + /** + * The stage of the projecttask definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the projecttask definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next definition stage + */ + WithCreate withProperties(ProjectTaskProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties { + } + } + /** + * The template for a ProjectTask update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of ProjectTask update stages. + */ + interface UpdateStages { + /** + * The stage of the projecttask update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the projecttask update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next update stage + */ + Update withProperties(ProjectTaskProperties properties); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTaskProperties.java new file mode 100644 index 0000000000000..4f3d81ee82fd3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ProjectTaskProperties.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for all types of DMS task properties. If task is not supported by + * current client, this object is returned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class) +}) +public class ProjectTaskProperties { + /** + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * The state of the task. This is ignored if submitted. Possible values + * include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + * 'Failed', 'FailedInputValidation', 'Faulted'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TaskState state; + + /** + * Get array of errors. This is ignored if submitted. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Get the state of the task. This is ignored if submitted. Possible values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted'. + * + * @return the state value + */ + public TaskState state() { + return this.state; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Projects.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Projects.java new file mode 100644 index 0000000000000..e5088563bce31 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Projects.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ProjectsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Projects. + */ +public interface Projects extends SupportsCreating, HasInner { + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName); + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName); + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryAnalysisValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryAnalysisValidationResult.java new file mode 100644 index 0000000000000..53ee02c9a47c3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryAnalysisValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for query analysis comparison between the source and target. + */ +public class QueryAnalysisValidationResult { + /** + * List of queries executed and it's execution results in source and + * target. + */ + @JsonProperty(value = "queryResults") + private QueryExecutionResult queryResults; + + /** + * Errors that are part of the execution. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of queries executed and it's execution results in source and target. + * + * @return the queryResults value + */ + public QueryExecutionResult queryResults() { + return this.queryResults; + } + + /** + * Set list of queries executed and it's execution results in source and target. + * + * @param queryResults the queryResults value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) { + this.queryResults = queryResults; + return this; + } + + /** + * Get errors that are part of the execution. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set errors that are part of the execution. + * + * @param validationErrors the validationErrors value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryExecutionResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryExecutionResult.java new file mode 100644 index 0000000000000..b927146a8b906 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QueryExecutionResult.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes query analysis results for execution in source and target. + */ +public class QueryExecutionResult { + /** + * Query text retrieved from the source server. + */ + @JsonProperty(value = "queryText") + private String queryText; + + /** + * Total no. of statements in the batch. + */ + @JsonProperty(value = "statementsInBatch") + private Long statementsInBatch; + + /** + * Query analysis result from the source. + */ + @JsonProperty(value = "sourceResult") + private ExecutionStatistics sourceResult; + + /** + * Query analysis result from the target. + */ + @JsonProperty(value = "targetResult") + private ExecutionStatistics targetResult; + + /** + * Get query text retrieved from the source server. + * + * @return the queryText value + */ + public String queryText() { + return this.queryText; + } + + /** + * Set query text retrieved from the source server. + * + * @param queryText the queryText value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + + /** + * Get total no. of statements in the batch. + * + * @return the statementsInBatch value + */ + public Long statementsInBatch() { + return this.statementsInBatch; + } + + /** + * Set total no. of statements in the batch. + * + * @param statementsInBatch the statementsInBatch value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withStatementsInBatch(Long statementsInBatch) { + this.statementsInBatch = statementsInBatch; + return this; + } + + /** + * Get query analysis result from the source. + * + * @return the sourceResult value + */ + public ExecutionStatistics sourceResult() { + return this.sourceResult; + } + + /** + * Set query analysis result from the source. + * + * @param sourceResult the sourceResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withSourceResult(ExecutionStatistics sourceResult) { + this.sourceResult = sourceResult; + return this; + } + + /** + * Get query analysis result from the target. + * + * @return the targetResult value + */ + public ExecutionStatistics targetResult() { + return this.targetResult; + } + + /** + * Set query analysis result from the target. + * + * @param targetResult the targetResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withTargetResult(ExecutionStatistics targetResult) { + this.targetResult = targetResult; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Quota.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Quota.java new file mode 100644 index 0000000000000..244d77d5e66bd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Quota.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.QuotaInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; + +/** + * Type representing Quota. + */ +public interface Quota extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + QuotaName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QuotaName.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QuotaName.java new file mode 100644 index 0000000000000..9af3c41013f47 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/QuotaName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name of the quota. + */ +public class QuotaName { + /** + * The localized name of the quota. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * The unlocalized name (or ID) of the quota. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the localized name of the quota. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the quota. + * + * @param localizedValue the localizedValue value to set + * @return the QuotaName object itself. + */ + public QuotaName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get the unlocalized name (or ID) of the quota. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the unlocalized name (or ID) of the quota. + * + * @param value the value value to set + * @return the QuotaName object itself. + */ + public QuotaName withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ReportableException.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ReportableException.java new file mode 100644 index 0000000000000..55460906308fd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ReportableException.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Exception object for all custom exceptions. + */ +public class ReportableException { + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The path to the file where exception occurred. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * The line number where exception occurred. + */ + @JsonProperty(value = "lineNumber") + private String lineNumber; + + /** + * Coded numerical value that is assigned to a specific exception. + */ + @JsonProperty(value = "hResult") + private Integer hResult; + + /** + * Stack trace. + */ + @JsonProperty(value = "stackTrace") + private String stackTrace; + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ReportableException object itself. + */ + public ReportableException withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the path to the file where exception occurred. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the path to the file where exception occurred. + * + * @param filePath the filePath value to set + * @return the ReportableException object itself. + */ + public ReportableException withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the line number where exception occurred. + * + * @return the lineNumber value + */ + public String lineNumber() { + return this.lineNumber; + } + + /** + * Set the line number where exception occurred. + * + * @param lineNumber the lineNumber value to set + * @return the ReportableException object itself. + */ + public ReportableException withLineNumber(String lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * Get coded numerical value that is assigned to a specific exception. + * + * @return the hResult value + */ + public Integer hResult() { + return this.hResult; + } + + /** + * Set coded numerical value that is assigned to a specific exception. + * + * @param hResult the hResult value to set + * @return the ReportableException object itself. + */ + public ReportableException withHResult(Integer hResult) { + this.hResult = hResult; + return this; + } + + /** + * Get stack trace. + * + * @return the stackTrace value + */ + public String stackTrace() { + return this.stackTrace; + } + + /** + * Set stack trace. + * + * @param stackTrace the stackTrace value to set + * @return the ReportableException object itself. + */ + public ReportableException withStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSku.java new file mode 100644 index 0000000000000..d5c2d6fdc2ca4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSku.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ResourceSkuInner; +import java.util.List; + +/** + * Type representing ResourceSku. + */ +public interface ResourceSku extends HasInner, HasManager { + /** + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * @return the costs value. + */ + List costs(); + + /** + * @return the family value. + */ + String family(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the size value. + */ + String size(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapabilities.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..7adeb2b6e6a67 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapabilities.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes The SKU capabilites object. + */ +public class ResourceSkuCapabilities { + /** + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get an invariant to describe the feature. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get an invariant if the feature is measured by quantity. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacity.java new file mode 100644 index 0000000000000..1749216b01567 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacity.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuCapacity { + /** + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /** + * The scale type applicable to the SKU. Possible values include: + * 'Automatic', 'Manual', 'None'. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum capacity. + * + * @return the minimum value + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scale type applicable to the SKU. Possible values include: 'Automatic', 'Manual', 'None'. + * + * @return the scaleType value + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacityScaleType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacityScaleType.java new file mode 100644 index 0000000000000..9f3b233a251b6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCapacityScaleType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuCapacityScaleType. + */ +public final class ResourceSkuCapacityScaleType extends ExpandableStringEnum { + /** Static value Automatic for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType AUTOMATIC = fromString("Automatic"); + + /** Static value Manual for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType MANUAL = fromString("Manual"); + + /** Static value None for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType NONE = fromString("None"); + + /** + * Creates or finds a ResourceSkuCapacityScaleType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuCapacityScaleType + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String name) { + return fromString(name, ResourceSkuCapacityScaleType.class); + } + + /** + * @return known ResourceSkuCapacityScaleType values + */ + public static Collection values() { + return values(ResourceSkuCapacityScaleType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCosts.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCosts.java new file mode 100644 index 0000000000000..1a1e082303729 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuCosts.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes metadata for retrieving price info. + */ +public class ResourceSkuCosts { + /** + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterID; + + /** + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /** + * An invariant to show the extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get used for querying price from commerce. + * + * @return the meterID value + */ + public String meterID() { + return this.meterID; + } + + /** + * Get the multiplier is needed to extend the base metered cost. + * + * @return the quantity value + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get an invariant to show the extended unit. + * + * @return the extendedUnit value + */ + public String extendedUnit() { + return this.extendedUnit; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictions.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..78581554c4eb9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictions.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuRestrictions { + /** + * The type of restrictions. Possible values include: 'location'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsType type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason code for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type of restrictions. Possible values include: 'location'. + * + * @return the type value + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason code for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsReasonCode.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..3ac780cbdf228 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsReasonCode. + */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsReasonCode + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** + * @return known ResourceSkuRestrictionsReasonCode values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..4cfcac710822a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkuRestrictionsType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsType. + */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("location"); + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsType + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** + * @return known ResourceSkuRestrictionsType values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkus.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkus.java new file mode 100644 index 0000000000000..af1d953147224 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ResourceSkus.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ResourceSkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourceSkus. + */ +public interface ResourceSkus extends HasInner { + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResult.java new file mode 100644 index 0000000000000..f28e52f341c10 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResult.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for schema comparison between the source and target. + */ +public class SchemaComparisonValidationResult { + /** + * List of schema differences between the source and target databases. + */ + @JsonProperty(value = "schemaDifferences") + private SchemaComparisonValidationResultType schemaDifferences; + + /** + * List of errors that happened while performing schema compare validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Count of source database objects. + */ + @JsonProperty(value = "sourceDatabaseObjectCount") + private Map sourceDatabaseObjectCount; + + /** + * Count of target database objects. + */ + @JsonProperty(value = "targetDatabaseObjectCount") + private Map targetDatabaseObjectCount; + + /** + * Get list of schema differences between the source and target databases. + * + * @return the schemaDifferences value + */ + public SchemaComparisonValidationResultType schemaDifferences() { + return this.schemaDifferences; + } + + /** + * Set list of schema differences between the source and target databases. + * + * @param schemaDifferences the schemaDifferences value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSchemaDifferences(SchemaComparisonValidationResultType schemaDifferences) { + this.schemaDifferences = schemaDifferences; + return this; + } + + /** + * Get list of errors that happened while performing schema compare validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing schema compare validation. + * + * @param validationErrors the validationErrors value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get count of source database objects. + * + * @return the sourceDatabaseObjectCount value + */ + public Map sourceDatabaseObjectCount() { + return this.sourceDatabaseObjectCount; + } + + /** + * Set count of source database objects. + * + * @param sourceDatabaseObjectCount the sourceDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSourceDatabaseObjectCount(Map sourceDatabaseObjectCount) { + this.sourceDatabaseObjectCount = sourceDatabaseObjectCount; + return this; + } + + /** + * Get count of target database objects. + * + * @return the targetDatabaseObjectCount value + */ + public Map targetDatabaseObjectCount() { + return this.targetDatabaseObjectCount; + } + + /** + * Set count of target database objects. + * + * @param targetDatabaseObjectCount the targetDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withTargetDatabaseObjectCount(Map targetDatabaseObjectCount) { + this.targetDatabaseObjectCount = targetDatabaseObjectCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResultType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResultType.java new file mode 100644 index 0000000000000..5423c60b2a218 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SchemaComparisonValidationResultType.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class SchemaComparisonValidationResultType { + /** + * Name of the object that has the difference. + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Type of the object that has the difference. e.g + * (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Update action type with respect to target. Possible values include: + * 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + */ + @JsonProperty(value = "updateAction") + private UpdateActionType updateAction; + + /** + * Get name of the object that has the difference. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Set name of the object that has the difference. + * + * @param objectName the objectName value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Get type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @return the updateAction value + */ + public UpdateActionType updateAction() { + return this.updateAction; + } + + /** + * Set update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @param updateAction the updateAction value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withUpdateAction(UpdateActionType updateAction) { + this.updateAction = updateAction; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServerLevelPermissionsGroup.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServerLevelPermissionsGroup.java new file mode 100644 index 0000000000000..f0d1d27098ac4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServerLevelPermissionsGroup.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerLevelPermissionsGroup. + */ +public final class ServerLevelPermissionsGroup extends ExpandableStringEnum { + /** Static value Default for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup DEFAULT = fromString("Default"); + + /** Static value MigrationFromSqlServerToAzureDB for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB = fromString("MigrationFromSqlServerToAzureDB"); + + /** + * Creates or finds a ServerLevelPermissionsGroup from its string representation. + * @param name a name to look for + * @return the corresponding ServerLevelPermissionsGroup + */ + @JsonCreator + public static ServerLevelPermissionsGroup fromString(String name) { + return fromString(name, ServerLevelPermissionsGroup.class); + } + + /** + * @return known ServerLevelPermissionsGroup values + */ + public static Collection values() { + return values(ServerLevelPermissionsGroup.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperation.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperation.java new file mode 100644 index 0000000000000..ab45cd6fcbf24 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ServiceOperationInner; + +/** + * Type representing ServiceOperation. + */ +public interface ServiceOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + ServiceOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperationDisplay.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperationDisplay.java new file mode 100644 index 0000000000000..df94fec33a498 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceOperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display text. + */ +public class ServiceOperationDisplay { + /** + * The localized resource provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The localized resource type name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The localized operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The localized operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the localized resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the localized resource provider name. + * + * @param provider the provider value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the localized resource type name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the localized resource type name. + * + * @param resource the resource value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the localized operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the localized operation name. + * + * @param operation the operation value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the localized operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the localized operation description. + * + * @param description the description value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceProvisioningState.java new file mode 100644 index 0000000000000..84f5936cf4d5e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceProvisioningState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceProvisioningState. + */ +public final class ServiceProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ServiceProvisioningState. */ + public static final ServiceProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ServiceProvisioningState. */ + public static final ServiceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deploying for ServiceProvisioningState. */ + public static final ServiceProvisioningState DEPLOYING = fromString("Deploying"); + + /** Static value Stopped for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPED = fromString("Stopped"); + + /** Static value Stopping for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPING = fromString("Stopping"); + + /** Static value Starting for ServiceProvisioningState. */ + public static final ServiceProvisioningState STARTING = fromString("Starting"); + + /** Static value FailedToStart for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_START = fromString("FailedToStart"); + + /** Static value FailedToStop for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_STOP = fromString("FailedToStop"); + + /** Static value Succeeded for ServiceProvisioningState. */ + public static final ServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ServiceProvisioningState + */ + @JsonCreator + public static ServiceProvisioningState fromString(String name) { + return fromString(name, ServiceProvisioningState.class); + } + + /** + * @return known ServiceProvisioningState values + */ + public static Collection values() { + return values(ServiceProvisioningState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceScalability.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceScalability.java new file mode 100644 index 0000000000000..5ed85edde05e7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceScalability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceScalability. + */ +public final class ServiceScalability extends ExpandableStringEnum { + /** Static value none for ServiceScalability. */ + public static final ServiceScalability NONE = fromString("none"); + + /** Static value manual for ServiceScalability. */ + public static final ServiceScalability MANUAL = fromString("manual"); + + /** Static value automatic for ServiceScalability. */ + public static final ServiceScalability AUTOMATIC = fromString("automatic"); + + /** + * Creates or finds a ServiceScalability from its string representation. + * @param name a name to look for + * @return the corresponding ServiceScalability + */ + @JsonCreator + public static ServiceScalability fromString(String name) { + return fromString(name, ServiceScalability.class); + } + + /** + * @return known ServiceScalability values + */ + public static Collection values() { + return values(ServiceScalability.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceSku.java new file mode 100644 index 0000000000000..a1ebe1cb58908 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ServiceSku.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Azure SKU instance. + */ +public class ServiceSku { + /** + * The unique name of the SKU, such as 'P3'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The SKU family, used when the service has multiple performance classes + * within a tier, such as 'A', 'D', etc. for virtual machines. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The size of the SKU, used when the name alone does not denote a service + * size or when a SKU has multiple performance classes within a family, + * e.g. 'A1' for virtual machines. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The capacity of the SKU, if it supports scaling. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the unique name of the SKU, such as 'P3'. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the SKU, such as 'P3'. + * + * @param name the name value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * + * @param tier the tier value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @param family the family value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @param size the size value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the capacity of the SKU, if it supports scaling. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the SKU, if it supports scaling. + * + * @param capacity the capacity value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Services.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Services.java new file mode 100644 index 0000000000000..13bcb5b48eab8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Services.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSku; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkStatusAsync(String groupName, String serviceName); + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String groupName, String serviceName); + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String groupName, String serviceName); + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters); + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusAsync(final String groupName, final String serviceName); + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Severity.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Severity.java new file mode 100644 index 0000000000000..62eb7c3a57a0f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Severity.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Message for Severity. */ + public static final Severity MESSAGE = fromString("Message"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates or finds a Severity from its string representation. + * @param name a name to look for + * @return the corresponding Severity + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * @return known Severity values + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlConnectionInfo.java new file mode 100644 index 0000000000000..81747283d0e6a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlConnectionInfo.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information for connecting to SQL database server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SqlConnectionInfo") +public class SqlConnectionInfo extends ConnectionInfo { + /** + * Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /** + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /** + * Whether to encrypt the connection. + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /** + * Additional connection settings. + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /** + * Whether to trust the server certificate. + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /** + * Get data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @return the dataSource value + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @param dataSource the dataSource value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @return the authentication value + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @param authentication the authentication value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get whether to encrypt the connection. + * + * @return the encryptConnection value + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get additional connection settings. + * + * @return the additionalSettings value + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set additional connection settings. + * + * @param additionalSettings the additionalSettings value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get whether to trust the server certificate. + * + * @return the trustServerCertificate value + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlMigrationTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlMigrationTaskInput.java new file mode 100644 index 0000000000000..d8901b6b2ab66 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/SqlMigrationTaskInput.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for migration task input. + */ +public class SqlMigrationTaskInput { + /** + * Information for connecting to source. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/StartMigrationScenarioServerRoleResult.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/StartMigrationScenarioServerRoleResult.java new file mode 100644 index 0000000000000..847e2c9128bad --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/StartMigrationScenarioServerRoleResult.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Server role migration result. + */ +public class StartMigrationScenarioServerRoleResult { + /** + * Name of server role. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get name of server role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/TaskState.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/TaskState.java new file mode 100644 index 0000000000000..f295e16a88526 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/TaskState.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TaskState. + */ +public final class TaskState extends ExpandableStringEnum { + /** Static value Unknown for TaskState. */ + public static final TaskState UNKNOWN = fromString("Unknown"); + + /** Static value Queued for TaskState. */ + public static final TaskState QUEUED = fromString("Queued"); + + /** Static value Running for TaskState. */ + public static final TaskState RUNNING = fromString("Running"); + + /** Static value Canceled for TaskState. */ + public static final TaskState CANCELED = fromString("Canceled"); + + /** Static value Succeeded for TaskState. */ + public static final TaskState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TaskState. */ + public static final TaskState FAILED = fromString("Failed"); + + /** Static value FailedInputValidation for TaskState. */ + public static final TaskState FAILED_INPUT_VALIDATION = fromString("FailedInputValidation"); + + /** Static value Faulted for TaskState. */ + public static final TaskState FAULTED = fromString("Faulted"); + + /** + * Creates or finds a TaskState from its string representation. + * @param name a name to look for + * @return the corresponding TaskState + */ + @JsonCreator + public static TaskState fromString(String name) { + return fromString(name, TaskState.class); + } + + /** + * @return known TaskState values + */ + public static Collection values() { + return values(TaskState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Tasks.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Tasks.java new file mode 100644 index 0000000000000..ab2cf38e0582e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Tasks.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.TasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tasks. + */ +public interface Tasks extends SupportsCreating, HasInner { + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName, final String projectName); + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/UpdateActionType.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/UpdateActionType.java new file mode 100644 index 0000000000000..157449a490e96 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/UpdateActionType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateActionType. + */ +public final class UpdateActionType extends ExpandableStringEnum { + /** Static value DeletedOnTarget for UpdateActionType. */ + public static final UpdateActionType DELETED_ON_TARGET = fromString("DeletedOnTarget"); + + /** Static value ChangedOnTarget for UpdateActionType. */ + public static final UpdateActionType CHANGED_ON_TARGET = fromString("ChangedOnTarget"); + + /** Static value AddedOnTarget for UpdateActionType. */ + public static final UpdateActionType ADDED_ON_TARGET = fromString("AddedOnTarget"); + + /** + * Creates or finds a UpdateActionType from its string representation. + * @param name a name to look for + * @return the corresponding UpdateActionType + */ + @JsonCreator + public static UpdateActionType fromString(String name) { + return fromString(name, UpdateActionType.class); + } + + /** + * @return known UpdateActionType values + */ + public static Collection values() { + return values(UpdateActionType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Usages.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Usages.java new file mode 100644 index 0000000000000..0c30bb018de5f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/Usages.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java new file mode 100644 index 0000000000000..e56a892f0c4ec --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that validates migration input for SQL to Azure SQL Managed + * Instance. + */ +public class ValidateMigrationInputSqlServerSqlMITaskInput { + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get backup file share information for all selected databases. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java new file mode 100644 index 0000000000000..c9a46392888b7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for task that validates migration input for SQL to Azure SQL Managed + * Instance migrations. + */ +public class ValidateMigrationInputSqlServerSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Name of database. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Errors associated with the RestoreDatabaseName. + */ + @JsonProperty(value = "restoreDatabaseNameErrors", access = JsonProperty.Access.WRITE_ONLY) + private List restoreDatabaseNameErrors; + + /** + * Errors associated with the BackupFolder path. + */ + @JsonProperty(value = "backupFolderErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupFolderErrors; + + /** + * Errors associated with backup share user name and password credentials. + */ + @JsonProperty(value = "backupShareCredentialsErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupShareCredentialsErrors; + + /** + * Errors associated with the storage account provided. + */ + @JsonProperty(value = "backupStorageAccountErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupStorageAccountErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get name of database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get errors associated with the RestoreDatabaseName. + * + * @return the restoreDatabaseNameErrors value + */ + public List restoreDatabaseNameErrors() { + return this.restoreDatabaseNameErrors; + } + + /** + * Get errors associated with the BackupFolder path. + * + * @return the backupFolderErrors value + */ + public List backupFolderErrors() { + return this.backupFolderErrors; + } + + /** + * Get errors associated with backup share user name and password credentials. + * + * @return the backupShareCredentialsErrors value + */ + public List backupShareCredentialsErrors() { + return this.backupShareCredentialsErrors; + } + + /** + * Get errors associated with the storage account provided. + * + * @return the backupStorageAccountErrors value + */ + public List backupStorageAccountErrors() { + return this.backupStorageAccountErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java new file mode 100644 index 0000000000000..60dea5b2a34e0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that validates migration input for SQL to Azure SQL + * Database Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI") +public class ValidateMigrationInputSqlServerSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ValidateMigrationInputSqlServerSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ValidateMigrationInputSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskProperties withInput(ValidateMigrationInputSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationError.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationError.java new file mode 100644 index 0000000000000..f0c2667670029 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ValidationError { + /** + * Error Text. + */ + @JsonProperty(value = "text") + private String text; + + /** + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error'. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /** + * Get error Text. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Set error Text. + * + * @param text the text value to set + * @return the ValidationError object itself. + */ + public ValidationError withText(String text) { + this.text = text; + return this; + } + + /** + * Get severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Set severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @param severity the severity value to set + * @return the ValidationError object itself. + */ + public ValidationError withSeverity(Severity severity) { + this.severity = severity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationStatus.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationStatus.java new file mode 100644 index 0000000000000..58347bb7f3493 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/ValidationStatus.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ValidationStatus. + */ +public final class ValidationStatus extends ExpandableStringEnum { + /** Static value Default for ValidationStatus. */ + public static final ValidationStatus DEFAULT = fromString("Default"); + + /** Static value NotStarted for ValidationStatus. */ + public static final ValidationStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Initialized for ValidationStatus. */ + public static final ValidationStatus INITIALIZED = fromString("Initialized"); + + /** Static value InProgress for ValidationStatus. */ + public static final ValidationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for ValidationStatus. */ + public static final ValidationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithIssues for ValidationStatus. */ + public static final ValidationStatus COMPLETED_WITH_ISSUES = fromString("CompletedWithIssues"); + + /** Static value Failed for ValidationStatus. */ + public static final ValidationStatus FAILED = fromString("Failed"); + + /** Static value Stopped for ValidationStatus. */ + public static final ValidationStatus STOPPED = fromString("Stopped"); + + /** + * Creates or finds a ValidationStatus from its string representation. + * @param name a name to look for + * @return the corresponding ValidationStatus + */ + @JsonCreator + public static ValidationStatus fromString(String name) { + return fromString(name, ValidationStatus.class); + } + + /** + * @return known ValidationStatus values + */ + public static Collection values() { + return values(ValidationStatus.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/WaitStatistics.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/WaitStatistics.java new file mode 100644 index 0000000000000..cbceded127cb6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/WaitStatistics.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Wait statistics gathered during query batch execution. + */ +public class WaitStatistics { + /** + * Type of the Wait. + */ + @JsonProperty(value = "waitType") + private String waitType; + + /** + * Total wait time in millisecond(s). + */ + @JsonProperty(value = "waitTimeMs") + private Double waitTimeMs; + + /** + * Total no. of waits. + */ + @JsonProperty(value = "waitCount") + private Long waitCount; + + /** + * Get type of the Wait. + * + * @return the waitType value + */ + public String waitType() { + return this.waitType; + } + + /** + * Set type of the Wait. + * + * @param waitType the waitType value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitType(String waitType) { + this.waitType = waitType; + return this; + } + + /** + * Get total wait time in millisecond(s). + * + * @return the waitTimeMs value + */ + public Double waitTimeMs() { + return this.waitTimeMs; + } + + /** + * Set total wait time in millisecond(s). + * + * @param waitTimeMs the waitTimeMs value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitTimeMs(Double waitTimeMs) { + this.waitTimeMs = waitTimeMs; + return this; + } + + /** + * Get total no. of waits. + * + * @return the waitCount value + */ + public Long waitCount() { + return this.waitCount; + } + + /** + * Set total no. of waits. + * + * @param waitCount the waitCount value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitCount(Long waitCount) { + this.waitCount = waitCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuImpl.java new file mode 100644 index 0000000000000..d124522e57bb5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSkuSku; + +class AvailableServiceSkuImpl extends WrapperImpl implements AvailableServiceSku { + private final DataMigrationManager manager; + + AvailableServiceSkuImpl(AvailableServiceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public AvailableServiceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public AvailableServiceSkuSku sku() { + return this.inner().sku(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuInner.java new file mode 100644 index 0000000000000..c58b0d44fe056 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/AvailableServiceSkuInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSkuSku; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSkuCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the available service SKU. + */ +public class AvailableServiceSkuInner { + /** + * The resource type, including the provider namespace. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * SKU name, tier, etc. + */ + @JsonProperty(value = "sku") + private AvailableServiceSkuSku sku; + + /** + * A description of the scaling capacities of the SKU. + */ + @JsonProperty(value = "capacity") + private AvailableServiceSkuCapacity capacity; + + /** + * Get the resource type, including the provider namespace. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resource type, including the provider namespace. + * + * @param resourceType the resourceType value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get sKU name, tier, etc. + * + * @return the sku value + */ + public AvailableServiceSkuSku sku() { + return this.sku; + } + + /** + * Set sKU name, tier, etc. + * + * @param sku the sku value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withSku(AvailableServiceSkuSku sku) { + this.sku = sku; + return this; + } + + /** + * Get a description of the scaling capacities of the SKU. + * + * @return the capacity value + */ + public AvailableServiceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Set a description of the scaling capacities of the SKU. + * + * @param capacity the capacity value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withCapacity(AvailableServiceSkuCapacity capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationManager.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationManager.java new file mode 100644 index 0000000000000..ad30c8530acfd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkus; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Usages; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataMigration resource management. + */ +public final class DataMigrationManager extends ManagerCore { + private ResourceSkus resourceSkus; + private Services services; + private Tasks tasks; + private Projects projects; + private Usages usages; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DataMigrationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataMigrationManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataMigrationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(RestClient restClient, String subscriptionId) { + return new DataMigrationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataMigrationManager that exposes DataMigration management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataMigration management API entry points that work across subscriptions + */ + DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ResourceSkus. + */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(this); + } + return this.resourceSkus; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage Tasks. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(this); + } + return this.tasks; + } + + /** + * @return Entry point to manage Projects. + */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(this); + } + return this.projects; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataMigrationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataMigrationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataMigrationServiceClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceClientImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceClientImpl.java new file mode 100644 index 0000000000000..5628818e11677 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceClientImpl.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataMigrationServiceClientImpl class. + */ +public class DataMigrationServiceClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Version of the API. */ + private String apiVersion; + + /** + * Gets Version of the API. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Identifier of the subscription. */ + private String subscriptionId; + + /** + * Gets Identifier of the subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Identifier of the subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ResourceSkusInner object to access its operations. + */ + private ResourceSkusInner resourceSkus; + + /** + * Gets the ResourceSkusInner object to access its operations. + * @return the ResourceSkusInner object. + */ + public ResourceSkusInner resourceSkus() { + return this.resourceSkus; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The TasksInner object to access its operations. + */ + private TasksInner tasks; + + /** + * Gets the TasksInner object to access its operations. + * @return the TasksInner object. + */ + public TasksInner tasks() { + return this.tasks; + } + + /** + * The ProjectsInner object to access its operations. + */ + private ProjectsInner projects; + + /** + * Gets the ProjectsInner object to access its operations. + * @return the ProjectsInner object. + */ + public ProjectsInner projects() { + return this.projects; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataMigrationServiceClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-03-31-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.tasks = new TasksInner(restClient().retrofit(), this); + this.projects = new ProjectsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataMigrationServiceClient", "2018-03-31-preview"); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceImpl.java new file mode 100644 index 0000000000000..09db4b085c967 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DataMigrationService; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceSku; + +class DataMigrationServiceImpl extends GroupableResourceCoreImpl implements DataMigrationService, DataMigrationService.Definition, DataMigrationService.Update { + DataMigrationServiceImpl(String name, DataMigrationServiceInner inner, DataMigrationManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public ServiceProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publicKey() { + return this.inner().publicKey(); + } + + @Override + public ServiceSku sku() { + return this.inner().sku(); + } + + @Override + public String virtualSubnetId() { + return this.inner().virtualSubnetId(); + } + + @Override + public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { + this.inner().withVirtualSubnetId(virtualSubnetId); + return this; + } + + @Override + public DataMigrationServiceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public DataMigrationServiceImpl withKind(String kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public DataMigrationServiceImpl withPublicKey(String publicKey) { + this.inner().withPublicKey(publicKey); + return this; + } + + @Override + public DataMigrationServiceImpl withSku(ServiceSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceInner.java new file mode 100644 index 0000000000000..68dcff8f55717 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A Data Migration Service resource. + */ +@JsonFlatten +public class DataMigrationServiceInner extends Resource { + /** + * HTTP strong entity tag value. Ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The resource kind. Only 'vm' (the default) is supported. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The resource's provisioning state. Possible values include: 'Accepted', + * 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceProvisioningState provisioningState; + + /** + * The public key of the service, used to encrypt secrets sent to the + * service. + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /** + * The ID of the Microsoft.Network/virtualNetworks/subnets resource to + * which the service should be joined. + */ + @JsonProperty(value = "properties.virtualSubnetId", required = true) + private String virtualSubnetId; + + /** + * Service SKU. + */ + @JsonProperty(value = "sku") + private ServiceSku sku; + + /** + * Get hTTP strong entity tag value. Ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. Ignored if submitted. + * + * @param etag the etag value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the resource kind. Only 'vm' (the default) is supported. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the resource kind. Only 'vm' (the default) is supported. + * + * @param kind the kind value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the resource's provisioning state. Possible values include: 'Accepted', 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the public key of the service, used to encrypt secrets sent to the service. + * + * @param publicKey the publicKey value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @return the virtualSubnetId value + */ + public String virtualSubnetId() { + return this.virtualSubnetId; + } + + /** + * Set the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @param virtualSubnetId the virtualSubnetId value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualSubnetId(String virtualSubnetId) { + this.virtualSubnetId = virtualSubnetId; + return this; + } + + /** + * Get service SKU. + * + * @return the sku value + */ + public ServiceSku sku() { + return this.sku; + } + + /** + * Set service SKU. + * + * @param sku the sku value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withSku(ServiceSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseImpl.java new file mode 100644 index 0000000000000..a3bbf7a6dffe8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DataMigrationServiceStatusResponseImpl extends WrapperImpl implements DataMigrationServiceStatusResponse { + private final DataMigrationManager manager; + DataMigrationServiceStatusResponseImpl(DataMigrationServiceStatusResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public List supportedTaskTypes() { + return this.inner().supportedTaskTypes(); + } + + @Override + public String vmSize() { + return this.inner().vmSize(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseInner.java new file mode 100644 index 0000000000000..b22ced6d1437b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/DataMigrationServiceStatusResponseInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service health status. + */ +public class DataMigrationServiceStatusResponseInner { + /** + * The DMS instance agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * The machine-readable status, such as 'Initializing', 'Offline', + * 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop' or 'Failed'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The services virtual machine size, such as 'Standard_D2_v2'. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * The list of supported task types. + */ + @JsonProperty(value = "supportedTaskTypes") + private List supportedTaskTypes; + + /** + * Get the DMS instance agent version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the DMS instance agent version. + * + * @param agentVersion the agentVersion value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @param status the status value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the services virtual machine size, such as 'Standard_D2_v2'. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the services virtual machine size, such as 'Standard_D2_v2'. + * + * @param vmSize the vmSize value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the list of supported task types. + * + * @return the supportedTaskTypes value + */ + public List supportedTaskTypes() { + return this.supportedTaskTypes; + } + + /** + * Set the list of supported task types. + * + * @param supportedTaskTypes the supportedTaskTypes value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withSupportedTaskTypes(List supportedTaskTypes) { + this.supportedTaskTypes = supportedTaskTypes; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/IdParsingUtils.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..220ef9f0b8f8c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..25fbb9cf1a1ae --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameAvailabilityResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameCheckFailureReason; + +class NameAvailabilityResponseImpl extends WrapperImpl implements NameAvailabilityResponse { + private final DataMigrationManager manager; + NameAvailabilityResponseImpl(NameAvailabilityResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public NameCheckFailureReason reason() { + return this.inner().reason(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..261c51d3ee729 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/NameAvailabilityResponseInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameCheckFailureReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Indicates whether a proposed resource name is available. + */ +public class NameAvailabilityResponseInner { + /** + * If true, the name is valid and available. If false, 'reason' describes + * why not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, if nameAvailable is false. + * Possible values include: 'AlreadyExists', 'Invalid'. + */ + @JsonProperty(value = "reason") + private NameCheckFailureReason reason; + + /** + * The localized reason why the name is not available, if nameAvailable is + * false. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get if true, the name is valid and available. If false, 'reason' describes why not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set if true, the name is valid and available. If false, 'reason' describes why not. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @return the reason value + */ + public NameCheckFailureReason reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @param reason the reason value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withReason(NameCheckFailureReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the localized reason why the name is not available, if nameAvailable is false. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the localized reason why the name is not available, if nameAvailable is false. + * + * @param message the message value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..a311684ee33f4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceOperation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataMigrationManager manager; + + OperationsImpl(DataMigrationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceOperation call(ServiceOperationInner inner) { + return new ServiceOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..dbf5c72ab4b49 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Operations list" }) + @GET("providers/Microsoft.DataMigration/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Data Migration Service resource provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/PageImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..5375ed0ef6ec3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectImpl.java new file mode 100644 index 0000000000000..0362acb2f38ad --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Project; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectProvisioningState; + +class ProjectImpl extends CreatableUpdatableImpl implements Project, Project.Definition, Project.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + + ProjectImpl(String name, DataMigrationManager manager) { + super(name, new ProjectInner()); + this.manager = manager; + // Set resource name + this.projectName = name; + // + } + + ProjectImpl(ProjectInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.projectName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.getAsync(this.groupName, this.serviceName, this.projectName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List databasesInfo() { + return this.inner().databasesInfo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionInfo sourceConnectionInfo() { + return this.inner().sourceConnectionInfo(); + } + + @Override + public ProjectSourcePlatform sourcePlatform() { + return this.inner().sourcePlatform(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public ConnectionInfo targetConnectionInfo() { + return this.inner().targetConnectionInfo(); + } + + @Override + public ProjectTargetPlatform targetPlatform() { + return this.inner().targetPlatform(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectImpl withExistingService(String groupName, String serviceName) { + this.groupName = groupName; + this.serviceName = serviceName; + return this; + } + + @Override + public ProjectImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.inner().withSourcePlatform(sourcePlatform); + return this; + } + + @Override + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.inner().withTargetPlatform(targetPlatform); + return this; + } + + @Override + public ProjectImpl withDatabasesInfo(List databasesInfo) { + this.inner().withDatabasesInfo(databasesInfo); + return this; + } + + @Override + public ProjectImpl withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.inner().withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + @Override + public ProjectImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public ProjectImpl withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.inner().withTargetConnectionInfo(targetConnectionInfo); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectInner.java new file mode 100644 index 0000000000000..90a9f3d6bb9d8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectInner.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A project resource. + */ +@JsonFlatten +public class ProjectInner extends Resource { + /** + * Source platform for the project. Possible values include: 'SQL', + * 'Unknown'. + */ + @JsonProperty(value = "properties.sourcePlatform", required = true) + private ProjectSourcePlatform sourcePlatform; + + /** + * Target platform for the project. Possible values include: 'SQLDB', + * 'SQLMI', 'Unknown'. + */ + @JsonProperty(value = "properties.targetPlatform", required = true) + private ProjectTargetPlatform targetPlatform; + + /** + * UTC Date and time when project was created. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Information for connecting to source. + */ + @JsonProperty(value = "properties.sourceConnectionInfo") + private ConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "properties.targetConnectionInfo") + private ConnectionInfo targetConnectionInfo; + + /** + * List of DatabaseInfo. + */ + @JsonProperty(value = "properties.databasesInfo") + private List databasesInfo; + + /** + * The project's provisioning state. Possible values include: 'Deleting', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProjectProvisioningState provisioningState; + + /** + * Get source platform for the project. Possible values include: 'SQL', 'Unknown'. + * + * @return the sourcePlatform value + */ + public ProjectSourcePlatform sourcePlatform() { + return this.sourcePlatform; + } + + /** + * Set source platform for the project. Possible values include: 'SQL', 'Unknown'. + * + * @param sourcePlatform the sourcePlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.sourcePlatform = sourcePlatform; + return this; + } + + /** + * Get target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'Unknown'. + * + * @return the targetPlatform value + */ + public ProjectTargetPlatform targetPlatform() { + return this.targetPlatform; + } + + /** + * Set target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'Unknown'. + * + * @param targetPlatform the targetPlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get uTC Date and time when project was created. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public ConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public ConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get list of DatabaseInfo. + * + * @return the databasesInfo value + */ + public List databasesInfo() { + return this.databasesInfo; + } + + /** + * Set list of DatabaseInfo. + * + * @param databasesInfo the databasesInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withDatabasesInfo(List databasesInfo) { + this.databasesInfo = databasesInfo; + return this; + } + + /** + * Get the project's provisioning state. Possible values include: 'Deleting', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProjectProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskImpl.java new file mode 100644 index 0000000000000..e4ff14932cf75 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTask; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTaskProperties; + +class ProjectTaskImpl extends CreatableUpdatableImpl implements ProjectTask, ProjectTask.Definition, ProjectTask.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + private String taskName; + + ProjectTaskImpl(String name, DataMigrationManager manager) { + super(name, new ProjectTaskInner()); + this.manager = manager; + // Set resource name + this.taskName = name; + // + } + + ProjectTaskImpl(ProjectTaskInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + this.taskName = IdParsingUtils.getValueFromIdByName(inner.id(), "tasks"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.getAsync(this.groupName, this.serviceName, this.projectName, this.taskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectTaskProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectTaskImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + @Override + public ProjectTaskImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ProjectTaskImpl withProperties(ProjectTaskProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskInner.java new file mode 100644 index 0000000000000..70656f369bda0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectTaskInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTaskProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A task resource. + */ +public class ProjectTaskInner extends ProxyResource { + /** + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Custom task properties. + */ + @JsonProperty(value = "properties") + private ProjectTaskProperties properties; + + /** + * Get hTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get custom task properties. + * + * @return the properties value + */ + public ProjectTaskProperties properties() { + return this.properties; + } + + /** + * Set custom task properties. + * + * @param properties the properties value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withProperties(ProjectTaskProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsImpl.java new file mode 100644 index 0000000000000..5f520a618a742 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Project; + +class ProjectsImpl extends WrapperImpl implements Projects { + private final DataMigrationManager manager; + + ProjectsImpl(DataMigrationManager manager) { + super(manager.inner().projects()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectImpl define(String name) { + return wrapModel(name); + } + + private ProjectImpl wrapModel(ProjectInner inner) { + return new ProjectImpl(inner, manager()); + } + + private ProjectImpl wrapModel(String name) { + return new ProjectImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName) { + ProjectsInner client = this.inner(); + return client.listAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsInner.java new file mode 100644 index 0000000000000..4c62a5b5a00f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ProjectsInner.java @@ -0,0 +1,834 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Projects. + */ +public class ProjectsInner { + /** The Retrofit service to perform REST calls. */ + private ProjectsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ProjectsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProjectsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ProjectsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Projects to be + * used by Retrofit to perform actually REST calls. + */ + interface ProjectsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Projects listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName) { + return listWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner get(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner update(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaImpl.java new file mode 100644 index 0000000000000..85a562561e620 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Quota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.QuotaName; + +class QuotaImpl extends WrapperImpl implements Quota { + private final DataMigrationManager manager; + + QuotaImpl(QuotaInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public QuotaName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaInner.java new file mode 100644 index 0000000000000..b93bdbd2dc2d6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/QuotaInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.QuotaName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a quota for or usage details about a resource. + */ +public class QuotaInner { + /** + * The current value of the quota. If null or missing, the current value + * cannot be determined in the context of the request. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /** + * The resource ID of the quota object. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The maximum value of the quota. If null or missing, the quota has no + * maximum, in which case it merely tracks usage. + */ + @JsonProperty(value = "limit") + private Double limit; + + /** + * The name of the quota. + */ + @JsonProperty(value = "name") + private QuotaName name; + + /** + * The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @param currentValue the currentValue value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the resource ID of the quota object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the quota object. + * + * @param id the id value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Set the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @param limit the limit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the quota. + * + * @return the name value + */ + public QuotaName name() { + return this.name; + } + + /** + * Set the name of the quota. + * + * @param name the name value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withName(QuotaName name) { + this.name = name; + return this; + } + + /** + * Get the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @param unit the unit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..f0a13d04f8297 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuRestrictions; + +class ResourceSkuImpl extends WrapperImpl implements ResourceSku { + private final DataMigrationManager manager; + ResourceSkuImpl(ResourceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public List apiVersions() { + return this.inner().apiVersions(); + } + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public ResourceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public List costs() { + return this.inner().costs(); + } + + @Override + public String family() { + return this.inner().family(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String size() { + return this.inner().size(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuInner.java new file mode 100644 index 0000000000000..3eb4d86925733 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkuInner.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCapacity; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an available DMS SKU. + */ +public class ResourceSkuInner { + /** + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Specifies the tier of DMS in a scale set. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /** + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /** + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Not used. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /** + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /** + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the type of resource the SKU applies to. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get specifies the tier of DMS in a scale set. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the Size of the SKU. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Get the Family of this particular SKU. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Get the Kind of resources that are supported in this SKU. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Get not used. + * + * @return the capacity value + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the api versions that support this SKU. + * + * @return the apiVersions value + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get metadata for retrieving price info. + * + * @return the costs value + */ + public List costs() { + return this.costs; + } + + /** + * Get a name value pair to describe the capability. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusImpl.java new file mode 100644 index 0000000000000..a37a53ab9190a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSku; + +class ResourceSkusImpl extends WrapperImpl implements ResourceSkus { + private final DataMigrationManager manager; + + ResourceSkusImpl(DataMigrationManager manager) { + super(manager.inner().resourceSkus()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + ResourceSkusInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceSku call(ResourceSkuInner inner) { + return new ResourceSkuImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusInner.java new file mode 100644 index 0000000000000..c5d66823e39bb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ResourceSkusInner.java @@ -0,0 +1,297 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ResourceSkus. + */ +public class ResourceSkusInner { + /** The Retrofit service to perform REST calls. */ + private ResourceSkusService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ResourceSkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourceSkusInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ResourceSkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourceSkus to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourceSkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ResourceSkus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationImpl.java new file mode 100644 index 0000000000000..8ad86a07f72cf --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceOperationDisplay; + +class ServiceOperationImpl extends WrapperImpl implements ServiceOperation { + private final DataMigrationManager manager; + ServiceOperationImpl(ServiceOperationInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ServiceOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationInner.java new file mode 100644 index 0000000000000..a37acd9960bea --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServiceOperationInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ServiceOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of an action supported by the Data Migration Service. + */ +public class ServiceOperationInner { + /** + * The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized display text. + */ + @JsonProperty(value = "display") + private ServiceOperationDisplay display; + + /** + * Get the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @param name the name value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized display text. + * + * @return the display value + */ + public ServiceOperationDisplay display() { + return this.display; + } + + /** + * Set localized display text. + * + * @param display the display value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..61e6ceb220a34 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesImpl.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DataMigrationService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameAvailabilityResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameAvailabilityRequest; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.AvailableServiceSku; + +class ServicesImpl extends GroupableResourcesCoreImpl implements Services { + protected ServicesImpl(DataMigrationManager manager) { + super(manager.inner().services(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataMigrationServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkStatusAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.checkStatusAsync(groupName, serviceName) + .map(new Func1() { + @Override + public DataMigrationServiceStatusResponse call(DataMigrationServiceStatusResponseInner inner) { + return new DataMigrationServiceStatusResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable startAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.startAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Completable stopAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.stopAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkChildrenNameAvailabilityAsync(groupName, serviceName, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + protected DataMigrationServiceImpl wrapModel(DataMigrationServiceInner inner) { + return new DataMigrationServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected DataMigrationServiceImpl wrapModel(String name) { + return new DataMigrationServiceImpl(name, new DataMigrationServiceInner(), this.manager()); + } + + private AvailableServiceSkuImpl wrapAvailableServiceSkuModel(AvailableServiceSkuInner inner) { + return new AvailableServiceSkuImpl(inner, manager()); + } + + @Override + public Observable listSkusAsync(final String groupName, final String serviceName) { + ServicesInner client = this.inner(); + return client.listSkusAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailableServiceSku call(AvailableServiceSkuInner inner) { + return wrapAvailableServiceSkuModel(inner); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesInner.java new file mode 100644 index 0000000000000..c720412bc8147 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/ServicesInner.java @@ -0,0 +1,2240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.NameAvailabilityRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services checkStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus") + Observable> checkStatus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services listSkus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus") + Observable> listSkus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services checkChildrenNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability") + Observable> checkChildrenNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services listSkusNext" }) + @GET + Observable> listSkusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable getByResourceGroupAsync(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName) { + deleteWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName) { + return deleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName) { + beginDeleteWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName, Boolean deleteRunningTasks) { + beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceStatusResponseInner object if successful. + */ + public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkStatusAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkStatusWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable checkStatusAsync(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceStatusResponseInner>() { + @Override + public DataMigrationServiceStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable> checkStatusWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.checkStatus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkStatusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String groupName, String serviceName) { + startWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String groupName, String serviceName) { + return startWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String groupName, String serviceName) { + beginStartWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String groupName, String serviceName) { + return beginStartWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Data Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String groupName, String serviceName) { + stopWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String groupName, String serviceName) { + return stopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String groupName, String serviceName) { + beginStopWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String groupName, String serviceName) { + return beginStopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkus(final String groupName, final String serviceName) { + ServiceResponse> response = listSkusSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusAsync(final String groupName, final String serviceName) { + return listSkusWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSkusSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkChildrenNameAvailabilityWithServiceResponseAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkChildrenNameAvailability(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkChildrenNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkChildrenNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String groupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(groupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String groupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(groupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String groupName) { + return listByResourceGroupWithServiceResponseAsync(groupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String groupName) { + return listByResourceGroupSinglePageAsync(groupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String groupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), groupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkusNext(final String nextPageLink) { + ServiceResponse> response = listSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusNextAsync(final String nextPageLink) { + return listSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusNextWithServiceResponseAsync(final String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSkusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of service resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksImpl.java new file mode 100644 index 0000000000000..5612cf15d487b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksImpl.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ProjectTask; + +class TasksImpl extends WrapperImpl implements Tasks { + private final DataMigrationManager manager; + + TasksImpl(DataMigrationManager manager) { + super(manager.inner().tasks()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectTaskImpl define(String name) { + return wrapModel(name); + } + + private ProjectTaskImpl wrapModel(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + + private ProjectTaskImpl wrapModel(String name) { + return new ProjectTaskImpl(name, this.manager()); + } + + @Override + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.cancelAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName, final String projectName) { + TasksInner client = this.inner(); + return client.listAsync(groupName, serviceName, projectName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName, taskName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksInner.java new file mode 100644 index 0000000000000..86b29d9960bcc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/TasksInner.java @@ -0,0 +1,1223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tasks. + */ +public class TasksInner { + /** The Retrofit service to perform REST calls. */ + private TasksService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of TasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TasksInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(TasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tasks to be + * used by Retrofit to perform actually REST calls. + */ + interface TasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Query("taskType") String taskType, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Tasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName) { + return listWithServiceResponseAsync(groupName, serviceName, projectName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName) { + return listSinglePageAsync(groupName, serviceName, projectName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String taskType = null; + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName, final String taskType) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName, taskType).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName, taskType), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listWithServiceResponseAsync(groupName, serviceName, projectName, taskType) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listSinglePageAsync(groupName, serviceName, projectName, taskType) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + ServiceResponse> * @param projectName Name of the project + ServiceResponse> * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner createOrUpdate(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner update(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> cancelWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancel(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Data Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..c964d39aa9f0b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Quota; + +class UsagesImpl extends WrapperImpl implements Usages { + private final DataMigrationManager manager; + + UsagesImpl(DataMigrationManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + private QuotaImpl wrapModel(QuotaInner inner) { + return new QuotaImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Quota call(QuotaInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesInner.java new file mode 100644 index 0000000000000..950e26e0219f3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/UsagesInner.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + ServiceResponse> * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Data Migration Service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/package-info.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/package-info.java new file mode 100644 index 0000000000000..d1371c5b5ac49 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview.implementation; diff --git a/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/package-info.java b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/package-info.java new file mode 100644 index 0000000000000..e8524448d166a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_03_31_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_03_31_preview; diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/pom.xml b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/pom.xml new file mode 100644 index 0000000000000..1d34aac01fa69 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.azuredatabasemigrationservice.v2018_07_15_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datamigration + 1.0.0-beta + jar + Microsoft Azure SDK for DataMigration Management + This package contains Microsoft DataMigration Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiError.java new file mode 100644 index 0000000000000..dcfca1555a78e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiError.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information. + */ +public class ApiError { + /** + * Error information in OData format. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get error information in OData format. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set error information in OData format. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiErrorException.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiErrorException.java new file mode 100644 index 0000000000000..99523e58a7a80 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AuthenticationType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AuthenticationType.java new file mode 100644 index 0000000000000..99228d337d8b9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AuthenticationType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationType. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** Static value None for AuthenticationType. */ + public static final AuthenticationType NONE = fromString("None"); + + /** Static value WindowsAuthentication for AuthenticationType. */ + public static final AuthenticationType WINDOWS_AUTHENTICATION = fromString("WindowsAuthentication"); + + /** Static value SqlAuthentication for AuthenticationType. */ + public static final AuthenticationType SQL_AUTHENTICATION = fromString("SqlAuthentication"); + + /** Static value ActiveDirectoryIntegrated for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_INTEGRATED = fromString("ActiveDirectoryIntegrated"); + + /** Static value ActiveDirectoryPassword for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_PASSWORD = fromString("ActiveDirectoryPassword"); + + /** + * Creates or finds a AuthenticationType from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationType + */ + @JsonCreator + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * @return known AuthenticationType values + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSku.java new file mode 100644 index 0000000000000..3475903c298b0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSku.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.AvailableServiceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; + +/** + * Type representing AvailableServiceSku. + */ +public interface AvailableServiceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + AvailableServiceSkuCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + AvailableServiceSkuSku sku(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuCapacity.java new file mode 100644 index 0000000000000..a6848e88f2436 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuCapacity.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A description of the scaling capacities of the SKU. + */ +public class AvailableServiceSkuCapacity { + /** + * The minimum capacity, usually 0 or 1. + */ + @JsonProperty(value = "minimum") + private Integer minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /** + * The scalability approach. Possible values include: 'none', 'manual', + * 'automatic'. + */ + @JsonProperty(value = "scaleType") + private ServiceScalability scaleType; + + /** + * Get the minimum capacity, usually 0 or 1. + * + * @return the minimum value + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Set the minimum capacity, usually 0 or 1. + * + * @param minimum the minimum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMinimum(Integer minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum capacity. + * + * @param maximum the maximum value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the default capacity. + * + * @param defaultProperty the defaultProperty value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @return the scaleType value + */ + public ServiceScalability scaleType() { + return this.scaleType; + } + + /** + * Set the scalability approach. Possible values include: 'none', 'manual', 'automatic'. + * + * @param scaleType the scaleType value to set + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withScaleType(ServiceScalability scaleType) { + this.scaleType = scaleType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuSku.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuSku.java new file mode 100644 index 0000000000000..c8443dd4ac84e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/AvailableServiceSkuSku.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU name, tier, etc. + */ +public class AvailableServiceSkuSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SKU family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * SKU size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The tier of the SKU, such as "Basic", "General Purpose", or "Business + * Critical". + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get sKU family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set sKU family. + * + * @param family the family value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get sKU size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set sKU size. + * + * @param size the size value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + * + * @param tier the tier value to set + * @return the AvailableServiceSkuSku object itself. + */ + public AvailableServiceSkuSku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupMode.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupMode.java new file mode 100644 index 0000000000000..f85a3d840aebb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupMode. + */ +public final class BackupMode extends ExpandableStringEnum { + /** Static value CreateBackup for BackupMode. */ + public static final BackupMode CREATE_BACKUP = fromString("CreateBackup"); + + /** Static value ExistingBackup for BackupMode. */ + public static final BackupMode EXISTING_BACKUP = fromString("ExistingBackup"); + + /** + * Creates or finds a BackupMode from its string representation. + * @param name a name to look for + * @return the corresponding BackupMode + */ + @JsonCreator + public static BackupMode fromString(String name) { + return fromString(name, BackupMode.class); + } + + /** + * @return known BackupMode values + */ + public static Collection values() { + return values(BackupMode.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupType.java new file mode 100644 index 0000000000000..7ddf8615dd75c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BackupType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupType. + */ +public final class BackupType extends ExpandableStringEnum { + /** Static value Database for BackupType. */ + public static final BackupType DATABASE = fromString("Database"); + + /** Static value TransactionLog for BackupType. */ + public static final BackupType TRANSACTION_LOG = fromString("TransactionLog"); + + /** Static value File for BackupType. */ + public static final BackupType FILE = fromString("File"); + + /** Static value DifferentialDatabase for BackupType. */ + public static final BackupType DIFFERENTIAL_DATABASE = fromString("DifferentialDatabase"); + + /** Static value DifferentialFile for BackupType. */ + public static final BackupType DIFFERENTIAL_FILE = fromString("DifferentialFile"); + + /** Static value Partial for BackupType. */ + public static final BackupType PARTIAL = fromString("Partial"); + + /** Static value DifferentialPartial for BackupType. */ + public static final BackupType DIFFERENTIAL_PARTIAL = fromString("DifferentialPartial"); + + /** + * Creates or finds a BackupType from its string representation. + * @param name a name to look for + * @return the corresponding BackupType + */ + @JsonCreator + public static BackupType fromString(String name) { + return fromString(name, BackupType.class); + } + + /** + * @return known BackupType values + */ + public static Collection values() { + return values(BackupType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BlobShare.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BlobShare.java new file mode 100644 index 0000000000000..fbc37be411a8c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/BlobShare.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob container storage information. + */ +public class BlobShare { + /** + * SAS URI of Azure Storage Account Container. + */ + @JsonProperty(value = "sasUri", required = true) + private String sasUri; + + /** + * Get sAS URI of Azure Storage Account Container. + * + * @return the sasUri value + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set sAS URI of Azure Storage Account Container. + * + * @param sasUri the sasUri value to set + * @return the BlobShare object itself. + */ + public BlobShare withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandProperties.java new file mode 100644 index 0000000000000..bd4c10b758ed4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandProperties.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; +import java.util.List; + +/** + * Type representing CommandProperties. + */ +public interface CommandProperties extends HasInner, HasManager { + /** + * @return the errors value. + */ + List errors(); + + /** + * @return the state value. + */ + CommandState state(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandState.java new file mode 100644 index 0000000000000..a631e12723a17 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/CommandState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CommandState. + */ +public final class CommandState extends ExpandableStringEnum { + /** Static value Unknown for CommandState. */ + public static final CommandState UNKNOWN = fromString("Unknown"); + + /** Static value Accepted for CommandState. */ + public static final CommandState ACCEPTED = fromString("Accepted"); + + /** Static value Running for CommandState. */ + public static final CommandState RUNNING = fromString("Running"); + + /** Static value Succeeded for CommandState. */ + public static final CommandState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CommandState. */ + public static final CommandState FAILED = fromString("Failed"); + + /** + * Creates or finds a CommandState from its string representation. + * @param name a name to look for + * @return the corresponding CommandState + */ + @JsonCreator + public static CommandState fromString(String name) { + return fromString(name, CommandState.class); + } + + /** + * @return known CommandState values + */ + public static Collection values() { + return values(CommandState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToMongoDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToMongoDbTaskProperties.java new file mode 100644 index 0000000000000..74ab5b47e9af4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToMongoDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates the connection to and provides + * information about a MongoDB server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Connect.MongoDb") +public class ConnectToMongoDbTaskProperties extends ProjectTaskProperties { + /** + * The input property. + */ + @JsonProperty(value = "input") + private MongoDbConnectionInfo input; + + /** + * An array containing a single MongoDbClusterInfo object. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input value. + * + * @return the input value + */ + public MongoDbConnectionInfo input() { + return this.input; + } + + /** + * Set the input value. + * + * @param input the input value to set + * @return the ConnectToMongoDbTaskProperties object itself. + */ + public ConnectToMongoDbTaskProperties withInput(MongoDbConnectionInfo input) { + this.input = input; + return this; + } + + /** + * Get an array containing a single MongoDbClusterInfo object. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskInput.java new file mode 100644 index 0000000000000..761b3934f3984 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskInput.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates MySQL database connection. + */ +public class ConnectToSourceMySqlTaskInput { + /** + * Information for connecting to MySQL source. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /** + * Target Platform for the migration. Possible values include: + * 'AzureDbForMySQL'. + */ + @JsonProperty(value = "targetPlatform") + private MySqlTargetPlatformType targetPlatform; + + /** + * Permission group for validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL'. + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /** + * Get information for connecting to MySQL source. + * + * @return the sourceConnectionInfo value + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to MySQL source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get target Platform for the migration. Possible values include: 'AzureDbForMySQL'. + * + * @return the targetPlatform value + */ + public MySqlTargetPlatformType targetPlatform() { + return this.targetPlatform; + } + + /** + * Set target Platform for the migration. Possible values include: 'AzureDbForMySQL'. + * + * @param targetPlatform the targetPlatform value to set + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withTargetPlatform(MySqlTargetPlatformType targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL'. + * + * @return the checkPermissionsGroup value + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL'. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withCheckPermissionsGroup(ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskProperties.java new file mode 100644 index 0000000000000..e9df4318dc4f6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceMySqlTaskProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates MySQL database connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.MySql") +public class ConnectToSourceMySqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToSourceMySqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToSourceMySqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToSourceMySqlTaskProperties object itself. + */ + public ConnectToSourceMySqlTaskProperties withInput(ConnectToSourceMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceNonSqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceNonSqlTaskOutput.java new file mode 100644 index 0000000000000..a742b06d72b2e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceNonSqlTaskOutput.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for connect to Oracle, MySQL type source. + */ +public class ConnectToSourceNonSqlTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Server properties. + */ + @JsonProperty(value = "serverProperties", access = JsonProperty.Access.WRITE_ONLY) + private ServerProperties serverProperties; + + /** + * List of databases on the server. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /** + * Validation errors associated with the task. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get server properties. + * + * @return the serverProperties value + */ + public ServerProperties serverProperties() { + return this.serverProperties; + } + + /** + * Get list of databases on the server. + * + * @return the databases value + */ + public List databases() { + return this.databases; + } + + /** + * Get validation errors associated with the task. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerSyncTaskProperties.java new file mode 100644 index 0000000000000..6783a975414d7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL Server and source + * server requirements for online migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer.Sync") +public class ConnectToSourceSqlServerSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToSourceSqlServerSyncTaskProperties object itself. + */ + public ConnectToSourceSqlServerSyncTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskInput.java new file mode 100644 index 0000000000000..ff591aa3adecf --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskInput.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +public class ConnectToSourceSqlServerTaskInput { + /** + * Connection information for Source SQL Server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Permission group for validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL'. + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /** + * Flag for whether to collect logins from source server. + */ + @JsonProperty(value = "collectLogins") + private Boolean collectLogins; + + /** + * Flag for whether to collect agent jobs from source server. + */ + @JsonProperty(value = "collectAgentJobs") + private Boolean collectAgentJobs; + + /** + * Flag for whether to collect TDE Certificate names from source server. + */ + @JsonProperty(value = "collectTdeCertificateInfo") + private Boolean collectTdeCertificateInfo; + + /** + * Get connection information for Source SQL Server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for Source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL'. + * + * @return the checkPermissionsGroup value + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set permission group for validations. Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL'. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCheckPermissionsGroup(ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + + /** + * Get flag for whether to collect logins from source server. + * + * @return the collectLogins value + */ + public Boolean collectLogins() { + return this.collectLogins; + } + + /** + * Set flag for whether to collect logins from source server. + * + * @param collectLogins the collectLogins value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectLogins(Boolean collectLogins) { + this.collectLogins = collectLogins; + return this; + } + + /** + * Get flag for whether to collect agent jobs from source server. + * + * @return the collectAgentJobs value + */ + public Boolean collectAgentJobs() { + return this.collectAgentJobs; + } + + /** + * Set flag for whether to collect agent jobs from source server. + * + * @param collectAgentJobs the collectAgentJobs value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAgentJobs) { + this.collectAgentJobs = collectAgentJobs; + return this; + } + + /** + * Get flag for whether to collect TDE Certificate names from source server. + * + * @return the collectTdeCertificateInfo value + */ + public Boolean collectTdeCertificateInfo() { + return this.collectTdeCertificateInfo; + } + + /** + * Set flag for whether to collect TDE Certificate names from source server. + * + * @param collectTdeCertificateInfo the collectTdeCertificateInfo value to set + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectTdeCertificateInfo(Boolean collectTdeCertificateInfo) { + this.collectTdeCertificateInfo = collectTdeCertificateInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutput.java new file mode 100644 index 0000000000000..9601f7518335d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ConnectToSourceSqlServerTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = ConnectToSourceSqlServerTaskOutputAgentJobLevel.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = ConnectToSourceSqlServerTaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = ConnectToSourceSqlServerTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TaskLevelOutput", value = ConnectToSourceSqlServerTaskOutputTaskLevel.class) +}) +public class ConnectToSourceSqlServerTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java new file mode 100644 index 0000000000000..8dceb41087c6a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Agent Job level output for the task that validates connection to SQL Server + * and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +public class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Agent Job name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of Agent Job. + */ + @JsonProperty(value = "jobCategory", access = JsonProperty.Access.WRITE_ONLY) + private String jobCategory; + + /** + * The state of the original Agent Job. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * The owner of the Agent Job. + */ + @JsonProperty(value = "jobOwner", access = JsonProperty.Access.WRITE_ONLY) + private String jobOwner; + + /** + * UTC Date and time when the Agent Job was last executed. + */ + @JsonProperty(value = "lastExecutedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastExecutedOn; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Information about eligiblity of agent job for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get agent Job name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of Agent Job. + * + * @return the jobCategory value + */ + public String jobCategory() { + return this.jobCategory; + } + + /** + * Get the state of the original Agent Job. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the owner of the Agent Job. + * + * @return the jobOwner value + */ + public String jobOwner() { + return this.jobOwner; + } + + /** + * Get uTC Date and time when the Agent Job was last executed. + * + * @return the lastExecutedOn value + */ + public DateTime lastExecutedOn() { + return this.lastExecutedOn; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Get information about eligiblity of agent job for migration. + * + * @return the migrationEligibility value + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..6ab6f229e7372 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Database level output for the task that validates connection to SQL Server + * and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Database name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * The list of database files. + */ + @JsonProperty(value = "databaseFiles", access = JsonProperty.Access.WRITE_ONLY) + private List databaseFiles; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseCompatLevel compatibilityLevel; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseState databaseState; + + /** + * Get database name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get the list of database files. + * + * @return the databaseFiles value + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java new file mode 100644 index 0000000000000..202188137dd72 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputLoginLevel.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Login level output for the task that validates connection to SQL Server and + * also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +public class ConnectToSourceSqlServerTaskOutputLoginLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Login name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of login. Possible values include: 'WindowsUser', + * 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', + * 'ExternalUser', 'ExternalGroup'. + */ + @JsonProperty(value = "loginType", access = JsonProperty.Access.WRITE_ONLY) + private LoginType loginType; + + /** + * The default database for the login. + */ + @JsonProperty(value = "defaultDatabase", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDatabase; + + /** + * The state of the login. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Information about eligiblity of login for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get login name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of login. Possible values include: 'WindowsUser', 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', 'ExternalUser', 'ExternalGroup'. + * + * @return the loginType value + */ + public LoginType loginType() { + return this.loginType; + } + + /** + * Get the default database for the login. + * + * @return the defaultDatabase value + */ + public String defaultDatabase() { + return this.defaultDatabase; + } + + /** + * Get the state of the login. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get information about eligiblity of login for migration. + * + * @return the migrationEligibility value + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java new file mode 100644 index 0000000000000..69215e741d8c1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskOutputTaskLevel.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Task level output for the task that validates connection to SQL Server and + * also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TaskLevelOutput") +public class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Source logins as a map from login name to login id. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private Map logins; + + /** + * Source agent jobs as a map from agent job name to id. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Map agentJobs; + + /** + * Mapping from database name to TDE certificate name, if applicable. + */ + @JsonProperty(value = "databaseTdeCertificateMapping", access = JsonProperty.Access.WRITE_ONLY) + private Map databaseTdeCertificateMapping; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get source logins as a map from login name to login id. + * + * @return the logins value + */ + public Map logins() { + return this.logins; + } + + /** + * Get source agent jobs as a map from agent job name to id. + * + * @return the agentJobs value + */ + public Map agentJobs() { + return this.agentJobs; + } + + /** + * Get mapping from database name to TDE certificate name, if applicable. + * + * @return the databaseTdeCertificateMapping value + */ + public Map databaseTdeCertificateMapping() { + return this.databaseTdeCertificateMapping; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskProperties.java new file mode 100644 index 0000000000000..7d768f4d37bd0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToSourceSqlServerTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL Server and also + * validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer") +public class ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskInput.java new file mode 100644 index 0000000000000..47f40bf283471 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to Azure Database for MySQL and + * target server requirements. + */ +public class ConnectToTargetAzureDbForMySqlTaskInput { + /** + * Connection information for source MySQL server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /** + * Connection information for target Azure Database for MySQL server. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MySqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for source MySQL server. + * + * @return the sourceConnectionInfo value + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for source MySQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get connection information for target Azure Database for MySQL server. + * + * @return the targetConnectionInfo value + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target Azure Database for MySQL server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withTargetConnectionInfo(MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskOutput.java new file mode 100644 index 0000000000000..0aaf623d4710e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskOutput.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to Azure Database for MySQL + * and target server requirements. + */ +public class ConnectToTargetAzureDbForMySqlTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Version of the target server. + */ + @JsonProperty(value = "serverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverVersion; + + /** + * List of databases on target server. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Validation errors associated with the task. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get version of the target server. + * + * @return the serverVersion value + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Get list of databases on target server. + * + * @return the databases value + */ + public List databases() { + return this.databases; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get validation errors associated with the task. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskProperties.java new file mode 100644 index 0000000000000..0d994f7738665 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetAzureDbForMySqlTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to Azure Database for + * MySQL and target server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureDbForMySql") +public class ConnectToTargetAzureDbForMySqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetAzureDbForMySqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetAzureDbForMySqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetAzureDbForMySqlTaskProperties object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskProperties withInput(ConnectToTargetAzureDbForMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskInput.java new file mode 100644 index 0000000000000..df6c6d3942c7d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskInput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskInput { + /** + * Connection information for target SQL DB. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for target SQL DB. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlDbTaskInput object itself. + */ + public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskOutput.java new file mode 100644 index 0000000000000..47530eb7f7a86 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskOutput.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to SQL DB and target server + * requirements. + */ +public class ConnectToTargetSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Source databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Version of the target server. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get source databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get version of the target server. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskProperties.java new file mode 100644 index 0000000000000..88f793823cec0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb") +public class ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withInput(ConnectToTargetSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskInput.java new file mode 100644 index 0000000000000..d1fdde8cf0d3c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskInput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to Azure SQL Database Managed + * Instance. + */ +public class ConnectToTargetSqlMITaskInput { + /** + * Connection information for target SQL Server. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for target SQL Server. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL Server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskOutput.java new file mode 100644 index 0000000000000..992a6ac5914b5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskOutput.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for the task that validates connection to Azure SQL Database Managed + * Instance. + */ +public class ConnectToTargetSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * List of logins on the target server. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private List logins; + + /** + * List of agent jobs on the target server. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private List agentJobs; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get list of logins on the target server. + * + * @return the logins value + */ + public List logins() { + return this.logins; + } + + /** + * Get list of agent jobs on the target server. + * + * @return the agentJobs value + */ + public List agentJobs() { + return this.agentJobs; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskProperties.java new file mode 100644 index 0000000000000..71739cea7de70 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureSqlDbMI") +public class ConnectToTargetSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlMITaskProperties object itself. + */ + public ConnectToTargetSqlMITaskProperties withInput(ConnectToTargetSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskInput.java new file mode 100644 index 0000000000000..f4ae885393b8f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to Azure SQL DB and target + * server requirements. + */ +public class ConnectToTargetSqlSqlDbSyncTaskInput { + /** + * Connection information for source SQL Server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Connection information for target SQL DB. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get connection information for source SQL Server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ConnectToTargetSqlSqlDbSyncTaskInput object itself. + */ + public ConnectToTargetSqlSqlDbSyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get connection information for target SQL DB. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ConnectToTargetSqlSqlDbSyncTaskInput object itself. + */ + public ConnectToTargetSqlSqlDbSyncTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskProperties.java new file mode 100644 index 0000000000000..776af330a924f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectToTargetSqlSqlDbSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements for online migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb.Sync") +public class ConnectToTargetSqlSqlDbSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlSqlDbSyncTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ConnectToTargetSqlSqlDbSyncTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ConnectToTargetSqlSqlDbSyncTaskProperties object itself. + */ + public ConnectToTargetSqlSqlDbSyncTaskProperties withInput(ConnectToTargetSqlSqlDbSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectionInfo.java new file mode 100644 index 0000000000000..3b2992385915e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ConnectionInfo.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the connection properties of a server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), + @JsonSubTypes.Type(name = "PostgreSqlConnectionInfo", value = PostgreSqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MySqlConnectionInfo", value = MySqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MongoDbConnectionInfo", value = MongoDbConnectionInfo.class), + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "Validate.MongoDb", value = ValidateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.SqlDb.Sync", value = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MySql.AzureDbForMySql.Sync", value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDb.Sync", value = MigrateSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureDbForMySql", value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.AzureSqlDb.Sync", value = GetUserTablesSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb.Sync", value = ConnectToTargetSqlSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer.Sync", value = ConnectToSourceSqlServerSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class), + @JsonSubTypes.Type(name = "Connect.MongoDb", value = ConnectToMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "MigrateSchemaSqlServerSqlDb", value = MigrateSchemaSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "cancel", value = MongoDbCancelCommand.class), + @JsonSubTypes.Type(name = "finish", value = MongoDbFinishCommand.class), + @JsonSubTypes.Type(name = "restart", value = MongoDbRestartCommand.class) +}) +public class ConnectionInfo { + /** + * User name. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * Password credential. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set user name. + * + * @param userName the userName value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get password credential. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password credential. + * + * @param password the password value to set + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataIntegrityValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataIntegrityValidationResult.java new file mode 100644 index 0000000000000..91252ff51f193 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataIntegrityValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for checksum based Data Integrity validation results. + */ +public class DataIntegrityValidationResult { + /** + * List of failed table names of source and target pair. + */ + @JsonProperty(value = "failedObjects") + private Map failedObjects; + + /** + * List of errors that happened while performing data integrity validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of failed table names of source and target pair. + * + * @return the failedObjects value + */ + public Map failedObjects() { + return this.failedObjects; + } + + /** + * Set list of failed table names of source and target pair. + * + * @param failedObjects the failedObjects value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withFailedObjects(Map failedObjects) { + this.failedObjects = failedObjects; + return this; + } + + /** + * Get list of errors that happened while performing data integrity validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing data integrity validation. + * + * @param validationErrors the validationErrors value to set + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataItemMigrationSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataItemMigrationSummaryResult.java new file mode 100644 index 0000000000000..596c2d6c65ddc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataItemMigrationSummaryResult.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Basic summary of a data item migration. + */ +public class DataItemMigrationSummaryResult { + /** + * Name of the item. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationError.java new file mode 100644 index 0000000000000..c3426de37d7f5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationError.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Task errors. + */ +public class DataMigrationError { + /** + * Error description. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Possible values include: 'Default', 'Warning', 'Error'. + */ + @JsonProperty(value = "type") + private ErrorType type; + + /** + * Get error description. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get possible values include: 'Default', 'Warning', 'Error'. + * + * @return the type value + */ + public ErrorType type() { + return this.type; + } + + /** + * Set possible values include: 'Default', 'Warning', 'Error'. + * + * @param type the type value to set + * @return the DataMigrationError object itself. + */ + public DataMigrationError withType(ErrorType type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationProjectMetadata.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationProjectMetadata.java new file mode 100644 index 0000000000000..65ad70f24b7e0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationProjectMetadata.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common metadata for migration projects. + */ +public class DataMigrationProjectMetadata { + /** + * Source server name. + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /** + * Source server port number. + */ + @JsonProperty(value = "sourceServerPort", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerPort; + + /** + * Source username. + */ + @JsonProperty(value = "sourceUsername", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUsername; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerName; + + /** + * Target username. + */ + @JsonProperty(value = "targetUsername", access = JsonProperty.Access.WRITE_ONLY) + private String targetUsername; + + /** + * Target database name. + */ + @JsonProperty(value = "targetDbName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDbName; + + /** + * Whether target connection is Windows authentication. + */ + @JsonProperty(value = "targetUsingWinAuth", access = JsonProperty.Access.WRITE_ONLY) + private Boolean targetUsingWinAuth; + + /** + * List of tables selected for migration. + */ + @JsonProperty(value = "selectedMigrationTables", access = JsonProperty.Access.WRITE_ONLY) + private List selectedMigrationTables; + + /** + * Get source server name. + * + * @return the sourceServerName value + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get source server port number. + * + * @return the sourceServerPort value + */ + public String sourceServerPort() { + return this.sourceServerPort; + } + + /** + * Get source username. + * + * @return the sourceUsername value + */ + public String sourceUsername() { + return this.sourceUsername; + } + + /** + * Get target server name. + * + * @return the targetServerName value + */ + public String targetServerName() { + return this.targetServerName; + } + + /** + * Get target username. + * + * @return the targetUsername value + */ + public String targetUsername() { + return this.targetUsername; + } + + /** + * Get target database name. + * + * @return the targetDbName value + */ + public String targetDbName() { + return this.targetDbName; + } + + /** + * Get whether target connection is Windows authentication. + * + * @return the targetUsingWinAuth value + */ + public Boolean targetUsingWinAuth() { + return this.targetUsingWinAuth; + } + + /** + * Get list of tables selected for migration. + * + * @return the selectedMigrationTables value + */ + public List selectedMigrationTables() { + return this.selectedMigrationTables; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationResultCode.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationResultCode.java new file mode 100644 index 0000000000000..d003dd7d72b59 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationResultCode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataMigrationResultCode. + */ +public final class DataMigrationResultCode extends ExpandableStringEnum { + /** Static value Initial for DataMigrationResultCode. */ + public static final DataMigrationResultCode INITIAL = fromString("Initial"); + + /** Static value Completed for DataMigrationResultCode. */ + public static final DataMigrationResultCode COMPLETED = fromString("Completed"); + + /** Static value ObjectNotExistsInSource for DataMigrationResultCode. */ + public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_SOURCE = fromString("ObjectNotExistsInSource"); + + /** Static value ObjectNotExistsInTarget for DataMigrationResultCode. */ + public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_TARGET = fromString("ObjectNotExistsInTarget"); + + /** Static value TargetObjectIsInaccessible for DataMigrationResultCode. */ + public static final DataMigrationResultCode TARGET_OBJECT_IS_INACCESSIBLE = fromString("TargetObjectIsInaccessible"); + + /** Static value FatalError for DataMigrationResultCode. */ + public static final DataMigrationResultCode FATAL_ERROR = fromString("FatalError"); + + /** + * Creates or finds a DataMigrationResultCode from its string representation. + * @param name a name to look for + * @return the corresponding DataMigrationResultCode + */ + @JsonCreator + public static DataMigrationResultCode fromString(String name) { + return fromString(name, DataMigrationResultCode.class); + } + + /** + * @return known DataMigrationResultCode values + */ + public static Collection values() { + return values(DataMigrationResultCode.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationService.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationService.java new file mode 100644 index 0000000000000..c325b821f62e7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationService.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationServiceInner; + +/** + * Type representing DataMigrationService. + */ +public interface DataMigrationService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the provisioningState value. + */ + ServiceProvisioningState provisioningState(); + + /** + * @return the publicKey value. + */ + String publicKey(); + + /** + * @return the sku value. + */ + ServiceSku sku(); + + /** + * @return the virtualSubnetId value. + */ + String virtualSubnetId(); + + /** + * The entirety of the DataMigrationService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithVirtualSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataMigrationService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataMigrationService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataMigrationService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datamigrationservice definition allowing to specify VirtualSubnetId. + */ + interface WithVirtualSubnetId { + /** + * Specifies virtualSubnetId. + * @param virtualSubnetId The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined + * @return the next definition stage +*/ + WithCreate withVirtualSubnetId(String virtualSubnetId); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next definition stage + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the datamigrationservice definition allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next definition stage + */ + WithCreate withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next definition stage + */ + WithCreate withSku(ServiceSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithKind, DefinitionStages.WithPublicKey, DefinitionStages.WithSku { + } + } + /** + * The template for a DataMigrationService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithPublicKey, UpdateStages.WithSku { + } + + /** + * Grouping of DataMigrationService update stages. + */ + interface UpdateStages { + /** + * The stage of the datamigrationservice update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. Ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the datamigrationservice update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The resource kind. Only 'vm' (the default) is supported + * @return the next update stage + */ + Update withKind(String kind); + } + + /** + * The stage of the datamigrationservice update allowing to specify PublicKey. + */ + interface WithPublicKey { + /** + * Specifies publicKey. + * @param publicKey The public key of the service, used to encrypt secrets sent to the service + * @return the next update stage + */ + Update withPublicKey(String publicKey); + } + + /** + * The stage of the datamigrationservice update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Service SKU + * @return the next update stage + */ + Update withSku(ServiceSku sku); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationServiceStatusResponse.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationServiceStatusResponse.java new file mode 100644 index 0000000000000..f656d0f2a3362 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DataMigrationServiceStatusResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationServiceStatusResponseInner; +import java.util.List; + +/** + * Type representing DataMigrationServiceStatusResponse. + */ +public interface DataMigrationServiceStatusResponse extends HasInner, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the supportedTaskTypes value. + */ + List supportedTaskTypes(); + + /** + * @return the vmSize value. + */ + String vmSize(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Database.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Database.java new file mode 100644 index 0000000000000..6ce94be21b7e5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Database.java @@ -0,0 +1,463 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a single database. + */ +public class Database { + /** + * Unique identifier for the database. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * SQL Server compatibility level of database. Possible values include: + * 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', + * 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + */ + @JsonProperty(value = "compatibilityLevel") + private DatabaseCompatLevel compatibilityLevel; + + /** + * Collation name of the database. + */ + @JsonProperty(value = "collation") + private String collation; + + /** + * Name of the server. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Fully qualified name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Install id of the database. + */ + @JsonProperty(value = "installId") + private String installId; + + /** + * Version of the server. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** + * Edition of the server. + */ + @JsonProperty(value = "serverEdition") + private String serverEdition; + + /** + * Product level of the server (RTM, SP, CTP). + */ + @JsonProperty(value = "serverLevel") + private String serverLevel; + + /** + * Default path of the data files. + */ + @JsonProperty(value = "serverDefaultDataPath") + private String serverDefaultDataPath; + + /** + * Default path of the log files. + */ + @JsonProperty(value = "serverDefaultLogPath") + private String serverDefaultLogPath; + + /** + * Default path of the backup folder. + */ + @JsonProperty(value = "serverDefaultBackupPath") + private String serverDefaultBackupPath; + + /** + * Number of cores on the server. + */ + @JsonProperty(value = "serverCoreCount") + private Integer serverCoreCount; + + /** + * Number of cores on the server that have VISIBLE ONLINE status. + */ + @JsonProperty(value = "serverVisibleOnlineCoreCount") + private Integer serverVisibleOnlineCoreCount; + + /** + * State of the database. Possible values include: 'Online', 'Restoring', + * 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', + * 'Copying', 'OfflineSecondary'. + */ + @JsonProperty(value = "databaseState") + private DatabaseState databaseState; + + /** + * The unique Server Id. + */ + @JsonProperty(value = "serverId") + private String serverId; + + /** + * Get unique identifier for the database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for the database. + * + * @param id the id value to set + * @return the Database object itself. + */ + public Database withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the Database object itself. + */ + public Database withName(String name) { + this.name = name; + return this; + } + + /** + * Get sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @return the compatibilityLevel value + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set sQL Server compatibility level of database. Possible values include: 'CompatLevel80', 'CompatLevel90', 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', 'CompatLevel140'. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the Database object itself. + */ + public Database withCompatibilityLevel(DatabaseCompatLevel compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get collation name of the database. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set collation name of the database. + * + * @param collation the collation value to set + * @return the Database object itself. + */ + public Database withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set name of the server. + * + * @param serverName the serverName value to set + * @return the Database object itself. + */ + public Database withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get fully qualified name. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified name. + * + * @param fqdn the fqdn value to set + * @return the Database object itself. + */ + public Database withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get install id of the database. + * + * @return the installId value + */ + public String installId() { + return this.installId; + } + + /** + * Set install id of the database. + * + * @param installId the installId value to set + * @return the Database object itself. + */ + public Database withInstallId(String installId) { + this.installId = installId; + return this; + } + + /** + * Get version of the server. + * + * @return the serverVersion value + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set version of the server. + * + * @param serverVersion the serverVersion value to set + * @return the Database object itself. + */ + public Database withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get edition of the server. + * + * @return the serverEdition value + */ + public String serverEdition() { + return this.serverEdition; + } + + /** + * Set edition of the server. + * + * @param serverEdition the serverEdition value to set + * @return the Database object itself. + */ + public Database withServerEdition(String serverEdition) { + this.serverEdition = serverEdition; + return this; + } + + /** + * Get product level of the server (RTM, SP, CTP). + * + * @return the serverLevel value + */ + public String serverLevel() { + return this.serverLevel; + } + + /** + * Set product level of the server (RTM, SP, CTP). + * + * @param serverLevel the serverLevel value to set + * @return the Database object itself. + */ + public Database withServerLevel(String serverLevel) { + this.serverLevel = serverLevel; + return this; + } + + /** + * Get default path of the data files. + * + * @return the serverDefaultDataPath value + */ + public String serverDefaultDataPath() { + return this.serverDefaultDataPath; + } + + /** + * Set default path of the data files. + * + * @param serverDefaultDataPath the serverDefaultDataPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultDataPath(String serverDefaultDataPath) { + this.serverDefaultDataPath = serverDefaultDataPath; + return this; + } + + /** + * Get default path of the log files. + * + * @return the serverDefaultLogPath value + */ + public String serverDefaultLogPath() { + return this.serverDefaultLogPath; + } + + /** + * Set default path of the log files. + * + * @param serverDefaultLogPath the serverDefaultLogPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultLogPath(String serverDefaultLogPath) { + this.serverDefaultLogPath = serverDefaultLogPath; + return this; + } + + /** + * Get default path of the backup folder. + * + * @return the serverDefaultBackupPath value + */ + public String serverDefaultBackupPath() { + return this.serverDefaultBackupPath; + } + + /** + * Set default path of the backup folder. + * + * @param serverDefaultBackupPath the serverDefaultBackupPath value to set + * @return the Database object itself. + */ + public Database withServerDefaultBackupPath(String serverDefaultBackupPath) { + this.serverDefaultBackupPath = serverDefaultBackupPath; + return this; + } + + /** + * Get number of cores on the server. + * + * @return the serverCoreCount value + */ + public Integer serverCoreCount() { + return this.serverCoreCount; + } + + /** + * Set number of cores on the server. + * + * @param serverCoreCount the serverCoreCount value to set + * @return the Database object itself. + */ + public Database withServerCoreCount(Integer serverCoreCount) { + this.serverCoreCount = serverCoreCount; + return this; + } + + /** + * Get number of cores on the server that have VISIBLE ONLINE status. + * + * @return the serverVisibleOnlineCoreCount value + */ + public Integer serverVisibleOnlineCoreCount() { + return this.serverVisibleOnlineCoreCount; + } + + /** + * Set number of cores on the server that have VISIBLE ONLINE status. + * + * @param serverVisibleOnlineCoreCount the serverVisibleOnlineCoreCount value to set + * @return the Database object itself. + */ + public Database withServerVisibleOnlineCoreCount(Integer serverVisibleOnlineCoreCount) { + this.serverVisibleOnlineCoreCount = serverVisibleOnlineCoreCount; + return this; + } + + /** + * Get state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @return the databaseState value + */ + public DatabaseState databaseState() { + return this.databaseState; + } + + /** + * Set state of the database. Possible values include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'. + * + * @param databaseState the databaseState value to set + * @return the Database object itself. + */ + public Database withDatabaseState(DatabaseState databaseState) { + this.databaseState = databaseState; + return this; + } + + /** + * Get the unique Server Id. + * + * @return the serverId value + */ + public String serverId() { + return this.serverId; + } + + /** + * Set the unique Server Id. + * + * @param serverId the serverId value to set + * @return the Database object itself. + */ + public Database withServerId(String serverId) { + this.serverId = serverId; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseBackupInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseBackupInfo.java new file mode 100644 index 0000000000000..ed88bf2afb9ec --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseBackupInfo.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about backup files when existing backup mode is used. + */ +public class DatabaseBackupInfo { + /** + * Database name. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Backup Type. Possible values include: 'Database', 'TransactionLog', + * 'File', 'DifferentialDatabase', 'DifferentialFile', 'Partial', + * 'DifferentialPartial'. + */ + @JsonProperty(value = "backupType", access = JsonProperty.Access.WRITE_ONLY) + private BackupType backupType; + + /** + * The list of backup files for the current database. + */ + @JsonProperty(value = "backupFiles", access = JsonProperty.Access.WRITE_ONLY) + private List backupFiles; + + /** + * Position of current database backup in the file. + */ + @JsonProperty(value = "position", access = JsonProperty.Access.WRITE_ONLY) + private Integer position; + + /** + * Database was damaged when backed up, but the backup operation was + * requested to continue despite errors. + */ + @JsonProperty(value = "isDamaged", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDamaged; + + /** + * Whether the backup set is compressed. + */ + @JsonProperty(value = "isCompressed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCompressed; + + /** + * Number of files in the backup set. + */ + @JsonProperty(value = "familyCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer familyCount; + + /** + * Date and time when the backup operation finished. + */ + @JsonProperty(value = "backupFinishDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime backupFinishDate; + + /** + * Get database name. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get backup Type. Possible values include: 'Database', 'TransactionLog', 'File', 'DifferentialDatabase', 'DifferentialFile', 'Partial', 'DifferentialPartial'. + * + * @return the backupType value + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Get the list of backup files for the current database. + * + * @return the backupFiles value + */ + public List backupFiles() { + return this.backupFiles; + } + + /** + * Get position of current database backup in the file. + * + * @return the position value + */ + public Integer position() { + return this.position; + } + + /** + * Get database was damaged when backed up, but the backup operation was requested to continue despite errors. + * + * @return the isDamaged value + */ + public Boolean isDamaged() { + return this.isDamaged; + } + + /** + * Get whether the backup set is compressed. + * + * @return the isCompressed value + */ + public Boolean isCompressed() { + return this.isCompressed; + } + + /** + * Get number of files in the backup set. + * + * @return the familyCount value + */ + public Integer familyCount() { + return this.familyCount; + } + + /** + * Get date and time when the backup operation finished. + * + * @return the backupFinishDate value + */ + public DateTime backupFinishDate() { + return this.backupFinishDate; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseCompatLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseCompatLevel.java new file mode 100644 index 0000000000000..e8d86be18108a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseCompatLevel.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseCompatLevel. + */ +public final class DatabaseCompatLevel extends ExpandableStringEnum { + /** Static value CompatLevel80 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL80 = fromString("CompatLevel80"); + + /** Static value CompatLevel90 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL90 = fromString("CompatLevel90"); + + /** Static value CompatLevel100 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL100 = fromString("CompatLevel100"); + + /** Static value CompatLevel110 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL110 = fromString("CompatLevel110"); + + /** Static value CompatLevel120 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL120 = fromString("CompatLevel120"); + + /** Static value CompatLevel130 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL130 = fromString("CompatLevel130"); + + /** Static value CompatLevel140 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL140 = fromString("CompatLevel140"); + + /** + * Creates or finds a DatabaseCompatLevel from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseCompatLevel + */ + @JsonCreator + public static DatabaseCompatLevel fromString(String name) { + return fromString(name, DatabaseCompatLevel.class); + } + + /** + * @return known DatabaseCompatLevel values + */ + public static Collection values() { + return values(DatabaseCompatLevel.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInfo.java new file mode 100644 index 0000000000000..49f916be2121c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInfo.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information. + */ +public class DatabaseFileInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Size of the file in megabytes. + */ + @JsonProperty(value = "sizeMB") + private Double sizeMB; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set name of the database. + * + * @param databaseName the databaseName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Get size of the file in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Set size of the file in megabytes. + * + * @param sizeMB the sizeMB value to set + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withSizeMB(Double sizeMB) { + this.sizeMB = sizeMB; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInput.java new file mode 100644 index 0000000000000..9a90b99a23089 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileInput.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database file specific information for input. + */ +public class DatabaseFileInput { + /** + * Unique identifier for database file. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Operating-system full path of the file. + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /** + * Suggested full path of the file for restoring. + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /** + * Database file type. Possible values include: 'Rows', 'Log', + * 'Filestream', 'NotSupported', 'Fulltext'. + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Get unique identifier for database file. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database file. + * + * @param id the id value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get operating-system full path of the file. + * + * @return the physicalFullName value + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get suggested full path of the file for restoring. + * + * @return the restoreFullName value + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @return the fileType value + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set database file type. Possible values include: 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext'. + * + * @param fileType the fileType value to set + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileType.java new file mode 100644 index 0000000000000..be06c6cdefb3e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseFileType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseFileType. + */ +public final class DatabaseFileType extends ExpandableStringEnum { + /** Static value Rows for DatabaseFileType. */ + public static final DatabaseFileType ROWS = fromString("Rows"); + + /** Static value Log for DatabaseFileType. */ + public static final DatabaseFileType LOG = fromString("Log"); + + /** Static value Filestream for DatabaseFileType. */ + public static final DatabaseFileType FILESTREAM = fromString("Filestream"); + + /** Static value NotSupported for DatabaseFileType. */ + public static final DatabaseFileType NOT_SUPPORTED = fromString("NotSupported"); + + /** Static value Fulltext for DatabaseFileType. */ + public static final DatabaseFileType FULLTEXT = fromString("Fulltext"); + + /** + * Creates or finds a DatabaseFileType from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseFileType + */ + @JsonCreator + public static DatabaseFileType fromString(String name) { + return fromString(name, DatabaseFileType.class); + } + + /** + * @return known DatabaseFileType values + */ + public static Collection values() { + return values(DatabaseFileType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseInfo.java new file mode 100644 index 0000000000000..893a9183c8dda --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Project Database Details. + */ +public class DatabaseInfo { + /** + * Name of the database. + */ + @JsonProperty(value = "sourceDatabaseName", required = true) + private String sourceDatabaseName; + + /** + * Get name of the database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set name of the database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set + * @return the DatabaseInfo object itself. + */ + public DatabaseInfo withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseMigrationStage.java new file mode 100644 index 0000000000000..e3aca3150010c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseMigrationStage.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseMigrationStage. + */ +public final class DatabaseMigrationStage extends ExpandableStringEnum { + /** Static value None for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage NONE = fromString("None"); + + /** Static value Initialize for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value Backup for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage BACKUP = fromString("Backup"); + + /** Static value FileCopy for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage FILE_COPY = fromString("FileCopy"); + + /** Static value Restore for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage RESTORE = fromString("Restore"); + + /** Static value Completed for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a DatabaseMigrationStage from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseMigrationStage + */ + @JsonCreator + public static DatabaseMigrationStage fromString(String name) { + return fromString(name, DatabaseMigrationStage.class); + } + + /** + * @return known DatabaseMigrationStage values + */ + public static Collection values() { + return values(DatabaseMigrationStage.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseObjectName.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseObjectName.java new file mode 100644 index 0000000000000..7b55b020b88aa --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseObjectName.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A representation of the name of an object in a database. + */ +public class DatabaseObjectName { + /** + * The unescaped name of the database containing the object. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * The unescaped name of the object. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * The unescaped name of the schema containing the object. + */ + @JsonProperty(value = "schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /** + * Type of the object in the database. Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Get the unescaped name of the database containing the object. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the unescaped name of the object. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the unescaped name of the schema containing the object. + * + * @return the schemaName value + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object in the database. Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the DatabaseObjectName object itself. + */ + public DatabaseObjectName withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseState.java new file mode 100644 index 0000000000000..683dbf1c70da6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseState. + */ +public final class DatabaseState extends ExpandableStringEnum { + /** Static value Online for DatabaseState. */ + public static final DatabaseState ONLINE = fromString("Online"); + + /** Static value Restoring for DatabaseState. */ + public static final DatabaseState RESTORING = fromString("Restoring"); + + /** Static value Recovering for DatabaseState. */ + public static final DatabaseState RECOVERING = fromString("Recovering"); + + /** Static value RecoveryPending for DatabaseState. */ + public static final DatabaseState RECOVERY_PENDING = fromString("RecoveryPending"); + + /** Static value Suspect for DatabaseState. */ + public static final DatabaseState SUSPECT = fromString("Suspect"); + + /** Static value Emergency for DatabaseState. */ + public static final DatabaseState EMERGENCY = fromString("Emergency"); + + /** Static value Offline for DatabaseState. */ + public static final DatabaseState OFFLINE = fromString("Offline"); + + /** Static value Copying for DatabaseState. */ + public static final DatabaseState COPYING = fromString("Copying"); + + /** Static value OfflineSecondary for DatabaseState. */ + public static final DatabaseState OFFLINE_SECONDARY = fromString("OfflineSecondary"); + + /** + * Creates or finds a DatabaseState from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseState + */ + @JsonCreator + public static DatabaseState fromString(String name) { + return fromString(name, DatabaseState.class); + } + + /** + * @return known DatabaseState values + */ + public static Collection values() { + return values(DatabaseState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseSummaryResult.java new file mode 100644 index 0000000000000..18928a765eccc --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseSummaryResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Summary of database results in the migration. + */ +public class DatabaseSummaryResult extends DataItemMigrationSummaryResult { + /** + * Size of the database in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Get size of the database in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseTable.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseTable.java new file mode 100644 index 0000000000000..1ab9698d3d8f3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/DatabaseTable.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Table properties. + */ +public class DatabaseTable { + /** + * Indicates whether table is empty or not. + */ + @JsonProperty(value = "hasRows", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasRows; + + /** + * Schema-qualified name of the table. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get indicates whether table is empty or not. + * + * @return the hasRows value + */ + public Boolean hasRows() { + return this.hasRows; + } + + /** + * Get schema-qualified name of the table. + * + * @return the name value + */ + public String name() { + return this.name; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ErrorType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ErrorType.java new file mode 100644 index 0000000000000..94c5c50c670fd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ErrorType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ErrorType. + */ +public final class ErrorType extends ExpandableStringEnum { + /** Static value Default for ErrorType. */ + public static final ErrorType DEFAULT = fromString("Default"); + + /** Static value Warning for ErrorType. */ + public static final ErrorType WARNING = fromString("Warning"); + + /** Static value Error for ErrorType. */ + public static final ErrorType ERROR = fromString("Error"); + + /** + * Creates or finds a ErrorType from its string representation. + * @param name a name to look for + * @return the corresponding ErrorType + */ + @JsonCreator + public static ErrorType fromString(String name) { + return fromString(name, ErrorType.class); + } + + /** + * @return known ErrorType values + */ + public static Collection values() { + return values(ErrorType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ExecutionStatistics.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ExecutionStatistics.java new file mode 100644 index 0000000000000..f1bec0a4a673d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ExecutionStatistics.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ExecutionStatistics { + /** + * No. of query executions. + */ + @JsonProperty(value = "executionCount") + private Long executionCount; + + /** + * CPU Time in millisecond(s) for the query execution. + */ + @JsonProperty(value = "cpuTimeMs") + private Double cpuTimeMs; + + /** + * Time taken in millisecond(s) for executing the query. + */ + @JsonProperty(value = "elapsedTimeMs") + private Double elapsedTimeMs; + + /** + * Dictionary of sql query execution wait types and the respective + * statistics. + */ + @JsonProperty(value = "waitStats") + private Map waitStats; + + /** + * Indicates whether the query resulted in an error. + */ + @JsonProperty(value = "hasErrors") + private Boolean hasErrors; + + /** + * List of sql Errors. + */ + @JsonProperty(value = "sqlErrors") + private List sqlErrors; + + /** + * Get no. of query executions. + * + * @return the executionCount value + */ + public Long executionCount() { + return this.executionCount; + } + + /** + * Set no. of query executions. + * + * @param executionCount the executionCount value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withExecutionCount(Long executionCount) { + this.executionCount = executionCount; + return this; + } + + /** + * Get cPU Time in millisecond(s) for the query execution. + * + * @return the cpuTimeMs value + */ + public Double cpuTimeMs() { + return this.cpuTimeMs; + } + + /** + * Set cPU Time in millisecond(s) for the query execution. + * + * @param cpuTimeMs the cpuTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withCpuTimeMs(Double cpuTimeMs) { + this.cpuTimeMs = cpuTimeMs; + return this; + } + + /** + * Get time taken in millisecond(s) for executing the query. + * + * @return the elapsedTimeMs value + */ + public Double elapsedTimeMs() { + return this.elapsedTimeMs; + } + + /** + * Set time taken in millisecond(s) for executing the query. + * + * @param elapsedTimeMs the elapsedTimeMs value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withElapsedTimeMs(Double elapsedTimeMs) { + this.elapsedTimeMs = elapsedTimeMs; + return this; + } + + /** + * Get dictionary of sql query execution wait types and the respective statistics. + * + * @return the waitStats value + */ + public Map waitStats() { + return this.waitStats; + } + + /** + * Set dictionary of sql query execution wait types and the respective statistics. + * + * @param waitStats the waitStats value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withWaitStats(Map waitStats) { + this.waitStats = waitStats; + return this; + } + + /** + * Get indicates whether the query resulted in an error. + * + * @return the hasErrors value + */ + public Boolean hasErrors() { + return this.hasErrors; + } + + /** + * Set indicates whether the query resulted in an error. + * + * @param hasErrors the hasErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withHasErrors(Boolean hasErrors) { + this.hasErrors = hasErrors; + return this; + } + + /** + * Get list of sql Errors. + * + * @return the sqlErrors value + */ + public List sqlErrors() { + return this.sqlErrors; + } + + /** + * Set list of sql Errors. + * + * @param sqlErrors the sqlErrors value to set + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withSqlErrors(List sqlErrors) { + this.sqlErrors = sqlErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileShare.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileShare.java new file mode 100644 index 0000000000000..72920a6a14761 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileShare.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * File share information with Path, Username, and Password. + */ +public class FileShare { + /** + * User name credential to connect to the share location. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * Password credential used to connect to the share location. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The folder path for this share. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /** + * Get user name credential to connect to the share location. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set user name credential to connect to the share location. + * + * @param userName the userName value to set + * @return the FileShare object itself. + */ + public FileShare withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get password credential used to connect to the share location. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password credential used to connect to the share location. + * + * @param password the password value to set + * @return the FileShare object itself. + */ + public FileShare withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the folder path for this share. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the folder path for this share. + * + * @param path the path value to set + * @return the FileShare object itself. + */ + public FileShare withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileStorageInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileStorageInfo.java new file mode 100644 index 0000000000000..2e72ebe60df2e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/FileStorageInfo.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.FileStorageInfoInner; +import java.util.Map; + +/** + * Type representing FileStorageInfo. + */ +public interface FileStorageInfo extends HasInner, HasManager { + /** + * @return the headers value. + */ + Map headers(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Files.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Files.java new file mode 100644 index 0000000000000..662d04a2b8514 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Files.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.FilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Files. + */ +public interface Files extends SupportsCreating, HasInner { + /** + * Request storage information for downloading the file content. + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable readAsync(String groupName, String serviceName, String projectName, String fileName); + + /** + * Request information for reading and writing file content. + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable readWriteAsync(String groupName, String serviceName, String projectName, String fileName); + + /** + * Get file information. + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName, String fileName); + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName, final String projectName); + + /** + * Delete file. + * This method deletes a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName, String fileName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetProjectDetailsNonSqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetProjectDetailsNonSqlTaskInput.java new file mode 100644 index 0000000000000..2c3b04bbd0a1b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetProjectDetailsNonSqlTaskInput.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that reads configuration from project artifacts. + */ +public class GetProjectDetailsNonSqlTaskInput { + /** + * Name of the migration project. + */ + @JsonProperty(value = "projectName", required = true) + private String projectName; + + /** + * A URL that points to the location to access project artifacts. + */ + @JsonProperty(value = "projectLocation", required = true) + private String projectLocation; + + /** + * Get name of the migration project. + * + * @return the projectName value + */ + public String projectName() { + return this.projectName; + } + + /** + * Set name of the migration project. + * + * @param projectName the projectName value to set + * @return the GetProjectDetailsNonSqlTaskInput object itself. + */ + public GetProjectDetailsNonSqlTaskInput withProjectName(String projectName) { + this.projectName = projectName; + return this; + } + + /** + * Get a URL that points to the location to access project artifacts. + * + * @return the projectLocation value + */ + public String projectLocation() { + return this.projectLocation; + } + + /** + * Set a URL that points to the location to access project artifacts. + * + * @param projectLocation the projectLocation value to set + * @return the GetProjectDetailsNonSqlTaskInput object itself. + */ + public GetProjectDetailsNonSqlTaskInput withProjectLocation(String projectLocation) { + this.projectLocation = projectLocation; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskInput.java new file mode 100644 index 0000000000000..aea76f489e7d4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskInput.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that gets TDE certificates in Base64 encoded format. + */ +public class GetTdeCertificatesSqlTaskInput { + /** + * Connection information for SQL Server. + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /** + * Backup file share information for file share to be used for temporarily + * storing files. + */ + @JsonProperty(value = "backupFileShare", required = true) + private FileShare backupFileShare; + + /** + * List containing certificate names and corresponding password to use for + * encrypting the exported certificate. + */ + @JsonProperty(value = "selectedCertificates", required = true) + private List selectedCertificates; + + /** + * Get connection information for SQL Server. + * + * @return the connectionInfo value + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get backup file share information for file share to be used for temporarily storing files. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for file share to be used for temporarily storing files. + * + * @param backupFileShare the backupFileShare value to set + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get list containing certificate names and corresponding password to use for encrypting the exported certificate. + * + * @return the selectedCertificates value + */ + public List selectedCertificates() { + return this.selectedCertificates; + } + + /** + * Set list containing certificate names and corresponding password to use for encrypting the exported certificate. + * + * @param selectedCertificates the selectedCertificates value to set + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withSelectedCertificates(List selectedCertificates) { + this.selectedCertificates = selectedCertificates; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskOutput.java new file mode 100644 index 0000000000000..3fc8e4daaca16 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskOutput.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the task that gets TDE certificates in Base64 encoded format. + */ +public class GetTdeCertificatesSqlTaskOutput { + /** + * Mapping from certificate name to base 64 encoded format. + */ + @JsonProperty(value = "base64EncodedCertificates", access = JsonProperty.Access.WRITE_ONLY) + private Map> base64EncodedCertificates; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get mapping from certificate name to base 64 encoded format. + * + * @return the base64EncodedCertificates value + */ + public Map> base64EncodedCertificates() { + return this.base64EncodedCertificates; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskProperties.java new file mode 100644 index 0000000000000..140ba4898710b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetTdeCertificatesSqlTaskProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that gets TDE certificates in Base64 encoded format. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetTDECertificates.Sql") +public class GetTdeCertificatesSqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private GetTdeCertificatesSqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public GetTdeCertificatesSqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the GetTdeCertificatesSqlTaskProperties object itself. + */ + public GetTdeCertificatesSqlTaskProperties withInput(GetTdeCertificatesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskInput.java new file mode 100644 index 0000000000000..4647b230cba00 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlSyncTaskInput { + /** + * Connection information for SQL Server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Connection information for SQL DB. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * List of source database names to collect tables for. + */ + @JsonProperty(value = "selectedSourceDatabases", required = true) + private List selectedSourceDatabases; + + /** + * List of target database names to collect tables for. + */ + @JsonProperty(value = "selectedTargetDatabases", required = true) + private List selectedTargetDatabases; + + /** + * Get connection information for SQL Server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get connection information for SQL DB. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get list of source database names to collect tables for. + * + * @return the selectedSourceDatabases value + */ + public List selectedSourceDatabases() { + return this.selectedSourceDatabases; + } + + /** + * Set list of source database names to collect tables for. + * + * @param selectedSourceDatabases the selectedSourceDatabases value to set + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSelectedSourceDatabases(List selectedSourceDatabases) { + this.selectedSourceDatabases = selectedSourceDatabases; + return this; + } + + /** + * Get list of target database names to collect tables for. + * + * @return the selectedTargetDatabases value + */ + public List selectedTargetDatabases() { + return this.selectedTargetDatabases; + } + + /** + * Set list of target database names to collect tables for. + * + * @param selectedTargetDatabases the selectedTargetDatabases value to set + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSelectedTargetDatabases(List selectedTargetDatabases) { + this.selectedTargetDatabases = selectedTargetDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskOutput.java new file mode 100644 index 0000000000000..52001868f6ef3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskOutput.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlSyncTaskOutput { + /** + * Mapping from database name to list of source tables. + */ + @JsonProperty(value = "databasesToSourceTables", access = JsonProperty.Access.WRITE_ONLY) + private Map> databasesToSourceTables; + + /** + * Mapping from database name to list of target tables. + */ + @JsonProperty(value = "databasesToTargetTables", access = JsonProperty.Access.WRITE_ONLY) + private Map> databasesToTargetTables; + + /** + * Mapping from database name to list of validation errors. + */ + @JsonProperty(value = "tableValidationErrors", access = JsonProperty.Access.WRITE_ONLY) + private Map> tableValidationErrors; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get mapping from database name to list of source tables. + * + * @return the databasesToSourceTables value + */ + public Map> databasesToSourceTables() { + return this.databasesToSourceTables; + } + + /** + * Get mapping from database name to list of target tables. + * + * @return the databasesToTargetTables value + */ + public Map> databasesToTargetTables() { + return this.databasesToTargetTables; + } + + /** + * Get mapping from database name to list of validation errors. + * + * @return the tableValidationErrors value + */ + public Map> tableValidationErrors() { + return this.tableValidationErrors; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskProperties.java new file mode 100644 index 0000000000000..e389c83671e30 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that collects user tables for the given list of + * databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.AzureSqlDb.Sync") +public class GetUserTablesSqlSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private GetUserTablesSqlSyncTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public GetUserTablesSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the GetUserTablesSqlSyncTaskProperties object itself. + */ + public GetUserTablesSqlSyncTaskProperties withInput(GetUserTablesSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskInput.java new file mode 100644 index 0000000000000..1a281f54bd3f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskInput { + /** + * Connection information for SQL Server. + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /** + * List of database names to collect tables for. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get connection information for SQL Server. + * + * @return the connectionInfo value + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get list of database names to collect tables for. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set list of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskOutput.java new file mode 100644 index 0000000000000..b1b16d724e215 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskOutput.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the task that collects user tables for the given list of + * databases. + */ +public class GetUserTablesSqlTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Mapping from database name to list of tables. + */ + @JsonProperty(value = "databasesToTables", access = JsonProperty.Access.WRITE_ONLY) + private Map> databasesToTables; + + /** + * Validation errors. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get mapping from database name to list of tables. + * + * @return the databasesToTables value + */ + public Map> databasesToTables() { + return this.databasesToTables; + } + + /** + * Get validation errors. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskProperties.java new file mode 100644 index 0000000000000..2bbf380bfd000 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/GetUserTablesSqlTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that collects user tables for the given list of + * databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.Sql") +public class GetUserTablesSqlTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private GetUserTablesSqlTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public GetUserTablesSqlTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withInput(GetUserTablesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginMigrationStage.java new file mode 100644 index 0000000000000..d881ff33e14d2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginMigrationStage.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoginMigrationStage. + */ +public final class LoginMigrationStage extends ExpandableStringEnum { + /** Static value None for LoginMigrationStage. */ + public static final LoginMigrationStage NONE = fromString("None"); + + /** Static value Initialize for LoginMigrationStage. */ + public static final LoginMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value LoginMigration for LoginMigrationStage. */ + public static final LoginMigrationStage LOGIN_MIGRATION = fromString("LoginMigration"); + + /** Static value EstablishUserMapping for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_USER_MAPPING = fromString("EstablishUserMapping"); + + /** Static value AssignRoleMembership for LoginMigrationStage. */ + public static final LoginMigrationStage ASSIGN_ROLE_MEMBERSHIP = fromString("AssignRoleMembership"); + + /** Static value AssignRoleOwnership for LoginMigrationStage. */ + public static final LoginMigrationStage ASSIGN_ROLE_OWNERSHIP = fromString("AssignRoleOwnership"); + + /** Static value EstablishServerPermissions for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_SERVER_PERMISSIONS = fromString("EstablishServerPermissions"); + + /** Static value EstablishObjectPermissions for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_OBJECT_PERMISSIONS = fromString("EstablishObjectPermissions"); + + /** Static value Completed for LoginMigrationStage. */ + public static final LoginMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a LoginMigrationStage from its string representation. + * @param name a name to look for + * @return the corresponding LoginMigrationStage + */ + @JsonCreator + public static LoginMigrationStage fromString(String name) { + return fromString(name, LoginMigrationStage.class); + } + + /** + * @return known LoginMigrationStage values + */ + public static Collection values() { + return values(LoginMigrationStage.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginType.java new file mode 100644 index 0000000000000..9ca3334b774ff --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/LoginType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoginType. + */ +public final class LoginType extends ExpandableStringEnum { + /** Static value WindowsUser for LoginType. */ + public static final LoginType WINDOWS_USER = fromString("WindowsUser"); + + /** Static value WindowsGroup for LoginType. */ + public static final LoginType WINDOWS_GROUP = fromString("WindowsGroup"); + + /** Static value SqlLogin for LoginType. */ + public static final LoginType SQL_LOGIN = fromString("SqlLogin"); + + /** Static value Certificate for LoginType. */ + public static final LoginType CERTIFICATE = fromString("Certificate"); + + /** Static value AsymmetricKey for LoginType. */ + public static final LoginType ASYMMETRIC_KEY = fromString("AsymmetricKey"); + + /** Static value ExternalUser for LoginType. */ + public static final LoginType EXTERNAL_USER = fromString("ExternalUser"); + + /** Static value ExternalGroup for LoginType. */ + public static final LoginType EXTERNAL_GROUP = fromString("ExternalGroup"); + + /** + * Creates or finds a LoginType from its string representation. + * @param name a name to look for + * @return the corresponding LoginType + */ + @JsonCreator + public static LoginType fromString(String name) { + return fromString(name, LoginType.class); + } + + /** + * @return known LoginType values + */ + public static Collection values() { + return values(LoginType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMongoDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMongoDbTaskProperties.java new file mode 100644 index 0000000000000..0a0519e3b4c9d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMongoDbTaskProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates data between MongoDB data sources. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MongoDb") +public class MigrateMongoDbTaskProperties extends ProjectTaskProperties { + /** + * The input property. + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /** + * The output property. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input value. + * + * @return the input value + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input value. + * + * @param input the input value to set + * @return the MigrateMongoDbTaskProperties object itself. + */ + public MigrateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get the output value. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java new file mode 100644 index 0000000000000..73f3cea6f3e42 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for MySQL to Azure Database for MySQL + * migration task inputs. + */ +public class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. Note: Target database will be truncated before starting migration. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. Note: Target database will be truncated before starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.java new file mode 100644 index 0000000000000..55f00cbbc34c6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskInput.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates MySQL databases to Azure Database for MySQL + * for online migrations. + */ +public class MigrateMySqlAzureDbForMySqlSyncTaskInput { + /** + * Connection information for source MySQL. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /** + * Connection information for target Azure Database for MySQL. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MySqlConnectionInfo targetConnectionInfo; + + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get connection information for source MySQL. + * + * @return the sourceConnectionInfo value + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for source MySQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get connection information for target Azure Database for MySQL. + * + * @return the targetConnectionInfo value + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target Azure Database for MySQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withTargetConnectionInfo(MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java new file mode 100644 index 0000000000000..8a4db9b7041ec --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateMySqlAzureDbForMySqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DatabaseLevelErrorOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class) +}) +public class MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java new file mode 100644 index 0000000000000..d0d4158c4b8a9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +public class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set error message. + * + * @param errorMessage the errorMessage value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get list of error events. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set list of error events. + * + * @param events the events value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..8d88e11e6717d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration state that this database is in. Possible values include: + * 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', + * 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', + * 'CANCELLED', 'FAILED'. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /** + * Number of incoming changes. + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /** + * Number of applied changes. + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /** + * Number of cdc inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /** + * Number of cdc deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /** + * Number of cdc updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /** + * Number of tables completed in full load. + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /** + * Number of tables loading in full load. + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /** + * Number of tables queued in full load. + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /** + * Number of tables errored in full load. + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /** + * Indicates if initial load (full load) has been completed. + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /** + * CDC apply latency. + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration state that this database is in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', 'CANCELLED', 'FAILED'. + * + * @return the migrationState value + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get number of incoming changes. + * + * @return the incomingChanges value + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get number of applied changes. + * + * @return the appliedChanges value + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get number of cdc inserts. + * + * @return the cdcInsertCounter value + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of cdc deletes. + * + * @return the cdcDeleteCounter value + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get number of cdc updates. + * + * @return the cdcUpdateCounter value + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of tables completed in full load. + * + * @return the fullLoadCompletedTables value + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get number of tables loading in full load. + * + * @return the fullLoadLoadingTables value + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get number of tables queued in full load. + * + * @return the fullLoadQueuedTables value + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get number of tables errored in full load. + * + * @return the fullLoadErroredTables value + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get cDC apply latency. + * + * @return the latency value + */ + public Long latency() { + return this.latency; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java new file mode 100644 index 0000000000000..5bc79201d12e0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateMySqlAzureDbForMySqlSyncTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateMySqlAzureDbForMySqlSyncTaskOutputError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..eff4d15007b3e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server name. + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server name. + * + * @return the sourceServer value + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server name. + * + * @return the targetServer value + */ + public String targetServer() { + return this.targetServer; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java new file mode 100644 index 0000000000000..a309f67492c75 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Name of the table. + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Number of applied inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcInsertCounter; + + /** + * Number of applied updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcUpdateCounter; + + /** + * Number of applied deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcDeleteCounter; + + /** + * Estimate to finish full load. + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEstFinishTime; + + /** + * Full load start time. + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadStartedOn; + + /** + * Full load end time. + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEndedOn; + + /** + * Number of rows applied in full load. + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /** + * Current state of the table migration. Possible values include: + * 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /** + * Total number of applied changes. + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /** + * Number of data errors occurred. + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /** + * Last modified time on target. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get name of the table. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get number of applied inserts. + * + * @return the cdcInsertCounter value + */ + public String cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of applied updates. + * + * @return the cdcUpdateCounter value + */ + public String cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of applied deletes. + * + * @return the cdcDeleteCounter value + */ + public String cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get estimate to finish full load. + * + * @return the fullLoadEstFinishTime value + */ + public DateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get full load start time. + * + * @return the fullLoadStartedOn value + */ + public DateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get full load end time. + * + * @return the fullLoadEndedOn value + */ + public DateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get number of rows applied in full load. + * + * @return the fullLoadTotalRows value + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get current state of the table migration. Possible values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + * + * @return the state value + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get total number of applied changes. + * + * @return the totalChangesApplied value + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get number of data errors occurred. + * + * @return the dataErrorsCounter value + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get last modified time on target. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java new file mode 100644 index 0000000000000..dde9f5edcb2a2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MySql.AzureDbForMySql.Sync") +public class MigrateMySqlAzureDbForMySqlSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateMySqlAzureDbForMySqlSyncTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateMySqlAzureDbForMySqlSyncTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskProperties withInput(MigrateMySqlAzureDbForMySqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java new file mode 100644 index 0000000000000..29bebeb4b44b5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for PostgreSQL to Azure Database for + * PostgreSQL migration task inputs. + */ +public class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. Note: Target database will be truncated before starting migration. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. Note: Target database will be truncated before starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java new file mode 100644 index 0000000000000..bc45ac91907eb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations. + */ +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Connection information for target Azure Database for PostgreSQL. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /** + * Connection information for source PostgreSQL. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private PostgreSqlConnectionInfo sourceConnectionInfo; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get connection information for target Azure Database for PostgreSQL. + * + * @return the targetConnectionInfo value + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set connection information for target Azure Database for PostgreSQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo(PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get connection information for source PostgreSQL. + * + * @return the sourceConnectionInfo value + */ + public PostgreSqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set connection information for source PostgreSQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSourceConnectionInfo(PostgreSqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java new file mode 100644 index 0000000000000..2e3e643f22dd9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DatabaseLevelErrorOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class) +}) +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java new file mode 100644 index 0000000000000..e5bce07226b9b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set error message. + * + * @param errorMessage the errorMessage value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get list of error events. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set list of error events. + * + * @param events the events value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..5d9b582e5a969 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration state that this database is in. Possible values include: + * 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', + * 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', + * 'CANCELLED', 'FAILED'. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /** + * Number of incoming changes. + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /** + * Number of applied changes. + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /** + * Number of cdc inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /** + * Number of cdc deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /** + * Number of cdc updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /** + * Number of tables completed in full load. + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /** + * Number of tables loading in full load. + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /** + * Number of tables queued in full load. + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /** + * Number of tables errored in full load. + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /** + * Indicates if initial load (full load) has been completed. + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /** + * CDC apply latency. + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration state that this database is in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', 'CANCELLED', 'FAILED'. + * + * @return the migrationState value + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get number of incoming changes. + * + * @return the incomingChanges value + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get number of applied changes. + * + * @return the appliedChanges value + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get number of cdc inserts. + * + * @return the cdcInsertCounter value + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of cdc deletes. + * + * @return the cdcDeleteCounter value + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get number of cdc updates. + * + * @return the cdcUpdateCounter value + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of tables completed in full load. + * + * @return the fullLoadCompletedTables value + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get number of tables loading in full load. + * + * @return the fullLoadLoadingTables value + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get number of tables queued in full load. + * + * @return the fullLoadQueuedTables value + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get number of tables errored in full load. + * + * @return the fullLoadErroredTables value + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get cDC apply latency. + * + * @return the latency value + */ + public Long latency() { + return this.latency; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java new file mode 100644 index 0000000000000..0d15539681ed8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..ef898f12ce0ae --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server name. + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server name. + * + * @return the sourceServer value + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server name. + * + * @return the targetServer value + */ + public String targetServer() { + return this.targetServer; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java new file mode 100644 index 0000000000000..e07c5b3443c2c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Name of the table. + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Number of applied inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /** + * Number of applied updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /** + * Number of applied deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /** + * Estimate to finish full load. + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEstFinishTime; + + /** + * Full load start time. + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadStartedOn; + + /** + * Full load end time. + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEndedOn; + + /** + * Number of rows applied in full load. + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /** + * Current state of the table migration. Possible values include: + * 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /** + * Total number of applied changes. + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /** + * Number of data errors occurred. + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /** + * Last modified time on target. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get name of the table. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get number of applied inserts. + * + * @return the cdcInsertCounter value + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of applied updates. + * + * @return the cdcUpdateCounter value + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of applied deletes. + * + * @return the cdcDeleteCounter value + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get estimate to finish full load. + * + * @return the fullLoadEstFinishTime value + */ + public DateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get full load start time. + * + * @return the fullLoadStartedOn value + */ + public DateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get full load end time. + * + * @return the fullLoadEndedOn value + */ + public DateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get number of rows applied in full load. + * + * @return the fullLoadTotalRows value + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get current state of the table migration. Possible values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + * + * @return the state value + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get total number of applied changes. + * + * @return the totalChangesApplied value + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get number of data errors occurred. + * + * @return the dataErrorsCounter value + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get last modified time on target. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 0000000000000..b2b5cd877451c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates PostgreSQL databases to Azure Database + * for PostgreSQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.PostgreSql.AzureDbForPostgreSql.Sync") +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withInput(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbDatabaseInput.java new file mode 100644 index 0000000000000..89f0a44fe1c85 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database input for migrate schema Sql Server to Azure SQL Server scenario. + */ +public class MigrateSchemaSqlServerSqlDbDatabaseInput { + /** + * Name of source database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Database schema migration settings. + */ + @JsonProperty(value = "schemaSetting") + private SchemaMigrationSetting schemaSetting; + + /** + * Get name of source database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of source database. + * + * @param name the name value to set + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get database schema migration settings. + * + * @return the schemaSetting value + */ + public SchemaMigrationSetting schemaSetting() { + return this.schemaSetting; + } + + /** + * Set database schema migration settings. + * + * @param schemaSetting the schemaSetting value to set + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withSchemaSetting(SchemaMigrationSetting schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskInput.java new file mode 100644 index 0000000000000..c67d29735f90d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskInput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that migrates Schema for SQL Server databases to Azure SQL + * databases. + */ +public class MigrateSchemaSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutput.java new file mode 100644 index 0000000000000..2fc5b668d0b68 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates Schema for SQL Server databases to Azure + * SQL databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSchemaSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "SchemaErrorOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSchemaSqlTaskOutputError.class) +}) +public class MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..4785470141fc7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * The name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * State of the schema migration for this database. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Schema migration stage for this database. Possible values include: + * 'NotStarted', 'ValidatingInputs', 'CollectingObjects', + * 'DownloadingScript', 'GeneratingScript', 'UploadingScript', + * 'DeployingSchema', 'Completed', 'CompletedWithWarnings', 'Failed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SchemaMigrationStage stage; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Prefix string to use for querying errors for this database. + */ + @JsonProperty(value = "databaseErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String databaseErrorResultPrefix; + + /** + * Prefix string to use for querying schema errors for this database. + */ + @JsonProperty(value = "schemaErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String schemaErrorResultPrefix; + + /** + * Number of successful operations for this database. + */ + @JsonProperty(value = "numberOfSuccessfulOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfSuccessfulOperations; + + /** + * Number of failed operations for this database. + */ + @JsonProperty(value = "numberOfFailedOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfFailedOperations; + + /** + * Identifier for the file resource containing the schema of this database. + */ + @JsonProperty(value = "fileId", access = JsonProperty.Access.WRITE_ONLY) + private String fileId; + + /** + * Get the name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get state of the schema migration for this database. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get schema migration stage for this database. Possible values include: 'NotStarted', 'ValidatingInputs', 'CollectingObjects', 'DownloadingScript', 'GeneratingScript', 'UploadingScript', 'DeployingSchema', 'Completed', 'CompletedWithWarnings', 'Failed'. + * + * @return the stage value + */ + public SchemaMigrationStage stage() { + return this.stage; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get prefix string to use for querying errors for this database. + * + * @return the databaseErrorResultPrefix value + */ + public String databaseErrorResultPrefix() { + return this.databaseErrorResultPrefix; + } + + /** + * Get prefix string to use for querying schema errors for this database. + * + * @return the schemaErrorResultPrefix value + */ + public String schemaErrorResultPrefix() { + return this.schemaErrorResultPrefix; + } + + /** + * Get number of successful operations for this database. + * + * @return the numberOfSuccessfulOperations value + */ + public Long numberOfSuccessfulOperations() { + return this.numberOfSuccessfulOperations; + } + + /** + * Get number of failed operations for this database. + * + * @return the numberOfFailedOperations value + */ + public Long numberOfFailedOperations() { + return this.numberOfFailedOperations; + } + + /** + * Get identifier for the file resource containing the schema of this database. + * + * @return the fileId value + */ + public String fileId() { + return this.fileId; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputError.java new file mode 100644 index 0000000000000..e1d1a724d01e1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("SchemaErrorOutput") +public class MigrateSchemaSqlServerSqlDbTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * Schema command which failed. + */ + @JsonProperty(value = "commandText", access = JsonProperty.Access.WRITE_ONLY) + private String commandText; + + /** + * Reason of failure. + */ + @JsonProperty(value = "errorText", access = JsonProperty.Access.WRITE_ONLY) + private String errorText; + + /** + * Get schema command which failed. + * + * @return the commandText value + */ + public String commandText() { + return this.commandText; + } + + /** + * Get reason of failure. + * + * @return the errorText value + */ + public String errorText() { + return this.errorText; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..0a10199f95f3d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * Overall state of the schema migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get overall state of the schema migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskProperties.java new file mode 100644 index 0000000000000..ec61e404497d6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlServerSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that migrates Schema for SQL Server databases to Azure + * SQL databases. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("MigrateSchemaSqlServerSqlDb") +public class MigrateSchemaSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSchemaSqlServerSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSchemaSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withInput(MigrateSchemaSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlTaskOutputError.java new file mode 100644 index 0000000000000..8ecff8f3f0278 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSchemaSqlTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSchemaSqlTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbDatabaseInput.java new file mode 100644 index 0000000000000..b211a0891df1f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB migration task inputs. + */ +public class MigrateSqlServerSqlDbDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Whether to set database read only before migration. + */ + @JsonProperty(value = "makeSourceDbReadOnly") + private Boolean makeSourceDbReadOnly; + + /** + * Mapping of source to target tables. + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of target database. Note: Target database will be truncated before starting migration. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set name of target database. Note: Target database will be truncated before starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get whether to set database read only before migration. + * + * @return the makeSourceDbReadOnly value + */ + public Boolean makeSourceDbReadOnly() { + return this.makeSourceDbReadOnly; + } + + /** + * Set whether to set database read only before migration. + * + * @param makeSourceDbReadOnly the makeSourceDbReadOnly value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withMakeSourceDbReadOnly(Boolean makeSourceDbReadOnly) { + this.makeSourceDbReadOnly = makeSourceDbReadOnly; + return this; + } + + /** + * Get mapping of source to target tables. + * + * @return the tableMap value + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set mapping of source to target tables. + * + * @param tableMap the tableMap value to set + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncDatabaseInput.java new file mode 100644 index 0000000000000..206d91f6eb7a8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncDatabaseInput.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB sync migration task + * inputs. + */ +public class MigrateSqlServerSqlDbSyncDatabaseInput { + /** + * Unique identifier for database. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Target database name. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /** + * Schema name to be migrated. + */ + @JsonProperty(value = "schemaName") + private String schemaName; + + /** + * Mapping of source to target tables. + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Migration settings which tune the migration behavior. + */ + @JsonProperty(value = "migrationSetting") + private Map migrationSetting; + + /** + * Source settings to tune source endpoint migration behavior. + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /** + * Target settings to tune target endpoint migration behavior. + */ + @JsonProperty(value = "targetSetting") + private Map targetSetting; + + /** + * Get unique identifier for database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique identifier for database. + * + * @param id the id value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get target database name. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set target database name. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get schema name to be migrated. + * + * @return the schemaName value + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set schema name to be migrated. + * + * @param schemaName the schemaName value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + /** + * Get mapping of source to target tables. + * + * @return the tableMap value + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set mapping of source to target tables. + * + * @param tableMap the tableMap value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Get migration settings which tune the migration behavior. + * + * @return the migrationSetting value + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withMigrationSetting(Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskInput.java new file mode 100644 index 0000000000000..844ca15156902 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskInput.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations. + */ +public class MigrateSqlServerSqlDbSyncTaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Validation options. + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlDbSyncTaskInput object itself. + */ + public MigrateSqlServerSqlDbSyncTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get validation options. + * + * @return the validationOptions value + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set validation options. + * + * @param validationOptions the validationOptions value to set + * @return the MigrateSqlServerSqlDbSyncTaskInput object itself. + */ + public MigrateSqlServerSqlDbSyncTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutput.java new file mode 100644 index 0000000000000..9a97a6b0011d2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlDbSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DatabaseLevelErrorOutput", value = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbSyncTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java new file mode 100644 index 0000000000000..e16a19b03c54c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbSyncTaskOutputDatabaseError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +public class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError extends MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set error message. + * + * @param errorMessage the errorMessage value to set + * @return the MigrateSqlServerSqlDbSyncTaskOutputDatabaseError object itself. + */ + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get list of error events. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set list of error events. + * + * @param events the events value to set + * @return the MigrateSqlServerSqlDbSyncTaskOutputDatabaseError object itself. + */ + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseError withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..fc69e9aa006c7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration state that this database is in. Possible values include: + * 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', + * 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', + * 'CANCELLED', 'FAILED'. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /** + * Number of incoming changes. + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /** + * Number of applied changes. + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /** + * Number of cdc inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /** + * Number of cdc deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /** + * Number of cdc updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /** + * Number of tables completed in full load. + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /** + * Number of tables loading in full load. + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /** + * Number of tables queued in full load. + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /** + * Number of tables errored in full load. + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /** + * Indicates if initial load (full load) has been completed. + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /** + * CDC apply latency. + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration state that this database is in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', 'CANCELLING', 'CANCELLED', 'FAILED'. + * + * @return the migrationState value + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get number of incoming changes. + * + * @return the incomingChanges value + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get number of applied changes. + * + * @return the appliedChanges value + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get number of cdc inserts. + * + * @return the cdcInsertCounter value + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of cdc deletes. + * + * @return the cdcDeleteCounter value + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get number of cdc updates. + * + * @return the cdcUpdateCounter value + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of tables completed in full load. + * + * @return the fullLoadCompletedTables value + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get number of tables loading in full load. + * + * @return the fullLoadLoadingTables value + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get number of tables queued in full load. + * + * @return the fullLoadQueuedTables value + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get number of tables errored in full load. + * + * @return the fullLoadErroredTables value + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get cDC apply latency. + * + * @return the latency value + */ + public Long latency() { + return this.latency; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputError.java new file mode 100644 index 0000000000000..9d167e4b02123 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbSyncTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlDbSyncTaskOutputError extends MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..85fd1696b04a1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server name. + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server name. + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Count of databases. + */ + @JsonProperty(value = "databaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer databaseCount; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server name. + * + * @return the sourceServer value + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server name. + * + * @return the targetServer value + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Get count of databases. + * + * @return the databaseCount value + */ + public Integer databaseCount() { + return this.databaseCount; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java new file mode 100644 index 0000000000000..52b038a20fcea --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbSyncTaskOutputTableLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigrateSqlServerSqlDbSyncTaskOutputTableLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Name of the table. + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Number of applied inserts. + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /** + * Number of applied updates. + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /** + * Number of applied deletes. + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /** + * Estimate to finish full load. + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEstFinishTime; + + /** + * Full load start time. + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadStartedOn; + + /** + * Full load end time. + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime fullLoadEndedOn; + + /** + * Number of rows applied in full load. + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /** + * Current state of the table migration. Possible values include: + * 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /** + * Total number of applied changes. + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /** + * Number of data errors occurred. + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /** + * Last modified time on target. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get name of the table. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get number of applied inserts. + * + * @return the cdcInsertCounter value + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get number of applied updates. + * + * @return the cdcUpdateCounter value + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get number of applied deletes. + * + * @return the cdcDeleteCounter value + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get estimate to finish full load. + * + * @return the fullLoadEstFinishTime value + */ + public DateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get full load start time. + * + * @return the fullLoadStartedOn value + */ + public DateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get full load end time. + * + * @return the fullLoadEndedOn value + */ + public DateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get number of rows applied in full load. + * + * @return the fullLoadTotalRows value + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get current state of the table migration. Possible values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', 'FAILED'. + * + * @return the state value + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get total number of applied changes. + * + * @return the totalChangesApplied value + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get number of data errors occurred. + * + * @return the dataErrorsCounter value + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get last modified time on target. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskProperties.java new file mode 100644 index 0000000000000..8dec00ed50877 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDb.Sync") +public class MigrateSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbSyncTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlDbSyncTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlDbSyncTaskProperties object itself. + */ + public MigrateSqlServerSqlDbSyncTaskProperties withInput(MigrateSqlServerSqlDbSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskInput.java new file mode 100644 index 0000000000000..ca9d9e9e5260f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskInput.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +public class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Options for enabling various post migration validations. Available + * options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of + * queries picked up automatically either from the Query Plan Cache or + * Query Store and execute them and compares the execution time between the + * source and target database. + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @return the validationOptions value + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set options for enabling various post migration validations. Available options, + 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to ensure the correctness of the data. + 2.) Schema Validation: Performs a thorough schema comparison between the source and target tables and provides a list of differences between the source and target database, 3.) Query Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and execute them and compares the execution time between the source and target database. + * + * @param validationOptions the validationOptions value to set + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutput.java new file mode 100644 index 0000000000000..8ec40e97f337f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbTaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlDbTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..abd8a5136466f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration stage that this database is in. Possible values include: + * 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Number of objects. + */ + @JsonProperty(value = "numberOfObjects", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjects; + + /** + * Number of successfully completed objects. + */ + @JsonProperty(value = "numberOfObjectsCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjectsCompleted; + + /** + * Number of database/object errors. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long errorCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Summary of object results in the migration. + */ + @JsonProperty(value = "objectSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map objectSummary; + + /** + * Get name of the item. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration stage that this database is in. Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + * + * @return the stage value + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get number of objects. + * + * @return the numberOfObjects value + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get number of database/object errors. + * + * @return the errorCount value + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get summary of object results in the migration. + * + * @return the objectSummary value + */ + public Map objectSummary() { + return this.objectSummary; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputError.java new file mode 100644 index 0000000000000..32e2eddee93f4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..a455c854ca0e0 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Duration of task execution in seconds. + */ + @JsonProperty(value = "durationInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long durationInSeconds; + + /** + * Current status of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Migration status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Selected databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Summary of database results in the migration. + */ + @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) + private Map databaseSummary; + + /** + * Migration Validation Results. + */ + @JsonProperty(value = "migrationValidationResult") + private MigrationValidationResult migrationValidationResult; + + /** + * Migration Report Result, provides unique url for downloading your + * migration report. + */ + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get duration of task execution in seconds. + * + * @return the durationInSeconds value + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get current status of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get migration status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get selected databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get summary of database results in the migration. + * + * @return the databaseSummary value + */ + public Map databaseSummary() { + return this.databaseSummary; + } + + /** + * Get migration Validation Results. + * + * @return the migrationValidationResult value + */ + public MigrationValidationResult migrationValidationResult() { + return this.migrationValidationResult; + } + + /** + * Set migration Validation Results. + * + * @param migrationValidationResult the migrationValidationResult value to set + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationValidationResult(MigrationValidationResult migrationValidationResult) { + this.migrationValidationResult = migrationValidationResult; + return this; + } + + /** + * Get migration Report Result, provides unique url for downloading your migration report. + * + * @return the migrationReportResult value + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set migration Report Result, provides unique url for downloading your migration report. + * + * @param migrationReportResult the migrationReportResult value to set + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult(MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java new file mode 100644 index 0000000000000..ee16c96a3a01c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskOutputTableLevel.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlDbTaskOutputTableLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +public class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { + /** + * Name of the item. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Status message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * Number of items. + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /** + * Number of successfully completed items. + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /** + * Wildcard string prefix to use for querying all errors of the item. + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /** + * Wildcard string prefix to use for querying all sub-tem results of the + * item. + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get name of the item. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get status message. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get number of items. + * + * @return the itemsCount value + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get number of successfully completed items. + * + * @return the itemsCompletedCount value + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value + */ + public String resultPrefix() { + return this.resultPrefix; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskProperties.java new file mode 100644 index 0000000000000..4cdac69bbe2fa --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.SqlDb") +public class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withInput(MigrateSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMIDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMIDatabaseInput.java new file mode 100644 index 0000000000000..d142332f171f2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMIDatabaseInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to Azure SQL DB Managed Instance + * migration task inputs. + */ +public class MigrateSqlServerSqlMIDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Name of the database at destination. + */ + @JsonProperty(value = "restoreDatabaseName", required = true) + private String restoreDatabaseName; + + /** + * Backup file share information for backing up this database. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * The list of backup files to be used in case of existing backups. + */ + @JsonProperty(value = "backupFilePaths") + private List backupFilePaths; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the database at destination. + * + * @return the restoreDatabaseName value + */ + public String restoreDatabaseName() { + return this.restoreDatabaseName; + } + + /** + * Set name of the database at destination. + * + * @param restoreDatabaseName the restoreDatabaseName value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withRestoreDatabaseName(String restoreDatabaseName) { + this.restoreDatabaseName = restoreDatabaseName; + return this; + } + + /** + * Get backup file share information for backing up this database. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for backing up this database. + * + * @param backupFileShare the backupFileShare value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the list of backup files to be used in case of existing backups. + * + * @return the backupFilePaths value + */ + public List backupFilePaths() { + return this.backupFilePaths; + } + + /** + * Set the list of backup files to be used in case of existing backups. + * + * @param backupFilePaths the backupFilePaths value to set + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withBackupFilePaths(List backupFilePaths) { + this.backupFilePaths = backupFilePaths; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskInput.java new file mode 100644 index 0000000000000..8c5627e9ec4de --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskInput.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +public class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput { + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Logins to migrate. + */ + @JsonProperty(value = "selectedLogins") + private List selectedLogins; + + /** + * Agent Jobs to migrate. + */ + @JsonProperty(value = "selectedAgentJobs") + private List selectedAgentJobs; + + /** + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /** + * Backup Mode to specify whether to use existing backup or create new + * backup. If using existing backups, backup file paths are required to be + * provided in selectedDatabases. Possible values include: 'CreateBackup', + * 'ExistingBackup'. + */ + @JsonProperty(value = "backupMode") + private BackupMode backupMode; + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get logins to migrate. + * + * @return the selectedLogins value + */ + public List selectedLogins() { + return this.selectedLogins; + } + + /** + * Set logins to migrate. + * + * @param selectedLogins the selectedLogins value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedLogins(List selectedLogins) { + this.selectedLogins = selectedLogins; + return this; + } + + /** + * Get agent Jobs to migrate. + * + * @return the selectedAgentJobs value + */ + public List selectedAgentJobs() { + return this.selectedAgentJobs; + } + + /** + * Set agent Jobs to migrate. + * + * @param selectedAgentJobs the selectedAgentJobs value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedAgentJobs(List selectedAgentJobs) { + this.selectedAgentJobs = selectedAgentJobs; + return this; + } + + /** + * Get backup file share information for all selected databases. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + + /** + * Get backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths are required to be provided in selectedDatabases. Possible values include: 'CreateBackup', 'ExistingBackup'. + * + * @return the backupMode value + */ + public BackupMode backupMode() { + return this.backupMode; + } + + /** + * Set backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths are required to be provided in selectedDatabases. Possible values include: 'CreateBackup', 'ExistingBackup'. + * + * @param backupMode the backupMode value to set + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { + this.backupMode = backupMode; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutput.java new file mode 100644 index 0000000000000..ec186cb367a6e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Output for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrateSqlServerSqlMITaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlMITaskOutputError.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = MigrateSqlServerSqlMITaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = MigrateSqlServerSqlMITaskOutputAgentJobLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlMITaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlMITaskOutputMigrationLevel.class) +}) +public class MigrateSqlServerSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java new file mode 100644 index 0000000000000..b09d023ab8711 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputAgentJobLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +public class MigrateSqlServerSqlMITaskOutputAgentJobLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Agent Job name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The state of the original Agent Job. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Migration errors and warnings per job. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get agent Job name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the state of the original Agent Job. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get migration errors and warnings per job. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..273f32120022c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputDatabaseLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +public class MigrateSqlServerSqlMITaskOutputDatabaseLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Size of the database in megabytes. + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Current stage of migration. Possible values include: 'None', + * 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get size of the database in megabytes. + * + * @return the sizeMB value + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get current stage of migration. Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed'. + * + * @return the stage value + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputError.java new file mode 100644 index 0000000000000..7a85cf2b6fdf4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputError.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputError model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +public class MigrateSqlServerSqlMITaskOutputError extends MigrateSqlServerSqlMITaskOutput { + /** + * Migration error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get migration error. + * + * @return the error value + */ + public ReportableException error() { + return this.error; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java new file mode 100644 index 0000000000000..75d9bfff1e8c3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputLoginLevel.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputLoginLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +public class MigrateSqlServerSqlMITaskOutputLoginLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Login name. + */ + @JsonProperty(value = "loginName", access = JsonProperty.Access.WRITE_ONLY) + private String loginName; + + /** + * Current state of login. Possible values include: 'None', 'InProgress', + * 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Current stage of login. Possible values include: 'None', 'Initialize', + * 'LoginMigration', 'EstablishUserMapping', 'AssignRoleMembership', + * 'AssignRoleOwnership', 'EstablishServerPermissions', + * 'EstablishObjectPermissions', 'Completed'. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private LoginMigrationStage stage; + + /** + * Login migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Login migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Login migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Login migration errors and warnings per login. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get login name. + * + * @return the loginName value + */ + public String loginName() { + return this.loginName; + } + + /** + * Get current state of login. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get current stage of login. Possible values include: 'None', 'Initialize', 'LoginMigration', 'EstablishUserMapping', 'AssignRoleMembership', 'AssignRoleOwnership', 'EstablishServerPermissions', 'EstablishObjectPermissions', 'Completed'. + * + * @return the stage value + */ + public LoginMigrationStage stage() { + return this.stage; + } + + /** + * Get login migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get login migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get login migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get login migration errors and warnings per login. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..8e49c5d0794c1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskOutputMigrationLevel.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The MigrateSqlServerSqlMITaskOutputMigrationLevel model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +public class MigrateSqlServerSqlMITaskOutputMigrationLevel extends MigrateSqlServerSqlMITaskOutput { + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current status of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Selected agent jobs as a map from name to id. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Map agentJobs; + + /** + * Selected logins as a map from name to id. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private Map logins; + + /** + * Migration progress message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Map of server role migration results. + */ + @JsonProperty(value = "serverRoleResults", access = JsonProperty.Access.WRITE_ONLY) + private Map serverRoleResults; + + /** + * Map of users to database name of orphaned users. + */ + @JsonProperty(value = "orphanedUsers", access = JsonProperty.Access.WRITE_ONLY) + private Map orphanedUsers; + + /** + * Selected databases as a map from database name to database id. + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private Map databases; + + /** + * Source server version. + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /** + * Source server brand version. + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /** + * Target server version. + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /** + * Target server brand version. + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current status of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get selected agent jobs as a map from name to id. + * + * @return the agentJobs value + */ + public Map agentJobs() { + return this.agentJobs; + } + + /** + * Get selected logins as a map from name to id. + * + * @return the logins value + */ + public Map logins() { + return this.logins; + } + + /** + * Get migration progress message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get map of server role migration results. + * + * @return the serverRoleResults value + */ + public Map serverRoleResults() { + return this.serverRoleResults; + } + + /** + * Get map of users to database name of orphaned users. + * + * @return the orphanedUsers value + */ + public Map orphanedUsers() { + return this.orphanedUsers; + } + + /** + * Get selected databases as a map from database name to database id. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Get source server version. + * + * @return the sourceServerVersion value + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get source server brand version. + * + * @return the sourceServerBrandVersion value + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get target server version. + * + * @return the targetServerVersion value + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get target server brand version. + * + * @return the targetServerBrandVersion value + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskProperties.java new file mode 100644 index 0000000000000..addd1acd84a4d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDbMI") +public class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public MigrateSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withInput(MigrateSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlServerDatabaseInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlServerDatabaseInput.java new file mode 100644 index 0000000000000..58a7cb2cbbcb2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSqlServerSqlServerDatabaseInput.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database specific information for SQL to SQL migration task inputs. + */ +public class MigrateSqlServerSqlServerDatabaseInput { + /** + * Name of the database. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Name of the database at destination. + */ + @JsonProperty(value = "restoreDatabaseName") + private String restoreDatabaseName; + + /** + * The backup and restore folder. + */ + @JsonProperty(value = "backupAndRestoreFolder") + private String backupAndRestoreFolder; + + /** + * The list of database files. + */ + @JsonProperty(value = "databaseFiles") + private List databaseFiles; + + /** + * Get name of the database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the database. + * + * @param name the name value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the database at destination. + * + * @return the restoreDatabaseName value + */ + public String restoreDatabaseName() { + return this.restoreDatabaseName; + } + + /** + * Set name of the database at destination. + * + * @param restoreDatabaseName the restoreDatabaseName value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withRestoreDatabaseName(String restoreDatabaseName) { + this.restoreDatabaseName = restoreDatabaseName; + return this; + } + + /** + * Get the backup and restore folder. + * + * @return the backupAndRestoreFolder value + */ + public String backupAndRestoreFolder() { + return this.backupAndRestoreFolder; + } + + /** + * Set the backup and restore folder. + * + * @param backupAndRestoreFolder the backupAndRestoreFolder value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withBackupAndRestoreFolder(String backupAndRestoreFolder) { + this.backupAndRestoreFolder = backupAndRestoreFolder; + return this; + } + + /** + * Get the list of database files. + * + * @return the databaseFiles value + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Set the list of database files. + * + * @param databaseFiles the databaseFiles value to set + * @return the MigrateSqlServerSqlServerDatabaseInput object itself. + */ + public MigrateSqlServerSqlServerDatabaseInput withDatabaseFiles(List databaseFiles) { + this.databaseFiles = databaseFiles; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandInput.java new file mode 100644 index 0000000000000..1ff852af2b410 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for command that completes sync migration for a database. + */ +public class MigrateSyncCompleteCommandInput { + /** + * Name of database. + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /** + * Time stamp to complete. + */ + @JsonProperty(value = "commitTimeStamp") + private DateTime commitTimeStamp; + + /** + * Get name of database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set name of database. + * + * @param databaseName the databaseName value to set + * @return the MigrateSyncCompleteCommandInput object itself. + */ + public MigrateSyncCompleteCommandInput withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get time stamp to complete. + * + * @return the commitTimeStamp value + */ + public DateTime commitTimeStamp() { + return this.commitTimeStamp; + } + + /** + * Set time stamp to complete. + * + * @param commitTimeStamp the commitTimeStamp value to set + * @return the MigrateSyncCompleteCommandInput object itself. + */ + public MigrateSyncCompleteCommandInput withCommitTimeStamp(DateTime commitTimeStamp) { + this.commitTimeStamp = commitTimeStamp; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandOutput.java new file mode 100644 index 0000000000000..4283beaf2738b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandOutput.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for command that completes sync migration for a database. + */ +public class MigrateSyncCompleteCommandOutput { + /** + * List of errors that happened during the command execution. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Get list of errors that happened during the command execution. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set list of errors that happened during the command execution. + * + * @param errors the errors value to set + * @return the MigrateSyncCompleteCommandOutput object itself. + */ + public MigrateSyncCompleteCommandOutput withErrors(List errors) { + this.errors = errors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandProperties.java new file mode 100644 index 0000000000000..6624b4eed81be --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrateSyncCompleteCommandProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; + +/** + * Properties for the command that completes sync migration for a database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("Migrate.Sync.Complete.Database") +public class MigrateSyncCompleteCommandProperties extends CommandPropertiesInner { + /** + * Command input. + */ + @JsonProperty(value = "input") + private MigrateSyncCompleteCommandInput input; + + /** + * Command output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private MigrateSyncCompleteCommandOutput output; + + /** + * Get command input. + * + * @return the input value + */ + public MigrateSyncCompleteCommandInput input() { + return this.input; + } + + /** + * Set command input. + * + * @param input the input value to set + * @return the MigrateSyncCompleteCommandProperties object itself. + */ + public MigrateSyncCompleteCommandProperties withInput(MigrateSyncCompleteCommandInput input) { + this.input = input; + return this; + } + + /** + * Get command output. This is ignored if submitted. + * + * @return the output value + */ + public MigrateSyncCompleteCommandOutput output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationEligibilityInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationEligibilityInfo.java new file mode 100644 index 0000000000000..a46e312138efb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationEligibilityInfo.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about migration eligibility of a server object. + */ +public class MigrationEligibilityInfo { + /** + * Whether object is eligible for migration or not. + */ + @JsonProperty(value = "isEligibileForMigration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEligibileForMigration; + + /** + * Information about eligibility failure for the server object. + */ + @JsonProperty(value = "validationMessages", access = JsonProperty.Access.WRITE_ONLY) + private List validationMessages; + + /** + * Get whether object is eligible for migration or not. + * + * @return the isEligibileForMigration value + */ + public Boolean isEligibileForMigration() { + return this.isEligibileForMigration; + } + + /** + * Get information about eligibility failure for the server object. + * + * @return the validationMessages value + */ + public List validationMessages() { + return this.validationMessages; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationReportResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationReportResult.java new file mode 100644 index 0000000000000..96daed25b7b06 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationReportResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration validation report result, contains the url for downloading the + * generated report. + */ +public class MigrationReportResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The url of the report. + */ + @JsonProperty(value = "reportUrl") + private String reportUrl; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set migration validation result identifier. + * + * @param id the id value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the url of the report. + * + * @return the reportUrl value + */ + public String reportUrl() { + return this.reportUrl; + } + + /** + * Set the url of the report. + * + * @param reportUrl the reportUrl value to set + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withReportUrl(String reportUrl) { + this.reportUrl = reportUrl; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationState.java new file mode 100644 index 0000000000000..ac7078c9a961e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MigrationState. + */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value None for MigrationState. */ + public static final MigrationState NONE = fromString("None"); + + /** Static value InProgress for MigrationState. */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for MigrationState. */ + public static final MigrationState FAILED = fromString("Failed"); + + /** Static value Warning for MigrationState. */ + public static final MigrationState WARNING = fromString("Warning"); + + /** Static value Completed for MigrationState. */ + public static final MigrationState COMPLETED = fromString("Completed"); + + /** Static value Skipped for MigrationState. */ + public static final MigrationState SKIPPED = fromString("Skipped"); + + /** Static value Stopped for MigrationState. */ + public static final MigrationState STOPPED = fromString("Stopped"); + + /** + * Creates or finds a MigrationState from its string representation. + * @param name a name to look for + * @return the corresponding MigrationState + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * @return known MigrationState values + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationStatus.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationStatus.java new file mode 100644 index 0000000000000..01c3f4694cb8b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationStatus.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MigrationStatus. + */ +public final class MigrationStatus extends ExpandableStringEnum { + /** Static value Default for MigrationStatus. */ + public static final MigrationStatus DEFAULT = fromString("Default"); + + /** Static value Connecting for MigrationStatus. */ + public static final MigrationStatus CONNECTING = fromString("Connecting"); + + /** Static value SourceAndTargetSelected for MigrationStatus. */ + public static final MigrationStatus SOURCE_AND_TARGET_SELECTED = fromString("SourceAndTargetSelected"); + + /** Static value SelectLogins for MigrationStatus. */ + public static final MigrationStatus SELECT_LOGINS = fromString("SelectLogins"); + + /** Static value Configured for MigrationStatus. */ + public static final MigrationStatus CONFIGURED = fromString("Configured"); + + /** Static value Running for MigrationStatus. */ + public static final MigrationStatus RUNNING = fromString("Running"); + + /** Static value Error for MigrationStatus. */ + public static final MigrationStatus ERROR = fromString("Error"); + + /** Static value Stopped for MigrationStatus. */ + public static final MigrationStatus STOPPED = fromString("Stopped"); + + /** Static value Completed for MigrationStatus. */ + public static final MigrationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for MigrationStatus. */ + public static final MigrationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * Creates or finds a MigrationStatus from its string representation. + * @param name a name to look for + * @return the corresponding MigrationStatus + */ + @JsonCreator + public static MigrationStatus fromString(String name) { + return fromString(name, MigrationStatus.class); + } + + /** + * @return known MigrationStatus values + */ + public static Collection values() { + return values(MigrationStatus.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationTableMetadata.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationTableMetadata.java new file mode 100644 index 0000000000000..e4ffb0f7f5dbd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationTableMetadata.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for tables selected in migration project. + */ +public class MigrationTableMetadata { + /** + * Source table name. + */ + @JsonProperty(value = "sourceTableName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceTableName; + + /** + * Target table name. + */ + @JsonProperty(value = "targetTableName", access = JsonProperty.Access.WRITE_ONLY) + private String targetTableName; + + /** + * Get source table name. + * + * @return the sourceTableName value + */ + public String sourceTableName() { + return this.sourceTableName; + } + + /** + * Get target table name. + * + * @return the targetTableName value + */ + public String targetTableName() { + return this.targetTableName; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseLevelResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseLevelResult.java new file mode 100644 index 0000000000000..f82449b9bd467 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database level validation results. + */ +public class MigrationValidationDatabaseLevelResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Provides data integrity validation result between the source and target + * tables that are migrated. + */ + @JsonProperty(value = "dataIntegrityValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private DataIntegrityValidationResult dataIntegrityValidationResult; + + /** + * Provides schema comparison result between source and target database. + */ + @JsonProperty(value = "schemaValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private SchemaComparisonValidationResult schemaValidationResult; + + /** + * Results of some of the query execution result between source and target + * database. + */ + @JsonProperty(value = "queryAnalysisValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private QueryAnalysisValidationResult queryAnalysisValidationResult; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get provides data integrity validation result between the source and target tables that are migrated. + * + * @return the dataIntegrityValidationResult value + */ + public DataIntegrityValidationResult dataIntegrityValidationResult() { + return this.dataIntegrityValidationResult; + } + + /** + * Get provides schema comparison result between source and target database. + * + * @return the schemaValidationResult value + */ + public SchemaComparisonValidationResult schemaValidationResult() { + return this.schemaValidationResult; + } + + /** + * Get results of some of the query execution result between source and target database. + * + * @return the queryAnalysisValidationResult value + */ + public QueryAnalysisValidationResult queryAnalysisValidationResult() { + return this.queryAnalysisValidationResult; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseSummaryResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseSummaryResult.java new file mode 100644 index 0000000000000..44d9f0848d731 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationDatabaseSummaryResult.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Database level summary result. + */ +public class MigrationValidationDatabaseSummaryResult { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /** + * Name of the target database. + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /** + * Validation start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Validation end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current status of validation at the database level. Possible values + * include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get name of the source database. + * + * @return the sourceDatabaseName value + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get name of the target database. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get validation start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get validation end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current status of validation at the database level. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationOptions.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationOptions.java new file mode 100644 index 0000000000000..2e16e938e217c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationOptions.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Types of validations to run after the migration. + */ +public class MigrationValidationOptions { + /** + * Allows to compare the schema information between source and target. + */ + @JsonProperty(value = "enableSchemaValidation") + private Boolean enableSchemaValidation; + + /** + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + */ + @JsonProperty(value = "enableDataIntegrityValidation") + private Boolean enableDataIntegrityValidation; + + /** + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and + * target databases for the extracted queries. + */ + @JsonProperty(value = "enableQueryAnalysisValidation") + private Boolean enableQueryAnalysisValidation; + + /** + * Get allows to compare the schema information between source and target. + * + * @return the enableSchemaValidation value + */ + public Boolean enableSchemaValidation() { + return this.enableSchemaValidation; + } + + /** + * Set allows to compare the schema information between source and target. + * + * @param enableSchemaValidation the enableSchemaValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableSchemaValidation(Boolean enableSchemaValidation) { + this.enableSchemaValidation = enableSchemaValidation; + return this; + } + + /** + * Get allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @return the enableDataIntegrityValidation value + */ + public Boolean enableDataIntegrityValidation() { + return this.enableDataIntegrityValidation; + } + + /** + * Set allows to perform a checksum based data integrity validation between source and target for the selected database / tables . + * + * @param enableDataIntegrityValidation the enableDataIntegrityValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableDataIntegrityValidation(Boolean enableDataIntegrityValidation) { + this.enableDataIntegrityValidation = enableDataIntegrityValidation; + return this; + } + + /** + * Get allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @return the enableQueryAnalysisValidation value + */ + public Boolean enableQueryAnalysisValidation() { + return this.enableQueryAnalysisValidation; + } + + /** + * Set allows to perform a quick and intelligent query analysis by retrieving queries from the source database and executes them in the target. The result will have execution statistics for executions in source and target databases for the extracted queries. + * + * @param enableQueryAnalysisValidation the enableQueryAnalysisValidation value to set + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableQueryAnalysisValidation(Boolean enableQueryAnalysisValidation) { + this.enableQueryAnalysisValidation = enableQueryAnalysisValidation; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationResult.java new file mode 100644 index 0000000000000..e02a7b759ff75 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MigrationValidationResult.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Migration Validation Result. + */ +public class MigrationValidationResult { + /** + * Migration validation result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration Identifier. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /** + * Validation summary results for each database. + */ + @JsonProperty(value = "summaryResults") + private Map summaryResults; + + /** + * Current status of validation at the migration level. Status from the + * database validation result status will be aggregated here. Possible + * values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', + * 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get migration validation result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration Identifier. + * + * @return the migrationId value + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get validation summary results for each database. + * + * @return the summaryResults value + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set validation summary results for each database. + * + * @param summaryResults the summaryResults value to set + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult withSummaryResults(Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get current status of validation at the migration level. Status from the database validation result status will be aggregated here. Possible values include: 'Default', 'NotStarted', 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCancelCommand.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCancelCommand.java new file mode 100644 index 0000000000000..f292cfd366167 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCancelCommand.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; + +/** + * Properties for the command that cancels a migration in whole or in part. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("cancel") +public class MongoDbCancelCommand extends CommandPropertiesInner { + /** + * Command input. + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get command input. + * + * @return the input value + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set command input. + * + * @param input the input value to set + * @return the MongoDbCancelCommand object itself. + */ + public MongoDbCancelCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterInfo.java new file mode 100644 index 0000000000000..42eac48a99768 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterInfo.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a MongoDB data source. + */ +public class MongoDbClusterInfo { + /** + * A list of non-system databases in the cluster. + */ + @JsonProperty(value = "databases", required = true) + private List databases; + + /** + * Whether the cluster supports sharded collections. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /** + * The type of data source. Possible values include: 'BlobContainer', + * 'CosmosDb', 'MongoDb'. + */ + @JsonProperty(value = "type", required = true) + private MongoDbClusterType type; + + /** + * The version of the data source in the form x.y.z (e.g. 3.6.7). Not used + * if Type is BlobContainer. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /** + * Get a list of non-system databases in the cluster. + * + * @return the databases value + */ + public List databases() { + return this.databases; + } + + /** + * Set a list of non-system databases in the cluster. + * + * @param databases the databases value to set + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withDatabases(List databases) { + this.databases = databases; + return this; + } + + /** + * Get whether the cluster supports sharded collections. + * + * @return the supportsSharding value + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set whether the cluster supports sharded collections. + * + * @param supportsSharding the supportsSharding value to set + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the type of data source. Possible values include: 'BlobContainer', 'CosmosDb', 'MongoDb'. + * + * @return the type value + */ + public MongoDbClusterType type() { + return this.type; + } + + /** + * Set the type of data source. Possible values include: 'BlobContainer', 'CosmosDb', 'MongoDb'. + * + * @param type the type value to set + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withType(MongoDbClusterType type) { + this.type = type; + return this; + } + + /** + * Get the version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is BlobContainer. + * + * @param version the version value to set + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterType.java new file mode 100644 index 0000000000000..f39e64e3b1520 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbClusterType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MongoDbClusterType. + */ +public final class MongoDbClusterType extends ExpandableStringEnum { + /** Static value BlobContainer for MongoDbClusterType. */ + public static final MongoDbClusterType BLOB_CONTAINER = fromString("BlobContainer"); + + /** Static value CosmosDb for MongoDbClusterType. */ + public static final MongoDbClusterType COSMOS_DB = fromString("CosmosDb"); + + /** Static value MongoDb for MongoDbClusterType. */ + public static final MongoDbClusterType MONGO_DB = fromString("MongoDb"); + + /** + * Creates or finds a MongoDbClusterType from its string representation. + * @param name a name to look for + * @return the corresponding MongoDbClusterType + */ + @JsonCreator + public static MongoDbClusterType fromString(String name) { + return fromString(name, MongoDbClusterType.class); + } + + /** + * @return known MongoDbClusterType values + */ + public static Collection values() { + return values(MongoDbClusterType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionInfo.java new file mode 100644 index 0000000000000..b68fb4879c135 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionInfo.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a supported collection within a MongoDB database. + */ +public class MongoDbCollectionInfo extends MongoDbObjectInfo { + /** + * The name of the database containing the collection. + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /** + * Whether the collection is a capped collection (i.e. whether it has a + * fixed size and acts like a circular buffer). + */ + @JsonProperty(value = "isCapped", required = true) + private boolean isCapped; + + /** + * Whether the collection is system collection. + */ + @JsonProperty(value = "isSystemCollection", required = true) + private boolean isSystemCollection; + + /** + * Whether the collection is a view of another collection. + */ + @JsonProperty(value = "isView", required = true) + private boolean isView; + + /** + * The shard key on the collection, or null if the collection is not + * sharded. + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeyInfo shardKey; + + /** + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /** + * The name of the collection that this is a view of, if IsView is true. + */ + @JsonProperty(value = "viewOf") + private String viewOf; + + /** + * Get the name of the database containing the collection. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the name of the database containing the collection. + * + * @param databaseName the databaseName value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer). + * + * @return the isCapped value + */ + public boolean isCapped() { + return this.isCapped; + } + + /** + * Set whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer). + * + * @param isCapped the isCapped value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsCapped(boolean isCapped) { + this.isCapped = isCapped; + return this; + } + + /** + * Get whether the collection is system collection. + * + * @return the isSystemCollection value + */ + public boolean isSystemCollection() { + return this.isSystemCollection; + } + + /** + * Set whether the collection is system collection. + * + * @param isSystemCollection the isSystemCollection value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsSystemCollection(boolean isSystemCollection) { + this.isSystemCollection = isSystemCollection; + return this; + } + + /** + * Get whether the collection is a view of another collection. + * + * @return the isView value + */ + public boolean isView() { + return this.isView; + } + + /** + * Set whether the collection is a view of another collection. + * + * @param isView the isView value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsView(boolean isView) { + this.isView = isView; + return this; + } + + /** + * Get the shard key on the collection, or null if the collection is not sharded. + * + * @return the shardKey value + */ + public MongoDbShardKeyInfo shardKey() { + return this.shardKey; + } + + /** + * Set the shard key on the collection, or null if the collection is not sharded. + * + * @param shardKey the shardKey value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withShardKey(MongoDbShardKeyInfo shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + * + * @return the supportsSharding value + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the name of the collection that this is a view of, if IsView is true. + * + * @return the viewOf value + */ + public String viewOf() { + return this.viewOf; + } + + /** + * Set the name of the collection that this is a view of, if IsView is true. + * + * @param viewOf the viewOf value to set + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withViewOf(String viewOf) { + this.viewOf = viewOf; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionProgress.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionProgress.java new file mode 100644 index 0000000000000..14320a13d7cd5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionProgress.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + + +/** + * Describes the progress of a collection. + */ +public class MongoDbCollectionProgress extends MongoDbProgress { +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionSettings.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionSettings.java new file mode 100644 index 0000000000000..6ae012e791d1b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCollectionSettings.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how an individual MongoDB collection should be migrated. + */ +public class MongoDbCollectionSettings { + /** + * Whether the migrator is allowed to drop the target collection in the + * course of performing a migration. The default is true. + */ + @JsonProperty(value = "canDelete") + private Boolean canDelete; + + /** + * The shardKey property. + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeySetting shardKey; + + /** + * The RUs that should be configured on a CosmosDB target, or null to use + * the default. This has no effect on non-CosmosDB targets. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is true. + * + * @return the canDelete value + */ + public Boolean canDelete() { + return this.canDelete; + } + + /** + * Set whether the migrator is allowed to drop the target collection in the course of performing a migration. The default is true. + * + * @param canDelete the canDelete value to set + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withCanDelete(Boolean canDelete) { + this.canDelete = canDelete; + return this; + } + + /** + * Get the shardKey value. + * + * @return the shardKey value + */ + public MongoDbShardKeySetting shardKey() { + return this.shardKey; + } + + /** + * Set the shardKey value. + * + * @param shardKey the shardKey value to set + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withShardKey(MongoDbShardKeySetting shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get the RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB targets. + * + * @return the targetRUs value + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the RUs that should be configured on a CosmosDB target, or null to use the default. This has no effect on non-CosmosDB targets. + * + * @param targetRUs the targetRUs value to set + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCommandInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCommandInput.java new file mode 100644 index 0000000000000..17fce63ee2c41 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbCommandInput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the input to the 'cancel' and 'restart' MongoDB migration + * commands. + */ +public class MongoDbCommandInput { + /** + * The qualified name of a database or collection to act upon, or null to + * act upon the entire migration. + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Get the qualified name of a database or collection to act upon, or null to act upon the entire migration. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Set the qualified name of a database or collection to act upon, or null to act upon the entire migration. + * + * @param objectName the objectName value to set + * @return the MongoDbCommandInput object itself. + */ + public MongoDbCommandInput withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbConnectionInfo.java new file mode 100644 index 0000000000000..ce158e77c957a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbConnectionInfo.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a connection to a MongoDB data source. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MongoDbConnectionInfo") +public class MongoDbConnectionInfo extends ConnectionInfo { + /** + * A MongoDB connection string or blob container URL. The user name and + * password can be specified here or in the userName and password + * properties. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * Get a MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set a MongoDB connection string or blob container URL. The user name and password can be specified here or in the userName and password properties. + * + * @param connectionString the connectionString value to set + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseInfo.java new file mode 100644 index 0000000000000..dbcbeb4ad7278 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a database within a MongoDB data source. + */ +public class MongoDbDatabaseInfo extends MongoDbObjectInfo { + /** + * A list of supported collections in a MongoDB database. + */ + @JsonProperty(value = "collections", required = true) + private List collections; + + /** + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /** + * Get a list of supported collections in a MongoDB database. + * + * @return the collections value + */ + public List collections() { + return this.collections; + } + + /** + * Set a list of supported collections in a MongoDB database. + * + * @param collections the collections value to set + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withCollections(List collections) { + this.collections = collections; + return this; + } + + /** + * Get whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + * + * @return the supportsSharding value + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set whether the database has sharding enabled. Note that the migration task will enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseProgress.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseProgress.java new file mode 100644 index 0000000000000..c5f286cf38ef6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseProgress.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the progress of a database. + */ +public class MongoDbDatabaseProgress extends MongoDbProgress { + /** + * The progress of the collections in the database. The keys are the + * unqualified names of the collections. + */ + @JsonProperty(value = "collections") + private Map collections; + + /** + * Get the progress of the collections in the database. The keys are the unqualified names of the collections. + * + * @return the collections value + */ + public Map collections() { + return this.collections; + } + + /** + * Set the progress of the collections in the database. The keys are the unqualified names of the collections. + * + * @param collections the collections value to set + * @return the MongoDbDatabaseProgress object itself. + */ + public MongoDbDatabaseProgress withCollections(Map collections) { + this.collections = collections; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseSettings.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseSettings.java new file mode 100644 index 0000000000000..0e7f7c8cd7399 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbDatabaseSettings.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how an individual MongoDB database should be migrated. + */ +public class MongoDbDatabaseSettings { + /** + * The collections on the source database to migrate to the target. The + * keys are the unqualified names of the collections. + */ + @JsonProperty(value = "collections", required = true) + private Map collections; + + /** + * The RUs that should be configured on a CosmosDB target, or null to use + * the default, or 0 if throughput should not be provisioned for the + * database. This has no effect on non-CosmosDB targets. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get the collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + * + * @return the collections value + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections on the source database to migrate to the target. The keys are the unqualified names of the collections. + * + * @param collections the collections value to set + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** + * Get the RUs that should be configured on a CosmosDB target, or null to use the default, or 0 if throughput should not be provisioned for the database. This has no effect on non-CosmosDB targets. + * + * @return the targetRUs value + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the RUs that should be configured on a CosmosDB target, or null to use the default, or 0 if throughput should not be provisioned for the database. This has no effect on non-CosmosDB targets. + * + * @param targetRUs the targetRUs value to set + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbError.java new file mode 100644 index 0000000000000..0f469781023a1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbError.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an error or warning that occurred during a MongoDB migration. + */ +public class MongoDbError { + /** + * The non-localized, machine-readable code that describes the error or + * warning. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The number of times the error or warning has occurred. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The localized, human-readable message that describes the error or + * warning. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The type of error or warning. Possible values include: 'Error', + * 'ValidationError', 'Warning'. + */ + @JsonProperty(value = "type") + private MongoDbErrorType type; + + /** + * Get the non-localized, machine-readable code that describes the error or warning. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the non-localized, machine-readable code that describes the error or warning. + * + * @param code the code value to set + * @return the MongoDbError object itself. + */ + public MongoDbError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the number of times the error or warning has occurred. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the number of times the error or warning has occurred. + * + * @param count the count value to set + * @return the MongoDbError object itself. + */ + public MongoDbError withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the localized, human-readable message that describes the error or warning. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the localized, human-readable message that describes the error or warning. + * + * @param message the message value to set + * @return the MongoDbError object itself. + */ + public MongoDbError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type of error or warning. Possible values include: 'Error', 'ValidationError', 'Warning'. + * + * @return the type value + */ + public MongoDbErrorType type() { + return this.type; + } + + /** + * Set the type of error or warning. Possible values include: 'Error', 'ValidationError', 'Warning'. + * + * @param type the type value to set + * @return the MongoDbError object itself. + */ + public MongoDbError withType(MongoDbErrorType type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbErrorType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbErrorType.java new file mode 100644 index 0000000000000..5d9fb53dccefd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbErrorType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MongoDbErrorType. + */ +public final class MongoDbErrorType extends ExpandableStringEnum { + /** Static value Error for MongoDbErrorType. */ + public static final MongoDbErrorType ERROR = fromString("Error"); + + /** Static value ValidationError for MongoDbErrorType. */ + public static final MongoDbErrorType VALIDATION_ERROR = fromString("ValidationError"); + + /** Static value Warning for MongoDbErrorType. */ + public static final MongoDbErrorType WARNING = fromString("Warning"); + + /** + * Creates or finds a MongoDbErrorType from its string representation. + * @param name a name to look for + * @return the corresponding MongoDbErrorType + */ + @JsonCreator + public static MongoDbErrorType fromString(String name) { + return fromString(name, MongoDbErrorType.class); + } + + /** + * @return known MongoDbErrorType values + */ + public static Collection values() { + return values(MongoDbErrorType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommand.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommand.java new file mode 100644 index 0000000000000..da5c4f742f586 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommand.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; + +/** + * Properties for the command that finishes a migration in whole or in part. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("finish") +public class MongoDbFinishCommand extends CommandPropertiesInner { + /** + * Command input. + */ + @JsonProperty(value = "input") + private MongoDbFinishCommandInput input; + + /** + * Get command input. + * + * @return the input value + */ + public MongoDbFinishCommandInput input() { + return this.input; + } + + /** + * Set command input. + * + * @param input the input value to set + * @return the MongoDbFinishCommand object itself. + */ + public MongoDbFinishCommand withInput(MongoDbFinishCommandInput input) { + this.input = input; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommandInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommandInput.java new file mode 100644 index 0000000000000..e5c97c43946ba --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbFinishCommandInput.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the input to the 'finish' MongoDB migration command. + */ +public class MongoDbFinishCommandInput extends MongoDbCommandInput { + /** + * If true, replication for the affected objects will be stopped + * immediately. If false, the migrator will finish replaying queued events + * before finishing the replication. + */ + @JsonProperty(value = "immediate", required = true) + private boolean immediate; + + /** + * Get if true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying queued events before finishing the replication. + * + * @return the immediate value + */ + public boolean immediate() { + return this.immediate; + } + + /** + * Set if true, replication for the affected objects will be stopped immediately. If false, the migrator will finish replaying queued events before finishing the replication. + * + * @param immediate the immediate value to set + * @return the MongoDbFinishCommandInput object itself. + */ + public MongoDbFinishCommandInput withImmediate(boolean immediate) { + this.immediate = immediate; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationProgress.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationProgress.java new file mode 100644 index 0000000000000..04b4da907c655 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationProgress.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the progress of the overall migration. + */ +public class MongoDbMigrationProgress extends MongoDbProgress { + /** + * The progress of the databases in the migration. The keys are the names + * of the databases. + */ + @JsonProperty(value = "databases") + private Map databases; + + /** + * Get the progress of the databases in the migration. The keys are the names of the databases. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Set the progress of the databases in the migration. The keys are the names of the databases. + * + * @param databases the databases value to set + * @return the MongoDbMigrationProgress object itself. + */ + public MongoDbMigrationProgress withDatabases(Map databases) { + this.databases = databases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationSettings.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationSettings.java new file mode 100644 index 0000000000000..eff1a69607310 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationSettings.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how a MongoDB data migration should be performed. + */ +public class MongoDbMigrationSettings { + /** + * The RU limit on a CosmosDB target that collections will be temporarily + * increased to (if lower) during the initial copy of a migration, from + * 10,000 to 1,000,000, or 0 to use the default boost (which is generally + * the maximum), or null to not boost the RUs. This setting has no effect + * on non-CosmosDB targets. + */ + @JsonProperty(value = "boostRUs") + private Integer boostRUs; + + /** + * The databases on the source cluster to migrate to the target. The keys + * are the names of the databases. + */ + @JsonProperty(value = "databases", required = true) + private Map databases; + + /** + * Describes how changes will be replicated from the source to the target. + * The default is OneTime. Possible values include: 'Disabled', 'OneTime', + * 'Continuous'. + */ + @JsonProperty(value = "replication") + private MongoDbReplication replication; + + /** + * Settings used to connect to the source cluster. + */ + @JsonProperty(value = "source", required = true) + private MongoDbConnectionInfo source; + + /** + * Settings used to connect to the target cluster. + */ + @JsonProperty(value = "target", required = true) + private MongoDbConnectionInfo target; + + /** + * Settings used to limit the resource usage of the migration. + */ + @JsonProperty(value = "throttling") + private MongoDbThrottlingSettings throttling; + + /** + * Get the RU limit on a CosmosDB target that collections will be temporarily increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost (which is generally the maximum), or null to not boost the RUs. This setting has no effect on non-CosmosDB targets. + * + * @return the boostRUs value + */ + public Integer boostRUs() { + return this.boostRUs; + } + + /** + * Set the RU limit on a CosmosDB target that collections will be temporarily increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost (which is generally the maximum), or null to not boost the RUs. This setting has no effect on non-CosmosDB targets. + * + * @param boostRUs the boostRUs value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withBoostRUs(Integer boostRUs) { + this.boostRUs = boostRUs; + return this; + } + + /** + * Get the databases on the source cluster to migrate to the target. The keys are the names of the databases. + * + * @return the databases value + */ + public Map databases() { + return this.databases; + } + + /** + * Set the databases on the source cluster to migrate to the target. The keys are the names of the databases. + * + * @param databases the databases value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withDatabases(Map databases) { + this.databases = databases; + return this; + } + + /** + * Get describes how changes will be replicated from the source to the target. The default is OneTime. Possible values include: 'Disabled', 'OneTime', 'Continuous'. + * + * @return the replication value + */ + public MongoDbReplication replication() { + return this.replication; + } + + /** + * Set describes how changes will be replicated from the source to the target. The default is OneTime. Possible values include: 'Disabled', 'OneTime', 'Continuous'. + * + * @param replication the replication value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withReplication(MongoDbReplication replication) { + this.replication = replication; + return this; + } + + /** + * Get settings used to connect to the source cluster. + * + * @return the source value + */ + public MongoDbConnectionInfo source() { + return this.source; + } + + /** + * Set settings used to connect to the source cluster. + * + * @param source the source value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withSource(MongoDbConnectionInfo source) { + this.source = source; + return this; + } + + /** + * Get settings used to connect to the target cluster. + * + * @return the target value + */ + public MongoDbConnectionInfo target() { + return this.target; + } + + /** + * Set settings used to connect to the target cluster. + * + * @param target the target value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withTarget(MongoDbConnectionInfo target) { + this.target = target; + return this; + } + + /** + * Get settings used to limit the resource usage of the migration. + * + * @return the throttling value + */ + public MongoDbThrottlingSettings throttling() { + return this.throttling; + } + + /** + * Set settings used to limit the resource usage of the migration. + * + * @param throttling the throttling value to set + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withThrottling(MongoDbThrottlingSettings throttling) { + this.throttling = throttling; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationState.java new file mode 100644 index 0000000000000..ed3708f961be3 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbMigrationState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MongoDbMigrationState. + */ +public final class MongoDbMigrationState extends ExpandableStringEnum { + /** Static value NotStarted for MongoDbMigrationState. */ + public static final MongoDbMigrationState NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInput for MongoDbMigrationState. */ + public static final MongoDbMigrationState VALIDATING_INPUT = fromString("ValidatingInput"); + + /** Static value Initializing for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIALIZING = fromString("Initializing"); + + /** Static value Restarting for MongoDbMigrationState. */ + public static final MongoDbMigrationState RESTARTING = fromString("Restarting"); + + /** Static value Copying for MongoDbMigrationState. */ + public static final MongoDbMigrationState COPYING = fromString("Copying"); + + /** Static value InitialReplay for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIAL_REPLAY = fromString("InitialReplay"); + + /** Static value Replaying for MongoDbMigrationState. */ + public static final MongoDbMigrationState REPLAYING = fromString("Replaying"); + + /** Static value Finalizing for MongoDbMigrationState. */ + public static final MongoDbMigrationState FINALIZING = fromString("Finalizing"); + + /** Static value Complete for MongoDbMigrationState. */ + public static final MongoDbMigrationState COMPLETE = fromString("Complete"); + + /** Static value Canceled for MongoDbMigrationState. */ + public static final MongoDbMigrationState CANCELED = fromString("Canceled"); + + /** Static value Failed for MongoDbMigrationState. */ + public static final MongoDbMigrationState FAILED = fromString("Failed"); + + /** + * Creates or finds a MongoDbMigrationState from its string representation. + * @param name a name to look for + * @return the corresponding MongoDbMigrationState + */ + @JsonCreator + public static MongoDbMigrationState fromString(String name) { + return fromString(name, MongoDbMigrationState.class); + } + + /** + * @return known MongoDbMigrationState values + */ + public static Collection values() { + return values(MongoDbMigrationState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbObjectInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbObjectInfo.java new file mode 100644 index 0000000000000..b3c168a6b7b1e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbObjectInfo.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a database or collection within a MongoDB data source. + */ +public class MongoDbObjectInfo { + /** + * The average document size, or -1 if the average size is unknown. + */ + @JsonProperty(value = "averageDocumentSize", required = true) + private long averageDocumentSize; + + /** + * The estimated total data size, in bytes, or -1 if the size is unknown. + */ + @JsonProperty(value = "dataSize", required = true) + private long dataSize; + + /** + * The estimated total number of documents, or -1 if the document count is + * unknown. + */ + @JsonProperty(value = "documentCount", required = true) + private long documentCount; + + /** + * The unqualified name of the database or collection. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The qualified name of the database or collection. For a collection, this + * is the database-qualified name. + */ + @JsonProperty(value = "qualifiedName", required = true) + private String qualifiedName; + + /** + * Get the average document size, or -1 if the average size is unknown. + * + * @return the averageDocumentSize value + */ + public long averageDocumentSize() { + return this.averageDocumentSize; + } + + /** + * Set the average document size, or -1 if the average size is unknown. + * + * @param averageDocumentSize the averageDocumentSize value to set + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withAverageDocumentSize(long averageDocumentSize) { + this.averageDocumentSize = averageDocumentSize; + return this; + } + + /** + * Get the estimated total data size, in bytes, or -1 if the size is unknown. + * + * @return the dataSize value + */ + public long dataSize() { + return this.dataSize; + } + + /** + * Set the estimated total data size, in bytes, or -1 if the size is unknown. + * + * @param dataSize the dataSize value to set + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDataSize(long dataSize) { + this.dataSize = dataSize; + return this; + } + + /** + * Get the estimated total number of documents, or -1 if the document count is unknown. + * + * @return the documentCount value + */ + public long documentCount() { + return this.documentCount; + } + + /** + * Set the estimated total number of documents, or -1 if the document count is unknown. + * + * @param documentCount the documentCount value to set + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDocumentCount(long documentCount) { + this.documentCount = documentCount; + return this; + } + + /** + * Get the unqualified name of the database or collection. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unqualified name of the database or collection. + * + * @param name the name value to set + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualified name of the database or collection. For a collection, this is the database-qualified name. + * + * @return the qualifiedName value + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualified name of the database or collection. For a collection, this is the database-qualified name. + * + * @param qualifiedName the qualifiedName value to set + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbProgress.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbProgress.java new file mode 100644 index 0000000000000..4b2ebcba3f924 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbProgress.java @@ -0,0 +1,396 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for MongoDB migration outputs. + */ +public class MongoDbProgress { + /** + * The number of document bytes copied during the Copying stage. + */ + @JsonProperty(value = "bytesCopied", required = true) + private long bytesCopied; + + /** + * The number of documents copied during the Copying stage. + */ + @JsonProperty(value = "documentsCopied", required = true) + private long documentsCopied; + + /** + * The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan + * format). + */ + @JsonProperty(value = "elapsedTime", required = true) + private String elapsedTime; + + /** + * The errors and warnings that have occurred for the current object. The + * keys are the error codes. + */ + @JsonProperty(value = "errors", required = true) + private Map errors; + + /** + * The number of oplog events awaiting replay. + */ + @JsonProperty(value = "eventsPending", required = true) + private long eventsPending; + + /** + * The number of oplog events replayed so far. + */ + @JsonProperty(value = "eventsReplayed", required = true) + private long eventsReplayed; + + /** + * The timestamp of the last oplog event received, or null if no oplog + * event has been received yet. + */ + @JsonProperty(value = "lastEventTime") + private DateTime lastEventTime; + + /** + * The timestamp of the last oplog event replayed, or null if no oplog + * event has been replayed yet. + */ + @JsonProperty(value = "lastReplayTime") + private DateTime lastReplayTime; + + /** + * The name of the progress object. For a collection, this is the + * unqualified collection name. For a database, this is the database name. + * For the overall migration, this is null. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The qualified name of the progress object. For a collection, this is the + * database-qualified name. For a database, this is the database name. For + * the overall migration, this is null. + */ + @JsonProperty(value = "qualifiedName") + private String qualifiedName; + + /** + * The type of progress object. Possible values include: 'Migration', + * 'Database', 'Collection'. + */ + @JsonProperty(value = "resultType", required = true) + private String resultType; + + /** + * Possible values include: 'NotStarted', 'ValidatingInput', + * 'Initializing', 'Restarting', 'Copying', 'InitialReplay', 'Replaying', + * 'Finalizing', 'Complete', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "state", required = true) + private MongoDbMigrationState state; + + /** + * The total number of document bytes on the source at the beginning of the + * Copying stage, or -1 if the total size was unknown. + */ + @JsonProperty(value = "totalBytes", required = true) + private long totalBytes; + + /** + * The total number of documents on the source at the beginning of the + * Copying stage, or -1 if the total count was unknown. + */ + @JsonProperty(value = "totalDocuments", required = true) + private long totalDocuments; + + /** + * Get the number of document bytes copied during the Copying stage. + * + * @return the bytesCopied value + */ + public long bytesCopied() { + return this.bytesCopied; + } + + /** + * Set the number of document bytes copied during the Copying stage. + * + * @param bytesCopied the bytesCopied value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withBytesCopied(long bytesCopied) { + this.bytesCopied = bytesCopied; + return this; + } + + /** + * Get the number of documents copied during the Copying stage. + * + * @return the documentsCopied value + */ + public long documentsCopied() { + return this.documentsCopied; + } + + /** + * Set the number of documents copied during the Copying stage. + * + * @param documentsCopied the documentsCopied value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withDocumentsCopied(long documentsCopied) { + this.documentsCopied = documentsCopied; + return this; + } + + /** + * Get the elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @return the elapsedTime value + */ + public String elapsedTime() { + return this.elapsedTime; + } + + /** + * Set the elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @param elapsedTime the elapsedTime value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withElapsedTime(String elapsedTime) { + this.elapsedTime = elapsedTime; + return this; + } + + /** + * Get the errors and warnings that have occurred for the current object. The keys are the error codes. + * + * @return the errors value + */ + public Map errors() { + return this.errors; + } + + /** + * Set the errors and warnings that have occurred for the current object. The keys are the error codes. + * + * @param errors the errors value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withErrors(Map errors) { + this.errors = errors; + return this; + } + + /** + * Get the number of oplog events awaiting replay. + * + * @return the eventsPending value + */ + public long eventsPending() { + return this.eventsPending; + } + + /** + * Set the number of oplog events awaiting replay. + * + * @param eventsPending the eventsPending value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsPending(long eventsPending) { + this.eventsPending = eventsPending; + return this; + } + + /** + * Get the number of oplog events replayed so far. + * + * @return the eventsReplayed value + */ + public long eventsReplayed() { + return this.eventsReplayed; + } + + /** + * Set the number of oplog events replayed so far. + * + * @param eventsReplayed the eventsReplayed value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsReplayed(long eventsReplayed) { + this.eventsReplayed = eventsReplayed; + return this; + } + + /** + * Get the timestamp of the last oplog event received, or null if no oplog event has been received yet. + * + * @return the lastEventTime value + */ + public DateTime lastEventTime() { + return this.lastEventTime; + } + + /** + * Set the timestamp of the last oplog event received, or null if no oplog event has been received yet. + * + * @param lastEventTime the lastEventTime value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastEventTime(DateTime lastEventTime) { + this.lastEventTime = lastEventTime; + return this; + } + + /** + * Get the timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. + * + * @return the lastReplayTime value + */ + public DateTime lastReplayTime() { + return this.lastReplayTime; + } + + /** + * Set the timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet. + * + * @param lastReplayTime the lastReplayTime value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastReplayTime(DateTime lastReplayTime) { + this.lastReplayTime = lastReplayTime; + return this; + } + + /** + * Get the name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null. + * + * @param name the name value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. + * + * @return the qualifiedName value + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null. + * + * @param qualifiedName the qualifiedName value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + + /** + * Get the type of progress object. Possible values include: 'Migration', 'Database', 'Collection'. + * + * @return the resultType value + */ + public String resultType() { + return this.resultType; + } + + /** + * Set the type of progress object. Possible values include: 'Migration', 'Database', 'Collection'. + * + * @param resultType the resultType value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withResultType(String resultType) { + this.resultType = resultType; + return this; + } + + /** + * Get possible values include: 'NotStarted', 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', 'Failed'. + * + * @return the state value + */ + public MongoDbMigrationState state() { + return this.state; + } + + /** + * Set possible values include: 'NotStarted', 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', 'Failed'. + * + * @param state the state value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withState(MongoDbMigrationState state) { + this.state = state; + return this; + } + + /** + * Get the total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. + * + * @return the totalBytes value + */ + public long totalBytes() { + return this.totalBytes; + } + + /** + * Set the total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown. + * + * @param totalBytes the totalBytes value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalBytes(long totalBytes) { + this.totalBytes = totalBytes; + return this; + } + + /** + * Get the total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. + * + * @return the totalDocuments value + */ + public long totalDocuments() { + return this.totalDocuments; + } + + /** + * Set the total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown. + * + * @param totalDocuments the totalDocuments value to set + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalDocuments(long totalDocuments) { + this.totalDocuments = totalDocuments; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbReplication.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbReplication.java new file mode 100644 index 0000000000000..dbe888b069a2b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbReplication.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MongoDbReplication. + */ +public final class MongoDbReplication extends ExpandableStringEnum { + /** Static value Disabled for MongoDbReplication. */ + public static final MongoDbReplication DISABLED = fromString("Disabled"); + + /** Static value OneTime for MongoDbReplication. */ + public static final MongoDbReplication ONE_TIME = fromString("OneTime"); + + /** Static value Continuous for MongoDbReplication. */ + public static final MongoDbReplication CONTINUOUS = fromString("Continuous"); + + /** + * Creates or finds a MongoDbReplication from its string representation. + * @param name a name to look for + * @return the corresponding MongoDbReplication + */ + @JsonCreator + public static MongoDbReplication fromString(String name) { + return fromString(name, MongoDbReplication.class); + } + + /** + * @return known MongoDbReplication values + */ + public static Collection values() { + return values(MongoDbReplication.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbRestartCommand.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbRestartCommand.java new file mode 100644 index 0000000000000..397172aa03720 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbRestartCommand.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; + +/** + * Properties for the command that restarts a migration in whole or in part. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("restart") +public class MongoDbRestartCommand extends CommandPropertiesInner { + /** + * Command input. + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get command input. + * + * @return the input value + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set command input. + * + * @param input the input value to set + * @return the MongoDbRestartCommand object itself. + */ + public MongoDbRestartCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyField.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyField.java new file mode 100644 index 0000000000000..24f0f6a13ed48 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyField.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a field reference within a MongoDB shard key. + */ +public class MongoDbShardKeyField { + /** + * The name of the field. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The field ordering. Possible values include: 'Forward', 'Reverse', + * 'Hashed'. + */ + @JsonProperty(value = "order", required = true) + private MongoDbShardKeyOrder order; + + /** + * Get the name of the field. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the field. + * + * @param name the name value to set + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withName(String name) { + this.name = name; + return this; + } + + /** + * Get the field ordering. Possible values include: 'Forward', 'Reverse', 'Hashed'. + * + * @return the order value + */ + public MongoDbShardKeyOrder order() { + return this.order; + } + + /** + * Set the field ordering. Possible values include: 'Forward', 'Reverse', 'Hashed'. + * + * @param order the order value to set + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withOrder(MongoDbShardKeyOrder order) { + this.order = order; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyInfo.java new file mode 100644 index 0000000000000..ff97eb06151ff --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyInfo.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a MongoDB shard key. + */ +public class MongoDbShardKeyInfo { + /** + * The fields within the shard key. + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /** + * Whether the shard key is unique. + */ + @JsonProperty(value = "isUnique", required = true) + private boolean isUnique; + + /** + * Get the fields within the shard key. + * + * @return the fields value + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields within the shard key. + * + * @param fields the fields value to set + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get whether the shard key is unique. + * + * @return the isUnique value + */ + public boolean isUnique() { + return this.isUnique; + } + + /** + * Set whether the shard key is unique. + * + * @param isUnique the isUnique value to set + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withIsUnique(boolean isUnique) { + this.isUnique = isUnique; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyOrder.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyOrder.java new file mode 100644 index 0000000000000..56a75391e7892 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeyOrder.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MongoDbShardKeyOrder. + */ +public final class MongoDbShardKeyOrder extends ExpandableStringEnum { + /** Static value Forward for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder FORWARD = fromString("Forward"); + + /** Static value Reverse for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder REVERSE = fromString("Reverse"); + + /** Static value Hashed for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder HASHED = fromString("Hashed"); + + /** + * Creates or finds a MongoDbShardKeyOrder from its string representation. + * @param name a name to look for + * @return the corresponding MongoDbShardKeyOrder + */ + @JsonCreator + public static MongoDbShardKeyOrder fromString(String name) { + return fromString(name, MongoDbShardKeyOrder.class); + } + + /** + * @return known MongoDbShardKeyOrder values + */ + public static Collection values() { + return values(MongoDbShardKeyOrder.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeySetting.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeySetting.java new file mode 100644 index 0000000000000..5188248af688a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbShardKeySetting.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a MongoDB shard key. + */ +public class MongoDbShardKeySetting { + /** + * The fields within the shard key. + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /** + * Whether the shard key is unique. + */ + @JsonProperty(value = "isUnique", required = true) + private boolean isUnique; + + /** + * Get the fields within the shard key. + * + * @return the fields value + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields within the shard key. + * + * @param fields the fields value to set + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get whether the shard key is unique. + * + * @return the isUnique value + */ + public boolean isUnique() { + return this.isUnique; + } + + /** + * Set whether the shard key is unique. + * + * @param isUnique the isUnique value to set + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withIsUnique(boolean isUnique) { + this.isUnique = isUnique; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbThrottlingSettings.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbThrottlingSettings.java new file mode 100644 index 0000000000000..a0893aa180018 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MongoDbThrottlingSettings.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies resource limits for the migration. + */ +public class MongoDbThrottlingSettings { + /** + * The percentage of CPU time that the migrator will try to avoid using, + * from 0 to 100. + */ + @JsonProperty(value = "minFreeCpu") + private Integer minFreeCpu; + + /** + * The number of megabytes of RAM that the migrator will try to avoid + * using. + */ + @JsonProperty(value = "minFreeMemoryMb") + private Integer minFreeMemoryMb; + + /** + * The maximum number of work items (e.g. collection copies) that will be + * processed in parallel. + */ + @JsonProperty(value = "maxParallelism") + private Integer maxParallelism; + + /** + * Get the percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @return the minFreeCpu value + */ + public Integer minFreeCpu() { + return this.minFreeCpu; + } + + /** + * Set the percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @param minFreeCpu the minFreeCpu value to set + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeCpu(Integer minFreeCpu) { + this.minFreeCpu = minFreeCpu; + return this; + } + + /** + * Get the number of megabytes of RAM that the migrator will try to avoid using. + * + * @return the minFreeMemoryMb value + */ + public Integer minFreeMemoryMb() { + return this.minFreeMemoryMb; + } + + /** + * Set the number of megabytes of RAM that the migrator will try to avoid using. + * + * @param minFreeMemoryMb the minFreeMemoryMb value to set + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeMemoryMb(Integer minFreeMemoryMb) { + this.minFreeMemoryMb = minFreeMemoryMb; + return this; + } + + /** + * Get the maximum number of work items (e.g. collection copies) that will be processed in parallel. + * + * @return the maxParallelism value + */ + public Integer maxParallelism() { + return this.maxParallelism; + } + + /** + * Set the maximum number of work items (e.g. collection copies) that will be processed in parallel. + * + * @param maxParallelism the maxParallelism value to set + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMaxParallelism(Integer maxParallelism) { + this.maxParallelism = maxParallelism; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlConnectionInfo.java new file mode 100644 index 0000000000000..351f0f3240356 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlConnectionInfo.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information for connecting to MySQL server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MySqlConnectionInfo") +public class MySqlConnectionInfo extends ConnectionInfo { + /** + * Name of the server. + */ + @JsonProperty(value = "serverName", required = true) + private String serverName; + + /** + * Port for Server. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set name of the server. + * + * @param serverName the serverName value to set + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get port for Server. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set port for Server. + * + * @param port the port value to set + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlTargetPlatformType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlTargetPlatformType.java new file mode 100644 index 0000000000000..e5e79ddf3fb65 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/MySqlTargetPlatformType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MySqlTargetPlatformType. + */ +public final class MySqlTargetPlatformType extends ExpandableStringEnum { + /** Static value AzureDbForMySQL for MySqlTargetPlatformType. */ + public static final MySqlTargetPlatformType AZURE_DB_FOR_MY_SQL = fromString("AzureDbForMySQL"); + + /** + * Creates or finds a MySqlTargetPlatformType from its string representation. + * @param name a name to look for + * @return the corresponding MySqlTargetPlatformType + */ + @JsonCreator + public static MySqlTargetPlatformType fromString(String name) { + return fromString(name, MySqlTargetPlatformType.class); + } + + /** + * @return known MySqlTargetPlatformType values + */ + public static Collection values() { + return values(MySqlTargetPlatformType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityRequest.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..74d8d4a673470 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource type and proposed name. + */ +public class NameAvailabilityRequest { + /** + * The proposed resource name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The resource type chain (e.g. virtualMachines/extensions). + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the proposed resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the proposed resource name. + * + * @param name the name value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type chain (e.g. virtualMachines/extensions). + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type chain (e.g. virtualMachines/extensions). + * + * @param type the type value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityResponse.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityResponse.java new file mode 100644 index 0000000000000..7535071c14645 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameAvailabilityResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.NameAvailabilityResponseInner; + +/** + * Type representing NameAvailabilityResponse. + */ +public interface NameAvailabilityResponse extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + NameCheckFailureReason reason(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameCheckFailureReason.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameCheckFailureReason.java new file mode 100644 index 0000000000000..2fe7642e2fa00 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NameCheckFailureReason.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NameCheckFailureReason. + */ +public final class NameCheckFailureReason extends ExpandableStringEnum { + /** Static value AlreadyExists for NameCheckFailureReason. */ + public static final NameCheckFailureReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** Static value Invalid for NameCheckFailureReason. */ + public static final NameCheckFailureReason INVALID = fromString("Invalid"); + + /** + * Creates or finds a NameCheckFailureReason from its string representation. + * @param name a name to look for + * @return the corresponding NameCheckFailureReason + */ + @JsonCreator + public static NameCheckFailureReason fromString(String name) { + return fromString(name, NameCheckFailureReason.class); + } + + /** + * @return known NameCheckFailureReason values + */ + public static Collection values() { + return values(NameCheckFailureReason.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTable.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTable.java new file mode 100644 index 0000000000000..550e3147f9283 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTable.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines metadata for table to be migrated. + */ +public class NonSqlDataMigrationTable { + /** + * Source table name. + */ + @JsonProperty(value = "sourceName") + private String sourceName; + + /** + * Get source table name. + * + * @return the sourceName value + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Set source table name. + * + * @param sourceName the sourceName value to set + * @return the NonSqlDataMigrationTable object itself. + */ + public NonSqlDataMigrationTable withSourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTableResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTableResult.java new file mode 100644 index 0000000000000..e132d8068c102 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlDataMigrationTableResult.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object used to report the data migration results of a table. + */ +public class NonSqlDataMigrationTableResult { + /** + * Result code of the data migration. Possible values include: 'Initial', + * 'Completed', 'ObjectNotExistsInSource', 'ObjectNotExistsInTarget', + * 'TargetObjectIsInaccessible', 'FatalError'. + */ + @JsonProperty(value = "resultCode", access = JsonProperty.Access.WRITE_ONLY) + private DataMigrationResultCode resultCode; + + /** + * Name of the source table. + */ + @JsonProperty(value = "sourceName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceName; + + /** + * Name of the target table. + */ + @JsonProperty(value = "targetName", access = JsonProperty.Access.WRITE_ONLY) + private String targetName; + + /** + * Number of rows in the source table. + */ + @JsonProperty(value = "sourceRowCount", access = JsonProperty.Access.WRITE_ONLY) + private Long sourceRowCount; + + /** + * Number of rows in the target table. + */ + @JsonProperty(value = "targetRowCount", access = JsonProperty.Access.WRITE_ONLY) + private Long targetRowCount; + + /** + * Time taken to migrate the data. + */ + @JsonProperty(value = "elapsedTimeInMiliseconds", access = JsonProperty.Access.WRITE_ONLY) + private Double elapsedTimeInMiliseconds; + + /** + * List of errors, if any, during migration. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get result code of the data migration. Possible values include: 'Initial', 'Completed', 'ObjectNotExistsInSource', 'ObjectNotExistsInTarget', 'TargetObjectIsInaccessible', 'FatalError'. + * + * @return the resultCode value + */ + public DataMigrationResultCode resultCode() { + return this.resultCode; + } + + /** + * Get name of the source table. + * + * @return the sourceName value + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Get name of the target table. + * + * @return the targetName value + */ + public String targetName() { + return this.targetName; + } + + /** + * Get number of rows in the source table. + * + * @return the sourceRowCount value + */ + public Long sourceRowCount() { + return this.sourceRowCount; + } + + /** + * Get number of rows in the target table. + * + * @return the targetRowCount value + */ + public Long targetRowCount() { + return this.targetRowCount; + } + + /** + * Get time taken to migrate the data. + * + * @return the elapsedTimeInMiliseconds value + */ + public Double elapsedTimeInMiliseconds() { + return this.elapsedTimeInMiliseconds; + } + + /** + * Get list of errors, if any, during migration. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskInput.java new file mode 100644 index 0000000000000..4d0f3cb785da7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskInput.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for non sql migration task input. + */ +public class NonSqlMigrationTaskInput { + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Target database name. + */ + @JsonProperty(value = "targetDatabaseName", required = true) + private String targetDatabaseName; + + /** + * Name of the migration project. + */ + @JsonProperty(value = "projectName", required = true) + private String projectName; + + /** + * A URL that points to the drop location to access project artifacts. + */ + @JsonProperty(value = "projectLocation", required = true) + private String projectLocation; + + /** + * Metadata of the tables selected for migration. + */ + @JsonProperty(value = "selectedTables", required = true) + private List selectedTables; + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the NonSqlMigrationTaskInput object itself. + */ + public NonSqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get target database name. + * + * @return the targetDatabaseName value + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set target database name. + * + * @param targetDatabaseName the targetDatabaseName value to set + * @return the NonSqlMigrationTaskInput object itself. + */ + public NonSqlMigrationTaskInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get name of the migration project. + * + * @return the projectName value + */ + public String projectName() { + return this.projectName; + } + + /** + * Set name of the migration project. + * + * @param projectName the projectName value to set + * @return the NonSqlMigrationTaskInput object itself. + */ + public NonSqlMigrationTaskInput withProjectName(String projectName) { + this.projectName = projectName; + return this; + } + + /** + * Get a URL that points to the drop location to access project artifacts. + * + * @return the projectLocation value + */ + public String projectLocation() { + return this.projectLocation; + } + + /** + * Set a URL that points to the drop location to access project artifacts. + * + * @param projectLocation the projectLocation value to set + * @return the NonSqlMigrationTaskInput object itself. + */ + public NonSqlMigrationTaskInput withProjectLocation(String projectLocation) { + this.projectLocation = projectLocation; + return this; + } + + /** + * Get metadata of the tables selected for migration. + * + * @return the selectedTables value + */ + public List selectedTables() { + return this.selectedTables; + } + + /** + * Set metadata of the tables selected for migration. + * + * @param selectedTables the selectedTables value to set + * @return the NonSqlMigrationTaskInput object itself. + */ + public NonSqlMigrationTaskInput withSelectedTables(List selectedTables) { + this.selectedTables = selectedTables; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskOutput.java new file mode 100644 index 0000000000000..1c3f7e902b588 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/NonSqlMigrationTaskOutput.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for non sql migration task output. + */ +public class NonSqlMigrationTaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startedOn; + + /** + * Migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endedOn; + + /** + * Current state of migration. Possible values include: 'Default', + * 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', + * 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /** + * Results of the migration. The key contains the table name and the value + * the table result object. + */ + @JsonProperty(value = "dataMigrationTableResults", access = JsonProperty.Access.WRITE_ONLY) + private Map dataMigrationTableResults; + + /** + * Message about the progress of the migration. + */ + @JsonProperty(value = "progressMessage", access = JsonProperty.Access.WRITE_ONLY) + private String progressMessage; + + /** + * Name of source server. + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /** + * Name of target server. + */ + @JsonProperty(value = "targetServerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerName; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get migration start time. + * + * @return the startedOn value + */ + public DateTime startedOn() { + return this.startedOn; + } + + /** + * Get migration end time. + * + * @return the endedOn value + */ + public DateTime endedOn() { + return this.endedOn; + } + + /** + * Get current state of migration. Possible values include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', 'CompletedWithWarnings'. + * + * @return the status value + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get results of the migration. The key contains the table name and the value the table result object. + * + * @return the dataMigrationTableResults value + */ + public Map dataMigrationTableResults() { + return this.dataMigrationTableResults; + } + + /** + * Get message about the progress of the migration. + * + * @return the progressMessage value + */ + public String progressMessage() { + return this.progressMessage; + } + + /** + * Get name of source server. + * + * @return the sourceServerName value + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get name of target server. + * + * @return the targetServerName value + */ + public String targetServerName() { + return this.targetServerName; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ODataError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ODataError.java new file mode 100644 index 0000000000000..2f47cd927b941 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ODataError.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information in OData format. + */ +public class ODataError { + /** + * The machine-readable description of the error, such as 'InvalidRequest' + * or 'InternalServerError'. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The human-readable description of the error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Inner errors that caused this error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the machine-readable description of the error, such as 'InvalidRequest' or 'InternalServerError'. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the human-readable description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the human-readable description of the error. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get inner errors that caused this error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set inner errors that caused this error. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ObjectType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ObjectType.java new file mode 100644 index 0000000000000..b11782937139e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ObjectType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ObjectType. + */ +public final class ObjectType extends ExpandableStringEnum { + /** Static value StoredProcedures for ObjectType. */ + public static final ObjectType STORED_PROCEDURES = fromString("StoredProcedures"); + + /** Static value Table for ObjectType. */ + public static final ObjectType TABLE = fromString("Table"); + + /** Static value User for ObjectType. */ + public static final ObjectType USER = fromString("User"); + + /** Static value View for ObjectType. */ + public static final ObjectType VIEW = fromString("View"); + + /** Static value Function for ObjectType. */ + public static final ObjectType FUNCTION = fromString("Function"); + + /** + * Creates or finds a ObjectType from its string representation. + * @param name a name to look for + * @return the corresponding ObjectType + */ + @JsonCreator + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** + * @return known ObjectType values + */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Operations.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Operations.java new file mode 100644 index 0000000000000..8d580845a5836 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/PostgreSqlConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/PostgreSqlConnectionInfo.java new file mode 100644 index 0000000000000..e4556f117401a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/PostgreSqlConnectionInfo.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information for connecting to PostgreSQL server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("PostgreSqlConnectionInfo") +public class PostgreSqlConnectionInfo extends ConnectionInfo { + /** + * Name of the server. + */ + @JsonProperty(value = "serverName", required = true) + private String serverName; + + /** + * Name of the database. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Port for Server. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set name of the server. + * + * @param serverName the serverName value to set + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set name of the database. + * + * @param databaseName the databaseName value to set + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get port for Server. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set port for Server. + * + * @param port the port value to set + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Project.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Project.java new file mode 100644 index 0000000000000..e291c06d07705 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Project.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ProjectInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import java.util.Map; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Project. + */ +public interface Project extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the databasesInfo value. + */ + List databasesInfo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProjectProvisioningState provisioningState(); + + /** + * @return the sourceConnectionInfo value. + */ + ConnectionInfo sourceConnectionInfo(); + + /** + * @return the sourcePlatform value. + */ + ProjectSourcePlatform sourcePlatform(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the targetConnectionInfo value. + */ + ConnectionInfo targetConnectionInfo(); + + /** + * @return the targetPlatform value. + */ + ProjectTargetPlatform targetPlatform(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Project definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithService, DefinitionStages.WithLocation, DefinitionStages.WithSourcePlatform, DefinitionStages.WithTargetPlatform, DefinitionStages.WithCreate { + } + + /** + * Grouping of Project definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Project definition. + */ + interface Blank extends WithService { + } + + /** + * The stage of the project definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies groupName, serviceName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @return the next definition stage + */ + WithLocation withExistingService(String groupName, String serviceName); + } + + /** + * The stage of the project definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithSourcePlatform withLocation(String location); + } + + /** + * The stage of the project definition allowing to specify SourcePlatform. + */ + interface WithSourcePlatform { + /** + * Specifies sourcePlatform. + * @param sourcePlatform Source platform for the project. Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * @return the next definition stage + */ + WithTargetPlatform withSourcePlatform(ProjectSourcePlatform sourcePlatform); + } + + /** + * The stage of the project definition allowing to specify TargetPlatform. + */ + interface WithTargetPlatform { + /** + * Specifies targetPlatform. + * @param targetPlatform Target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * @return the next definition stage + */ + WithCreate withTargetPlatform(ProjectTargetPlatform targetPlatform); + } + + /** + * The stage of the project definition allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next definition stage + */ + WithCreate withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project definition allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next definition stage + */ + WithCreate withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the project definition allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next definition stage + */ + WithCreate withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDatabasesInfo, DefinitionStages.WithSourceConnectionInfo, DefinitionStages.WithTags, DefinitionStages.WithTargetConnectionInfo { + } + } + /** + * The template for a Project update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDatabasesInfo, UpdateStages.WithSourceConnectionInfo, UpdateStages.WithTags, UpdateStages.WithTargetConnectionInfo { + } + + /** + * Grouping of Project update stages. + */ + interface UpdateStages { + /** + * The stage of the project update allowing to specify DatabasesInfo. + */ + interface WithDatabasesInfo { + /** + * Specifies databasesInfo. + * @param databasesInfo List of DatabaseInfo + * @return the next update stage + */ + Update withDatabasesInfo(List databasesInfo); + } + + /** + * The stage of the project update allowing to specify SourceConnectionInfo. + */ + interface WithSourceConnectionInfo { + /** + * Specifies sourceConnectionInfo. + * @param sourceConnectionInfo Information for connecting to source + * @return the next update stage + */ + Update withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + + /** + * The stage of the project update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the project update allowing to specify TargetConnectionInfo. + */ + interface WithTargetConnectionInfo { + /** + * Specifies targetConnectionInfo. + * @param targetConnectionInfo Information for connecting to target + * @return the next update stage + */ + Update withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFile.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFile.java new file mode 100644 index 0000000000000..527d90bfd37ae --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFile.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ProjectFileInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; + +/** + * Type representing ProjectFile. + */ +public interface ProjectFile extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProjectFileProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ProjectFile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProject, DefinitionStages.WithCreate { + } + + /** + * Grouping of ProjectFile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ProjectFile definition. + */ + interface Blank extends WithProject { + } + + /** + * The stage of the projectfile definition allowing to specify Project. + */ + interface WithProject { + /** + * Specifies groupName, serviceName, projectName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @return the next definition stage + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + + /** + * The stage of the projectfile definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the projectfile definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom file properties + * @return the next definition stage + */ + WithCreate withProperties(ProjectFileProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties { + } + } + /** + * The template for a ProjectFile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of ProjectFile update stages. + */ + interface UpdateStages { + /** + * The stage of the projectfile update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the projectfile update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom file properties + * @return the next update stage + */ + Update withProperties(ProjectFileProperties properties); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFileProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFileProperties.java new file mode 100644 index 0000000000000..e06dcf658c1a9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectFileProperties.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for file properties. + */ +public class ProjectFileProperties { + /** + * Optional File extension. If submitted it should not have a leading + * period and must match the extension from filePath. + */ + @JsonProperty(value = "extension") + private String extension; + + /** + * Relative path of this file resource. This property can be set when + * creating or updating the file resource. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Modification DateTime. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * File content type. This propery can be modified to reflect the file + * content type. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * File size. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private Long size; + + /** + * Get optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + * + * @return the extension value + */ + public String extension() { + return this.extension; + } + + /** + * Set optional File extension. If submitted it should not have a leading period and must match the extension from filePath. + * + * @param extension the extension value to set + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withExtension(String extension) { + this.extension = extension; + return this; + } + + /** + * Get relative path of this file resource. This property can be set when creating or updating the file resource. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set relative path of this file resource. This property can be set when creating or updating the file resource. + * + * @param filePath the filePath value to set + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get modification DateTime. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get file content type. This propery can be modified to reflect the file content type. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set file content type. This propery can be modified to reflect the file content type. + * + * @param mediaType the mediaType value to set + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get file size. + * + * @return the size value + */ + public Long size() { + return this.size; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectProvisioningState.java new file mode 100644 index 0000000000000..06cf1fd351af8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectProvisioningState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectProvisioningState. + */ +public final class ProjectProvisioningState extends ExpandableStringEnum { + /** Static value Deleting for ProjectProvisioningState. */ + public static final ProjectProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProjectProvisioningState. */ + public static final ProjectProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates or finds a ProjectProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProjectProvisioningState + */ + @JsonCreator + public static ProjectProvisioningState fromString(String name) { + return fromString(name, ProjectProvisioningState.class); + } + + /** + * @return known ProjectProvisioningState values + */ + public static Collection values() { + return values(ProjectProvisioningState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectSourcePlatform.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectSourcePlatform.java new file mode 100644 index 0000000000000..e8147798d3a1b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectSourcePlatform.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectSourcePlatform. + */ +public final class ProjectSourcePlatform extends ExpandableStringEnum { + /** Static value SQL for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform SQL = fromString("SQL"); + + /** Static value MySQL for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform MY_SQL = fromString("MySQL"); + + /** Static value PostgreSql for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform POSTGRE_SQL = fromString("PostgreSql"); + + /** Static value MongoDb for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform MONGO_DB = fromString("MongoDb"); + + /** Static value Unknown for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectSourcePlatform from its string representation. + * @param name a name to look for + * @return the corresponding ProjectSourcePlatform + */ + @JsonCreator + public static ProjectSourcePlatform fromString(String name) { + return fromString(name, ProjectSourcePlatform.class); + } + + /** + * @return known ProjectSourcePlatform values + */ + public static Collection values() { + return values(ProjectSourcePlatform.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTargetPlatform.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTargetPlatform.java new file mode 100644 index 0000000000000..3e5761b740d67 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTargetPlatform.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProjectTargetPlatform. + */ +public final class ProjectTargetPlatform extends ExpandableStringEnum { + /** Static value SQLDB for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLDB = fromString("SQLDB"); + + /** Static value SQLMI for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLMI = fromString("SQLMI"); + + /** Static value AzureDbForMySql for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform AZURE_DB_FOR_MY_SQL = fromString("AzureDbForMySql"); + + /** Static value AzureDbForPostgreSql for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform AZURE_DB_FOR_POSTGRE_SQL = fromString("AzureDbForPostgreSql"); + + /** Static value MongoDb for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform MONGO_DB = fromString("MongoDb"); + + /** Static value Unknown for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectTargetPlatform from its string representation. + * @param name a name to look for + * @return the corresponding ProjectTargetPlatform + */ + @JsonCreator + public static ProjectTargetPlatform fromString(String name) { + return fromString(name, ProjectTargetPlatform.class); + } + + /** + * @return known ProjectTargetPlatform values + */ + public static Collection values() { + return values(ProjectTargetPlatform.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTask.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTask.java new file mode 100644 index 0000000000000..317be2fd998d5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTask.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ProjectTaskInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; + +/** + * Type representing ProjectTask. + */ +public interface ProjectTask extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProjectTaskProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ProjectTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProject, DefinitionStages.WithCreate { + } + + /** + * Grouping of ProjectTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ProjectTask definition. + */ + interface Blank extends WithProject { + } + + /** + * The stage of the projecttask definition allowing to specify Project. + */ + interface WithProject { + /** + * Specifies groupName, serviceName, projectName. + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @return the next definition stage + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + + /** + * The stage of the projecttask definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the projecttask definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next definition stage + */ + WithCreate withProperties(ProjectTaskProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties { + } + } + /** + * The template for a ProjectTask update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of ProjectTask update stages. + */ + interface UpdateStages { + /** + * The stage of the projecttask update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag HTTP strong entity tag value. This is ignored if submitted + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the projecttask update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Custom task properties + * @return the next update stage + */ + Update withProperties(ProjectTaskProperties properties); + } + + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTaskProperties.java new file mode 100644 index 0000000000000..36615d673156a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ProjectTaskProperties.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for all types of DMS task properties. If task is not supported by + * current client, this object is returned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), + @JsonSubTypes.Type(name = "PostgreSqlConnectionInfo", value = PostgreSqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MySqlConnectionInfo", value = MySqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MongoDbConnectionInfo", value = MongoDbConnectionInfo.class), + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "Validate.MongoDb", value = ValidateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.SqlDb.Sync", value = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MySql.AzureDbForMySql.Sync", value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDb.Sync", value = MigrateSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureDbForMySql", value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.AzureSqlDb.Sync", value = GetUserTablesSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb.Sync", value = ConnectToTargetSqlSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer.Sync", value = ConnectToSourceSqlServerSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class), + @JsonSubTypes.Type(name = "Connect.MongoDb", value = ConnectToMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "MigrateSchemaSqlServerSqlDb", value = MigrateSchemaSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "cancel", value = MongoDbCancelCommand.class), + @JsonSubTypes.Type(name = "finish", value = MongoDbFinishCommand.class), + @JsonSubTypes.Type(name = "restart", value = MongoDbRestartCommand.class) +}) +public class ProjectTaskProperties { + /** + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * The state of the task. This is ignored if submitted. Possible values + * include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', + * 'Failed', 'FailedInputValidation', 'Faulted'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TaskState state; + + /** + * Array of command properties. + */ + @JsonProperty(value = "commands", access = JsonProperty.Access.WRITE_ONLY) + private List commands; + + /** + * Get array of errors. This is ignored if submitted. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Get the state of the task. This is ignored if submitted. Possible values include: 'Unknown', 'Queued', 'Running', 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted'. + * + * @return the state value + */ + public TaskState state() { + return this.state; + } + + /** + * Get array of command properties. + * + * @return the commands value + */ + public List commands() { + return this.commands; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Projects.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Projects.java new file mode 100644 index 0000000000000..f99b28f1c38f7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Projects.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ProjectsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Projects. + */ +public interface Projects extends SupportsCreating, HasInner { + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName); + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName); + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryAnalysisValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryAnalysisValidationResult.java new file mode 100644 index 0000000000000..d9890b033268c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryAnalysisValidationResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for query analysis comparison between the source and target. + */ +public class QueryAnalysisValidationResult { + /** + * List of queries executed and it's execution results in source and + * target. + */ + @JsonProperty(value = "queryResults") + private QueryExecutionResult queryResults; + + /** + * Errors that are part of the execution. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get list of queries executed and it's execution results in source and target. + * + * @return the queryResults value + */ + public QueryExecutionResult queryResults() { + return this.queryResults; + } + + /** + * Set list of queries executed and it's execution results in source and target. + * + * @param queryResults the queryResults value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) { + this.queryResults = queryResults; + return this; + } + + /** + * Get errors that are part of the execution. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set errors that are part of the execution. + * + * @param validationErrors the validationErrors value to set + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryExecutionResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryExecutionResult.java new file mode 100644 index 0000000000000..b0f32436fd231 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QueryExecutionResult.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes query analysis results for execution in source and target. + */ +public class QueryExecutionResult { + /** + * Query text retrieved from the source server. + */ + @JsonProperty(value = "queryText") + private String queryText; + + /** + * Total no. of statements in the batch. + */ + @JsonProperty(value = "statementsInBatch") + private Long statementsInBatch; + + /** + * Query analysis result from the source. + */ + @JsonProperty(value = "sourceResult") + private ExecutionStatistics sourceResult; + + /** + * Query analysis result from the target. + */ + @JsonProperty(value = "targetResult") + private ExecutionStatistics targetResult; + + /** + * Get query text retrieved from the source server. + * + * @return the queryText value + */ + public String queryText() { + return this.queryText; + } + + /** + * Set query text retrieved from the source server. + * + * @param queryText the queryText value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + + /** + * Get total no. of statements in the batch. + * + * @return the statementsInBatch value + */ + public Long statementsInBatch() { + return this.statementsInBatch; + } + + /** + * Set total no. of statements in the batch. + * + * @param statementsInBatch the statementsInBatch value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withStatementsInBatch(Long statementsInBatch) { + this.statementsInBatch = statementsInBatch; + return this; + } + + /** + * Get query analysis result from the source. + * + * @return the sourceResult value + */ + public ExecutionStatistics sourceResult() { + return this.sourceResult; + } + + /** + * Set query analysis result from the source. + * + * @param sourceResult the sourceResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withSourceResult(ExecutionStatistics sourceResult) { + this.sourceResult = sourceResult; + return this; + } + + /** + * Get query analysis result from the target. + * + * @return the targetResult value + */ + public ExecutionStatistics targetResult() { + return this.targetResult; + } + + /** + * Set query analysis result from the target. + * + * @param targetResult the targetResult value to set + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withTargetResult(ExecutionStatistics targetResult) { + this.targetResult = targetResult; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Quota.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Quota.java new file mode 100644 index 0000000000000..3fe71e9aaaeda --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Quota.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.QuotaInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; + +/** + * Type representing Quota. + */ +public interface Quota extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + QuotaName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QuotaName.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QuotaName.java new file mode 100644 index 0000000000000..3133f3729744e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/QuotaName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name of the quota. + */ +public class QuotaName { + /** + * The localized name of the quota. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * The unlocalized name (or ID) of the quota. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the localized name of the quota. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the quota. + * + * @param localizedValue the localizedValue value to set + * @return the QuotaName object itself. + */ + public QuotaName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get the unlocalized name (or ID) of the quota. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the unlocalized name (or ID) of the quota. + * + * @param value the value value to set + * @return the QuotaName object itself. + */ + public QuotaName withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ReportableException.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ReportableException.java new file mode 100644 index 0000000000000..65a5095a31dd1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ReportableException.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Exception object for all custom exceptions. + */ +public class ReportableException { + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Actionable steps for this exception. + */ + @JsonProperty(value = "actionableMessage") + private String actionableMessage; + + /** + * The path to the file where exception occurred. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * The line number where exception occurred. + */ + @JsonProperty(value = "lineNumber") + private String lineNumber; + + /** + * Coded numerical value that is assigned to a specific exception. + */ + @JsonProperty(value = "hResult") + private Integer hResult; + + /** + * Stack trace. + */ + @JsonProperty(value = "stackTrace") + private String stackTrace; + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ReportableException object itself. + */ + public ReportableException withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get actionable steps for this exception. + * + * @return the actionableMessage value + */ + public String actionableMessage() { + return this.actionableMessage; + } + + /** + * Set actionable steps for this exception. + * + * @param actionableMessage the actionableMessage value to set + * @return the ReportableException object itself. + */ + public ReportableException withActionableMessage(String actionableMessage) { + this.actionableMessage = actionableMessage; + return this; + } + + /** + * Get the path to the file where exception occurred. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the path to the file where exception occurred. + * + * @param filePath the filePath value to set + * @return the ReportableException object itself. + */ + public ReportableException withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the line number where exception occurred. + * + * @return the lineNumber value + */ + public String lineNumber() { + return this.lineNumber; + } + + /** + * Set the line number where exception occurred. + * + * @param lineNumber the lineNumber value to set + * @return the ReportableException object itself. + */ + public ReportableException withLineNumber(String lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * Get coded numerical value that is assigned to a specific exception. + * + * @return the hResult value + */ + public Integer hResult() { + return this.hResult; + } + + /** + * Set coded numerical value that is assigned to a specific exception. + * + * @param hResult the hResult value to set + * @return the ReportableException object itself. + */ + public ReportableException withHResult(Integer hResult) { + this.hResult = hResult; + return this; + } + + /** + * Get stack trace. + * + * @return the stackTrace value + */ + public String stackTrace() { + return this.stackTrace; + } + + /** + * Set stack trace. + * + * @param stackTrace the stackTrace value to set + * @return the ReportableException object itself. + */ + public ReportableException withStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSku.java new file mode 100644 index 0000000000000..9ca31f28ebbff --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSku.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ResourceSkuInner; +import java.util.List; + +/** + * Type representing ResourceSku. + */ +public interface ResourceSku extends HasInner, HasManager { + /** + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * @return the costs value. + */ + List costs(); + + /** + * @return the family value. + */ + String family(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the size value. + */ + String size(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapabilities.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..a240fb6b2ecc7 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapabilities.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes The SKU capabilites object. + */ +public class ResourceSkuCapabilities { + /** + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get an invariant to describe the feature. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get an invariant if the feature is measured by quantity. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacity.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacity.java new file mode 100644 index 0000000000000..db8c73031693a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacity.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuCapacity { + /** + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /** + * The maximum capacity. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /** + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /** + * The scale type applicable to the SKU. Possible values include: + * 'Automatic', 'Manual', 'None'. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum capacity. + * + * @return the minimum value + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum capacity. + * + * @return the maximum value + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the default capacity. + * + * @return the defaultProperty value + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scale type applicable to the SKU. Possible values include: 'Automatic', 'Manual', 'None'. + * + * @return the scaleType value + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacityScaleType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacityScaleType.java new file mode 100644 index 0000000000000..252402e62a485 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCapacityScaleType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuCapacityScaleType. + */ +public final class ResourceSkuCapacityScaleType extends ExpandableStringEnum { + /** Static value Automatic for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType AUTOMATIC = fromString("Automatic"); + + /** Static value Manual for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType MANUAL = fromString("Manual"); + + /** Static value None for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType NONE = fromString("None"); + + /** + * Creates or finds a ResourceSkuCapacityScaleType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuCapacityScaleType + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String name) { + return fromString(name, ResourceSkuCapacityScaleType.class); + } + + /** + * @return known ResourceSkuCapacityScaleType values + */ + public static Collection values() { + return values(ResourceSkuCapacityScaleType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCosts.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCosts.java new file mode 100644 index 0000000000000..30b830c09d019 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuCosts.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes metadata for retrieving price info. + */ +public class ResourceSkuCosts { + /** + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterID; + + /** + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /** + * An invariant to show the extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get used for querying price from commerce. + * + * @return the meterID value + */ + public String meterID() { + return this.meterID; + } + + /** + * Get the multiplier is needed to extend the base metered cost. + * + * @return the quantity value + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get an invariant to show the extended unit. + * + * @return the extendedUnit value + */ + public String extendedUnit() { + return this.extendedUnit; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictions.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..5c7de9a24bc38 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictions.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes scaling information of a SKU. + */ +public class ResourceSkuRestrictions { + /** + * The type of restrictions. Possible values include: 'location'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsType type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason code for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type of restrictions. Possible values include: 'location'. + * + * @return the type value + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason code for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsReasonCode.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..e1cff1f65c811 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsReasonCode. + */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsReasonCode + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** + * @return known ResourceSkuRestrictionsReasonCode values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..d0dadaa300aca --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkuRestrictionsType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsType. + */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("location"); + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsType + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** + * @return known ResourceSkuRestrictionsType values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkus.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkus.java new file mode 100644 index 0000000000000..91702482973d4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ResourceSkus.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ResourceSkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourceSkus. + */ +public interface ResourceSkus extends HasInner { + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResult.java new file mode 100644 index 0000000000000..0b853e02d2dc9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResult.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results for schema comparison between the source and target. + */ +public class SchemaComparisonValidationResult { + /** + * List of schema differences between the source and target databases. + */ + @JsonProperty(value = "schemaDifferences") + private SchemaComparisonValidationResultType schemaDifferences; + + /** + * List of errors that happened while performing schema compare validation. + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Count of source database objects. + */ + @JsonProperty(value = "sourceDatabaseObjectCount") + private Map sourceDatabaseObjectCount; + + /** + * Count of target database objects. + */ + @JsonProperty(value = "targetDatabaseObjectCount") + private Map targetDatabaseObjectCount; + + /** + * Get list of schema differences between the source and target databases. + * + * @return the schemaDifferences value + */ + public SchemaComparisonValidationResultType schemaDifferences() { + return this.schemaDifferences; + } + + /** + * Set list of schema differences between the source and target databases. + * + * @param schemaDifferences the schemaDifferences value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSchemaDifferences(SchemaComparisonValidationResultType schemaDifferences) { + this.schemaDifferences = schemaDifferences; + return this; + } + + /** + * Get list of errors that happened while performing schema compare validation. + * + * @return the validationErrors value + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set list of errors that happened while performing schema compare validation. + * + * @param validationErrors the validationErrors value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get count of source database objects. + * + * @return the sourceDatabaseObjectCount value + */ + public Map sourceDatabaseObjectCount() { + return this.sourceDatabaseObjectCount; + } + + /** + * Set count of source database objects. + * + * @param sourceDatabaseObjectCount the sourceDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSourceDatabaseObjectCount(Map sourceDatabaseObjectCount) { + this.sourceDatabaseObjectCount = sourceDatabaseObjectCount; + return this; + } + + /** + * Get count of target database objects. + * + * @return the targetDatabaseObjectCount value + */ + public Map targetDatabaseObjectCount() { + return this.targetDatabaseObjectCount; + } + + /** + * Set count of target database objects. + * + * @param targetDatabaseObjectCount the targetDatabaseObjectCount value to set + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withTargetDatabaseObjectCount(Map targetDatabaseObjectCount) { + this.targetDatabaseObjectCount = targetDatabaseObjectCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResultType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResultType.java new file mode 100644 index 0000000000000..3259b8fae8aa6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaComparisonValidationResultType.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class SchemaComparisonValidationResultType { + /** + * Name of the object that has the difference. + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Type of the object that has the difference. e.g + * (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /** + * Update action type with respect to target. Possible values include: + * 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + */ + @JsonProperty(value = "updateAction") + private UpdateActionType updateAction; + + /** + * Get name of the object that has the difference. + * + * @return the objectName value + */ + public String objectName() { + return this.objectName; + } + + /** + * Set name of the object that has the difference. + * + * @param objectName the objectName value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Get type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @return the objectType value + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set type of the object that has the difference. e.g (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function'. + * + * @param objectType the objectType value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @return the updateAction value + */ + public UpdateActionType updateAction() { + return this.updateAction; + } + + /** + * Set update action type with respect to target. Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget'. + * + * @param updateAction the updateAction value to set + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withUpdateAction(UpdateActionType updateAction) { + this.updateAction = updateAction; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationOption.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationOption.java new file mode 100644 index 0000000000000..98a7fa1a8fb7f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationOption.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SchemaMigrationOption. + */ +public final class SchemaMigrationOption extends ExpandableStringEnum { + /** Static value None for SchemaMigrationOption. */ + public static final SchemaMigrationOption NONE = fromString("None"); + + /** Static value ExtractFromSource for SchemaMigrationOption. */ + public static final SchemaMigrationOption EXTRACT_FROM_SOURCE = fromString("ExtractFromSource"); + + /** Static value UseStorageFile for SchemaMigrationOption. */ + public static final SchemaMigrationOption USE_STORAGE_FILE = fromString("UseStorageFile"); + + /** + * Creates or finds a SchemaMigrationOption from its string representation. + * @param name a name to look for + * @return the corresponding SchemaMigrationOption + */ + @JsonCreator + public static SchemaMigrationOption fromString(String name) { + return fromString(name, SchemaMigrationOption.class); + } + + /** + * @return known SchemaMigrationOption values + */ + public static Collection values() { + return values(SchemaMigrationOption.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationSetting.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationSetting.java new file mode 100644 index 0000000000000..82c9b203520d2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationSetting.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings for migrating schema from source to target. + */ +public class SchemaMigrationSetting { + /** + * Option on how to migrate the schema. Possible values include: 'None', + * 'ExtractFromSource', 'UseStorageFile'. + */ + @JsonProperty(value = "schemaOption") + private SchemaMigrationOption schemaOption; + + /** + * Resource Identifier of a file resource containing the uploaded schema + * file. + */ + @JsonProperty(value = "fileId") + private String fileId; + + /** + * Get option on how to migrate the schema. Possible values include: 'None', 'ExtractFromSource', 'UseStorageFile'. + * + * @return the schemaOption value + */ + public SchemaMigrationOption schemaOption() { + return this.schemaOption; + } + + /** + * Set option on how to migrate the schema. Possible values include: 'None', 'ExtractFromSource', 'UseStorageFile'. + * + * @param schemaOption the schemaOption value to set + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withSchemaOption(SchemaMigrationOption schemaOption) { + this.schemaOption = schemaOption; + return this; + } + + /** + * Get resource Identifier of a file resource containing the uploaded schema file. + * + * @return the fileId value + */ + public String fileId() { + return this.fileId; + } + + /** + * Set resource Identifier of a file resource containing the uploaded schema file. + * + * @param fileId the fileId value to set + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileId(String fileId) { + this.fileId = fileId; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationStage.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationStage.java new file mode 100644 index 0000000000000..72d43d500ef56 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SchemaMigrationStage.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SchemaMigrationStage. + */ +public final class SchemaMigrationStage extends ExpandableStringEnum { + /** Static value NotStarted for SchemaMigrationStage. */ + public static final SchemaMigrationStage NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInputs for SchemaMigrationStage. */ + public static final SchemaMigrationStage VALIDATING_INPUTS = fromString("ValidatingInputs"); + + /** Static value CollectingObjects for SchemaMigrationStage. */ + public static final SchemaMigrationStage COLLECTING_OBJECTS = fromString("CollectingObjects"); + + /** Static value DownloadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage DOWNLOADING_SCRIPT = fromString("DownloadingScript"); + + /** Static value GeneratingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage GENERATING_SCRIPT = fromString("GeneratingScript"); + + /** Static value UploadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage UPLOADING_SCRIPT = fromString("UploadingScript"); + + /** Static value DeployingSchema for SchemaMigrationStage. */ + public static final SchemaMigrationStage DEPLOYING_SCHEMA = fromString("DeployingSchema"); + + /** Static value Completed for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value Failed for SchemaMigrationStage. */ + public static final SchemaMigrationStage FAILED = fromString("Failed"); + + /** + * Creates or finds a SchemaMigrationStage from its string representation. + * @param name a name to look for + * @return the corresponding SchemaMigrationStage + */ + @JsonCreator + public static SchemaMigrationStage fromString(String name) { + return fromString(name, SchemaMigrationStage.class); + } + + /** + * @return known SchemaMigrationStage values + */ + public static Collection values() { + return values(SchemaMigrationStage.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SelectedCertificateInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SelectedCertificateInput.java new file mode 100644 index 0000000000000..b92105ada8d59 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SelectedCertificateInput.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Info for ertificate to be exported for TDE enabled databases. + */ +public class SelectedCertificateInput { + /** + * Name of certificate to be exported. + */ + @JsonProperty(value = "certificateName", required = true) + private String certificateName; + + /** + * Password to use for encrypting the exported certificate. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get name of certificate to be exported. + * + * @return the certificateName value + */ + public String certificateName() { + return this.certificateName; + } + + /** + * Set name of certificate to be exported. + * + * @param certificateName the certificateName value to set + * @return the SelectedCertificateInput object itself. + */ + public SelectedCertificateInput withCertificateName(String certificateName) { + this.certificateName = certificateName; + return this; + } + + /** + * Get password to use for encrypting the exported certificate. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password to use for encrypting the exported certificate. + * + * @param password the password value to set + * @return the SelectedCertificateInput object itself. + */ + public SelectedCertificateInput withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerLevelPermissionsGroup.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerLevelPermissionsGroup.java new file mode 100644 index 0000000000000..f332a3b6e0f00 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerLevelPermissionsGroup.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerLevelPermissionsGroup. + */ +public final class ServerLevelPermissionsGroup extends ExpandableStringEnum { + /** Static value Default for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup DEFAULT = fromString("Default"); + + /** Static value MigrationFromSqlServerToAzureDB for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB = fromString("MigrationFromSqlServerToAzureDB"); + + /** Static value MigrationFromSqlServerToAzureMI for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI = fromString("MigrationFromSqlServerToAzureMI"); + + /** Static value MigrationFromMySQLToAzureDBForMySQL for ServerLevelPermissionsGroup. */ + public static final ServerLevelPermissionsGroup MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL = fromString("MigrationFromMySQLToAzureDBForMySQL"); + + /** + * Creates or finds a ServerLevelPermissionsGroup from its string representation. + * @param name a name to look for + * @return the corresponding ServerLevelPermissionsGroup + */ + @JsonCreator + public static ServerLevelPermissionsGroup fromString(String name) { + return fromString(name, ServerLevelPermissionsGroup.class); + } + + /** + * @return known ServerLevelPermissionsGroup values + */ + public static Collection values() { + return values(ServerLevelPermissionsGroup.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerProperties.java new file mode 100644 index 0000000000000..5b581f6edeac5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServerProperties.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Server properties for Oracle, MySQL type source. + */ +public class ServerProperties { + /** + * Name of the server platform. + */ + @JsonProperty(value = "serverPlatform", access = JsonProperty.Access.WRITE_ONLY) + private String serverPlatform; + + /** + * Name of the server. + */ + @JsonProperty(value = "serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /** + * Version of the database server. + */ + @JsonProperty(value = "serverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverVersion; + + /** + * Edition of the database server. + */ + @JsonProperty(value = "serverEdition", access = JsonProperty.Access.WRITE_ONLY) + private String serverEdition; + + /** + * Version of the operating system. + */ + @JsonProperty(value = "serverOperatingSystemVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverOperatingSystemVersion; + + /** + * Number of databases in the server. + */ + @JsonProperty(value = "serverDatabaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverDatabaseCount; + + /** + * Get name of the server platform. + * + * @return the serverPlatform value + */ + public String serverPlatform() { + return this.serverPlatform; + } + + /** + * Get name of the server. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Get version of the database server. + * + * @return the serverVersion value + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Get edition of the database server. + * + * @return the serverEdition value + */ + public String serverEdition() { + return this.serverEdition; + } + + /** + * Get version of the operating system. + * + * @return the serverOperatingSystemVersion value + */ + public String serverOperatingSystemVersion() { + return this.serverOperatingSystemVersion; + } + + /** + * Get number of databases in the server. + * + * @return the serverDatabaseCount value + */ + public Integer serverDatabaseCount() { + return this.serverDatabaseCount; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperation.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperation.java new file mode 100644 index 0000000000000..27b3f004b5919 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.DataMigrationManager; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ServiceOperationInner; + +/** + * Type representing ServiceOperation. + */ +public interface ServiceOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + ServiceOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperationDisplay.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperationDisplay.java new file mode 100644 index 0000000000000..0129f85b4e013 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceOperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display text. + */ +public class ServiceOperationDisplay { + /** + * The localized resource provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The localized resource type name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The localized operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The localized operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the localized resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the localized resource provider name. + * + * @param provider the provider value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the localized resource type name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the localized resource type name. + * + * @param resource the resource value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the localized operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the localized operation name. + * + * @param operation the operation value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the localized operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the localized operation description. + * + * @param description the description value to set + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceProvisioningState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceProvisioningState.java new file mode 100644 index 0000000000000..a3a754a1e2dee --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceProvisioningState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceProvisioningState. + */ +public final class ServiceProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ServiceProvisioningState. */ + public static final ServiceProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ServiceProvisioningState. */ + public static final ServiceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deploying for ServiceProvisioningState. */ + public static final ServiceProvisioningState DEPLOYING = fromString("Deploying"); + + /** Static value Stopped for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPED = fromString("Stopped"); + + /** Static value Stopping for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPING = fromString("Stopping"); + + /** Static value Starting for ServiceProvisioningState. */ + public static final ServiceProvisioningState STARTING = fromString("Starting"); + + /** Static value FailedToStart for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_START = fromString("FailedToStart"); + + /** Static value FailedToStop for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_STOP = fromString("FailedToStop"); + + /** Static value Succeeded for ServiceProvisioningState. */ + public static final ServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ServiceProvisioningState + */ + @JsonCreator + public static ServiceProvisioningState fromString(String name) { + return fromString(name, ServiceProvisioningState.class); + } + + /** + * @return known ServiceProvisioningState values + */ + public static Collection values() { + return values(ServiceProvisioningState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceScalability.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceScalability.java new file mode 100644 index 0000000000000..6c6eec6315ce4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceScalability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceScalability. + */ +public final class ServiceScalability extends ExpandableStringEnum { + /** Static value none for ServiceScalability. */ + public static final ServiceScalability NONE = fromString("none"); + + /** Static value manual for ServiceScalability. */ + public static final ServiceScalability MANUAL = fromString("manual"); + + /** Static value automatic for ServiceScalability. */ + public static final ServiceScalability AUTOMATIC = fromString("automatic"); + + /** + * Creates or finds a ServiceScalability from its string representation. + * @param name a name to look for + * @return the corresponding ServiceScalability + */ + @JsonCreator + public static ServiceScalability fromString(String name) { + return fromString(name, ServiceScalability.class); + } + + /** + * @return known ServiceScalability values + */ + public static Collection values() { + return values(ServiceScalability.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceSku.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceSku.java new file mode 100644 index 0000000000000..7ab65e176b3cb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ServiceSku.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Azure SKU instance. + */ +public class ServiceSku { + /** + * The unique name of the SKU, such as 'P3'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business + * Critical'. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The SKU family, used when the service has multiple performance classes + * within a tier, such as 'A', 'D', etc. for virtual machines. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The size of the SKU, used when the name alone does not denote a service + * size or when a SKU has multiple performance classes within a family, + * e.g. 'A1' for virtual machines. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The capacity of the SKU, if it supports scaling. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the unique name of the SKU, such as 'P3'. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the SKU, such as 'P3'. + * + * @param name the name value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + * + * @param tier the tier value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines. + * + * @param family the family value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @param size the size value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the capacity of the SKU, if it supports scaling. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the SKU, if it supports scaling. + * + * @param capacity the capacity value to set + * @return the ServiceSku object itself. + */ + public ServiceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Services.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Services.java new file mode 100644 index 0000000000000..3b148ac5f048e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Services.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSku; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check service health status. + * The services resource is the top-level resource that represents the Database Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkStatusAsync(String groupName, String serviceName); + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String groupName, String serviceName); + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String groupName, String serviceName); + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters); + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusAsync(final String groupName, final String serviceName); + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Severity.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Severity.java new file mode 100644 index 0000000000000..67344eda2576a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Severity.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Message for Severity. */ + public static final Severity MESSAGE = fromString("Message"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates or finds a Severity from its string representation. + * @param name a name to look for + * @return the corresponding Severity + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * @return known Severity values + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlConnectionInfo.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlConnectionInfo.java new file mode 100644 index 0000000000000..efb235ec1b0ea --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlConnectionInfo.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information for connecting to SQL database server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SqlConnectionInfo") +public class SqlConnectionInfo extends ConnectionInfo { + /** + * Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /** + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /** + * Whether to encrypt the connection. + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /** + * Additional connection settings. + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /** + * Whether to trust the server certificate. + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /** + * Server platform type for connection. Possible values include: + * 'SqlOnPrem'. + */ + @JsonProperty(value = "platform") + private SqlSourcePlatform platform; + + /** + * Get data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @return the dataSource value + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @param dataSource the dataSource value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @return the authentication value + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set authentication type to use for connection. Possible values include: 'None', 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword'. + * + * @param authentication the authentication value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get whether to encrypt the connection. + * + * @return the encryptConnection value + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get additional connection settings. + * + * @return the additionalSettings value + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set additional connection settings. + * + * @param additionalSettings the additionalSettings value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get whether to trust the server certificate. + * + * @return the trustServerCertificate value + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get server platform type for connection. Possible values include: 'SqlOnPrem'. + * + * @return the platform value + */ + public SqlSourcePlatform platform() { + return this.platform; + } + + /** + * Set server platform type for connection. Possible values include: 'SqlOnPrem'. + * + * @param platform the platform value to set + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withPlatform(SqlSourcePlatform platform) { + this.platform = platform; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlMigrationTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlMigrationTaskInput.java new file mode 100644 index 0000000000000..e657cd0dda54a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlMigrationTaskInput.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for migration task input. + */ +public class SqlMigrationTaskInput { + /** + * Information for connecting to source. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlSourcePlatform.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlSourcePlatform.java new file mode 100644 index 0000000000000..ad1d76012d063 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SqlSourcePlatform.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SqlSourcePlatform. + */ +public final class SqlSourcePlatform extends ExpandableStringEnum { + /** Static value SqlOnPrem for SqlSourcePlatform. */ + public static final SqlSourcePlatform SQL_ON_PREM = fromString("SqlOnPrem"); + + /** + * Creates or finds a SqlSourcePlatform from its string representation. + * @param name a name to look for + * @return the corresponding SqlSourcePlatform + */ + @JsonCreator + public static SqlSourcePlatform fromString(String name) { + return fromString(name, SqlSourcePlatform.class); + } + + /** + * @return known SqlSourcePlatform values + */ + public static Collection values() { + return values(SqlSourcePlatform.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/StartMigrationScenarioServerRoleResult.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/StartMigrationScenarioServerRoleResult.java new file mode 100644 index 0000000000000..084ab9c9da47c --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/StartMigrationScenarioServerRoleResult.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Server role migration result. + */ +public class StartMigrationScenarioServerRoleResult { + /** + * Name of server role. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Current state of migration. Possible values include: 'None', + * 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /** + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get name of server role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get current state of migration. Possible values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped'. + * + * @return the state value + */ + public MigrationState state() { + return this.state; + } + + /** + * Get migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncDatabaseMigrationReportingState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncDatabaseMigrationReportingState.java new file mode 100644 index 0000000000000..cf9e805c5ee2d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncDatabaseMigrationReportingState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SyncDatabaseMigrationReportingState. + */ +public final class SyncDatabaseMigrationReportingState extends ExpandableStringEnum { + /** Static value UNDEFINED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState UNDEFINED = fromString("UNDEFINED"); + + /** Static value CONFIGURING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CONFIGURING = fromString("CONFIGURING"); + + /** Static value INITIALIAZING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState INITIALIAZING = fromString("INITIALIAZING"); + + /** Static value STARTING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState STARTING = fromString("STARTING"); + + /** Static value RUNNING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RUNNING = fromString("RUNNING"); + + /** Static value READY_TO_COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState READY_TO_COMPLETE = fromString("READY_TO_COMPLETE"); + + /** Static value COMPLETING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState COMPLETING = fromString("COMPLETING"); + + /** Static value COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState COMPLETE = fromString("COMPLETE"); + + /** Static value CANCELLING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CANCELLING = fromString("CANCELLING"); + + /** Static value CANCELLED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CANCELLED = fromString("CANCELLED"); + + /** Static value FAILED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState FAILED = fromString("FAILED"); + + /** + * Creates or finds a SyncDatabaseMigrationReportingState from its string representation. + * @param name a name to look for + * @return the corresponding SyncDatabaseMigrationReportingState + */ + @JsonCreator + public static SyncDatabaseMigrationReportingState fromString(String name) { + return fromString(name, SyncDatabaseMigrationReportingState.class); + } + + /** + * @return known SyncDatabaseMigrationReportingState values + */ + public static Collection values() { + return values(SyncDatabaseMigrationReportingState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncMigrationDatabaseErrorEvent.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncMigrationDatabaseErrorEvent.java new file mode 100644 index 0000000000000..501b4eab57d97 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncMigrationDatabaseErrorEvent.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Database migration errors for online migration. + */ +public class SyncMigrationDatabaseErrorEvent { + /** + * String value of timestamp. + */ + @JsonProperty(value = "timestampString", access = JsonProperty.Access.WRITE_ONLY) + private String timestampString; + + /** + * Event type. + */ + @JsonProperty(value = "eventTypeString", access = JsonProperty.Access.WRITE_ONLY) + private String eventTypeString; + + /** + * Event text. + */ + @JsonProperty(value = "eventText", access = JsonProperty.Access.WRITE_ONLY) + private String eventText; + + /** + * Get string value of timestamp. + * + * @return the timestampString value + */ + public String timestampString() { + return this.timestampString; + } + + /** + * Get event type. + * + * @return the eventTypeString value + */ + public String eventTypeString() { + return this.eventTypeString; + } + + /** + * Get event text. + * + * @return the eventText value + */ + public String eventText() { + return this.eventText; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncTableMigrationState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncTableMigrationState.java new file mode 100644 index 0000000000000..d2a7151049ce6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/SyncTableMigrationState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SyncTableMigrationState. + */ +public final class SyncTableMigrationState extends ExpandableStringEnum { + /** Static value BEFORE_LOAD for SyncTableMigrationState. */ + public static final SyncTableMigrationState BEFORE_LOAD = fromString("BEFORE_LOAD"); + + /** Static value FULL_LOAD for SyncTableMigrationState. */ + public static final SyncTableMigrationState FULL_LOAD = fromString("FULL_LOAD"); + + /** Static value COMPLETED for SyncTableMigrationState. */ + public static final SyncTableMigrationState COMPLETED = fromString("COMPLETED"); + + /** Static value CANCELED for SyncTableMigrationState. */ + public static final SyncTableMigrationState CANCELED = fromString("CANCELED"); + + /** Static value ERROR for SyncTableMigrationState. */ + public static final SyncTableMigrationState ERROR = fromString("ERROR"); + + /** Static value FAILED for SyncTableMigrationState. */ + public static final SyncTableMigrationState FAILED = fromString("FAILED"); + + /** + * Creates or finds a SyncTableMigrationState from its string representation. + * @param name a name to look for + * @return the corresponding SyncTableMigrationState + */ + @JsonCreator + public static SyncTableMigrationState fromString(String name) { + return fromString(name, SyncTableMigrationState.class); + } + + /** + * @return known SyncTableMigrationState values + */ + public static Collection values() { + return values(SyncTableMigrationState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/TaskState.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/TaskState.java new file mode 100644 index 0000000000000..c7cbe99eed970 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/TaskState.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TaskState. + */ +public final class TaskState extends ExpandableStringEnum { + /** Static value Unknown for TaskState. */ + public static final TaskState UNKNOWN = fromString("Unknown"); + + /** Static value Queued for TaskState. */ + public static final TaskState QUEUED = fromString("Queued"); + + /** Static value Running for TaskState. */ + public static final TaskState RUNNING = fromString("Running"); + + /** Static value Canceled for TaskState. */ + public static final TaskState CANCELED = fromString("Canceled"); + + /** Static value Succeeded for TaskState. */ + public static final TaskState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TaskState. */ + public static final TaskState FAILED = fromString("Failed"); + + /** Static value FailedInputValidation for TaskState. */ + public static final TaskState FAILED_INPUT_VALIDATION = fromString("FailedInputValidation"); + + /** Static value Faulted for TaskState. */ + public static final TaskState FAULTED = fromString("Faulted"); + + /** + * Creates or finds a TaskState from its string representation. + * @param name a name to look for + * @return the corresponding TaskState + */ + @JsonCreator + public static TaskState fromString(String name) { + return fromString(name, TaskState.class); + } + + /** + * @return known TaskState values + */ + public static Collection values() { + return values(TaskState.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Tasks.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Tasks.java new file mode 100644 index 0000000000000..6e2714c341118 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Tasks.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.CommandPropertiesInner; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.TasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tasks. + */ +public interface Tasks extends SupportsCreating, HasInner { + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Execute a command on a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Command to execute + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable commandAsync(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters); + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String groupName, String serviceName, String projectName, String taskName); + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String groupName, final String serviceName, final String projectName); + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/UpdateActionType.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/UpdateActionType.java new file mode 100644 index 0000000000000..e74e6729907bb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/UpdateActionType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateActionType. + */ +public final class UpdateActionType extends ExpandableStringEnum { + /** Static value DeletedOnTarget for UpdateActionType. */ + public static final UpdateActionType DELETED_ON_TARGET = fromString("DeletedOnTarget"); + + /** Static value ChangedOnTarget for UpdateActionType. */ + public static final UpdateActionType CHANGED_ON_TARGET = fromString("ChangedOnTarget"); + + /** Static value AddedOnTarget for UpdateActionType. */ + public static final UpdateActionType ADDED_ON_TARGET = fromString("AddedOnTarget"); + + /** + * Creates or finds a UpdateActionType from its string representation. + * @param name a name to look for + * @return the corresponding UpdateActionType + */ + @JsonCreator + public static UpdateActionType fromString(String name) { + return fromString(name, UpdateActionType.class); + } + + /** + * @return known UpdateActionType values + */ + public static Collection values() { + return values(UpdateActionType.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Usages.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Usages.java new file mode 100644 index 0000000000000..8aefaf040e7b4 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/Usages.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java new file mode 100644 index 0000000000000..ed8ee7cfda2c6 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that validates migration input for SQL to Azure SQL DB + * sync migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.SqlDb.Sync") +public class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ValidateSyncMigrationInputSqlServerTaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ValidateSyncMigrationInputSqlServerTaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ValidateMigrationInputSqlServerSqlDbSyncTaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties withInput(ValidateSyncMigrationInputSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java new file mode 100644 index 0000000000000..e43aad35cbacb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskInput.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that validates migration input for SQL to Azure SQL Managed + * Instance. + */ +public class ValidateMigrationInputSqlServerSqlMITaskInput { + /** + * Information for connecting to source. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Logins to migrate. + */ + @JsonProperty(value = "selectedLogins") + private List selectedLogins; + + /** + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /** + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /** + * Backup Mode to specify whether to use existing backup or create new + * backup. Possible values include: 'CreateBackup', 'ExistingBackup'. + */ + @JsonProperty(value = "backupMode") + private BackupMode backupMode; + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get logins to migrate. + * + * @return the selectedLogins value + */ + public List selectedLogins() { + return this.selectedLogins; + } + + /** + * Set logins to migrate. + * + * @param selectedLogins the selectedLogins value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSelectedLogins(List selectedLogins) { + this.selectedLogins = selectedLogins; + return this; + } + + /** + * Get backup file share information for all selected databases. + * + * @return the backupFileShare value + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set sAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + + /** + * Get backup Mode to specify whether to use existing backup or create new backup. Possible values include: 'CreateBackup', 'ExistingBackup'. + * + * @return the backupMode value + */ + public BackupMode backupMode() { + return this.backupMode; + } + + /** + * Set backup Mode to specify whether to use existing backup or create new backup. Possible values include: 'CreateBackup', 'ExistingBackup'. + * + * @param backupMode the backupMode value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { + this.backupMode = backupMode; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java new file mode 100644 index 0000000000000..9bd306fdf3b3a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskOutput.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for task that validates migration input for SQL to Azure SQL Managed + * Instance migrations. + */ +public class ValidateMigrationInputSqlServerSqlMITaskOutput { + /** + * Result identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Name of database. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Errors associated with the RestoreDatabaseName. + */ + @JsonProperty(value = "restoreDatabaseNameErrors", access = JsonProperty.Access.WRITE_ONLY) + private List restoreDatabaseNameErrors; + + /** + * Errors associated with the BackupFolder path. + */ + @JsonProperty(value = "backupFolderErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupFolderErrors; + + /** + * Errors associated with backup share user name and password credentials. + */ + @JsonProperty(value = "backupShareCredentialsErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupShareCredentialsErrors; + + /** + * Errors associated with the storage account provided. + */ + @JsonProperty(value = "backupStorageAccountErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupStorageAccountErrors; + + /** + * Errors associated with existing backup files. + */ + @JsonProperty(value = "existingBackupErrors", access = JsonProperty.Access.WRITE_ONLY) + private List existingBackupErrors; + + /** + * Information about backup files when existing backup mode is used. + */ + @JsonProperty(value = "databaseBackupInfo") + private DatabaseBackupInfo databaseBackupInfo; + + /** + * Get result identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get name of database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get errors associated with the RestoreDatabaseName. + * + * @return the restoreDatabaseNameErrors value + */ + public List restoreDatabaseNameErrors() { + return this.restoreDatabaseNameErrors; + } + + /** + * Get errors associated with the BackupFolder path. + * + * @return the backupFolderErrors value + */ + public List backupFolderErrors() { + return this.backupFolderErrors; + } + + /** + * Get errors associated with backup share user name and password credentials. + * + * @return the backupShareCredentialsErrors value + */ + public List backupShareCredentialsErrors() { + return this.backupShareCredentialsErrors; + } + + /** + * Get errors associated with the storage account provided. + * + * @return the backupStorageAccountErrors value + */ + public List backupStorageAccountErrors() { + return this.backupStorageAccountErrors; + } + + /** + * Get errors associated with existing backup files. + * + * @return the existingBackupErrors value + */ + public List existingBackupErrors() { + return this.existingBackupErrors; + } + + /** + * Get information about backup files when existing backup mode is used. + * + * @return the databaseBackupInfo value + */ + public DatabaseBackupInfo databaseBackupInfo() { + return this.databaseBackupInfo; + } + + /** + * Set information about backup files when existing backup mode is used. + * + * @param databaseBackupInfo the databaseBackupInfo value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskOutput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskOutput withDatabaseBackupInfo(DatabaseBackupInfo databaseBackupInfo) { + this.databaseBackupInfo = databaseBackupInfo; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java new file mode 100644 index 0000000000000..32aa5984b9d5d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMigrationInputSqlServerSqlMITaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for task that validates migration input for SQL to Azure SQL + * Database Managed Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI") +public class ValidateMigrationInputSqlServerSqlMITaskProperties extends ProjectTaskProperties { + /** + * Task input. + */ + @JsonProperty(value = "input") + private ValidateMigrationInputSqlServerSqlMITaskInput input; + + /** + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get task input. + * + * @return the input value + */ + public ValidateMigrationInputSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set task input. + * + * @param input the input value to set + * @return the ValidateMigrationInputSqlServerSqlMITaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskProperties withInput(ValidateMigrationInputSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get task output. This is ignored if submitted. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMongoDbTaskProperties.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMongoDbTaskProperties.java new file mode 100644 index 0000000000000..801eb27b1b070 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateMongoDbTaskProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties for the task that validates a migration between MongoDB data + * sources. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Validate.MongoDb") +public class ValidateMongoDbTaskProperties extends ProjectTaskProperties { + /** + * The input property. + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /** + * An array containing a single MongoDbMigrationProgress object. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input value. + * + * @return the input value + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input value. + * + * @param input the input value to set + * @return the ValidateMongoDbTaskProperties object itself. + */ + public ValidateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get an array containing a single MongoDbMigrationProgress object. + * + * @return the output value + */ + public List output() { + return this.output; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskInput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskInput.java new file mode 100644 index 0000000000000..20bf969e58090 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskInput.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for task that validates migration input for SQL sync migrations. + */ +public class ValidateSyncMigrationInputSqlServerTaskInput { + /** + * Information for connecting to source SQL server. + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Databases to migrate. + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get information for connecting to source SQL server. + * + * @return the sourceConnectionInfo value + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source SQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get databases to migrate. + * + * @return the selectedDatabases value + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskOutput.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskOutput.java new file mode 100644 index 0000000000000..cd289899b5ace --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidateSyncMigrationInputSqlServerTaskOutput.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for task that validates migration input for SQL sync migrations. + */ +public class ValidateSyncMigrationInputSqlServerTaskOutput { + /** + * Database identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Name of database. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Errors associated with a selected database object. + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get database identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get name of database. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get errors associated with a selected database object. + * + * @return the validationErrors value + */ + public List validationErrors() { + return this.validationErrors; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationError.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationError.java new file mode 100644 index 0000000000000..02281636cb893 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description about the errors happen while performing migration validation. + */ +public class ValidationError { + /** + * Error Text. + */ + @JsonProperty(value = "text") + private String text; + + /** + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error'. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /** + * Get error Text. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Set error Text. + * + * @param text the text value to set + * @return the ValidationError object itself. + */ + public ValidationError withText(String text) { + this.text = text; + return this; + } + + /** + * Get severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Set severity of the error. Possible values include: 'Message', 'Warning', 'Error'. + * + * @param severity the severity value to set + * @return the ValidationError object itself. + */ + public ValidationError withSeverity(Severity severity) { + this.severity = severity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationStatus.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationStatus.java new file mode 100644 index 0000000000000..67e3f577fab14 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/ValidationStatus.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ValidationStatus. + */ +public final class ValidationStatus extends ExpandableStringEnum { + /** Static value Default for ValidationStatus. */ + public static final ValidationStatus DEFAULT = fromString("Default"); + + /** Static value NotStarted for ValidationStatus. */ + public static final ValidationStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Initialized for ValidationStatus. */ + public static final ValidationStatus INITIALIZED = fromString("Initialized"); + + /** Static value InProgress for ValidationStatus. */ + public static final ValidationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for ValidationStatus. */ + public static final ValidationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithIssues for ValidationStatus. */ + public static final ValidationStatus COMPLETED_WITH_ISSUES = fromString("CompletedWithIssues"); + + /** Static value Stopped for ValidationStatus. */ + public static final ValidationStatus STOPPED = fromString("Stopped"); + + /** Static value Failed for ValidationStatus. */ + public static final ValidationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ValidationStatus from its string representation. + * @param name a name to look for + * @return the corresponding ValidationStatus + */ + @JsonCreator + public static ValidationStatus fromString(String name) { + return fromString(name, ValidationStatus.class); + } + + /** + * @return known ValidationStatus values + */ + public static Collection values() { + return values(ValidationStatus.class); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/WaitStatistics.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/WaitStatistics.java new file mode 100644 index 0000000000000..7fca168c6d349 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/WaitStatistics.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Wait statistics gathered during query batch execution. + */ +public class WaitStatistics { + /** + * Type of the Wait. + */ + @JsonProperty(value = "waitType") + private String waitType; + + /** + * Total wait time in millisecond(s). + */ + @JsonProperty(value = "waitTimeMs") + private Double waitTimeMs; + + /** + * Total no. of waits. + */ + @JsonProperty(value = "waitCount") + private Long waitCount; + + /** + * Get type of the Wait. + * + * @return the waitType value + */ + public String waitType() { + return this.waitType; + } + + /** + * Set type of the Wait. + * + * @param waitType the waitType value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitType(String waitType) { + this.waitType = waitType; + return this; + } + + /** + * Get total wait time in millisecond(s). + * + * @return the waitTimeMs value + */ + public Double waitTimeMs() { + return this.waitTimeMs; + } + + /** + * Set total wait time in millisecond(s). + * + * @param waitTimeMs the waitTimeMs value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitTimeMs(Double waitTimeMs) { + this.waitTimeMs = waitTimeMs; + return this; + } + + /** + * Get total no. of waits. + * + * @return the waitCount value + */ + public Long waitCount() { + return this.waitCount; + } + + /** + * Set total no. of waits. + * + * @param waitCount the waitCount value to set + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitCount(Long waitCount) { + this.waitCount = waitCount; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuImpl.java new file mode 100644 index 0000000000000..cf577e5be9175 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSkuSku; + +class AvailableServiceSkuImpl extends WrapperImpl implements AvailableServiceSku { + private final DataMigrationManager manager; + + AvailableServiceSkuImpl(AvailableServiceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public AvailableServiceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public AvailableServiceSkuSku sku() { + return this.inner().sku(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuInner.java new file mode 100644 index 0000000000000..c3effe8aa5bdf --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/AvailableServiceSkuInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSkuSku; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSkuCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the available service SKU. + */ +public class AvailableServiceSkuInner { + /** + * The resource type, including the provider namespace. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * SKU name, tier, etc. + */ + @JsonProperty(value = "sku") + private AvailableServiceSkuSku sku; + + /** + * A description of the scaling capacities of the SKU. + */ + @JsonProperty(value = "capacity") + private AvailableServiceSkuCapacity capacity; + + /** + * Get the resource type, including the provider namespace. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resource type, including the provider namespace. + * + * @param resourceType the resourceType value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get sKU name, tier, etc. + * + * @return the sku value + */ + public AvailableServiceSkuSku sku() { + return this.sku; + } + + /** + * Set sKU name, tier, etc. + * + * @param sku the sku value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withSku(AvailableServiceSkuSku sku) { + this.sku = sku; + return this; + } + + /** + * Get a description of the scaling capacities of the SKU. + * + * @return the capacity value + */ + public AvailableServiceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Set a description of the scaling capacities of the SKU. + * + * @param capacity the capacity value to set + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withCapacity(AvailableServiceSkuCapacity capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesImpl.java new file mode 100644 index 0000000000000..f63c9fbe84ae2 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.CommandProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ODataError; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.CommandState; + +class CommandPropertiesImpl extends WrapperImpl implements CommandProperties { + private final DataMigrationManager manager; + CommandPropertiesImpl(CommandPropertiesInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public List errors() { + return this.inner().errors(); + } + + @Override + public CommandState state() { + return this.inner().state(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesInner.java new file mode 100644 index 0000000000000..b998185e4b9d8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/CommandPropertiesInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.CommandState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToMongoDbTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToSourceMySqlTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToSourceSqlServerSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToSourceSqlServerTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToTargetAzureDbForMySqlTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToTargetSqlDbTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToTargetSqlMITaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectToTargetSqlSqlDbSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.GetTdeCertificatesSqlTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.GetUserTablesSqlSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.GetUserTablesSqlTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateMongoDbTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateMySqlAzureDbForMySqlSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateSchemaSqlServerSqlDbTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateSqlServerSqlDbSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateSqlServerSqlDbTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateSqlServerSqlMITaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MigrateSyncCompleteCommandProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MongoDbCancelCommand; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MongoDbConnectionInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MongoDbFinishCommand; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MongoDbRestartCommand; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.MySqlConnectionInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ODataError; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.PostgreSqlConnectionInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.SqlConnectionInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ValidateMigrationInputSqlServerSqlMITaskProperties; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ValidateMongoDbTaskProperties; + +import java.util.List; + +/** + * Base class for all types of DMS command properties. If command is not + * supported by current client, this object is returned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("Unknown") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), + @JsonSubTypes.Type(name = "PostgreSqlConnectionInfo", value = PostgreSqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MySqlConnectionInfo", value = MySqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MongoDbConnectionInfo", value = MongoDbConnectionInfo.class), + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "Validate.MongoDb", value = ValidateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "ValidateMigrationInput.SqlServer.SqlDb.Sync", value = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MySql.AzureDbForMySql.Sync", value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDb.Sync", value = MigrateSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureDbForMySql", value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.AzureSqlDb.Sync", value = GetUserTablesSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb.Sync", value = ConnectToTargetSqlSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer.Sync", value = ConnectToSourceSqlServerSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class), + @JsonSubTypes.Type(name = "Connect.MongoDb", value = ConnectToMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "MigrateSchemaSqlServerSqlDb", value = MigrateSchemaSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "cancel", value = MongoDbCancelCommand.class), + @JsonSubTypes.Type(name = "finish", value = MongoDbFinishCommand.class), + @JsonSubTypes.Type(name = "restart", value = MongoDbRestartCommand.class) +}) +public class CommandPropertiesInner { + /** + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * The state of the command. This is ignored if submitted. Possible values + * include: 'Unknown', 'Accepted', 'Running', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private CommandState state; + + /** + * Get array of errors. This is ignored if submitted. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Get the state of the command. This is ignored if submitted. Possible values include: 'Unknown', 'Accepted', 'Running', 'Succeeded', 'Failed'. + * + * @return the state value + */ + public CommandState state() { + return this.state; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationManager.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationManager.java new file mode 100644 index 0000000000000..62387e9320259 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkus; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Usages; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Operations; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataMigration resource management. + */ +public final class DataMigrationManager extends ManagerCore { + private ResourceSkus resourceSkus; + private Services services; + private Tasks tasks; + private Projects projects; + private Usages usages; + private Operations operations; + private Files files; + /** + * Get a Configurable instance that can be used to create DataMigrationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataMigrationManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataMigrationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataMigrationManager that exposes DataMigration resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataMigrationManager + */ + public static DataMigrationManager authenticate(RestClient restClient, String subscriptionId) { + return new DataMigrationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataMigrationManager that exposes DataMigration management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataMigration management API entry points that work across subscriptions + */ + DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ResourceSkus. + */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(this); + } + return this.resourceSkus; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage Tasks. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(this); + } + return this.tasks; + } + + /** + * @return Entry point to manage Projects. + */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(this); + } + return this.projects; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Files. + */ + public Files files() { + if (this.files == null) { + this.files = new FilesImpl(this); + } + return this.files; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataMigrationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataMigrationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataMigrationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataMigrationServiceClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceClientImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceClientImpl.java new file mode 100644 index 0000000000000..06f8c5be3b270 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceClientImpl.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataMigrationServiceClientImpl class. + */ +public class DataMigrationServiceClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Version of the API. */ + private String apiVersion; + + /** + * Gets Version of the API. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Identifier of the subscription. */ + private String subscriptionId; + + /** + * Gets Identifier of the subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Identifier of the subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataMigrationServiceClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ResourceSkusInner object to access its operations. + */ + private ResourceSkusInner resourceSkus; + + /** + * Gets the ResourceSkusInner object to access its operations. + * @return the ResourceSkusInner object. + */ + public ResourceSkusInner resourceSkus() { + return this.resourceSkus; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The TasksInner object to access its operations. + */ + private TasksInner tasks; + + /** + * Gets the TasksInner object to access its operations. + * @return the TasksInner object. + */ + public TasksInner tasks() { + return this.tasks; + } + + /** + * The ProjectsInner object to access its operations. + */ + private ProjectsInner projects; + + /** + * Gets the ProjectsInner object to access its operations. + * @return the ProjectsInner object. + */ + public ProjectsInner projects() { + return this.projects; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The FilesInner object to access its operations. + */ + private FilesInner files; + + /** + * Gets the FilesInner object to access its operations. + * @return the FilesInner object. + */ + public FilesInner files() { + return this.files; + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataMigrationServiceClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataMigrationServiceClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataMigrationServiceClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-07-15-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.tasks = new TasksInner(restClient().retrofit(), this); + this.projects = new ProjectsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.files = new FilesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataMigrationServiceClient", "2018-07-15-preview"); + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceImpl.java new file mode 100644 index 0000000000000..fe415e4e30bdf --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DataMigrationService; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceSku; + +class DataMigrationServiceImpl extends GroupableResourceCoreImpl implements DataMigrationService, DataMigrationService.Definition, DataMigrationService.Update { + DataMigrationServiceImpl(String name, DataMigrationServiceInner inner, DataMigrationManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public ServiceProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publicKey() { + return this.inner().publicKey(); + } + + @Override + public ServiceSku sku() { + return this.inner().sku(); + } + + @Override + public String virtualSubnetId() { + return this.inner().virtualSubnetId(); + } + + @Override + public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { + this.inner().withVirtualSubnetId(virtualSubnetId); + return this; + } + + @Override + public DataMigrationServiceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public DataMigrationServiceImpl withKind(String kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public DataMigrationServiceImpl withPublicKey(String publicKey) { + this.inner().withPublicKey(publicKey); + return this; + } + + @Override + public DataMigrationServiceImpl withSku(ServiceSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceInner.java new file mode 100644 index 0000000000000..901cb99863e50 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceProvisioningState; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A Database Migration Service resource. + */ +@JsonFlatten +public class DataMigrationServiceInner extends Resource { + /** + * HTTP strong entity tag value. Ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The resource kind. Only 'vm' (the default) is supported. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The resource's provisioning state. Possible values include: 'Accepted', + * 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceProvisioningState provisioningState; + + /** + * The public key of the service, used to encrypt secrets sent to the + * service. + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /** + * The ID of the Microsoft.Network/virtualNetworks/subnets resource to + * which the service should be joined. + */ + @JsonProperty(value = "properties.virtualSubnetId", required = true) + private String virtualSubnetId; + + /** + * Service SKU. + */ + @JsonProperty(value = "sku") + private ServiceSku sku; + + /** + * Get hTTP strong entity tag value. Ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. Ignored if submitted. + * + * @param etag the etag value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the resource kind. Only 'vm' (the default) is supported. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the resource kind. Only 'vm' (the default) is supported. + * + * @param kind the kind value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the resource's provisioning state. Possible values include: 'Accepted', 'Deleting', 'Deploying', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the public key of the service, used to encrypt secrets sent to the service. + * + * @param publicKey the publicKey value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @return the virtualSubnetId value + */ + public String virtualSubnetId() { + return this.virtualSubnetId; + } + + /** + * Set the ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined. + * + * @param virtualSubnetId the virtualSubnetId value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualSubnetId(String virtualSubnetId) { + this.virtualSubnetId = virtualSubnetId; + return this; + } + + /** + * Get service SKU. + * + * @return the sku value + */ + public ServiceSku sku() { + return this.sku; + } + + /** + * Set service SKU. + * + * @param sku the sku value to set + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withSku(ServiceSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java new file mode 100644 index 0000000000000..20d9944bec181 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DataMigrationServiceStatusResponseImpl extends WrapperImpl implements DataMigrationServiceStatusResponse { + private final DataMigrationManager manager; + DataMigrationServiceStatusResponseImpl(DataMigrationServiceStatusResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public List supportedTaskTypes() { + return this.inner().supportedTaskTypes(); + } + + @Override + public String vmSize() { + return this.inner().vmSize(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseInner.java new file mode 100644 index 0000000000000..092e6515a284b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/DataMigrationServiceStatusResponseInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service health status. + */ +public class DataMigrationServiceStatusResponseInner { + /** + * The DMS instance agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * The machine-readable status, such as 'Initializing', 'Offline', + * 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop' or 'Failed'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The services virtual machine size, such as 'Standard_D2_v2'. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * The list of supported task types. + */ + @JsonProperty(value = "supportedTaskTypes") + private List supportedTaskTypes; + + /** + * Get the DMS instance agent version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the DMS instance agent version. + * + * @param agentVersion the agentVersion value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @param status the status value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the services virtual machine size, such as 'Standard_D2_v2'. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the services virtual machine size, such as 'Standard_D2_v2'. + * + * @param vmSize the vmSize value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the list of supported task types. + * + * @return the supportedTaskTypes value + */ + public List supportedTaskTypes() { + return this.supportedTaskTypes; + } + + /** + * Set the list of supported task types. + * + * @param supportedTaskTypes the supportedTaskTypes value to set + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withSupportedTaskTypes(List supportedTaskTypes) { + this.supportedTaskTypes = supportedTaskTypes; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoImpl.java new file mode 100644 index 0000000000000..25f4eb5361e49 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.FileStorageInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class FileStorageInfoImpl extends WrapperImpl implements FileStorageInfo { + private final DataMigrationManager manager; + FileStorageInfoImpl(FileStorageInfoInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Map headers() { + return this.inner().headers(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoInner.java new file mode 100644 index 0000000000000..b38d7e91e1505 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FileStorageInfoInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * File storage information. + */ +public class FileStorageInfoInner { + /** + * A URI that can be used to access the file content. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The headers property. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * Get a URI that can be used to access the file content. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set a URI that can be used to access the file content. + * + * @param uri the uri value to set + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the headers value. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers value. + * + * @param headers the headers value to set + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withHeaders(Map headers) { + this.headers = headers; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesImpl.java new file mode 100644 index 0000000000000..c4ed7c4bc8fbb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.FileStorageInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectFile; + +class FilesImpl extends WrapperImpl implements Files { + private final DataMigrationManager manager; + + FilesImpl(DataMigrationManager manager) { + super(manager.inner().files()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectFileImpl define(String name) { + return wrapModel(name); + } + + private ProjectFileImpl wrapModel(ProjectFileInner inner) { + return new ProjectFileImpl(inner, manager()); + } + + private ProjectFileImpl wrapModel(String name) { + return new ProjectFileImpl(name, this.manager()); + } + + @Override + public Observable readAsync(String groupName, String serviceName, String projectName, String fileName) { + FilesInner client = this.inner(); + return client.readAsync(groupName, serviceName, projectName, fileName) + .map(new Func1() { + @Override + public FileStorageInfo call(FileStorageInfoInner inner) { + return new FileStorageInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable readWriteAsync(String groupName, String serviceName, String projectName, String fileName) { + FilesInner client = this.inner(); + return client.readWriteAsync(groupName, serviceName, projectName, fileName) + .map(new Func1() { + @Override + public FileStorageInfo call(FileStorageInfoInner inner) { + return new FileStorageInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName, final String projectName) { + FilesInner client = this.inner(); + return client.listAsync(groupName, serviceName, projectName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProjectFile call(ProjectFileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName, String fileName) { + FilesInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName, fileName) + .map(new Func1() { + @Override + public ProjectFile call(ProjectFileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName, String fileName) { + FilesInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName, fileName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesInner.java new file mode 100644 index 0000000000000..6ee4a0433963a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/FilesInner.java @@ -0,0 +1,993 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Files. + */ +public class FilesInner { + /** The Retrofit service to perform REST calls. */ + private FilesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of FilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FilesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(FilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Files to be + * used by Retrofit to perform actually REST calls. + */ + interface FilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Body ProjectFileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Body ProjectFileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files read" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read") + Observable> read(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files readWrite" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite") + Observable> readWrite(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("fileName") String fileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Files listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectFileInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectFileInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName) { + return listWithServiceResponseAsync(groupName, serviceName, projectName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectFileInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName) { + return listSinglePageAsync(groupName, serviceName, projectName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + ServiceResponse> * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectFileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get file information. + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectFileInner object if successful. + */ + public ProjectFileInner get(String groupName, String serviceName, String projectName, String fileName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, fileName).toBlocking().single().body(); + } + + /** + * Get file information. + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String fileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, fileName), serviceCallback); + } + + /** + * Get file information. + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String fileName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1, ProjectFileInner>() { + @Override + public ProjectFileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get file information. + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a file resource. + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectFileInner object if successful. + */ + public ProjectFileInner createOrUpdate(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).toBlocking().single().body(); + } + + /** + * Create a file resource. + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters), serviceCallback); + } + + /** + * Create a file resource. + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1, ProjectFileInner>() { + @Override + public ProjectFileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a file resource. + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete file. + * This method deletes a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String fileName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).toBlocking().single().body(); + } + + /** + * Delete file. + * This method deletes a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String fileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, fileName), serviceCallback); + } + + /** + * Delete file. + * This method deletes a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String fileName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete file. + * This method deletes a file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a file. + * This method updates an existing file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectFileInner object if successful. + */ + public ProjectFileInner update(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).toBlocking().single().body(); + } + + /** + * Update a file. + * This method updates an existing file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters), serviceCallback); + } + + /** + * Update a file. + * This method updates an existing file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1, ProjectFileInner>() { + @Override + public ProjectFileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a file. + * This method updates an existing file. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param parameters Information about the file + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectFileInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Request storage information for downloading the file content. + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FileStorageInfoInner object if successful. + */ + public FileStorageInfoInner read(String groupName, String serviceName, String projectName, String fileName) { + return readWithServiceResponseAsync(groupName, serviceName, projectName, fileName).toBlocking().single().body(); + } + + /** + * Request storage information for downloading the file content. + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture readAsync(String groupName, String serviceName, String projectName, String fileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(readWithServiceResponseAsync(groupName, serviceName, projectName, fileName), serviceCallback); + } + + /** + * Request storage information for downloading the file content. + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileStorageInfoInner object + */ + public Observable readAsync(String groupName, String serviceName, String projectName, String fileName) { + return readWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1, FileStorageInfoInner>() { + @Override + public FileStorageInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Request storage information for downloading the file content. + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileStorageInfoInner object + */ + public Observable> readWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.read(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = readDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse readDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Request information for reading and writing file content. + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FileStorageInfoInner object if successful. + */ + public FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName) { + return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).toBlocking().single().body(); + } + + /** + * Request information for reading and writing file content. + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture readWriteAsync(String groupName, String serviceName, String projectName, String fileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName), serviceCallback); + } + + /** + * Request information for reading and writing file content. + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileStorageInfoInner object + */ + public Observable readWriteAsync(String groupName, String serviceName, String projectName, String fileName) { + return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1, FileStorageInfoInner>() { + @Override + public FileStorageInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Request information for reading and writing file content. + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param fileName Name of the File + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileStorageInfoInner object + */ + public Observable> readWriteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String fileName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.readWrite(this.client.subscriptionId(), groupName, serviceName, projectName, fileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = readWriteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse readWriteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectFileInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectFileInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectFileInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get files in a project. + * The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectFileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/IdParsingUtils.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..da7d4b7e57f91 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..ea783df1b207a --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameAvailabilityResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameCheckFailureReason; + +class NameAvailabilityResponseImpl extends WrapperImpl implements NameAvailabilityResponse { + private final DataMigrationManager manager; + NameAvailabilityResponseImpl(NameAvailabilityResponseInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public NameCheckFailureReason reason() { + return this.inner().reason(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..7ac67e8220074 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/NameAvailabilityResponseInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameCheckFailureReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Indicates whether a proposed resource name is available. + */ +public class NameAvailabilityResponseInner { + /** + * If true, the name is valid and available. If false, 'reason' describes + * why not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, if nameAvailable is false. + * Possible values include: 'AlreadyExists', 'Invalid'. + */ + @JsonProperty(value = "reason") + private NameCheckFailureReason reason; + + /** + * The localized reason why the name is not available, if nameAvailable is + * false. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get if true, the name is valid and available. If false, 'reason' describes why not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set if true, the name is valid and available. If false, 'reason' describes why not. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @return the reason value + */ + public NameCheckFailureReason reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, if nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid'. + * + * @param reason the reason value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withReason(NameCheckFailureReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the localized reason why the name is not available, if nameAvailable is false. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the localized reason why the name is not available, if nameAvailable is false. + * + * @param message the message value to set + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c69df9c06b11f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceOperation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataMigrationManager manager; + + OperationsImpl(DataMigrationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceOperation call(ServiceOperationInner inner) { + return new ServiceOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..3348e184a8683 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Operations list" }) + @GET("providers/Microsoft.DataMigration/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get available resource provider actions (operations). + * Lists all available actions exposed by the Database Migration Service resource provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/PageImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..543af4aa7f53f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileImpl.java new file mode 100644 index 0000000000000..3b16c453c05d5 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectFile; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectFileProperties; + +class ProjectFileImpl extends CreatableUpdatableImpl implements ProjectFile, ProjectFile.Definition, ProjectFile.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + private String fileName; + + ProjectFileImpl(String name, DataMigrationManager manager) { + super(name, new ProjectFileInner()); + this.manager = manager; + // Set resource name + this.fileName = name; + // + } + + ProjectFileImpl(ProjectFileInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.fileName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + this.fileName = IdParsingUtils.getValueFromIdByName(inner.id(), "files"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FilesInner client = this.manager().inner().files(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.fileName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FilesInner client = this.manager().inner().files(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.fileName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FilesInner client = this.manager().inner().files(); + return client.getAsync(this.groupName, this.serviceName, this.projectName, this.fileName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectFileProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectFileImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + @Override + public ProjectFileImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ProjectFileImpl withProperties(ProjectFileProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileInner.java new file mode 100644 index 0000000000000..cba4a445f98fa --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectFileInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectFileProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A file resource. + */ +public class ProjectFileInner extends ProxyResource { + /** + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Custom file properties. + */ + @JsonProperty(value = "properties") + private ProjectFileProperties properties; + + /** + * Get hTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get custom file properties. + * + * @return the properties value + */ + public ProjectFileProperties properties() { + return this.properties; + } + + /** + * Set custom file properties. + * + * @param properties the properties value to set + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withProperties(ProjectFileProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectImpl.java new file mode 100644 index 0000000000000..358bf2275fc0f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Project; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectProvisioningState; + +class ProjectImpl extends CreatableUpdatableImpl implements Project, Project.Definition, Project.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + + ProjectImpl(String name, DataMigrationManager manager) { + super(name, new ProjectInner()); + this.manager = manager; + // Set resource name + this.projectName = name; + // + } + + ProjectImpl(ProjectInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.projectName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProjectsInner client = this.manager().inner().projects(); + return client.getAsync(this.groupName, this.serviceName, this.projectName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List databasesInfo() { + return this.inner().databasesInfo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionInfo sourceConnectionInfo() { + return this.inner().sourceConnectionInfo(); + } + + @Override + public ProjectSourcePlatform sourcePlatform() { + return this.inner().sourcePlatform(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public ConnectionInfo targetConnectionInfo() { + return this.inner().targetConnectionInfo(); + } + + @Override + public ProjectTargetPlatform targetPlatform() { + return this.inner().targetPlatform(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectImpl withExistingService(String groupName, String serviceName) { + this.groupName = groupName; + this.serviceName = serviceName; + return this; + } + + @Override + public ProjectImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.inner().withSourcePlatform(sourcePlatform); + return this; + } + + @Override + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.inner().withTargetPlatform(targetPlatform); + return this; + } + + @Override + public ProjectImpl withDatabasesInfo(List databasesInfo) { + this.inner().withDatabasesInfo(databasesInfo); + return this; + } + + @Override + public ProjectImpl withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.inner().withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + @Override + public ProjectImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public ProjectImpl withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.inner().withTargetConnectionInfo(targetConnectionInfo); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectInner.java new file mode 100644 index 0000000000000..e7aba6c2a0d42 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectInner.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectSourcePlatform; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTargetPlatform; +import org.joda.time.DateTime; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ConnectionInfo; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DatabaseInfo; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A project resource. + */ +@JsonFlatten +public class ProjectInner extends Resource { + /** + * Source platform for the project. Possible values include: 'SQL', + * 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown'. + */ + @JsonProperty(value = "properties.sourcePlatform", required = true) + private ProjectSourcePlatform sourcePlatform; + + /** + * Target platform for the project. Possible values include: 'SQLDB', + * 'SQLMI', 'AzureDbForMySql', 'AzureDbForPostgreSql', 'MongoDb', + * 'Unknown'. + */ + @JsonProperty(value = "properties.targetPlatform", required = true) + private ProjectTargetPlatform targetPlatform; + + /** + * UTC Date and time when project was created. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Information for connecting to source. + */ + @JsonProperty(value = "properties.sourceConnectionInfo") + private ConnectionInfo sourceConnectionInfo; + + /** + * Information for connecting to target. + */ + @JsonProperty(value = "properties.targetConnectionInfo") + private ConnectionInfo targetConnectionInfo; + + /** + * List of DatabaseInfo. + */ + @JsonProperty(value = "properties.databasesInfo") + private List databasesInfo; + + /** + * The project's provisioning state. Possible values include: 'Deleting', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProjectProvisioningState provisioningState; + + /** + * Get source platform for the project. Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown'. + * + * @return the sourcePlatform value + */ + public ProjectSourcePlatform sourcePlatform() { + return this.sourcePlatform; + } + + /** + * Set source platform for the project. Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown'. + * + * @param sourcePlatform the sourcePlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.sourcePlatform = sourcePlatform; + return this; + } + + /** + * Get target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', 'AzureDbForPostgreSql', 'MongoDb', 'Unknown'. + * + * @return the targetPlatform value + */ + public ProjectTargetPlatform targetPlatform() { + return this.targetPlatform; + } + + /** + * Set target platform for the project. Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', 'AzureDbForPostgreSql', 'MongoDb', 'Unknown'. + * + * @param targetPlatform the targetPlatform value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get uTC Date and time when project was created. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get information for connecting to source. + * + * @return the sourceConnectionInfo value + */ + public ConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get information for connecting to target. + * + * @return the targetConnectionInfo value + */ + public ConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get list of DatabaseInfo. + * + * @return the databasesInfo value + */ + public List databasesInfo() { + return this.databasesInfo; + } + + /** + * Set list of DatabaseInfo. + * + * @param databasesInfo the databasesInfo value to set + * @return the ProjectInner object itself. + */ + public ProjectInner withDatabasesInfo(List databasesInfo) { + this.databasesInfo = databasesInfo; + return this; + } + + /** + * Get the project's provisioning state. Possible values include: 'Deleting', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProjectProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskImpl.java new file mode 100644 index 0000000000000..134166cc7f2fd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTask; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTaskProperties; + +class ProjectTaskImpl extends CreatableUpdatableImpl implements ProjectTask, ProjectTask.Definition, ProjectTask.Update { + private final DataMigrationManager manager; + private String groupName; + private String serviceName; + private String projectName; + private String taskName; + + ProjectTaskImpl(String name, DataMigrationManager manager) { + super(name, new ProjectTaskInner()); + this.manager = manager; + // Set resource name + this.taskName = name; + // + } + + ProjectTaskImpl(ProjectTaskInner inner, DataMigrationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskName = inner.name(); + // set resource ancestor and positional variables + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.projectName = IdParsingUtils.getValueFromIdByName(inner.id(), "projects"); + this.taskName = IdParsingUtils.getValueFromIdByName(inner.id(), "tasks"); + // + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.createOrUpdateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.updateAsync(this.groupName, this.serviceName, this.projectName, this.taskName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.getAsync(this.groupName, this.serviceName, this.projectName, this.taskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProjectTaskProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ProjectTaskImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + @Override + public ProjectTaskImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ProjectTaskImpl withProperties(ProjectTaskProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskInner.java new file mode 100644 index 0000000000000..fa717e7f0ae48 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectTaskInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTaskProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A task resource. + */ +public class ProjectTaskInner extends ProxyResource { + /** + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Custom task properties. + */ + @JsonProperty(value = "properties") + private ProjectTaskProperties properties; + + /** + * Get hTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set hTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get custom task properties. + * + * @return the properties value + */ + public ProjectTaskProperties properties() { + return this.properties; + } + + /** + * Set custom task properties. + * + * @param properties the properties value to set + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withProperties(ProjectTaskProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsImpl.java new file mode 100644 index 0000000000000..62f5a89f7e51e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Project; + +class ProjectsImpl extends WrapperImpl implements Projects { + private final DataMigrationManager manager; + + ProjectsImpl(DataMigrationManager manager) { + super(manager.inner().projects()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectImpl define(String name) { + return wrapModel(name); + } + + private ProjectImpl wrapModel(ProjectInner inner) { + return new ProjectImpl(inner, manager()); + } + + private ProjectImpl wrapModel(String name) { + return new ProjectImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName) { + ProjectsInner client = this.inner(); + return client.listAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName) + .map(new Func1() { + @Override + public Project call(ProjectInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName) { + ProjectsInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsInner.java new file mode 100644 index 0000000000000..a35e6438c61ca --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ProjectsInner.java @@ -0,0 +1,834 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Projects. + */ +public class ProjectsInner { + /** The Retrofit service to perform REST calls. */ + private ProjectsService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ProjectsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProjectsInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ProjectsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Projects to be + * used by Retrofit to perform actually REST calls. + */ + interface ProjectsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Body ProjectInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Projects listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName) { + return listWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update project. + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner get(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get project information. + * The project resource is a nested resource representing a stored migration project. The GET method retrieves information about a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete project. + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectInner object if successful. + */ + public ProjectInner update(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body(); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters), serviceCallback); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).map(new Func1, ProjectInner>() { + @Override + public ProjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update project. + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an existing project. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param parameters Information about the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get projects in a service. + * The project resource is a nested resource representing a stored migration project. This method returns a list of projects owned by a service resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaImpl.java new file mode 100644 index 0000000000000..ddd6abaf86c8e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Quota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.QuotaName; + +class QuotaImpl extends WrapperImpl implements Quota { + private final DataMigrationManager manager; + + QuotaImpl(QuotaInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public QuotaName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaInner.java new file mode 100644 index 0000000000000..3a12c15fc7d18 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/QuotaInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.QuotaName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a quota for or usage details about a resource. + */ +public class QuotaInner { + /** + * The current value of the quota. If null or missing, the current value + * cannot be determined in the context of the request. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /** + * The resource ID of the quota object. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The maximum value of the quota. If null or missing, the quota has no + * maximum, in which case it merely tracks usage. + */ + @JsonProperty(value = "limit") + private Double limit; + + /** + * The name of the quota. + */ + @JsonProperty(value = "name") + private QuotaName name; + + /** + * The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the quota. If null or missing, the current value cannot be determined in the context of the request. + * + * @param currentValue the currentValue value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the resource ID of the quota object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the quota object. + * + * @param id the id value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Set the maximum value of the quota. If null or missing, the quota has no maximum, in which case it merely tracks usage. + * + * @param limit the limit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the quota. + * + * @return the name value + */ + public QuotaName name() { + return this.name; + } + + /** + * Set the name of the quota. + * + * @param name the name value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withName(QuotaName name) { + this.name = name; + return this; + } + + /** + * Get the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @param unit the unit value to set + * @return the QuotaInner object itself. + */ + public QuotaInner withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..c67c7be80e2b9 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCapacity; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuRestrictions; + +class ResourceSkuImpl extends WrapperImpl implements ResourceSku { + private final DataMigrationManager manager; + ResourceSkuImpl(ResourceSkuInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public List apiVersions() { + return this.inner().apiVersions(); + } + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public ResourceSkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public List costs() { + return this.inner().costs(); + } + + @Override + public String family() { + return this.inner().family(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String size() { + return this.inner().size(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuInner.java new file mode 100644 index 0000000000000..012a481044f8e --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkuInner.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCapacity; +import java.util.List; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCosts; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuCapabilities; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an available DMS SKU. + */ +public class ResourceSkuInner { + /** + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Specifies the tier of DMS in a scale set. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /** + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /** + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Not used. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /** + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /** + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the type of resource the SKU applies to. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get specifies the tier of DMS in a scale set. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the Size of the SKU. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Get the Family of this particular SKU. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Get the Kind of resources that are supported in this SKU. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Get not used. + * + * @return the capacity value + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the api versions that support this SKU. + * + * @return the apiVersions value + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get metadata for retrieving price info. + * + * @return the costs value + */ + public List costs() { + return this.costs; + } + + /** + * Get a name value pair to describe the capability. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusImpl.java new file mode 100644 index 0000000000000..bc56b655ed26d --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSku; + +class ResourceSkusImpl extends WrapperImpl implements ResourceSkus { + private final DataMigrationManager manager; + + ResourceSkusImpl(DataMigrationManager manager) { + super(manager.inner().resourceSkus()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + ResourceSkusInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceSku call(ResourceSkuInner inner) { + return new ResourceSkuImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusInner.java new file mode 100644 index 0000000000000..5856dee2c8835 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ResourceSkusInner.java @@ -0,0 +1,297 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ResourceSkus. + */ +public class ResourceSkusInner { + /** The Retrofit service to perform REST calls. */ + private ResourceSkusService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ResourceSkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourceSkusInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ResourceSkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourceSkus to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourceSkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ResourceSkus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get supported SKUs. + * The skus action returns the list of SKUs that DMS supports. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationImpl.java new file mode 100644 index 0000000000000..884368895d03b --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceOperationDisplay; + +class ServiceOperationImpl extends WrapperImpl implements ServiceOperation { + private final DataMigrationManager manager; + ServiceOperationImpl(ServiceOperationInner inner, DataMigrationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ServiceOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationInner.java new file mode 100644 index 0000000000000..181f776a29bdd --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServiceOperationInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ServiceOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of an action supported by the Database Migration Service. + */ +public class ServiceOperationInner { + /** + * The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized display text. + */ + @JsonProperty(value = "display") + private ServiceOperationDisplay display; + + /** + * Get the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @param name the name value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized display text. + * + * @return the display value + */ + public ServiceOperationDisplay display() { + return this.display; + } + + /** + * Set localized display text. + * + * @param display the display value to set + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..7c2a3ee9621eb --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesImpl.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DataMigrationService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.DataMigrationServiceStatusResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameAvailabilityResponse; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameAvailabilityRequest; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.AvailableServiceSku; + +class ServicesImpl extends GroupableResourcesCoreImpl implements Services { + protected ServicesImpl(DataMigrationManager manager) { + super(manager.inner().services(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataMigrationService call(DataMigrationServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataMigrationServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkStatusAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.checkStatusAsync(groupName, serviceName) + .map(new Func1() { + @Override + public DataMigrationServiceStatusResponse call(DataMigrationServiceStatusResponseInner inner) { + return new DataMigrationServiceStatusResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable startAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.startAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Completable stopAsync(String groupName, String serviceName) { + ServicesInner client = this.inner(); + return client.stopAsync(groupName, serviceName).toCompletable(); + } + + @Override + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkChildrenNameAvailabilityAsync(groupName, serviceName, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + protected DataMigrationServiceImpl wrapModel(DataMigrationServiceInner inner) { + return new DataMigrationServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected DataMigrationServiceImpl wrapModel(String name) { + return new DataMigrationServiceImpl(name, new DataMigrationServiceInner(), this.manager()); + } + + private AvailableServiceSkuImpl wrapAvailableServiceSkuModel(AvailableServiceSkuInner inner) { + return new AvailableServiceSkuImpl(inner, manager()); + } + + @Override + public Observable listSkusAsync(final String groupName, final String serviceName) { + ServicesInner client = this.inner(); + return client.listSkusAsync(groupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailableServiceSku call(AvailableServiceSkuInner inner) { + return wrapAvailableServiceSkuModel(inner); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, parameters) + .map(new Func1() { + @Override + public NameAvailabilityResponse call(NameAvailabilityResponseInner inner) { + return new NameAvailabilityResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesInner.java new file mode 100644 index 0000000000000..190cf88a205f1 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/ServicesInner.java @@ -0,0 +1,2240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.NameAvailabilityRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Body DataMigrationServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services checkStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus") + Observable> checkStatus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services listSkus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus") + Observable> listSkus(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services checkChildrenNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability") + Observable> checkChildrenNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services listSkusNext" }) + @GET + Observable> listSkusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, although other kinds may be added in the future. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations use the provisioningState property. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable getByResourceGroupAsync(String groupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName) { + deleteWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName) { + return deleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().last().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName) { + beginDeleteWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String groupName, String serviceName, Boolean deleteRunningTasks) { + beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + return beginDeleteWithServiceResponseAsync(groupName, serviceName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), groupName, serviceName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceInner object if successful. + */ + public DataMigrationServiceInner beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, DataMigrationServiceInner>() { + @Override + public DataMigrationServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DMS Service Instance. + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Information about the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), groupName, serviceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Database Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMigrationServiceStatusResponseInner object if successful. + */ + public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Database Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkStatusAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkStatusWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Database Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable checkStatusAsync(String groupName, String serviceName) { + return checkStatusWithServiceResponseAsync(groupName, serviceName).map(new Func1, DataMigrationServiceStatusResponseInner>() { + @Override + public DataMigrationServiceStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check service health status. + * The services resource is the top-level resource that represents the Database Migration Service. This action performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMigrationServiceStatusResponseInner object + */ + public Observable> checkStatusWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.checkStatus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkStatusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String groupName, String serviceName) { + startWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String groupName, String serviceName) { + return startWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String groupName, String serviceName) { + beginStartWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String groupName, String serviceName) { + return beginStartWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start service. + * The services resource is the top-level resource that represents the Database Migration Service. This action starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String groupName, String serviceName) { + stopWithServiceResponseAsync(groupName, serviceName).toBlocking().last().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String groupName, String serviceName) { + return stopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String groupName, String serviceName) { + beginStopWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String groupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(groupName, serviceName), serviceCallback); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String groupName, String serviceName) { + return beginStopWithServiceResponseAsync(groupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop service. + * The services resource is the top-level resource that represents the Database Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String groupName, String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkus(final String groupName, final String serviceName) { + ServiceResponse> response = listSkusSinglePageAsync(groupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusAsync(final String groupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusSinglePageAsync(groupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusAsync(final String groupName, final String serviceName) { + return listSkusWithServiceResponseAsync(groupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusWithServiceResponseAsync(final String groupName, final String serviceName) { + return listSkusSinglePageAsync(groupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusSinglePageAsync(final String groupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkus(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body(); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters), serviceCallback); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check nested resource name validity and availability. + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkChildrenNameAvailabilityWithServiceResponseAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkChildrenNameAvailability(this.client.subscriptionId(), groupName, serviceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkChildrenNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkChildrenNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String groupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(groupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String groupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(groupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String groupName) { + return listByResourceGroupWithServiceResponseAsync(groupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String groupName) { + return listByResourceGroupSinglePageAsync(groupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param groupName Name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String groupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), groupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityResponseInner object if successful. + */ + public NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityResponseInner>() { + @Override + public NameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check name validity and availability. + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation + * @param parameters Requested name to validate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityResponseInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableServiceSkuInner> object if successful. + */ + public PagedList listSkusNext(final String nextPageLink) { + ServiceResponse> response = listSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSkusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable> listSkusNextAsync(final String nextPageLink) { + return listSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableServiceSkuInner> object + */ + public Observable>> listSkusNextWithServiceResponseAsync(final String nextPageLink) { + return listSkusNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get compatible SKUs. + * The services resource is the top-level resource that represents the Database Migration Service. The skus action returns the list of SKUs that a service resource can be updated to. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableServiceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSkusNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSkusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in resource group. + * The Services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataMigrationServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataMigrationServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get services in subscription. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of service resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataMigrationServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksImpl.java new file mode 100644 index 0000000000000..c0ac2cda4069f --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ProjectTask; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.CommandProperties; + +class TasksImpl extends WrapperImpl implements Tasks { + private final DataMigrationManager manager; + + TasksImpl(DataMigrationManager manager) { + super(manager.inner().tasks()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + @Override + public ProjectTaskImpl define(String name) { + return wrapModel(name); + } + + private ProjectTaskImpl wrapModel(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + + private ProjectTaskImpl wrapModel(String name) { + return new ProjectTaskImpl(name, this.manager()); + } + + @Override + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.cancelAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return new ProjectTaskImpl(inner, manager()); + } + }); + } + + @Override + public Observable commandAsync(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + TasksInner client = this.inner(); + return client.commandAsync(groupName, serviceName, projectName, taskName, parameters) + .map(new Func1() { + @Override + public CommandProperties call(CommandPropertiesInner inner) { + return new CommandPropertiesImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String groupName, final String serviceName, final String projectName) { + TasksInner client = this.inner(); + return client.listAsync(groupName, serviceName, projectName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.getAsync(groupName, serviceName, projectName, taskName) + .map(new Func1() { + @Override + public ProjectTask call(ProjectTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + TasksInner client = this.inner(); + return client.deleteAsync(groupName, serviceName, projectName, taskName).toCompletable(); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksInner.java new file mode 100644 index 0000000000000..30f6e97bad0ad --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/TasksInner.java @@ -0,0 +1,1339 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tasks. + */ +public class TasksInner { + /** The Retrofit service to perform REST calls. */ + private TasksService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of TasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TasksInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(TasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tasks to be + * used by Retrofit to perform actually REST calls. + */ + interface TasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Query("api-version") String apiVersion, @Query("taskType") String taskType, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("deleteRunningTasks") Boolean deleteRunningTasks, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Body ProjectTaskInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks command" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command") + Observable> command(@Path("subscriptionId") String subscriptionId, @Path("groupName") String groupName, @Path("serviceName") String serviceName, @Path("projectName") String projectName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body CommandPropertiesInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Tasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName) { + return listWithServiceResponseAsync(groupName, serviceName, projectName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName) { + return listSinglePageAsync(groupName, serviceName, projectName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String taskType = null; + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList list(final String groupName, final String serviceName, final String projectName, final String taskType) { + ServiceResponse> response = listSinglePageAsync(groupName, serviceName, projectName, taskType).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(groupName, serviceName, projectName, taskType), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listWithServiceResponseAsync(groupName, serviceName, projectName, taskType) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + return listSinglePageAsync(groupName, serviceName, projectName, taskType) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param groupName Name of the resource group + ServiceResponse> * @param serviceName Name of the service + ServiceResponse> * @param projectName Name of the project + ServiceResponse> * @param taskType Filter tasks by task type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String groupName, final String serviceName, final String projectName, final String taskType) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), groupName, serviceName, projectName, this.client.apiVersion(), taskType, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner createOrUpdate(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an exising one. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).toBlocking().single().body(); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String groupName, String serviceName, String projectName, String taskName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand), serviceCallback); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable getAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName, expand).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get task information. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param expand Expand the response + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> getWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean deleteRunningTasks = null; + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).toBlocking().single().body(); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks), serviceCallback); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + return deleteWithServiceResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param deleteRunningTasks Delete the resource even if it contains running tasks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, deleteRunningTasks, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner update(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable updateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Information about the task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> updateWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProjectTaskInner object if successful. + */ + public ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body(); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String groupName, String serviceName, String projectName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName), serviceCallback); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable cancelAsync(String groupName, String serviceName, String projectName, String taskName) { + return cancelWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1, ProjectTaskInner>() { + @Override + public ProjectTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProjectTaskInner object + */ + public Observable> cancelWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancel(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Execute a command on a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Command to execute + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CommandPropertiesInner object if successful. + */ + public CommandPropertiesInner command(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).toBlocking().single().body(); + } + + /** + * Execute a command on a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Command to execute + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture commandAsync(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(commandWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters), serviceCallback); + } + + /** + * Execute a command on a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Command to execute + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommandPropertiesInner object + */ + public Observable commandAsync(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1, CommandPropertiesInner>() { + @Override + public CommandPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute a command on a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. + * + * @param groupName Name of the resource group + * @param serviceName Name of the service + * @param projectName Name of the project + * @param taskName Name of the Task + * @param parameters Command to execute + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommandPropertiesInner object + */ + public Observable> commandWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (projectName == null) { + throw new IllegalArgumentException("Parameter projectName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.command(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = commandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse commandDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProjectTaskInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProjectTaskInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get tasks in a service. + * The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProjectTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesImpl.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..635154d1e7cd8 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Quota; + +class UsagesImpl extends WrapperImpl implements Usages { + private final DataMigrationManager manager; + + UsagesImpl(DataMigrationManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public DataMigrationManager manager() { + return this.manager; + } + + private QuotaImpl wrapModel(QuotaInner inner) { + return new QuotaImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Quota call(QuotaInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesInner.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesInner.java new file mode 100644 index 0000000000000..2371345d6d783 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/UsagesInner.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private DataMigrationServiceClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, DataMigrationServiceClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + ServiceResponse> * @param location The Azure region of the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QuotaInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get resource quotas and usage information. + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/package-info.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/package-info.java new file mode 100644 index 0000000000000..f316665362455 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview.implementation; diff --git a/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/package-info.java b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/package-info.java new file mode 100644 index 0000000000000..b735efa9e1976 --- /dev/null +++ b/azuredatabasemigrationservice/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/azuredatabasemigrationservice/v2018_07_15_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataMigrationServiceClient. + * Data Migration Client. + */ +package com.microsoft.azure.management.azuredatabasemigrationservice.v2018_07_15_preview; diff --git a/batchai/resource-manager/v2017_09_01_preview/pom.xml b/batchai/resource-manager/v2017_09_01_preview/pom.xml index 6823c5945142d..401f9f73fffcc 100644 --- a/batchai/resource-manager/v2017_09_01_preview/pom.xml +++ b/batchai/resource-manager/v2017_09_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-batchai diff --git a/batchai/resource-manager/v2018_03_01/pom.xml b/batchai/resource-manager/v2018_03_01/pom.xml index 443b29b2e043e..20262c8121142 100644 --- a/batchai/resource-manager/v2018_03_01/pom.xml +++ b/batchai/resource-manager/v2018_03_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-batchai diff --git a/batchai/resource-manager/v2018_05_01/pom.xml b/batchai/resource-manager/v2018_05_01/pom.xml index 562c2e607f64a..13342085f71ff 100644 --- a/batchai/resource-manager/v2018_05_01/pom.xml +++ b/batchai/resource-manager/v2018_05_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-batchai diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/EndpointAPI.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/EndpointAPI.java new file mode 100644 index 0000000000000..52867e46fe64c --- /dev/null +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/EndpointAPI.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.cognitiveservices.language.luis.authoring; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +import java.util.Collection; + +/** + * Defines values for LUIS endpoint API. + */ +public final class EndpointAPI extends ExpandableStringEnum { + /** Static value US_WEST for EndpointAPI. */ + public static final EndpointAPI US_WEST = fromString("westus.api.cognitive.microsoft.com"); + + /** Static value US_WEST2 for EndpointAPI. */ + public static final EndpointAPI US_WEST2 = fromString("westus2.api.cognitive.microsoft.com"); + + /** Static value US_EAST for EndpointAPI. */ + public static final EndpointAPI US_EAST = fromString("eastus.api.cognitive.microsoft.com"); + + /** Static value US_EAST2 for EndpointAPI. */ + public static final EndpointAPI US_EAST2 = fromString("eastus2.api.cognitive.microsoft.com"); + + /** Static value US_WEST_CENTRAL for EndpointAPI. */ + public static final EndpointAPI US_WEST_CENTRAL = fromString("westcentralus.api.cognitive.microsoft.com"); + + /** Static value US_SOUTH_CENTRAL for EndpointAPI. */ + public static final EndpointAPI US_SOUTH_CENTRAL = fromString("southcentralus.api.cognitive.microsoft.com"); + + /** Static value EUROPE_WEST for EndpointAPI. */ + public static final EndpointAPI EUROPE_WEST = fromString("westeurope.api.cognitive.microsoft.com"); + + /** Static value EUROPE_NORTH for EndpointAPI. */ + public static final EndpointAPI EUROPE_NORTH = fromString("northeurope.api.cognitive.microsoft.com"); + + /** Static value ASIA_SOUTHEAST for EndpointAPI. */ + public static final EndpointAPI ASIA_SOUTHEAST = fromString("southeastasia.api.cognitive.microsoft.com"); + + /** Static value ASIA_EAST for EndpointAPI. */ + public static final EndpointAPI ASIA_EAST = fromString("eastasia.api.cognitive.microsoft.com"); + + /** Static value AUSTRALIA_EAST for EndpointAPI. */ + public static final EndpointAPI AUSTRALIA_EAST = fromString("australiaeast.api.cognitive.microsoft.com"); + + /** Static value BRAZIL_SOUTH for EndpointAPI. */ + public static final EndpointAPI BRAZIL_SOUTH = fromString("brazilsouth.api.cognitive.microsoft.com"); + + /** + * Creates or finds a EndpointAPI from its string representation. + * @param name a name to look for + * @return the corresponding EndpointAPI + */ + @JsonCreator + public static EndpointAPI fromString(String name) { + return fromString(name, EndpointAPI.class); + } + + /** + * @return known CatalogCollationType values + */ + public static Collection values() { + return values(EndpointAPI.class); + } +} diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java index a3b9b84e9d9c2..065cc8cbd49e6 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java @@ -35,6 +35,21 @@ public interface LUISAuthoringClient { */ String userAgent(); + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + LUISAuthoringClient withEndpoint(String endpoint); + /** * Gets Gets or sets the preferred language for the response.. * diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringManager.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringManager.java index 5b4e94ff8eece..4621eb7891972 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringManager.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringManager.java @@ -15,6 +15,7 @@ import okhttp3.Response; import java.io.IOException; +import java.net.URI; /** * Entry point to Azure Cognitive Services Language Understanding (LUIS) Authoring manager. @@ -23,21 +24,23 @@ public class LUISAuthoringManager { /** * Initializes an instance of Language Understanding (LUIS) Authoring API client. * - * @param subscriptionKey the Language Understanding (LUIS) Authoring API key + * @param endpointAPI the endpoint API + * @param luisAuthoringKey the Language Understanding (LUIS) Authoring API key (see https://www.luis.ai) * @return the Language Understanding Authoring API client */ - public static LUISAuthoringClient authenticate(String subscriptionKey) { - return authenticate("https://api.cognitive.microsoft.com/luis/api/v2.0/", subscriptionKey); + public static LUISAuthoringClient authenticate(EndpointAPI endpointAPI, String luisAuthoringKey) { + return authenticate(String.format("https://%s/luis/api/v2.0/", endpointAPI.toString()), luisAuthoringKey) + .withEndpoint(endpointAPI.toString()); } /** * Initializes an instance of Language Understanding (LUIS) Authoring API client. * * @param baseUrl the base URL of the service - * @param subscriptionKey the Language Understanding (LUIS) Authoring API key + * @param luisAuthoringKey the Language Understanding (LUIS) Authoring API key (see https://www.luis.ai) * @return the Language Understanding (LUIS) Authoring API client */ - public static LUISAuthoringClient authenticate(String baseUrl, final String subscriptionKey) { + public static LUISAuthoringClient authenticate(String baseUrl, final String luisAuthoringKey) { ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { @Override public void applyCredentialsFilter(OkHttpClient.Builder builder) { @@ -49,24 +52,34 @@ public Response intercept(Chain chain) throws IOException { Request original = chain.request(); // Request customization: add request headers Request.Builder requestBuilder = original.newBuilder() - .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey); + .addHeader("Ocp-Apim-Subscription-Key", luisAuthoringKey); request = requestBuilder.build(); return chain.proceed(request); } }); } }; - return authenticate(baseUrl, serviceClientCredentials); + String endpointAPI = null; + try { + URI uri = new URI(baseUrl); + endpointAPI = uri.getHost(); + } catch (Exception e) { + endpointAPI = EndpointAPI.US_WEST.toString(); + } + return authenticate(baseUrl, serviceClientCredentials) + .withEndpoint(endpointAPI); } /** * Initializes an instance of Language Understanding (LUIS) Authoring API client. * + * @param endpointAPI the endpoint API * @param credentials the management credentials for Azure * @return the Language Understanding (LUIS) Authoring API client */ - public static LUISAuthoringClient authenticate(ServiceClientCredentials credentials) { - return authenticate("https://api.cognitive.microsoft.com/luis/api/v2.0/", credentials); + public static LUISAuthoringClient authenticate(EndpointAPI endpointAPI, ServiceClientCredentials credentials) { + return authenticate(String.format("https://%s/luis/api/v2.0/", endpointAPI), credentials) + .withEndpoint(endpointAPI.toString()); } /** diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java index 924eff8f513f1..195089e731648 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateSettingsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ApplicationCreateObject; @@ -83,84 +84,84 @@ public AppsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps add" }) @POST("apps/") - Observable> add(@Body ApplicationCreateObject applicationCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> add(@Body ApplicationCreateObject applicationCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps list" }) @GET("apps/") - Observable> list(@Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps importMethod" }) @POST("apps/import") - Observable> importMethod(@Query("appName") String appName, @Body LuisApp luisApp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> importMethod(@Query("appName") String appName, @Body LuisApp luisApp, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listCortanaEndpoints" }) @GET("apps/assistants") - Observable> listCortanaEndpoints(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listCortanaEndpoints(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listDomains" }) @GET("apps/domains") - Observable> listDomains(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listDomains(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listUsageScenarios" }) @GET("apps/usagescenarios") - Observable> listUsageScenarios(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listUsageScenarios(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listSupportedCultures" }) @GET("apps/cultures") - Observable> listSupportedCultures(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listSupportedCultures(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps downloadQueryLogs" }) @GET("apps/{appId}/querylogs") @Streaming - Observable> downloadQueryLogs(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> downloadQueryLogs(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps get" }) @GET("apps/{appId}") - Observable> get(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> get(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps update" }) @PUT("apps/{appId}") - Observable> update(@Path("appId") UUID appId, @Body ApplicationUpdateObject applicationUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("appId") UUID appId, @Body ApplicationUpdateObject applicationUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps delete" }) @HTTP(path = "apps/{appId}", method = "DELETE", hasBody = true) - Observable> delete(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps publish" }) @POST("apps/{appId}/publish") - Observable> publish(@Path("appId") UUID appId, @Body ApplicationPublishObject applicationPublishObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> publish(@Path("appId") UUID appId, @Body ApplicationPublishObject applicationPublishObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps getSettings" }) @GET("apps/{appId}/settings") - Observable> getSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps updateSettings" }) @PUT("apps/{appId}/settings") - Observable> updateSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body ApplicationSettingUpdateObject applicationSettingUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body ApplicationSettingUpdateObject applicationSettingUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps getPublishSettings" }) @GET("apps/{appId}/publishsettings") - Observable> getPublishSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPublishSettings(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps updatePublishSettings" }) @PUT("apps/{appId}/publishsettings") - Observable> updatePublishSettings(@Path("appId") UUID appId, @Body PublishSettingUpdateObject publishSettingUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updatePublishSettings(@Path("appId") UUID appId, @Body PublishSettingUpdateObject publishSettingUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listEndpoints" }) @GET("apps/{appId}/endpoints") - Observable> listEndpoints(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listEndpoints(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listAvailableCustomPrebuiltDomains" }) @GET("apps/customprebuiltdomains") - Observable> listAvailableCustomPrebuiltDomains(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listAvailableCustomPrebuiltDomains(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps addCustomPrebuiltDomain" }) @POST("apps/customprebuiltdomains") - Observable> addCustomPrebuiltDomain(@Body PrebuiltDomainCreateObject prebuiltDomainCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addCustomPrebuiltDomain(@Body PrebuiltDomainCreateObject prebuiltDomainCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps listAvailableCustomPrebuiltDomainsForCulture" }) @GET("apps/customprebuiltdomains/{culture}") - Observable> listAvailableCustomPrebuiltDomainsForCulture(@Path("culture") String culture, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listAvailableCustomPrebuiltDomainsForCulture(@Path("culture") String culture, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -213,11 +214,15 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addWithServiceResponseAsync(ApplicationCreateObject applicationCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (applicationCreateObject == null) { throw new IllegalArgumentException("Parameter applicationCreateObject is required and cannot be null."); } Validator.validate(applicationCreateObject); - return service.add(applicationCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.add(applicationCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -288,6 +293,9 @@ public List call(ServiceResponse>> listWithServiceResponseAsync(ListAppsOptionalParameter listOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } final Integer skip = listOptionalParameter != null ? listOptionalParameter.skip() : null; final Integer take = listOptionalParameter != null ? listOptionalParameter.take() : null; @@ -303,7 +311,11 @@ public Observable>> listWithServic * @return the observable to the List<ApplicationInfoResponse> object */ public Observable>> listWithServiceResponseAsync(Integer skip, Integer take) { - return service.list(skip, take, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.list(skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -317,7 +329,7 @@ public Observable>> call(Response< }); } - private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -427,6 +439,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> importMethodWithServiceResponseAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (luisApp == null) { throw new IllegalArgumentException("Parameter luisApp is required and cannot be null."); } @@ -445,11 +460,15 @@ public Observable> importMethodWithServiceResponseAsync(Lu * @return the observable to the UUID object */ public Observable> importMethodWithServiceResponseAsync(LuisApp luisApp, String appName) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (luisApp == null) { throw new IllegalArgumentException("Parameter luisApp is required and cannot be null."); } Validator.validate(luisApp); - return service.importMethod(appName, luisApp, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importMethod(appName, luisApp, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -564,7 +583,11 @@ public PersonalAssistantsResponse call(ServiceResponse> listCortanaEndpointsWithServiceResponseAsync() { - return service.listCortanaEndpoints(this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listCortanaEndpoints(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -578,7 +601,7 @@ public Observable> call(Response listCortanaEndpointsDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse listCortanaEndpointsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) @@ -630,7 +653,11 @@ public List call(ServiceResponse> response) { * @return the observable to the List<String> object */ public Observable>> listDomainsWithServiceResponseAsync() { - return service.listDomains(this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listDomains(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -644,7 +671,7 @@ public Observable>> call(Response res }); } - private ServiceResponse> listDomainsDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listDomainsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -696,7 +723,11 @@ public List call(ServiceResponse> response) { * @return the observable to the List<String> object */ public Observable>> listUsageScenariosWithServiceResponseAsync() { - return service.listUsageScenarios(this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listUsageScenarios(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -710,7 +741,7 @@ public Observable>> call(Response res }); } - private ServiceResponse> listUsageScenariosDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listUsageScenariosDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -762,7 +793,11 @@ public List call(ServiceResponse> respo * @return the observable to the List<AvailableCulture> object */ public Observable>> listSupportedCulturesWithServiceResponseAsync() { - return service.listSupportedCultures(this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listSupportedCultures(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -776,7 +811,7 @@ public Observable>> call(Response> listSupportedCulturesDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listSupportedCulturesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -832,10 +867,14 @@ public InputStream call(ServiceResponse response) { * @return the observable to the InputStream object */ public Observable> downloadQueryLogsWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.downloadQueryLogs(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.downloadQueryLogs(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -905,10 +944,14 @@ public ApplicationInfoResponse call(ServiceResponse res * @return the observable to the ApplicationInfoResponse object */ public Observable> getWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.get(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.get(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -982,6 +1025,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateWithServiceResponseAsync(UUID appId, ApplicationUpdateObject applicationUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -989,7 +1035,8 @@ public Observable> updateWithServiceResponseAsy throw new IllegalArgumentException("Parameter applicationUpdateObject is required and cannot be null."); } Validator.validate(applicationUpdateObject); - return service.update(appId, applicationUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.update(appId, applicationUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1059,10 +1106,14 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.delete(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.delete(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1136,6 +1187,9 @@ public ProductionOrStagingEndpointInfo call(ServiceResponse> publishWithServiceResponseAsync(UUID appId, ApplicationPublishObject applicationPublishObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1143,7 +1197,8 @@ public Observable> publishWithS throw new IllegalArgumentException("Parameter applicationPublishObject is required and cannot be null."); } Validator.validate(applicationPublishObject); - return service.publish(appId, applicationPublishObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.publish(appId, applicationPublishObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1213,10 +1268,14 @@ public ApplicationSettings call(ServiceResponse response) { * @return the observable to the ApplicationSettings object */ public Observable> getSettingsWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.getSettings(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getSettings(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1291,6 +1350,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateSettingsWithServiceResponseAsync(UUID appId, UpdateSettingsOptionalParameter updateSettingsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1308,12 +1370,16 @@ public Observable> updateSettingsWithServiceRes * @return the observable to the OperationStatus object */ public Observable> updateSettingsWithServiceResponseAsync(UUID appId, boolean publicParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } ApplicationSettingUpdateObject applicationSettingUpdateObject = new ApplicationSettingUpdateObject(); applicationSettingUpdateObject.withPublicProperty(publicParameter); - return service.updateSettings(appId, this.client.acceptLanguage(), applicationSettingUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateSettings(appId, this.client.acceptLanguage(), applicationSettingUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1432,10 +1498,14 @@ public PublishSettings call(ServiceResponse response) { * @return the observable to the PublishSettings object */ public Observable> getPublishSettingsWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.getPublishSettings(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPublishSettings(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1509,6 +1579,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updatePublishSettingsWithServiceResponseAsync(UUID appId, PublishSettingUpdateObject publishSettingUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1516,7 +1589,8 @@ public Observable> updatePublishSettingsWithSer throw new IllegalArgumentException("Parameter publishSettingUpdateObject is required and cannot be null."); } Validator.validate(publishSettingUpdateObject); - return service.updatePublishSettings(appId, publishSettingUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePublishSettings(appId, publishSettingUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1586,10 +1660,14 @@ public Map call(ServiceResponse> response) { * @return the observable to the Map<String, String> object */ public Observable>> listEndpointsWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.listEndpoints(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listEndpoints(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1655,7 +1733,11 @@ public List call(ServiceResponse> response) * @return the observable to the List<PrebuiltDomain> object */ public Observable>> listAvailableCustomPrebuiltDomainsWithServiceResponseAsync() { - return service.listAvailableCustomPrebuiltDomains(this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listAvailableCustomPrebuiltDomains(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1669,7 +1751,7 @@ public Observable>> call(Response> listAvailableCustomPrebuiltDomainsDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listAvailableCustomPrebuiltDomainsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -1725,11 +1807,15 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addCustomPrebuiltDomainWithServiceResponseAsync(PrebuiltDomainCreateObject prebuiltDomainCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (prebuiltDomainCreateObject == null) { throw new IllegalArgumentException("Parameter prebuiltDomainCreateObject is required and cannot be null."); } Validator.validate(prebuiltDomainCreateObject); - return service.addCustomPrebuiltDomain(prebuiltDomainCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCustomPrebuiltDomain(prebuiltDomainCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1799,10 +1885,14 @@ public List call(ServiceResponse> response) * @return the observable to the List<PrebuiltDomain> object */ public Observable>> listAvailableCustomPrebuiltDomainsForCultureWithServiceResponseAsync(String culture) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (culture == null) { throw new IllegalArgumentException("Parameter culture is required and cannot be null."); } - return service.listAvailableCustomPrebuiltDomainsForCulture(culture, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listAvailableCustomPrebuiltDomainsForCulture(culture, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java index 9eff79626adc6..c929232095311 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListExamplesOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.BatchLabelExample; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; @@ -66,19 +67,19 @@ public ExamplesImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface ExamplesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples add" }) @POST("apps/{appId}/versions/{versionId}/example") - Observable> add(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body ExampleLabelObject exampleLabelObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> add(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body ExampleLabelObject exampleLabelObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples batch" }) @POST("apps/{appId}/versions/{versionId}/examples") - Observable> batch(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List exampleLabelObjectArray, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> batch(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List exampleLabelObjectArray, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples list" }) @GET("apps/{appId}/versions/{versionId}/examples") - Observable> list(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples delete" }) @HTTP(path = "apps/{appId}/versions/{versionId}/examples/{exampleId}", method = "DELETE", hasBody = true) - Observable> delete(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("exampleId") int exampleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("exampleId") int exampleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -139,6 +140,9 @@ public LabelExampleResponse call(ServiceResponse response) * @return the observable to the LabelExampleResponse object */ public Observable> addWithServiceResponseAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -149,7 +153,8 @@ public Observable> addWithServiceResponseA throw new IllegalArgumentException("Parameter exampleLabelObject is required and cannot be null."); } Validator.validate(exampleLabelObject); - return service.add(appId, versionId, exampleLabelObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.add(appId, versionId, exampleLabelObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -227,6 +232,9 @@ public List call(ServiceResponse> res * @return the observable to the List<BatchLabelExample> object */ public Observable>> batchWithServiceResponseAsync(UUID appId, String versionId, List exampleLabelObjectArray) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -237,7 +245,8 @@ public Observable>> batchWithServiceResp throw new IllegalArgumentException("Parameter exampleLabelObjectArray is required and cannot be null."); } Validator.validate(exampleLabelObjectArray); - return service.batch(appId, versionId, exampleLabelObjectArray, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.batch(appId, versionId, exampleLabelObjectArray, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -317,6 +326,9 @@ public List call(ServiceResponse> respo * @return the observable to the List<LabeledUtterance> object */ public Observable>> listWithServiceResponseAsync(UUID appId, String versionId, ListExamplesOptionalParameter listOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -340,13 +352,17 @@ public Observable>> listWithServiceRespon * @return the observable to the List<LabeledUtterance> object */ public Observable>> listWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.list(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.list(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -487,13 +503,17 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteWithServiceResponseAsync(UUID appId, String versionId, int exampleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.delete(appId, versionId, exampleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.delete(appId, versionId, exampleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java index 07627d4908510..cfb7f11b0d4e4 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdatePhraseListOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Features; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.FeaturesResponseObject; @@ -69,27 +70,27 @@ public FeaturesImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface FeaturesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features addPhraseList" }) @POST("apps/{appId}/versions/{versionId}/phraselists") - Observable> addPhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PhraselistCreateObject phraselistCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addPhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PhraselistCreateObject phraselistCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features listPhraseLists" }) @GET("apps/{appId}/versions/{versionId}/phraselists") - Observable> listPhraseLists(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listPhraseLists(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features list" }) @GET("apps/{appId}/versions/{versionId}/features") - Observable> list(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features getPhraseList" }) @GET("apps/{appId}/versions/{versionId}/phraselists/{phraselistId}") - Observable> getPhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features updatePhraseList" }) @PUT("apps/{appId}/versions/{versionId}/phraselists/{phraselistId}") - Observable> updatePhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Body PhraselistUpdateObject phraselistUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updatePhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Body PhraselistUpdateObject phraselistUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Features deletePhraseList" }) @HTTP(path = "apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", method = "DELETE", hasBody = true) - Observable> deletePhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePhraseList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("phraselistId") int phraselistId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -150,6 +151,9 @@ public Integer call(ServiceResponse response) { * @return the observable to the Integer object */ public Observable> addPhraseListWithServiceResponseAsync(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -160,7 +164,8 @@ public Observable> addPhraseListWithServiceResponseAsyn throw new IllegalArgumentException("Parameter phraselistCreateObject is required and cannot be null."); } Validator.validate(phraselistCreateObject); - return service.addPhraseList(appId, versionId, phraselistCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addPhraseList(appId, versionId, phraselistCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -239,6 +244,9 @@ public List call(ServiceResponse>> listPhraseListsWithServiceResponseAsync(UUID appId, String versionId, ListPhraseListsOptionalParameter listPhraseListsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -262,13 +270,17 @@ public Observable>> listPhraseListsW * @return the observable to the List<PhraseListFeatureInfo> object */ public Observable>> listPhraseListsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listPhraseLists(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listPhraseLists(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -410,6 +422,9 @@ public FeaturesResponseObject call(ServiceResponse respo * @return the observable to the FeaturesResponseObject object */ public Observable> listWithServiceResponseAsync(UUID appId, String versionId, ListFeaturesOptionalParameter listOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -433,13 +448,17 @@ public Observable> listWithServiceRespon * @return the observable to the FeaturesResponseObject object */ public Observable> listWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.list(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.list(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -580,13 +599,17 @@ public PhraseListFeatureInfo call(ServiceResponse respons * @return the observable to the PhraseListFeatureInfo object */ public Observable> getPhraseListWithServiceResponseAsync(UUID appId, String versionId, int phraselistId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.getPhraseList(appId, versionId, phraselistId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPhraseList(appId, versionId, phraselistId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -669,6 +692,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updatePhraseListWithServiceResponseAsync(UUID appId, String versionId, int phraselistId, UpdatePhraseListOptionalParameter updatePhraseListOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -691,6 +717,9 @@ public Observable> updatePhraseListWithServiceR * @return the observable to the OperationStatus object */ public Observable> updatePhraseListWithServiceResponseAsync(UUID appId, String versionId, int phraselistId, PhraselistUpdateObject phraselistUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -698,7 +727,8 @@ public Observable> updatePhraseListWithServiceR throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } Validator.validate(phraselistUpdateObject); - return service.updatePhraseList(appId, versionId, phraselistId, phraselistUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePhraseList(appId, versionId, phraselistId, phraselistUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -839,13 +869,17 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePhraseListWithServiceResponseAsync(UUID appId, String versionId, int phraselistId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.deletePhraseList(appId, versionId, phraselistId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePhraseList(appId, versionId, phraselistId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java index 89f5a0a8803c8..accd92be520ac 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java @@ -37,6 +37,29 @@ public AzureClient getAzureClient() { return this.azureClient; } + /** Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). */ + private String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public LUISAuthoringClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -216,7 +239,7 @@ public Patterns patterns() { * @param credentials the management credentials for Azure */ public LUISAuthoringClientImpl(ServiceClientCredentials credentials) { - this("https://api.cognitive.microsoft.com/luis/api/v2.0", credentials); + this("https://{endpoint}/luis/api/v2.0", credentials); } /** diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java index 69e8f5414d950..5e5798398c5fc 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java @@ -50,6 +50,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateExplicitListItemOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Models; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AvailablePrebuiltEntityModel; @@ -143,427 +144,427 @@ public ModelsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface ModelsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addIntent" }) @POST("apps/{appId}/versions/{versionId}/intents") - Observable> addIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body ModelCreateObject intentCreateObject, @Header("User-Agent") String userAgent); + Observable> addIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body ModelCreateObject intentCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listIntents" }) @GET("apps/{appId}/versions/{versionId}/intents") - Observable> listIntents(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listIntents(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addEntity" }) @POST("apps/{appId}/versions/{versionId}/entities") - Observable> addEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body ModelCreateObject modelCreateObject, @Header("User-Agent") String userAgent); + Observable> addEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body ModelCreateObject modelCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listEntities" }) @GET("apps/{appId}/versions/{versionId}/entities") - Observable> listEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addHierarchicalEntity" }) @POST("apps/{appId}/versions/{versionId}/hierarchicalentities") - Observable> addHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body HierarchicalEntityModel hierarchicalModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body HierarchicalEntityModel hierarchicalModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listHierarchicalEntities" }) @GET("apps/{appId}/versions/{versionId}/hierarchicalentities") - Observable> listHierarchicalEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listHierarchicalEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addCompositeEntity" }) @POST("apps/{appId}/versions/{versionId}/compositeentities") - Observable> addCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body CompositeEntityModel compositeModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body CompositeEntityModel compositeModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listCompositeEntities" }) @GET("apps/{appId}/versions/{versionId}/compositeentities") - Observable> listCompositeEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listCompositeEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listClosedLists" }) @GET("apps/{appId}/versions/{versionId}/closedlists") - Observable> listClosedLists(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listClosedLists(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addClosedList" }) @POST("apps/{appId}/versions/{versionId}/closedlists") - Observable> addClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body ClosedListModelCreateObject closedListModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body ClosedListModelCreateObject closedListModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addPrebuilt" }) @POST("apps/{appId}/versions/{versionId}/prebuilts") - Observable> addPrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List prebuiltExtractorNames, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addPrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List prebuiltExtractorNames, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listPrebuilts" }) @GET("apps/{appId}/versions/{versionId}/prebuilts") - Observable> listPrebuilts(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listPrebuilts(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listPrebuiltEntities" }) @GET("apps/{appId}/versions/{versionId}/listprebuilts") - Observable> listPrebuiltEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listPrebuiltEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listModels" }) @GET("apps/{appId}/versions/{versionId}/models") - Observable> listModels(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listModels(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models examplesMethod" }) @GET("apps/{appId}/versions/{versionId}/models/{modelId}/examples") - Observable> examplesMethod(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("modelId") String modelId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> examplesMethod(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("modelId") String modelId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getIntent" }) @GET("apps/{appId}/versions/{versionId}/intents/{intentId}") - Observable> getIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateIntent" }) @PUT("apps/{appId}/versions/{versionId}/intents/{intentId}") - Observable> updateIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Header("accept-language") String acceptLanguage, @Body ModelUpdateObject modelUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Header("accept-language") String acceptLanguage, @Body ModelUpdateObject modelUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteIntent" }) @HTTP(path = "apps/{appId}/versions/{versionId}/intents/{intentId}", method = "DELETE", hasBody = true) - Observable> deleteIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("deleteUtterances") Boolean deleteUtterances, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("deleteUtterances") Boolean deleteUtterances, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getEntity" }) @GET("apps/{appId}/versions/{versionId}/entities/{entityId}") - Observable> getEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateEntity" }) @PUT("apps/{appId}/versions/{versionId}/entities/{entityId}") - Observable> updateEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body ModelUpdateObject modelUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body ModelUpdateObject modelUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteEntity" }) @HTTP(path = "apps/{appId}/versions/{versionId}/entities/{entityId}", method = "DELETE", hasBody = true) - Observable> deleteEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getHierarchicalEntity" }) @GET("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}") - Observable> getHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateHierarchicalEntity" }) @PUT("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}") - Observable> updateHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Body HierarchicalEntityModel hierarchicalModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updateHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Body HierarchicalEntityModel hierarchicalModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteHierarchicalEntity" }) @HTTP(path = "apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", method = "DELETE", hasBody = true) - Observable> deleteHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteHierarchicalEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getCompositeEntity" }) @GET("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}") - Observable> getCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateCompositeEntity" }) @PUT("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}") - Observable> updateCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Body CompositeEntityModel compositeModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updateCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Body CompositeEntityModel compositeModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteCompositeEntity" }) @HTTP(path = "apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", method = "DELETE", hasBody = true) - Observable> deleteCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteCompositeEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getClosedList" }) @GET("apps/{appId}/versions/{versionId}/closedlists/{clEntityId}") - Observable> getClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateClosedList" }) @PUT("apps/{appId}/versions/{versionId}/closedlists/{clEntityId}") - Observable> updateClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Body ClosedListModelUpdateObject closedListModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updateClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Body ClosedListModelUpdateObject closedListModelUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models patchClosedList" }) @PATCH("apps/{appId}/versions/{versionId}/closedlists/{clEntityId}") - Observable> patchClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Body ClosedListModelPatchObject closedListModelPatchObject, @Header("User-Agent") String userAgent); + Observable> patchClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Body ClosedListModelPatchObject closedListModelPatchObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteClosedList" }) @HTTP(path = "apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", method = "DELETE", hasBody = true) - Observable> deleteClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteClosedList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPrebuilt" }) @GET("apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}") - Observable> getPrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("prebuiltId") UUID prebuiltId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("prebuiltId") UUID prebuiltId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deletePrebuilt" }) @HTTP(path = "apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", method = "DELETE", hasBody = true) - Observable> deletePrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("prebuiltId") UUID prebuiltId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePrebuilt(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("prebuiltId") UUID prebuiltId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteSubList" }) @HTTP(path = "apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", method = "DELETE", hasBody = true) - Observable> deleteSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Path("subListId") int subListId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Path("subListId") int subListId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateSubList" }) @PUT("apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}") - Observable> updateSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Path("subListId") int subListId, @Body WordListBaseUpdateObject wordListBaseUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updateSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Path("subListId") int subListId, @Body WordListBaseUpdateObject wordListBaseUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getIntentSuggestions" }) @GET("apps/{appId}/versions/{versionId}/intents/{intentId}/suggest") - Observable> getIntentSuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getIntentSuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getEntitySuggestions" }) @GET("apps/{appId}/versions/{versionId}/entities/{entityId}/suggest") - Observable> getEntitySuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getEntitySuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addSubList" }) @POST("apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists") - Observable> addSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Body WordListObject wordListCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addSubList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("clEntityId") UUID clEntityId, @Body WordListObject wordListCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addCustomPrebuiltDomain" }) @POST("apps/{appId}/versions/{versionId}/customprebuiltdomains") - Observable> addCustomPrebuiltDomain(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body PrebuiltDomainCreateBaseObject prebuiltDomainObject, @Header("User-Agent") String userAgent); + Observable> addCustomPrebuiltDomain(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body PrebuiltDomainCreateBaseObject prebuiltDomainObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addCustomPrebuiltIntent" }) @POST("apps/{appId}/versions/{versionId}/customprebuiltintents") - Observable> addCustomPrebuiltIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addCustomPrebuiltIntent(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listCustomPrebuiltIntents" }) @GET("apps/{appId}/versions/{versionId}/customprebuiltintents") - Observable> listCustomPrebuiltIntents(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listCustomPrebuiltIntents(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addCustomPrebuiltEntity" }) @POST("apps/{appId}/versions/{versionId}/customprebuiltentities") - Observable> addCustomPrebuiltEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addCustomPrebuiltEntity(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listCustomPrebuiltEntities" }) @GET("apps/{appId}/versions/{versionId}/customprebuiltentities") - Observable> listCustomPrebuiltEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listCustomPrebuiltEntities(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listCustomPrebuiltModels" }) @GET("apps/{appId}/versions/{versionId}/customprebuiltmodels") - Observable> listCustomPrebuiltModels(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listCustomPrebuiltModels(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteCustomPrebuiltDomain" }) @HTTP(path = "apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}", method = "DELETE", hasBody = true) - Observable> deleteCustomPrebuiltDomain(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("domainName") String domainName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteCustomPrebuiltDomain(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("domainName") String domainName, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getHierarchicalEntityChild" }) @GET("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}") - Observable> getHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateHierarchicalEntityChild" }) @PUT("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}") - Observable> updateHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Body HierarchicalChildModelUpdateObject hierarchicalChildModelUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Body HierarchicalChildModelUpdateObject hierarchicalChildModelUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteHierarchicalEntityChild" }) @HTTP(path = "apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", method = "DELETE", hasBody = true) - Observable> deleteHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("hChildId") UUID hChildId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addHierarchicalEntityChild" }) @POST("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children") - Observable> addHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Body HierarchicalChildModelCreateObject hierarchicalChildModelCreateObject, @Header("User-Agent") String userAgent); + Observable> addHierarchicalEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Body HierarchicalChildModelCreateObject hierarchicalChildModelCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addCompositeEntityChild" }) @POST("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children") - Observable> addCompositeEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Body CompositeChildModelCreateObject compositeChildModelCreateObject, @Header("User-Agent") String userAgent); + Observable> addCompositeEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Body CompositeChildModelCreateObject compositeChildModelCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteCompositeEntityChild" }) @HTTP(path = "apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}", method = "DELETE", hasBody = true) - Observable> deleteCompositeEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("cChildId") UUID cChildId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteCompositeEntityChild(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("cChildId") UUID cChildId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getRegexEntityInfos" }) @GET("apps/{appId}/versions/{versionId}/regexentities") - Observable> getRegexEntityInfos(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getRegexEntityInfos(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createRegexEntityModel" }) @POST("apps/{appId}/versions/{versionId}/regexentities") - Observable> createRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body RegexModelCreateObject regexEntityExtractorCreateObj, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body RegexModelCreateObject regexEntityExtractorCreateObj, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPatternAnyEntityInfos" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities") - Observable> getPatternAnyEntityInfos(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPatternAnyEntityInfos(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createPatternAnyEntityModel" }) @POST("apps/{appId}/versions/{versionId}/patternanyentities") - Observable> createPatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PatternAnyModelCreateObject extractorCreateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createPatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PatternAnyModelCreateObject extractorCreateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/entities/{entityId}/roles") - Observable> getEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createEntityRole" }) @POST("apps/{appId}/versions/{versionId}/entities/{entityId}/roles") - Observable> createEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPrebuiltEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles") - Observable> getPrebuiltEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPrebuiltEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createPrebuiltEntityRole" }) @POST("apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles") - Observable> createPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getClosedListEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles") - Observable> getClosedListEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getClosedListEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createClosedListEntityRole" }) @POST("apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles") - Observable> createClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getRegexEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles") - Observable> getRegexEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getRegexEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createRegexEntityRole" }) @POST("apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles") - Observable> createRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getCompositeEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles") - Observable> getCompositeEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getCompositeEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createCompositeEntityRole" }) @POST("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles") - Observable> createCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPatternAnyEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles") - Observable> getPatternAnyEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPatternAnyEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createPatternAnyEntityRole" }) @POST("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles") - Observable> createPatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createPatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getHierarchicalEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles") - Observable> getHierarchicalEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getHierarchicalEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createHierarchicalEntityRole" }) @POST("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles") - Observable> createHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getCustomPrebuiltEntityRoles" }) @GET("apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles") - Observable> getCustomPrebuiltEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getCustomPrebuiltEntityRoles(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models createCustomPrebuiltEntityRole" }) @POST("apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles") - Observable> createCustomPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("User-Agent") String userAgent); + Observable> createCustomPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body EntityRoleCreateObject entityRoleCreateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getExplicitList" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist") - Observable> getExplicitList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getExplicitList(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models addExplicitListItem" }) @POST("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist") - Observable> addExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body ExplicitListItemCreateObject item, @Header("User-Agent") String userAgent); + Observable> addExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Body ExplicitListItemCreateObject item, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getRegexEntityEntityInfo" }) @GET("apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}") - Observable> getRegexEntityEntityInfo(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getRegexEntityEntityInfo(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateRegexEntityModel" }) @PUT("apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}") - Observable> updateRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Body RegexModelUpdateObject regexEntityUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updateRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Body RegexModelUpdateObject regexEntityUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteRegexEntityModel" }) @HTTP(path = "apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", method = "DELETE", hasBody = true) - Observable> deleteRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteRegexEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("regexEntityId") UUID regexEntityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPatternAnyEntityInfo" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}") - Observable> getPatternAnyEntityInfo(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPatternAnyEntityInfo(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updatePatternAnyEntityModel" }) @PUT("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}") - Observable> updatePatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Body PatternAnyModelUpdateObject patternAnyUpdateObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updatePatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Body PatternAnyModelUpdateObject patternAnyUpdateObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deletePatternAnyEntityModel" }) @HTTP(path = "apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", method = "DELETE", hasBody = true) - Observable> deletePatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePatternAnyEntityModel(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getEntityRole" }) @GET("apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}") - Observable> getEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}") - Observable> updateEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPrebuiltEntityRole" }) @GET("apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}") - Observable> getPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updatePrebuiltEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}") - Observable> updatePrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updatePrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deletePrebuiltEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deletePrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getClosedListEntityRole" }) @GET("apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}") - Observable> getClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateClosedListEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}") - Observable> updateClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteClosedListEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteClosedListEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getRegexEntityRole" }) @GET("apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}") - Observable> getRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateRegexEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}") - Observable> updateRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteRegexEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteRegexEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getCompositeEntityRole" }) @GET("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}") - Observable> getCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateCompositeEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}") - Observable> updateCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteCompositeEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteCompositeEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("cEntityId") UUID cEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getPatternAnyEntityRole" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}") - Observable> getPatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updatePatternAnyEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}") - Observable> updatePatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updatePatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deletePatternAnyEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deletePatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePatternAnyEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getHierarchicalEntityRole" }) @GET("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}") - Observable> getHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateHierarchicalEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}") - Observable> updateHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteHierarchicalEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteHierarchicalEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("hEntityId") UUID hEntityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getCustomEntityRole" }) @GET("apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}") - Observable> getCustomEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getCustomEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateCustomPrebuiltEntityRole" }) @PUT("apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}") - Observable> updateCustomPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("User-Agent") String userAgent); + Observable> updateCustomPrebuiltEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Body EntityRoleUpdateObject entityRoleUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteCustomEntityRole" }) @HTTP(path = "apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", method = "DELETE", hasBody = true) - Observable> deleteCustomEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteCustomEntityRole(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("roleId") UUID roleId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models getExplicitListItem" }) @GET("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}") - Observable> getExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models updateExplicitListItem" }) @PUT("apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}") - Observable> updateExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Body ExplicitListItemUpdateObject item, @Header("User-Agent") String userAgent); + Observable> updateExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Body ExplicitListItemUpdateObject item, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models deleteExplicitListItem" }) @HTTP(path = "apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", method = "DELETE", hasBody = true) - Observable> deleteExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteExplicitListItem(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Path("itemId") long itemId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -625,6 +626,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addIntentWithServiceResponseAsync(UUID appId, String versionId, AddIntentOptionalParameter addIntentOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -646,6 +650,9 @@ public Observable> addIntentWithServiceResponseAsync(UUID * @return the observable to the UUID object */ public Observable> addIntentWithServiceResponseAsync(UUID appId, String versionId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -654,7 +661,8 @@ public Observable> addIntentWithServiceResponseAsync(UUID } ModelCreateObject intentCreateObject = new ModelCreateObject(); intentCreateObject.withName(name); - return service.addIntent(appId, versionId, this.client.acceptLanguage(), intentCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addIntent(appId, versionId, this.client.acceptLanguage(), intentCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -789,6 +797,9 @@ public List call(ServiceResponse> respo * @return the observable to the List<IntentClassifier> object */ public Observable>> listIntentsWithServiceResponseAsync(UUID appId, String versionId, ListIntentsOptionalParameter listIntentsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -812,13 +823,17 @@ public Observable>> listIntentsWithServic * @return the observable to the List<IntentClassifier> object */ public Observable>> listIntentsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listIntents(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listIntents(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -960,6 +975,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addEntityWithServiceResponseAsync(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -981,6 +999,9 @@ public Observable> addEntityWithServiceResponseAsync(UUID * @return the observable to the UUID object */ public Observable> addEntityWithServiceResponseAsync(UUID appId, String versionId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -989,7 +1010,8 @@ public Observable> addEntityWithServiceResponseAsync(UUID } ModelCreateObject modelCreateObject = new ModelCreateObject(); modelCreateObject.withName(name); - return service.addEntity(appId, versionId, this.client.acceptLanguage(), modelCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addEntity(appId, versionId, this.client.acceptLanguage(), modelCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1124,6 +1146,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<EntityExtractor> object */ public Observable>> listEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListEntitiesOptionalParameter listEntitiesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1147,13 +1172,17 @@ public Observable>> listEntitiesWithServic * @return the observable to the List<EntityExtractor> object */ public Observable>> listEntitiesWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listEntities(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listEntities(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1294,6 +1323,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addHierarchicalEntityWithServiceResponseAsync(UUID appId, String versionId, HierarchicalEntityModel hierarchicalModelCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1304,7 +1336,8 @@ public Observable> addHierarchicalEntityWithServiceRespons throw new IllegalArgumentException("Parameter hierarchicalModelCreateObject is required and cannot be null."); } Validator.validate(hierarchicalModelCreateObject); - return service.addHierarchicalEntity(appId, versionId, hierarchicalModelCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addHierarchicalEntity(appId, versionId, hierarchicalModelCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1383,6 +1416,9 @@ public List call(ServiceResponse>> listHierarchicalEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListHierarchicalEntitiesOptionalParameter listHierarchicalEntitiesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1406,13 +1442,17 @@ public Observable>> listHierar * @return the observable to the List<HierarchicalEntityExtractor> object */ public Observable>> listHierarchicalEntitiesWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listHierarchicalEntities(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listHierarchicalEntities(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1553,6 +1593,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addCompositeEntityWithServiceResponseAsync(UUID appId, String versionId, CompositeEntityModel compositeModelCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1563,7 +1606,8 @@ public Observable> addCompositeEntityWithServiceResponseAs throw new IllegalArgumentException("Parameter compositeModelCreateObject is required and cannot be null."); } Validator.validate(compositeModelCreateObject); - return service.addCompositeEntity(appId, versionId, compositeModelCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCompositeEntity(appId, versionId, compositeModelCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1642,6 +1686,9 @@ public List call(ServiceResponse>> listCompositeEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1665,13 +1712,17 @@ public Observable>> listComposite * @return the observable to the List<CompositeEntityExtractor> object */ public Observable>> listCompositeEntitiesWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listCompositeEntities(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listCompositeEntities(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1813,6 +1864,9 @@ public List call(ServiceResponse>> listClosedListsWithServiceResponseAsync(UUID appId, String versionId, ListClosedListsOptionalParameter listClosedListsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1836,13 +1890,17 @@ public Observable>> listClosedLi * @return the observable to the List<ClosedListEntityExtractor> object */ public Observable>> listClosedListsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listClosedLists(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listClosedLists(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1983,6 +2041,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addClosedListWithServiceResponseAsync(UUID appId, String versionId, ClosedListModelCreateObject closedListModelCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1993,7 +2054,8 @@ public Observable> addClosedListWithServiceResponseAsync(U throw new IllegalArgumentException("Parameter closedListModelCreateObject is required and cannot be null."); } Validator.validate(closedListModelCreateObject); - return service.addClosedList(appId, versionId, closedListModelCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addClosedList(appId, versionId, closedListModelCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2071,6 +2133,9 @@ public List call(ServiceResponse>> addPrebuiltWithServiceResponseAsync(UUID appId, String versionId, List prebuiltExtractorNames) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2081,7 +2146,8 @@ public Observable>> addPrebuiltWit throw new IllegalArgumentException("Parameter prebuiltExtractorNames is required and cannot be null."); } Validator.validate(prebuiltExtractorNames); - return service.addPrebuilt(appId, versionId, prebuiltExtractorNames, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addPrebuilt(appId, versionId, prebuiltExtractorNames, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -2160,6 +2226,9 @@ public List call(ServiceResponse>> listPrebuiltsWithServiceResponseAsync(UUID appId, String versionId, ListPrebuiltsOptionalParameter listPrebuiltsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2183,13 +2252,17 @@ public Observable>> listPrebuiltsW * @return the observable to the List<PrebuiltEntityExtractor> object */ public Observable>> listPrebuiltsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listPrebuilts(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listPrebuilts(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -2326,13 +2399,17 @@ public List call(ServiceResponse>> listPrebuiltEntitiesWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listPrebuiltEntities(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listPrebuiltEntities(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -2411,6 +2488,9 @@ public List call(ServiceResponse> res * @return the observable to the List<ModelInfoResponse> object */ public Observable>> listModelsWithServiceResponseAsync(UUID appId, String versionId, ListModelsOptionalParameter listModelsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2434,13 +2514,17 @@ public Observable>> listModelsWithServic * @return the observable to the List<ModelInfoResponse> object */ public Observable>> listModelsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listModels(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listModels(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -2586,6 +2670,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<LabelTextObject> object */ public Observable>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2613,6 +2700,9 @@ public Observable>> examplesMethodWithServ * @return the observable to the List<LabelTextObject> object */ public Observable>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2622,7 +2712,8 @@ public Observable>> examplesMethodWithServ if (modelId == null) { throw new IllegalArgumentException("Parameter modelId is required and cannot be null."); } - return service.examplesMethod(appId, versionId, modelId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.examplesMethod(appId, versionId, modelId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -2770,6 +2861,9 @@ public IntentClassifier call(ServiceResponse response) { * @return the observable to the IntentClassifier object */ public Observable> getIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2779,7 +2873,8 @@ public Observable> getIntentWithServiceRespons if (intentId == null) { throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } - return service.getIntent(appId, versionId, intentId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIntent(appId, versionId, intentId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2862,6 +2957,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2887,6 +2985,9 @@ public Observable> updateIntentWithServiceRespo * @return the observable to the OperationStatus object */ public Observable> updateIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -2898,7 +2999,8 @@ public Observable> updateIntentWithServiceRespo } ModelUpdateObject modelUpdateObject = new ModelUpdateObject(); modelUpdateObject.withName(name); - return service.updateIntent(appId, versionId, intentId, this.client.acceptLanguage(), modelUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateIntent(appId, versionId, intentId, this.client.acceptLanguage(), modelUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3044,6 +3146,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, DeleteIntentOptionalParameter deleteIntentOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3069,6 +3174,9 @@ public Observable> deleteIntentWithServiceRespo * @return the observable to the OperationStatus object */ public Observable> deleteIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, Boolean deleteUtterances) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3078,7 +3186,8 @@ public Observable> deleteIntentWithServiceRespo if (intentId == null) { throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } - return service.deleteIntent(appId, versionId, intentId, deleteUtterances, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteIntent(appId, versionId, intentId, deleteUtterances, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3219,6 +3328,9 @@ public EntityExtractor call(ServiceResponse response) { * @return the observable to the EntityExtractor object */ public Observable> getEntityWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3228,7 +3340,8 @@ public Observable> getEntityWithServiceResponse if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getEntity(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getEntity(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3311,6 +3424,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateEntityWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UpdateEntityOptionalParameter updateEntityOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3336,6 +3452,9 @@ public Observable> updateEntityWithServiceRespo * @return the observable to the OperationStatus object */ public Observable> updateEntityWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3347,7 +3466,8 @@ public Observable> updateEntityWithServiceRespo } ModelUpdateObject modelUpdateObject = new ModelUpdateObject(); modelUpdateObject.withName(name); - return service.updateEntity(appId, versionId, entityId, this.client.acceptLanguage(), modelUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateEntity(appId, versionId, entityId, this.client.acceptLanguage(), modelUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3488,6 +3608,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteEntityWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3497,7 +3620,8 @@ public Observable> deleteEntityWithServiceRespo if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.deleteEntity(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteEntity(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3575,6 +3699,9 @@ public HierarchicalEntityExtractor call(ServiceResponse> getHierarchicalEntityWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3584,7 +3711,8 @@ public Observable> getHierarchicalE if (hEntityId == null) { throw new IllegalArgumentException("Parameter hEntityId is required and cannot be null."); } - return service.getHierarchicalEntity(appId, versionId, hEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getHierarchicalEntity(appId, versionId, hEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3666,6 +3794,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateHierarchicalEntityWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, HierarchicalEntityModel hierarchicalModelUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3679,7 +3810,8 @@ public Observable> updateHierarchicalEntityWith throw new IllegalArgumentException("Parameter hierarchicalModelUpdateObject is required and cannot be null."); } Validator.validate(hierarchicalModelUpdateObject); - return service.updateHierarchicalEntity(appId, versionId, hEntityId, hierarchicalModelUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateHierarchicalEntity(appId, versionId, hEntityId, hierarchicalModelUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3757,6 +3889,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteHierarchicalEntityWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3766,7 +3901,8 @@ public Observable> deleteHierarchicalEntityWith if (hEntityId == null) { throw new IllegalArgumentException("Parameter hEntityId is required and cannot be null."); } - return service.deleteHierarchicalEntity(appId, versionId, hEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteHierarchicalEntity(appId, versionId, hEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3844,6 +3980,9 @@ public CompositeEntityExtractor call(ServiceResponse r * @return the observable to the CompositeEntityExtractor object */ public Observable> getCompositeEntityWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3853,7 +3992,8 @@ public Observable> getCompositeEntityW if (cEntityId == null) { throw new IllegalArgumentException("Parameter cEntityId is required and cannot be null."); } - return service.getCompositeEntity(appId, versionId, cEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getCompositeEntity(appId, versionId, cEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -3935,6 +4075,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateCompositeEntityWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, CompositeEntityModel compositeModelUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -3948,7 +4091,8 @@ public Observable> updateCompositeEntityWithSer throw new IllegalArgumentException("Parameter compositeModelUpdateObject is required and cannot be null."); } Validator.validate(compositeModelUpdateObject); - return service.updateCompositeEntity(appId, versionId, cEntityId, compositeModelUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateCompositeEntity(appId, versionId, cEntityId, compositeModelUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4026,6 +4170,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteCompositeEntityWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4035,7 +4182,8 @@ public Observable> deleteCompositeEntityWithSer if (cEntityId == null) { throw new IllegalArgumentException("Parameter cEntityId is required and cannot be null."); } - return service.deleteCompositeEntity(appId, versionId, cEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteCompositeEntity(appId, versionId, cEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4113,6 +4261,9 @@ public ClosedListEntityExtractor call(ServiceResponse * @return the observable to the ClosedListEntityExtractor object */ public Observable> getClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4122,7 +4273,8 @@ public Observable> getClosedListWithS if (clEntityId == null) { throw new IllegalArgumentException("Parameter clEntityId is required and cannot be null."); } - return service.getClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4204,6 +4356,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, ClosedListModelUpdateObject closedListModelUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4217,7 +4372,8 @@ public Observable> updateClosedListWithServiceR throw new IllegalArgumentException("Parameter closedListModelUpdateObject is required and cannot be null."); } Validator.validate(closedListModelUpdateObject); - return service.updateClosedList(appId, versionId, clEntityId, closedListModelUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateClosedList(appId, versionId, clEntityId, closedListModelUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4300,6 +4456,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> patchClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, PatchClosedListOptionalParameter patchClosedListOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4325,6 +4484,9 @@ public Observable> patchClosedListWithServiceRe * @return the observable to the OperationStatus object */ public Observable> patchClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, List subLists) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4337,7 +4499,8 @@ public Observable> patchClosedListWithServiceRe Validator.validate(subLists); ClosedListModelPatchObject closedListModelPatchObject = new ClosedListModelPatchObject(); closedListModelPatchObject.withSubLists(subLists); - return service.patchClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), closedListModelPatchObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.patchClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), closedListModelPatchObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4478,6 +4641,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4487,7 +4653,8 @@ public Observable> deleteClosedListWithServiceR if (clEntityId == null) { throw new IllegalArgumentException("Parameter clEntityId is required and cannot be null."); } - return service.deleteClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4565,6 +4732,9 @@ public PrebuiltEntityExtractor call(ServiceResponse res * @return the observable to the PrebuiltEntityExtractor object */ public Observable> getPrebuiltWithServiceResponseAsync(UUID appId, String versionId, UUID prebuiltId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4574,7 +4744,8 @@ public Observable> getPrebuiltWithServi if (prebuiltId == null) { throw new IllegalArgumentException("Parameter prebuiltId is required and cannot be null."); } - return service.getPrebuilt(appId, versionId, prebuiltId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPrebuilt(appId, versionId, prebuiltId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4652,6 +4823,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePrebuiltWithServiceResponseAsync(UUID appId, String versionId, UUID prebuiltId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4661,7 +4835,8 @@ public Observable> deletePrebuiltWithServiceRes if (prebuiltId == null) { throw new IllegalArgumentException("Parameter prebuiltId is required and cannot be null."); } - return service.deletePrebuilt(appId, versionId, prebuiltId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePrebuilt(appId, versionId, prebuiltId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4743,6 +4918,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteSubListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, int subListId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4752,7 +4930,8 @@ public Observable> deleteSubListWithServiceResp if (clEntityId == null) { throw new IllegalArgumentException("Parameter clEntityId is required and cannot be null."); } - return service.deleteSubList(appId, versionId, clEntityId, subListId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteSubList(appId, versionId, clEntityId, subListId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4838,6 +5017,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateSubListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4851,7 +5033,8 @@ public Observable> updateSubListWithServiceResp throw new IllegalArgumentException("Parameter wordListBaseUpdateObject is required and cannot be null."); } Validator.validate(wordListBaseUpdateObject); - return service.updateSubList(appId, versionId, clEntityId, subListId, wordListBaseUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateSubList(appId, versionId, clEntityId, subListId, wordListBaseUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -4934,6 +5117,9 @@ public List call(ServiceResponse>> getIntentSuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, GetIntentSuggestionsOptionalParameter getIntentSuggestionsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4959,6 +5145,9 @@ public Observable>> getIntentSugg * @return the observable to the List<IntentsSuggestionExample> object */ public Observable>> getIntentSuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -4968,7 +5157,8 @@ public Observable>> getIntentSugg if (intentId == null) { throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } - return service.getIntentSuggestions(appId, versionId, intentId, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIntentSuggestions(appId, versionId, intentId, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5114,6 +5304,9 @@ public List call(ServiceResponse>> getEntitySuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, GetEntitySuggestionsOptionalParameter getEntitySuggestionsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5139,6 +5332,9 @@ public Observable>> getEntitySug * @return the observable to the List<EntitiesSuggestionExample> object */ public Observable>> getEntitySuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5148,7 +5344,8 @@ public Observable>> getEntitySug if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getEntitySuggestions(appId, versionId, entityId, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getEntitySuggestions(appId, versionId, entityId, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5293,6 +5490,9 @@ public Integer call(ServiceResponse response) { * @return the observable to the Integer object */ public Observable> addSubListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5306,7 +5506,8 @@ public Observable> addSubListWithServiceResponseAsync(U throw new IllegalArgumentException("Parameter wordListCreateObject is required and cannot be null."); } Validator.validate(wordListCreateObject); - return service.addSubList(appId, versionId, clEntityId, wordListCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addSubList(appId, versionId, clEntityId, wordListCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -5385,6 +5586,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<UUID> object */ public Observable>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5406,6 +5610,9 @@ public Observable>> addCustomPrebuiltDomainWithServic * @return the observable to the List<UUID> object */ public Observable>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, String domainName) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5414,7 +5621,8 @@ public Observable>> addCustomPrebuiltDomainWithServic } PrebuiltDomainCreateBaseObject prebuiltDomainObject = new PrebuiltDomainCreateBaseObject(); prebuiltDomainObject.withDomainName(domainName); - return service.addCustomPrebuiltDomain(appId, versionId, this.client.acceptLanguage(), prebuiltDomainObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCustomPrebuiltDomain(appId, versionId, this.client.acceptLanguage(), prebuiltDomainObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5548,6 +5756,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addCustomPrebuiltIntentWithServiceResponseAsync(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5558,7 +5769,8 @@ public Observable> addCustomPrebuiltIntentWithServiceRespo throw new IllegalArgumentException("Parameter prebuiltDomainModelCreateObject is required and cannot be null."); } Validator.validate(prebuiltDomainModelCreateObject); - return service.addCustomPrebuiltIntent(appId, versionId, prebuiltDomainModelCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCustomPrebuiltIntent(appId, versionId, prebuiltDomainModelCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -5632,13 +5844,17 @@ public List call(ServiceResponse> respo * @return the observable to the List<IntentClassifier> object */ public Observable>> listCustomPrebuiltIntentsWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listCustomPrebuiltIntents(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listCustomPrebuiltIntents(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5716,6 +5932,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addCustomPrebuiltEntityWithServiceResponseAsync(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5726,7 +5945,8 @@ public Observable> addCustomPrebuiltEntityWithServiceRespo throw new IllegalArgumentException("Parameter prebuiltDomainModelCreateObject is required and cannot be null."); } Validator.validate(prebuiltDomainModelCreateObject); - return service.addCustomPrebuiltEntity(appId, versionId, prebuiltDomainModelCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCustomPrebuiltEntity(appId, versionId, prebuiltDomainModelCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -5800,13 +6020,17 @@ public List call(ServiceResponse> respons * @return the observable to the List<EntityExtractor> object */ public Observable>> listCustomPrebuiltEntitiesWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listCustomPrebuiltEntities(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listCustomPrebuiltEntities(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5880,13 +6104,17 @@ public List call(ServiceResponse> * @return the observable to the List<CustomPrebuiltModel> object */ public Observable>> listCustomPrebuiltModelsWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.listCustomPrebuiltModels(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.listCustomPrebuiltModels(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5964,6 +6192,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, String domainName) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -5973,7 +6204,8 @@ public Observable> deleteCustomPrebuiltDomainWi if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } - return service.deleteCustomPrebuiltDomain(appId, versionId, domainName, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteCustomPrebuiltDomain(appId, versionId, domainName, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6055,6 +6287,9 @@ public HierarchicalChildEntity call(ServiceResponse res * @return the observable to the HierarchicalChildEntity object */ public Observable> getHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID hChildId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6067,7 +6302,8 @@ public Observable> getHierarchicalEntit if (hChildId == null) { throw new IllegalArgumentException("Parameter hChildId is required and cannot be null."); } - return service.getHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6154,6 +6390,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID hChildId, UpdateHierarchicalEntityChildOptionalParameter updateHierarchicalEntityChildOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6183,6 +6422,9 @@ public Observable> updateHierarchicalEntityChil * @return the observable to the OperationStatus object */ public Observable> updateHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID hChildId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6197,7 +6439,8 @@ public Observable> updateHierarchicalEntityChil } HierarchicalChildModelUpdateObject hierarchicalChildModelUpdateObject = new HierarchicalChildModelUpdateObject(); hierarchicalChildModelUpdateObject.withName(name); - return service.updateHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), hierarchicalChildModelUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), hierarchicalChildModelUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6349,6 +6592,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID hChildId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6361,7 +6607,8 @@ public Observable> deleteHierarchicalEntityChil if (hChildId == null) { throw new IllegalArgumentException("Parameter hChildId is required and cannot be null."); } - return service.deleteHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteHierarchicalEntityChild(appId, versionId, hEntityId, hChildId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6444,6 +6691,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, AddHierarchicalEntityChildOptionalParameter addHierarchicalEntityChildOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6469,6 +6719,9 @@ public Observable> addHierarchicalEntityChildWithServiceRe * @return the observable to the UUID object */ public Observable> addHierarchicalEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6480,7 +6733,8 @@ public Observable> addHierarchicalEntityChildWithServiceRe } HierarchicalChildModelCreateObject hierarchicalChildModelCreateObject = new HierarchicalChildModelCreateObject(); hierarchicalChildModelCreateObject.withName(name); - return service.addHierarchicalEntityChild(appId, versionId, hEntityId, this.client.acceptLanguage(), hierarchicalChildModelCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addHierarchicalEntityChild(appId, versionId, hEntityId, this.client.acceptLanguage(), hierarchicalChildModelCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6626,6 +6880,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> addCompositeEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, AddCompositeEntityChildOptionalParameter addCompositeEntityChildOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6651,6 +6908,9 @@ public Observable> addCompositeEntityChildWithServiceRespo * @return the observable to the UUID object */ public Observable> addCompositeEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6662,7 +6922,8 @@ public Observable> addCompositeEntityChildWithServiceRespo } CompositeChildModelCreateObject compositeChildModelCreateObject = new CompositeChildModelCreateObject(); compositeChildModelCreateObject.withName(name); - return service.addCompositeEntityChild(appId, versionId, cEntityId, this.client.acceptLanguage(), compositeChildModelCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addCompositeEntityChild(appId, versionId, cEntityId, this.client.acceptLanguage(), compositeChildModelCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6807,6 +7068,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteCompositeEntityChildWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, UUID cChildId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6819,7 +7083,8 @@ public Observable> deleteCompositeEntityChildWi if (cChildId == null) { throw new IllegalArgumentException("Parameter cChildId is required and cannot be null."); } - return service.deleteCompositeEntityChild(appId, versionId, cEntityId, cChildId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteCompositeEntityChild(appId, versionId, cEntityId, cChildId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -6898,6 +7163,9 @@ public List call(ServiceResponse>> getRegexEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetRegexEntityInfosOptionalParameter getRegexEntityInfosOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -6921,13 +7189,17 @@ public Observable>> getRegexEntityInf * @return the observable to the List<RegexEntityExtractor> object */ public Observable>> getRegexEntityInfosWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.getRegexEntityInfos(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getRegexEntityInfos(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -7068,6 +7340,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createRegexEntityModelWithServiceResponseAsync(UUID appId, String versionId, RegexModelCreateObject regexEntityExtractorCreateObj) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7078,7 +7353,8 @@ public Observable> createRegexEntityModelWithServiceRespon throw new IllegalArgumentException("Parameter regexEntityExtractorCreateObj is required and cannot be null."); } Validator.validate(regexEntityExtractorCreateObj); - return service.createRegexEntityModel(appId, versionId, regexEntityExtractorCreateObj, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createRegexEntityModel(appId, versionId, regexEntityExtractorCreateObj, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -7157,6 +7433,9 @@ public List call(ServiceResponse>> getPatternAnyEntityInfosWithServiceResponseAsync(UUID appId, String versionId, GetPatternAnyEntityInfosOptionalParameter getPatternAnyEntityInfosOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7180,13 +7459,17 @@ public Observable>> getPatternAn * @return the observable to the List<PatternAnyEntityExtractor> object */ public Observable>> getPatternAnyEntityInfosWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.getPatternAnyEntityInfos(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPatternAnyEntityInfos(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -7327,6 +7610,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createPatternAnyEntityModelWithServiceResponseAsync(UUID appId, String versionId, PatternAnyModelCreateObject extractorCreateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7337,7 +7623,8 @@ public Observable> createPatternAnyEntityModelWithServiceR throw new IllegalArgumentException("Parameter extractorCreateObject is required and cannot be null."); } Validator.validate(extractorCreateObject); - return service.createPatternAnyEntityModel(appId, versionId, extractorCreateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createPatternAnyEntityModel(appId, versionId, extractorCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -7415,6 +7702,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7424,7 +7714,8 @@ public Observable>> getEntityRolesWithServiceRe if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -7507,6 +7798,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7532,6 +7826,9 @@ public Observable> createEntityRoleWithServiceResponseAsyn * @return the observable to the UUID object */ public Observable> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7543,7 +7840,8 @@ public Observable> createEntityRoleWithServiceResponseAsyn } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -7684,6 +7982,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getPrebuiltEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7693,7 +7994,8 @@ public Observable>> getPrebuiltEntityRolesWithS if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getPrebuiltEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPrebuiltEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -7776,6 +8078,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7801,6 +8106,9 @@ public Observable> createPrebuiltEntityRoleWithServiceResp * @return the observable to the UUID object */ public Observable> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7812,7 +8120,8 @@ public Observable> createPrebuiltEntityRoleWithServiceResp } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createPrebuiltEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createPrebuiltEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -7953,6 +8262,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getClosedListEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -7962,7 +8274,8 @@ public Observable>> getClosedListEntityRolesWit if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getClosedListEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getClosedListEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -8045,6 +8358,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateClosedListEntityRoleOptionalParameter createClosedListEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8070,6 +8386,9 @@ public Observable> createClosedListEntityRoleWithServiceRe * @return the observable to the UUID object */ public Observable> createClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8081,7 +8400,8 @@ public Observable> createClosedListEntityRoleWithServiceRe } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createClosedListEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createClosedListEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -8222,6 +8542,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getRegexEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8231,7 +8554,8 @@ public Observable>> getRegexEntityRolesWithServ if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getRegexEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getRegexEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -8314,6 +8638,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateRegexEntityRoleOptionalParameter createRegexEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8339,6 +8666,9 @@ public Observable> createRegexEntityRoleWithServiceRespons * @return the observable to the UUID object */ public Observable> createRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8350,7 +8680,8 @@ public Observable> createRegexEntityRoleWithServiceRespons } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createRegexEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createRegexEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -8491,6 +8822,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getCompositeEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8500,7 +8834,8 @@ public Observable>> getCompositeEntityRolesWith if (cEntityId == null) { throw new IllegalArgumentException("Parameter cEntityId is required and cannot be null."); } - return service.getCompositeEntityRoles(appId, versionId, cEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getCompositeEntityRoles(appId, versionId, cEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -8583,6 +8918,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8608,6 +8946,9 @@ public Observable> createCompositeEntityRoleWithServiceRes * @return the observable to the UUID object */ public Observable> createCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8619,7 +8960,8 @@ public Observable> createCompositeEntityRoleWithServiceRes } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createCompositeEntityRole(appId, versionId, cEntityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createCompositeEntityRole(appId, versionId, cEntityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -8760,6 +9102,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getPatternAnyEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8769,7 +9114,8 @@ public Observable>> getPatternAnyEntityRolesWit if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getPatternAnyEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPatternAnyEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -8852,6 +9198,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createPatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePatternAnyEntityRoleOptionalParameter createPatternAnyEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8877,6 +9226,9 @@ public Observable> createPatternAnyEntityRoleWithServiceRe * @return the observable to the UUID object */ public Observable> createPatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -8888,7 +9240,8 @@ public Observable> createPatternAnyEntityRoleWithServiceRe } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createPatternAnyEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createPatternAnyEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -9029,6 +9382,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getHierarchicalEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9038,7 +9394,8 @@ public Observable>> getHierarchicalEntityRolesW if (hEntityId == null) { throw new IllegalArgumentException("Parameter hEntityId is required and cannot be null."); } - return service.getHierarchicalEntityRoles(appId, versionId, hEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getHierarchicalEntityRoles(appId, versionId, hEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -9121,6 +9478,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, CreateHierarchicalEntityRoleOptionalParameter createHierarchicalEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9146,6 +9506,9 @@ public Observable> createHierarchicalEntityRoleWithService * @return the observable to the UUID object */ public Observable> createHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9157,7 +9520,8 @@ public Observable> createHierarchicalEntityRoleWithService } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createHierarchicalEntityRole(appId, versionId, hEntityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createHierarchicalEntityRole(appId, versionId, hEntityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -9298,6 +9662,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<EntityRole> object */ public Observable>> getCustomPrebuiltEntityRolesWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9307,7 +9674,8 @@ public Observable>> getCustomPrebuiltEntityRole if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getCustomPrebuiltEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getCustomPrebuiltEntityRoles(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -9390,6 +9758,9 @@ public UUID call(ServiceResponse response) { * @return the observable to the UUID object */ public Observable> createCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9415,6 +9786,9 @@ public Observable> createCustomPrebuiltEntityRoleWithServi * @return the observable to the UUID object */ public Observable> createCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9426,7 +9800,8 @@ public Observable> createCustomPrebuiltEntityRoleWithServi } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject(); entityRoleCreateObject.withName(name); - return service.createCustomPrebuiltEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createCustomPrebuiltEntityRole(appId, versionId, entityId, this.client.acceptLanguage(), entityRoleCreateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -9567,6 +9942,9 @@ public List call(ServiceResponse> respo * @return the observable to the List<ExplicitListItem> object */ public Observable>> getExplicitListWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9576,7 +9954,8 @@ public Observable>> getExplicitListWithSe if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getExplicitList(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getExplicitList(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -9659,6 +10038,9 @@ public Integer call(ServiceResponse response) { * @return the observable to the Integer object */ public Observable> addExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9684,6 +10066,9 @@ public Observable> addExplicitListItemWithServiceRespon * @return the observable to the Integer object */ public Observable> addExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String explicitListItem) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9695,7 +10080,8 @@ public Observable> addExplicitListItemWithServiceRespon } ExplicitListItemCreateObject item = new ExplicitListItemCreateObject(); item.withExplicitListItem(explicitListItem); - return service.addExplicitListItem(appId, versionId, entityId, this.client.acceptLanguage(), item, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addExplicitListItem(appId, versionId, entityId, this.client.acceptLanguage(), item, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -9836,6 +10222,9 @@ public RegexEntityExtractor call(ServiceResponse response) * @return the observable to the RegexEntityExtractor object */ public Observable> getRegexEntityEntityInfoWithServiceResponseAsync(UUID appId, String versionId, UUID regexEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9845,7 +10234,8 @@ public Observable> getRegexEntityEntityInf if (regexEntityId == null) { throw new IllegalArgumentException("Parameter regexEntityId is required and cannot be null."); } - return service.getRegexEntityEntityInfo(appId, versionId, regexEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getRegexEntityEntityInfo(appId, versionId, regexEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -9927,6 +10317,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateRegexEntityModelWithServiceResponseAsync(UUID appId, String versionId, UUID regexEntityId, RegexModelUpdateObject regexEntityUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -9940,7 +10333,8 @@ public Observable> updateRegexEntityModelWithSe throw new IllegalArgumentException("Parameter regexEntityUpdateObject is required and cannot be null."); } Validator.validate(regexEntityUpdateObject); - return service.updateRegexEntityModel(appId, versionId, regexEntityId, regexEntityUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateRegexEntityModel(appId, versionId, regexEntityId, regexEntityUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10018,6 +10412,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteRegexEntityModelWithServiceResponseAsync(UUID appId, String versionId, UUID regexEntityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10027,7 +10424,8 @@ public Observable> deleteRegexEntityModelWithSe if (regexEntityId == null) { throw new IllegalArgumentException("Parameter regexEntityId is required and cannot be null."); } - return service.deleteRegexEntityModel(appId, versionId, regexEntityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteRegexEntityModel(appId, versionId, regexEntityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10105,6 +10503,9 @@ public PatternAnyEntityExtractor call(ServiceResponse * @return the observable to the PatternAnyEntityExtractor object */ public Observable> getPatternAnyEntityInfoWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10114,7 +10515,8 @@ public Observable> getPatternAnyEntit if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getPatternAnyEntityInfo(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPatternAnyEntityInfo(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10196,6 +10598,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updatePatternAnyEntityModelWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, PatternAnyModelUpdateObject patternAnyUpdateObject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10209,7 +10614,8 @@ public Observable> updatePatternAnyEntityModelW throw new IllegalArgumentException("Parameter patternAnyUpdateObject is required and cannot be null."); } Validator.validate(patternAnyUpdateObject); - return service.updatePatternAnyEntityModel(appId, versionId, entityId, patternAnyUpdateObject, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePatternAnyEntityModel(appId, versionId, entityId, patternAnyUpdateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10287,6 +10693,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePatternAnyEntityModelWithServiceResponseAsync(UUID appId, String versionId, UUID entityId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10296,7 +10705,8 @@ public Observable> deletePatternAnyEntityModelW if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.deletePatternAnyEntityModel(appId, versionId, entityId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePatternAnyEntityModel(appId, versionId, entityId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10378,6 +10788,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10390,7 +10803,8 @@ public Observable> getEntityRoleWithServiceResponseA if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10477,6 +10891,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateEntityRoleOptionalParameter updateEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10506,6 +10923,9 @@ public Observable> updateEntityRoleWithServiceR * @return the observable to the OperationStatus object */ public Observable> updateEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10520,7 +10940,8 @@ public Observable> updateEntityRoleWithServiceR } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10672,6 +11093,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10684,7 +11108,8 @@ public Observable> deleteEntityRoleWithServiceR if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10766,6 +11191,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10778,7 +11206,8 @@ public Observable> getPrebuiltEntityRoleWithServiceR if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getPrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -10865,6 +11294,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updatePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10894,6 +11326,9 @@ public Observable> updatePrebuiltEntityRoleWith * @return the observable to the OperationStatus object */ public Observable> updatePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -10908,7 +11343,8 @@ public Observable> updatePrebuiltEntityRoleWith } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updatePrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11060,6 +11496,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11072,7 +11511,8 @@ public Observable> deletePrebuiltEntityRoleWith if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deletePrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11154,6 +11594,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11166,7 +11609,8 @@ public Observable> getClosedListEntityRoleWithServic if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11253,6 +11697,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateClosedListEntityRoleOptionalParameter updateClosedListEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11282,6 +11729,9 @@ public Observable> updateClosedListEntityRoleWi * @return the observable to the OperationStatus object */ public Observable> updateClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11296,7 +11746,8 @@ public Observable> updateClosedListEntityRoleWi } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11448,6 +11899,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11460,7 +11914,8 @@ public Observable> deleteClosedListEntityRoleWi if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteClosedListEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11542,6 +11997,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11554,7 +12012,8 @@ public Observable> getRegexEntityRoleWithServiceResp if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11641,6 +12100,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateRegexEntityRoleOptionalParameter updateRegexEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11670,6 +12132,9 @@ public Observable> updateRegexEntityRoleWithSer * @return the observable to the OperationStatus object */ public Observable> updateRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11684,7 +12149,8 @@ public Observable> updateRegexEntityRoleWithSer } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11836,6 +12302,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteRegexEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11848,7 +12317,8 @@ public Observable> deleteRegexEntityRoleWithSer if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteRegexEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -11930,6 +12400,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -11942,7 +12415,8 @@ public Observable> getCompositeEntityRoleWithService if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12029,6 +12503,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId, UpdateCompositeEntityRoleOptionalParameter updateCompositeEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12058,6 +12535,9 @@ public Observable> updateCompositeEntityRoleWit * @return the observable to the OperationStatus object */ public Observable> updateCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12072,7 +12552,8 @@ public Observable> updateCompositeEntityRoleWit } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12224,6 +12705,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12236,7 +12720,8 @@ public Observable> deleteCompositeEntityRoleWit if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteCompositeEntityRole(appId, versionId, cEntityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12318,6 +12803,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getPatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12330,7 +12818,8 @@ public Observable> getPatternAnyEntityRoleWithServic if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getPatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12417,6 +12906,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updatePatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12446,6 +12938,9 @@ public Observable> updatePatternAnyEntityRoleWi * @return the observable to the OperationStatus object */ public Observable> updatePatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12460,7 +12955,8 @@ public Observable> updatePatternAnyEntityRoleWi } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updatePatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12612,6 +13108,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12624,7 +13123,8 @@ public Observable> deletePatternAnyEntityRoleWi if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deletePatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePatternAnyEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12706,6 +13206,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12718,7 +13221,8 @@ public Observable> getHierarchicalEntityRoleWithServ if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -12805,6 +13309,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12834,6 +13341,9 @@ public Observable> updateHierarchicalEntityRole * @return the observable to the OperationStatus object */ public Observable> updateHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -12848,7 +13358,8 @@ public Observable> updateHierarchicalEntityRole } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13000,6 +13511,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13012,7 +13526,8 @@ public Observable> deleteHierarchicalEntityRole if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteHierarchicalEntityRole(appId, versionId, hEntityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13094,6 +13609,9 @@ public EntityRole call(ServiceResponse response) { * @return the observable to the EntityRole object */ public Observable> getCustomEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13106,7 +13624,8 @@ public Observable> getCustomEntityRoleWithServiceRes if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.getCustomEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getCustomEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13193,6 +13712,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateCustomPrebuiltEntityRoleOptionalParameter updateCustomPrebuiltEntityRoleOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13222,6 +13744,9 @@ public Observable> updateCustomPrebuiltEntityRo * @return the observable to the OperationStatus object */ public Observable> updateCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13236,7 +13761,8 @@ public Observable> updateCustomPrebuiltEntityRo } EntityRoleUpdateObject entityRoleUpdateObject = new EntityRoleUpdateObject(); entityRoleUpdateObject.withName(name); - return service.updateCustomPrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateCustomPrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), entityRoleUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13388,6 +13914,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteCustomEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13400,7 +13929,8 @@ public Observable> deleteCustomEntityRoleWithSe if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } - return service.deleteCustomEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteCustomEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13482,6 +14012,9 @@ public ExplicitListItem call(ServiceResponse response) { * @return the observable to the ExplicitListItem object */ public Observable> getExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13491,7 +14024,8 @@ public Observable> getExplicitListItemWithServ if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.getExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13578,6 +14112,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13604,6 +14141,9 @@ public Observable> updateExplicitListItemWithSe * @return the observable to the OperationStatus object */ public Observable> updateExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId, String explicitListItem) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13615,7 +14155,8 @@ public Observable> updateExplicitListItemWithSe } ExplicitListItemUpdateObject item = new ExplicitListItemUpdateObject(); item.withExplicitListItem(explicitListItem); - return service.updateExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), item, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), item, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -13767,6 +14308,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -13776,7 +14320,8 @@ public Observable> deleteExplicitListItemWithSe if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } - return service.deleteExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteExplicitListItem(appId, versionId, entityId, itemId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java index ca3cd90b31f21..c953014f09501 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java @@ -12,6 +12,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.GetIntentPatternsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; @@ -67,35 +68,35 @@ public PatternsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface PatternsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns addPattern" }) @POST("apps/{appId}/versions/{versionId}/patternrule") - Observable> addPattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PatternRuleCreateObject pattern, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> addPattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body PatternRuleCreateObject pattern, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns getPatterns" }) @GET("apps/{appId}/versions/{versionId}/patternrules") - Observable> getPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns updatePatterns" }) @PUT("apps/{appId}/versions/{versionId}/patternrules") - Observable> updatePatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patterns, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updatePatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patterns, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns batchAddPatterns" }) @POST("apps/{appId}/versions/{versionId}/patternrules") - Observable> batchAddPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patterns, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> batchAddPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patterns, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns deletePatterns" }) @HTTP(path = "apps/{appId}/versions/{versionId}/patternrules", method = "DELETE", hasBody = true) - Observable> deletePatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patternIds, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body List patternIds, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns updatePattern" }) @PUT("apps/{appId}/versions/{versionId}/patternrules/{patternId}") - Observable> updatePattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("patternId") UUID patternId, @Body PatternRuleUpdateObject pattern, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> updatePattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("patternId") UUID patternId, @Body PatternRuleUpdateObject pattern, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns deletePattern" }) @HTTP(path = "apps/{appId}/versions/{versionId}/patternrules/{patternId}", method = "DELETE", hasBody = true) - Observable> deletePattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("patternId") UUID patternId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deletePattern(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("patternId") UUID patternId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns getIntentPatterns" }) @GET("apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules") - Observable> getIntentPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getIntentPatterns(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -156,6 +157,9 @@ public PatternRuleInfo call(ServiceResponse response) { * @return the observable to the PatternRuleInfo object */ public Observable> addPatternWithServiceResponseAsync(UUID appId, String versionId, PatternRuleCreateObject pattern) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -166,7 +170,8 @@ public Observable> addPatternWithServiceRespons throw new IllegalArgumentException("Parameter pattern is required and cannot be null."); } Validator.validate(pattern); - return service.addPattern(appId, versionId, pattern, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.addPattern(appId, versionId, pattern, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -245,6 +250,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<PatternRuleInfo> object */ public Observable>> getPatternsWithServiceResponseAsync(UUID appId, String versionId, GetPatternsOptionalParameter getPatternsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -268,13 +276,17 @@ public Observable>> getPatternsWithService * @return the observable to the List<PatternRuleInfo> object */ public Observable>> getPatternsWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.getPatterns(appId, versionId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getPatterns(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -415,6 +427,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<PatternRuleInfo> object */ public Observable>> updatePatternsWithServiceResponseAsync(UUID appId, String versionId, List patterns) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -425,7 +440,8 @@ public Observable>> updatePatternsWithServ throw new IllegalArgumentException("Parameter patterns is required and cannot be null."); } Validator.validate(patterns); - return service.updatePatterns(appId, versionId, patterns, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePatterns(appId, versionId, patterns, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -503,6 +519,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<PatternRuleInfo> object */ public Observable>> batchAddPatternsWithServiceResponseAsync(UUID appId, String versionId, List patterns) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -513,7 +532,8 @@ public Observable>> batchAddPatternsWithSe throw new IllegalArgumentException("Parameter patterns is required and cannot be null."); } Validator.validate(patterns); - return service.batchAddPatterns(appId, versionId, patterns, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.batchAddPatterns(appId, versionId, patterns, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -591,6 +611,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePatternsWithServiceResponseAsync(UUID appId, String versionId, List patternIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -601,7 +624,8 @@ public Observable> deletePatternsWithServiceRes throw new IllegalArgumentException("Parameter patternIds is required and cannot be null."); } Validator.validate(patternIds); - return service.deletePatterns(appId, versionId, patternIds, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePatterns(appId, versionId, patternIds, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -683,6 +707,9 @@ public PatternRuleInfo call(ServiceResponse response) { * @return the observable to the PatternRuleInfo object */ public Observable> updatePatternWithServiceResponseAsync(UUID appId, String versionId, UUID patternId, PatternRuleUpdateObject pattern) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -696,7 +723,8 @@ public Observable> updatePatternWithServiceResp throw new IllegalArgumentException("Parameter pattern is required and cannot be null."); } Validator.validate(pattern); - return service.updatePattern(appId, versionId, patternId, pattern, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updatePattern(appId, versionId, patternId, pattern, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -774,6 +802,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deletePatternWithServiceResponseAsync(UUID appId, String versionId, UUID patternId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -783,7 +814,8 @@ public Observable> deletePatternWithServiceResp if (patternId == null) { throw new IllegalArgumentException("Parameter patternId is required and cannot be null."); } - return service.deletePattern(appId, versionId, patternId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deletePattern(appId, versionId, patternId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -866,6 +898,9 @@ public List call(ServiceResponse> respons * @return the observable to the List<PatternRuleInfo> object */ public Observable>> getIntentPatternsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, GetIntentPatternsOptionalParameter getIntentPatternsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -893,6 +928,9 @@ public Observable>> getIntentPatternsWithS * @return the observable to the List<PatternRuleInfo> object */ public Observable>> getIntentPatternsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -902,7 +940,8 @@ public Observable>> getIntentPatternsWithS if (intentId == null) { throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } - return service.getIntentPatterns(appId, versionId, intentId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIntentPatterns(appId, versionId, intentId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java index 22667ce992e04..3f2dd428d505b 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdatePermissionsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.CollaboratorsArray; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; @@ -67,19 +68,19 @@ public PermissionsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface PermissionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions list" }) @GET("apps/{appId}/permissions") - Observable> list(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions add" }) @POST("apps/{appId}/permissions") - Observable> add(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body UserCollaborator userToAdd, @Header("User-Agent") String userAgent); + Observable> add(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body UserCollaborator userToAdd, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions delete" }) @HTTP(path = "apps/{appId}/permissions", method = "DELETE", hasBody = true) - Observable> delete(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body UserCollaborator userToDelete, @Header("User-Agent") String userAgent); + Observable> delete(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body UserCollaborator userToDelete, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions update" }) @PUT("apps/{appId}/permissions") - Observable> update(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body CollaboratorsArray collaborators, @Header("User-Agent") String userAgent); + Observable> update(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Body CollaboratorsArray collaborators, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -132,10 +133,14 @@ public UserAccessList call(ServiceResponse response) { * @return the observable to the UserAccessList object */ public Observable> listWithServiceResponseAsync(UUID appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.list(appId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.list(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -210,6 +215,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> addWithServiceResponseAsync(UUID appId, AddPermissionsOptionalParameter addOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -227,12 +235,16 @@ public Observable> addWithServiceResponseAsync( * @return the observable to the OperationStatus object */ public Observable> addWithServiceResponseAsync(UUID appId, String email) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } UserCollaborator userToAdd = new UserCollaborator(); userToAdd.withEmail(email); - return service.add(appId, this.client.acceptLanguage(), userToAdd, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.add(appId, this.client.acceptLanguage(), userToAdd, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -356,6 +368,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteWithServiceResponseAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -373,12 +388,16 @@ public Observable> deleteWithServiceResponseAsy * @return the observable to the OperationStatus object */ public Observable> deleteWithServiceResponseAsync(UUID appId, String email) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } UserCollaborator userToDelete = new UserCollaborator(); userToDelete.withEmail(email); - return service.delete(appId, this.client.acceptLanguage(), userToDelete, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.delete(appId, this.client.acceptLanguage(), userToDelete, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -502,6 +521,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateWithServiceResponseAsync(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -519,13 +541,17 @@ public Observable> updateWithServiceResponseAsy * @return the observable to the OperationStatus object */ public Observable> updateWithServiceResponseAsync(UUID appId, List emails) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } Validator.validate(emails); CollaboratorsArray collaborators = new CollaboratorsArray(); collaborators.withEmails(emails); - return service.update(appId, this.client.acceptLanguage(), collaborators, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.update(appId, this.client.acceptLanguage(), collaborators, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java index 241d537384944..c72da51ee224d 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java @@ -10,6 +10,7 @@ import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Trains; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.EnqueueTrainingResponse; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; @@ -58,11 +59,11 @@ public TrainsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface TrainsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Trains trainVersion" }) @POST("apps/{appId}/versions/{versionId}/train") - Observable> trainVersion(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> trainVersion(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Trains getStatus" }) @GET("apps/{appId}/versions/{versionId}/train") - Observable> getStatus(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getStatus(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -119,13 +120,17 @@ public EnqueueTrainingResponse call(ServiceResponse res * @return the observable to the EnqueueTrainingResponse object */ public Observable> trainVersionWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.trainVersion(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.trainVersion(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -199,13 +204,17 @@ public List call(ServiceResponse> res * @return the observable to the List<ModelTrainingInfo> object */ public Observable>> getStatusWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.getStatus(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getStatus(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java index 2dcccd4157ac6..1b3b8e5b0b0bb 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java +++ b/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportMethodVersionsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisApp; @@ -69,35 +70,35 @@ public VersionsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface VersionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions clone" }) @POST("apps/{appId}/versions/{versionId}/clone") - Observable> clone(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body TaskUpdateObject versionCloneObject, @Header("User-Agent") String userAgent); + Observable> clone(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body TaskUpdateObject versionCloneObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions list" }) @GET("apps/{appId}/versions") - Observable> list(@Path("appId") UUID appId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("appId") UUID appId, @Query("skip") Integer skip, @Query("take") Integer take, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions get" }) @GET("apps/{appId}/versions/{versionId}/") - Observable> get(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> get(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions update" }) @PUT("apps/{appId}/versions/{versionId}/") - Observable> update(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body TaskUpdateObject versionUpdateObject, @Header("User-Agent") String userAgent); + Observable> update(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Body TaskUpdateObject versionUpdateObject, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions delete" }) @HTTP(path = "apps/{appId}/versions/{versionId}/", method = "DELETE", hasBody = true) - Observable> delete(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions export" }) @GET("apps/{appId}/versions/{versionId}/export") - Observable> export(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> export(@Path("appId") UUID appId, @Path("versionId") String versionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions importMethod" }) @POST("apps/{appId}/versions/import") - Observable> importMethod(@Path("appId") UUID appId, @Query("versionId") String versionId, @Body LuisApp luisApp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> importMethod(@Path("appId") UUID appId, @Query("versionId") String versionId, @Body LuisApp luisApp, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions deleteUnlabelledUtterance" }) @HTTP(path = "apps/{appId}/versions/{versionId}/suggest", method = "DELETE", hasBody = true) - Observable> deleteUnlabelledUtterance(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body String utterance, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> deleteUnlabelledUtterance(@Path("appId") UUID appId, @Path("versionId") String versionId, @Body String utterance, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -159,6 +160,9 @@ public String call(ServiceResponse response) { * @return the observable to the String object */ public Observable> cloneWithServiceResponseAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -180,6 +184,9 @@ public Observable> cloneWithServiceResponseAsync(UUID ap * @return the observable to the String object */ public Observable> cloneWithServiceResponseAsync(UUID appId, String versionId, String version) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -191,7 +198,8 @@ public Observable> cloneWithServiceResponseAsync(UUID ap versionCloneObject = new TaskUpdateObject(); versionCloneObject.withVersion(version); } - return service.clone(appId, versionId, this.client.acceptLanguage(), versionCloneObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.clone(appId, versionId, this.client.acceptLanguage(), versionCloneObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -322,6 +330,9 @@ public List call(ServiceResponse> response) { * @return the observable to the List<VersionInfo> object */ public Observable>> listWithServiceResponseAsync(UUID appId, ListVersionsOptionalParameter listOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -341,10 +352,14 @@ public Observable>> listWithServiceResponseAsy * @return the observable to the List<VersionInfo> object */ public Observable>> listWithServiceResponseAsync(UUID appId, Integer skip, Integer take) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } - return service.list(appId, skip, take, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.list(appId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -474,13 +489,17 @@ public VersionInfo call(ServiceResponse response) { * @return the observable to the VersionInfo object */ public Observable> getWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.get(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.get(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -559,6 +578,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> updateWithServiceResponseAsync(UUID appId, String versionId, UpdateVersionsOptionalParameter updateOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -580,6 +602,9 @@ public Observable> updateWithServiceResponseAsy * @return the observable to the OperationStatus object */ public Observable> updateWithServiceResponseAsync(UUID appId, String versionId, String version) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -588,7 +613,8 @@ public Observable> updateWithServiceResponseAsy } TaskUpdateObject versionUpdateObject = new TaskUpdateObject(); versionUpdateObject.withVersion(version); - return service.update(appId, versionId, this.client.acceptLanguage(), versionUpdateObject, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.update(appId, versionId, this.client.acceptLanguage(), versionUpdateObject, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -718,13 +744,17 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.delete(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.delete(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -798,13 +828,17 @@ public LuisApp call(ServiceResponse response) { * @return the observable to the LuisApp object */ public Observable> exportWithServiceResponseAsync(UUID appId, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } - return service.export(appId, versionId, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.export(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -883,6 +917,9 @@ public String call(ServiceResponse response) { * @return the observable to the String object */ public Observable> importMethodWithServiceResponseAsync(UUID appId, LuisApp luisApp, ImportMethodVersionsOptionalParameter importMethodOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -905,6 +942,9 @@ public Observable> importMethodWithServiceResponseAsync( * @return the observable to the String object */ public Observable> importMethodWithServiceResponseAsync(UUID appId, LuisApp luisApp, String versionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -912,7 +952,8 @@ public Observable> importMethodWithServiceResponseAsync( throw new IllegalArgumentException("Parameter luisApp is required and cannot be null."); } Validator.validate(luisApp); - return service.importMethod(appId, versionId, luisApp, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importMethod(appId, versionId, luisApp, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1046,6 +1087,9 @@ public OperationStatus call(ServiceResponse response) { * @return the observable to the OperationStatus object */ public Observable> deleteUnlabelledUtteranceWithServiceResponseAsync(UUID appId, String versionId, String utterance) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -1055,7 +1099,8 @@ public Observable> deleteUnlabelledUtteranceWit if (utterance == null) { throw new IllegalArgumentException("Parameter utterance is required and cannot be null."); } - return service.deleteUnlabelledUtterance(appId, versionId, utterance, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteUnlabelledUtterance(appId, versionId, utterance, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/EndpointAPI.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/EndpointAPI.java new file mode 100644 index 0000000000000..7ea4c957b625e --- /dev/null +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/EndpointAPI.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.cognitiveservices.language.luis.runtime; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +import java.util.Collection; + +/** + * Defines values for LUIS endpoint API. + */ +public final class EndpointAPI extends ExpandableStringEnum { + /** Static value US_WEST for EndpointAPI. */ + public static final EndpointAPI US_WEST = fromString("westus.api.cognitive.microsoft.com"); + + /** Static value US_WEST2 for EndpointAPI. */ + public static final EndpointAPI US_WEST2 = fromString("westus2.api.cognitive.microsoft.com"); + + /** Static value US_EAST for EndpointAPI. */ + public static final EndpointAPI US_EAST = fromString("eastus.api.cognitive.microsoft.com"); + + /** Static value US_EAST2 for EndpointAPI. */ + public static final EndpointAPI US_EAST2 = fromString("eastus2.api.cognitive.microsoft.com"); + + /** Static value US_WEST_CENTRAL for EndpointAPI. */ + public static final EndpointAPI US_WEST_CENTRAL = fromString("westcentralus.api.cognitive.microsoft.com"); + + /** Static value US_SOUTH_CENTRAL for EndpointAPI. */ + public static final EndpointAPI US_SOUTH_CENTRAL = fromString("southcentralus.api.cognitive.microsoft.com"); + + /** Static value EUROPE_WEST for EndpointAPI. */ + public static final EndpointAPI EUROPE_WEST = fromString("westeurope.api.cognitive.microsoft.com"); + + /** Static value EUROPE_NORTH for EndpointAPI. */ + public static final EndpointAPI EUROPE_NORTH = fromString("northeurope.api.cognitive.microsoft.com"); + + /** Static value ASIA_SOUTHEAST for EndpointAPI. */ + public static final EndpointAPI ASIA_SOUTHEAST = fromString("southeastasia.api.cognitive.microsoft.com"); + + /** Static value ASIA_EAST for EndpointAPI. */ + public static final EndpointAPI ASIA_EAST = fromString("eastasia.api.cognitive.microsoft.com"); + + /** Static value AUSTRALIA_EAST for EndpointAPI. */ + public static final EndpointAPI AUSTRALIA_EAST = fromString("australiaeast.api.cognitive.microsoft.com"); + + /** Static value BRAZIL_SOUTH for EndpointAPI. */ + public static final EndpointAPI BRAZIL_SOUTH = fromString("brazilsouth.api.cognitive.microsoft.com"); + + /** + * Creates or finds a EndpointAPI from its string representation. + * @param name a name to look for + * @return the corresponding EndpointAPI + */ + @JsonCreator + public static EndpointAPI fromString(String name) { + return fromString(name, EndpointAPI.class); + } + + /** + * @return known CatalogCollationType values + */ + public static Collection values() { + return values(EndpointAPI.class); + } +} diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java index 4cdc67e772bd8..96e1da798fa43 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java @@ -35,6 +35,21 @@ public interface LuisRuntimeAPI { */ String userAgent(); + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + LuisRuntimeAPI withEndpoint(String endpoint); + /** * Gets Gets or sets the preferred language for the response.. * diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java index a70dc9de8371c..64c13ed985061 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java @@ -15,6 +15,7 @@ import okhttp3.Response; import java.io.IOException; +import java.net.URI; /** * Entry point to Azure Cognitive Services Language Understanding (LUIS) Runtime manager. @@ -23,21 +24,23 @@ public class LuisRuntimeManager { /** * Initializes an instance of Language Understanding (LUIS) Runtime API client. * - * @param subscriptionKey the Language Understanding (LUIS) Runtime API key + * @param endpointAPI the endpoint API + * @param luisAuthoringKey the Language Understanding (LUIS) Authoring API key (see https://www.luis.ai) * @return the Language Understanding Runtime API client */ - public static LuisRuntimeAPI authenticate(String subscriptionKey) { - return authenticate("https://api.cognitive.microsoft.com/luis/v2.0/", subscriptionKey); + public static LuisRuntimeAPI authenticate(EndpointAPI endpointAPI, String luisAuthoringKey) { + return authenticate(String.format("https://%s/luis/v2.0/", endpointAPI.toString()), luisAuthoringKey) + .withEndpoint(endpointAPI.toString()); } /** * Initializes an instance of Language Understanding (LUIS) Runtime API client. * * @param baseUrl the base URL of the service - * @param subscriptionKey the Language Understanding (LUIS) Runtime API key + * @param luisAuthoringKey the Language Understanding (LUIS) Authoring API key (see https://www.luis.ai) * @return the Language Understanding (LUIS) Runtime API client */ - public static LuisRuntimeAPI authenticate(String baseUrl, final String subscriptionKey) { + public static LuisRuntimeAPI authenticate(String baseUrl, final String luisAuthoringKey) { ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { @Override public void applyCredentialsFilter(OkHttpClient.Builder builder) { @@ -49,24 +52,34 @@ public Response intercept(Chain chain) throws IOException { Request original = chain.request(); // Request customization: add request headers Request.Builder requestBuilder = original.newBuilder() - .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey); + .addHeader("Ocp-Apim-Subscription-Key", luisAuthoringKey); request = requestBuilder.build(); return chain.proceed(request); } }); } }; - return authenticate(baseUrl, serviceClientCredentials); + String endpointAPI = null; + try { + URI uri = new URI(baseUrl); + endpointAPI = uri.getHost(); + } catch (Exception e) { + endpointAPI = EndpointAPI.US_WEST.toString(); + } + return authenticate(baseUrl, serviceClientCredentials) + .withEndpoint(endpointAPI); } /** * Initializes an instance of Language Understanding (LUIS) Runtime API client. * + * @param endpointAPI the endpoint API * @param credentials the management credentials for Azure * @return the Language Understanding (LUIS) Runtime API client */ - public static LuisRuntimeAPI authenticate(ServiceClientCredentials credentials) { - return authenticate("https://api.cognitive.microsoft.com/luis/v2.0/", credentials); + public static LuisRuntimeAPI authenticate(EndpointAPI endpointAPI, ServiceClientCredentials credentials) { + return authenticate(String.format("https://%s/luis/v2.0/", endpointAPI.toString()), credentials) + .withEndpoint(endpointAPI.toString()); } /** @@ -77,7 +90,15 @@ public static LuisRuntimeAPI authenticate(ServiceClientCredentials credentials) * @return the Language Understanding (LUIS) Runtime API client */ public static LuisRuntimeAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { - return new LuisRuntimeAPIImpl(baseUrl, credentials); + String endpointAPI = null; + try { + URI uri = new URI(baseUrl); + endpointAPI = uri.getHost(); + } catch (Exception e) { + endpointAPI = EndpointAPI.US_WEST.toString(); + } + return new LuisRuntimeAPIImpl(baseUrl, credentials) + .withEndpoint(endpointAPI); } /** diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java index 391f1cc5d8a54..b60448adcd775 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java @@ -30,6 +30,29 @@ public AzureClient getAzureClient() { return this.azureClient; } + /** Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). */ + private String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public LuisRuntimeAPIImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -118,7 +141,7 @@ public Predictions predictions() { * @param credentials the management credentials for Azure */ public LuisRuntimeAPIImpl(ServiceClientCredentials credentials) { - this("https://api.cognitive.microsoft.com/luis/v2.0", credentials); + this("https://{endpoint}/luis/v2.0", credentials); } /** diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java index bda630f0ca0d6..5a5c11e348aa5 100755 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.ResolveOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.runtime.Predictions; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.APIErrorException; import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.LuisResult; @@ -57,7 +58,7 @@ public PredictionsImpl(Retrofit retrofit, LuisRuntimeAPIImpl client) { interface PredictionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.runtime.Predictions resolve" }) @POST("apps/{appId}") - Observable> resolve(@Path("appId") String appId, @Body String query, @Query("timezoneOffset") Double timezoneOffset, @Query("verbose") Boolean verbose, @Query("staging") Boolean staging, @Query("spellCheck") Boolean spellCheck, @Query("bing-spell-check-subscription-key") String bingSpellCheckSubscriptionKey, @Query("log") Boolean log, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> resolve(@Path("appId") String appId, @Body String query, @Query("timezoneOffset") Double timezoneOffset, @Query("verbose") Boolean verbose, @Query("staging") Boolean staging, @Query("spellCheck") Boolean spellCheck, @Query("bing-spell-check-subscription-key") String bingSpellCheckSubscriptionKey, @Query("log") Boolean log, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -119,6 +120,9 @@ public LuisResult call(ServiceResponse response) { * @return the observable to the LuisResult object */ public Observable> resolveWithServiceResponseAsync(String appId, String query, ResolveOptionalParameter resolveOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -150,13 +154,17 @@ public Observable> resolveWithServiceResponseAsync(S * @return the observable to the LuisResult object */ public Observable> resolveWithServiceResponseAsync(String appId, String query, Double timezoneOffset, Boolean verbose, Boolean staging, Boolean spellCheck, String bingSpellCheckSubscriptionKey, Boolean log) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (query == null) { throw new IllegalArgumentException("Parameter query is required and cannot be null."); } - return service.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log, this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/models/EntityModel.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/models/EntityModel.java index 772c8aa1703a3..04ae32bfc26ec 100755 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/models/EntityModel.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/models/EntityModel.java @@ -37,14 +37,14 @@ public class EntityModel { * utterance. */ @JsonProperty(value = "startIndex", required = true) - private double startIndex; + private int startIndex; /** * The position of the last character of the matched entity within the * utterance. */ @JsonProperty(value = "endIndex", required = true) - private double endIndex; + private int endIndex; /** * Get the additionalProperties value. @@ -111,7 +111,7 @@ public EntityModel withType(String type) { * * @return the startIndex value */ - public double startIndex() { + public int startIndex() { return this.startIndex; } @@ -121,7 +121,7 @@ public double startIndex() { * @param startIndex the startIndex value to set * @return the EntityModel object itself. */ - public EntityModel withStartIndex(double startIndex) { + public EntityModel withStartIndex(int startIndex) { this.startIndex = startIndex; return this; } @@ -131,7 +131,7 @@ public EntityModel withStartIndex(double startIndex) { * * @return the endIndex value */ - public double endIndex() { + public int endIndex() { return this.endIndex; } @@ -141,7 +141,7 @@ public double endIndex() { * @param endIndex the endIndex value to set * @return the EntityModel object itself. */ - public EntityModel withEndIndex(double endIndex) { + public EntityModel withEndIndex(int endIndex) { this.endIndex = endIndex; return this; } diff --git a/cognitiveservices/resource-manager/v2016_02_01_preview/pom.xml b/cognitiveservices/resource-manager/v2016_02_01_preview/pom.xml index dc1c6fd974e14..969ed7777e326 100644 --- a/cognitiveservices/resource-manager/v2016_02_01_preview/pom.xml +++ b/cognitiveservices/resource-manager/v2016_02_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-cognitiveservices diff --git a/cognitiveservices/resource-manager/v2017_04_18/pom.xml b/cognitiveservices/resource-manager/v2017_04_18/pom.xml index b253364803d6a..6da5d1755c217 100644 --- a/cognitiveservices/resource-manager/v2017_04_18/pom.xml +++ b/cognitiveservices/resource-manager/v2017_04_18/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-cognitiveservices diff --git a/compute/resource-manager/v2017_03_30/pom.xml b/compute/resource-manager/v2017_03_30/pom.xml index 753e96b6258f9..d01723da9dcfb 100644 --- a/compute/resource-manager/v2017_03_30/pom.xml +++ b/compute/resource-manager/v2017_03_30/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-compute diff --git a/compute/resource-manager/v2017_09_01/pom.xml b/compute/resource-manager/v2017_09_01/pom.xml index 7fa6e5166ea6f..887853aa08d7b 100644 --- a/compute/resource-manager/v2017_09_01/pom.xml +++ b/compute/resource-manager/v2017_09_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-compute diff --git a/compute/resource-manager/v2017_12_01/pom.xml b/compute/resource-manager/v2017_12_01/pom.xml index faf890d331733..912a1b8c16aa7 100644 --- a/compute/resource-manager/v2017_12_01/pom.xml +++ b/compute/resource-manager/v2017_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-compute diff --git a/compute/resource-manager/v2018_04_01/pom.xml b/compute/resource-manager/v2018_04_01/pom.xml index 4f12c0657e3e1..71c6e1b2b9297 100644 --- a/compute/resource-manager/v2018_04_01/pom.xml +++ b/compute/resource-manager/v2018_04_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-compute diff --git a/containerinstance/resource-manager/v2017_08_01_preview/pom.xml b/containerinstance/resource-manager/v2017_08_01_preview/pom.xml new file mode 100644 index 0000000000000..a078776e51faa --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_08_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..42236a533fb18 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java new file mode 100644 index 0000000000000..a776c562bd5e7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java new file mode 100644 index 0000000000000..af2d41ac699f4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container instance event. + */ +public class ContainerEvent { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..1bee667287392 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerRestartPolicy restartPolicy(); + + /** + * @return the state value. + */ + String state(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..67078f97ff501 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..9bbab9aa734b2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..d2f2b62861748 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerName, String containerGroupName); + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..018e5761143b9 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..2b14eb0052223 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState") + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState") + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the number of times that the container instance has been restarted. + * + * @param restartCount the restartCount value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Set current container instance state. + * + * @param currentState the currentState value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withCurrentState(ContainerState currentState) { + this.currentState = currentState; + return this; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Set previous container instance state. + * + * @param previousState the previousState value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withPreviousState(ContainerState previousState) { + this.previousState = previousState; + return this; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set the events of the container instance. + * + * @param events the events value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java new file mode 100644 index 0000000000000..3d48083481699 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerRestartPolicy. + */ +public final class ContainerRestartPolicy extends ExpandableStringEnum { + /** Static value always for ContainerRestartPolicy. */ + public static final ContainerRestartPolicy ALWAYS = fromString("always"); + + /** + * Creates or finds a ContainerRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerRestartPolicy + */ + @JsonCreator + public static ContainerRestartPolicy fromString(String name) { + return fromString(name, ContainerRestartPolicy.class); + } + + /** + * @return known ContainerRestartPolicy values + */ + public static Collection values() { + return values(ContainerRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java new file mode 100644 index 0000000000000..a1d08bb7ebe14 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..337b732a0f77c --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..f00d7f725ee6a --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java new file mode 100644 index 0000000000000..dbe15e035531f --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java new file mode 100644 index 0000000000000..5bc30ba21bdd7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..4f8aa7cc873d0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java new file mode 100644 index 0000000000000..56698eb99cdc0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..4c6902b9d1bda --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..30688d55d101a --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..995ea36943d79 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java new file mode 100644 index 0000000000000..f5c80a019a6f0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the Azure File volume. + */ + @JsonProperty(value = "azureFile", required = true) + private AzureFileVolume azureFile; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the name of the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..008fcd7feface --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..d48214facdd2b --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Volume; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public String state() { + return this.inner().state(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..a5e022eb42ae0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Volume; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. Currently + * the only available option is `always`. Possible values include: + * 'always'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The current state of the container group. This is only valid for the + * response. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. Currently the only available option is `always`. Possible values include: 'always'. + * + * @return the restartPolicy value + */ + public ContainerRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. Currently the only available option is `always`. Possible values include: 'always'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the current state of the container group. This is only valid for the response. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..a9aef34583c1e --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..a2f8b0fb76aba --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..e5a092b1a4858 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-08-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-08-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..b91dc25645556 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..4f1d3edd87461 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerName, containerGroupName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..21b8269c82eb7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerName") String containerName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerName, String containerGroupName) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerName, containerGroupName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerName, containerGroupName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ef6980c904b53 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..a0123d89d1a85 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..58f79046578f5 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..29530cdff6f64 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..e40b44ef4daaa --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java new file mode 100644 index 0000000000000..977248458c0e2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; diff --git a/containerinstance/resource-manager/v2017_10_01_preview/pom.xml b/containerinstance/resource-manager/v2017_10_01_preview/pom.xml new file mode 100644 index 0000000000000..ccf3444720ae2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_10_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..c73db93bbbd3a --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java new file mode 100644 index 0000000000000..7c2c4687e4258 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..93ac80d140e2f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..f19829239054b --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..c0522fba621ff --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..a0918edf2e733 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..6096d2a2aab6d --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..97fb0fbe6f5d4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..2f8437409ae57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..ba95784fdfe57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..f0576e1a71df2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..39f4f0bff3f53 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java new file mode 100644 index 0000000000000..924d5a8ec1fab --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..b013d12b4414d --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java new file mode 100644 index 0000000000000..55d3e6a6a7af6 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..65095268da989 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java new file mode 100644 index 0000000000000..2c1149416b88f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java new file mode 100644 index 0000000000000..de7c362b3e68e --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..e8b34824b6181 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..ffb578f73bd22 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the name of the resource type of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the friendly name of the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..9530b3ea2ff57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java new file mode 100644 index 0000000000000..c7eb36ee82c8b --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java new file mode 100644 index 0000000000000..bc779b28c0fd0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..b7572e568f628 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..f119c37ef50f2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..d5ed003da37f2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java new file mode 100644 index 0000000000000..2a3f6a312725c --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the name of the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..6c267dd42c3b2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..a1ac6df6bb5c5 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupPropertiesInstanceView; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..72e83a5ed94b8 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..b0a4dbc51d185 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..dc73b3528eb90 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..c0b017d9437ef --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-10-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..6c7a5110e10bd --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..f436cc3cab33e --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..99a6b98d225cf --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..398cf8e5f8775 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..95882eb55c253 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..03b524d1257b7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..8e1faaac8bfcf --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..b4e7740eabf86 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..a178d7d9734ee --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..adcdcffe82b4f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..a0e0a2951b5bb --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..eb2860b879231 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..a9d9f336ebbb6 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java new file mode 100644 index 0000000000000..b911969cb5fda --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; diff --git a/containerinstance/resource-manager/v2017_12_01_preview/pom.xml b/containerinstance/resource-manager/v2017_12_01_preview/pom.xml new file mode 100644 index 0000000000000..2213353ea037c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_12_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..eaba9f6c731cb --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java new file mode 100644 index 0000000000000..68cf3e5efe4d1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..d4670680e18ed --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..604e3be112def --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..bc6c7d695fafb --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..97f2f98e52bed --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java new file mode 100644 index 0000000000000..bafd7bf8390f8 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..edede22072fef --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..5b58d4c67b496 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..ef810fa2f7078 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..1dfb78d817107 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..d55246ce541ec --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..e132a8f63ef72 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java new file mode 100644 index 0000000000000..f370c38d54523 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..20ddbb1644955 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java new file mode 100644 index 0000000000000..eb5b476c937b7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java new file mode 100644 index 0000000000000..f1be753fda70d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public class GitRepoVolume { + /** + * Target directory name. Must not contain or start with '..'. If '.' is + * supplied, the volume directory will be the git repository. Otherwise, + * if specified, the volume will contain the git repository in the + * subdirectory with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /** + * Repository URL. + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /** + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * Get target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @param directory the directory value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set repository URL. + * + * @param repository the repository value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set commit hash for the specified revision. + * + * @param revision the revision value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..1e81b2c74198c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java new file mode 100644 index 0000000000000..6170ff48bf2d9 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java new file mode 100644 index 0000000000000..e9730d5956f5f --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..dba8fff938824 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..77ca1e6d210d3 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the name of the resource type of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the friendly name of the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..402297329fdec --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java new file mode 100644 index 0000000000000..41f811728e421 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java new file mode 100644 index 0000000000000..7e3bc49f759e4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..19dbde3da9cb3 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..563ef70d54dc1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..885e5b7386f2a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java new file mode 100644 index 0000000000000..9a02b49f6f154 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * Unit of the usage result. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The name object of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java new file mode 100644 index 0000000000000..18256ea734b50 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java new file mode 100644 index 0000000000000..becea77481c43 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java new file mode 100644 index 0000000000000..62fe6a234550c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * The secret volume. + */ + @JsonProperty(value = "secret") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret volume. + * + * @param secret the secret value to set + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the git repo volume. + * + * @param gitRepo the gitRepo value to set + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..5de6d35ef27e1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..93051c97a2264 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupPropertiesInstanceView; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..438a7880bd92f --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..ef9ec6293c69d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..d03080f74cd1b --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..dc8dd7f101ad2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..b430a7c73a241 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..b318560b84884 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-12-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-12-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..1c38833e7b541 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..5595703022245 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..bab33c386aa7c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..7918041098731 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..05e95b84ddd5d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..21b2cc1773e9a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..2c2c6a9cc79db --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..8fcc29ff7e0cf --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..9bc849288f3a0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..3bdcfeed19025 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..bfa14ef27060b --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..7448495be5543 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..6f1eb89e44220 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..c87bed496da79 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..dd9147e92b75a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java new file mode 100644 index 0000000000000..9b501a395fb17 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; diff --git a/containerinstance/resource-manager/v2018_02_01_preview/pom.xml b/containerinstance/resource-manager/v2018_02_01_preview/pom.xml new file mode 100644 index 0000000000000..b826d872a85b1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2018_02_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..2936632001bd0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java new file mode 100644 index 0000000000000..80dc8762cd1ae --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java new file mode 100644 index 0000000000000..7d492d5daa748 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The start container exec request. + */ +public class ContainerExecRequest { + /** + * The command to be executed. + */ + @JsonProperty(value = "command") + private String command; + + /** + * The size of the terminal. + */ + @JsonProperty(value = "terminalSize") + private ContainerExecRequestTerminalSize terminalSize; + + /** + * Get the command to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set the command to be executed. + * + * @param command the command value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the size of the terminal. + * + * @param terminalSize the terminalSize value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..95ee4d500d09c --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public class ContainerExecRequestTerminalSize { + /** + * The row size of the terminal. + */ + @JsonProperty(value = "rows") + private Integer rows; + + /** + * The column size of the terminal. + */ + @JsonProperty(value = "cols") + private Integer cols; + + /** + * Get the row size of the terminal. + * + * @return the rows value + */ + public Integer rows() { + return this.rows; + } + + /** + * Set the row size of the terminal. + * + * @param rows the rows value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRows(Integer rows) { + this.rows = rows; + return this; + } + + /** + * Get the column size of the terminal. + * + * @return the cols value + */ + public Integer cols() { + return this.cols; + } + + /** + * Set the column size of the terminal. + * + * @param cols the cols value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withCols(Integer cols) { + this.cols = cols; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java new file mode 100644 index 0000000000000..8a69e351c565e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..34e82e1876f53 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..18cea3a76faaf --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..f3b72ebb2b69f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..5d6f22d8f6cde --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java new file mode 100644 index 0000000000000..48a1932a0714e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..e935d9b5d0b08 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..c5d79eee2e815 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..5fb5e48566024 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerLogsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs extends HasInner { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..8c895d1bb35c4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..3d931819a9841 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..97ffa7fb1d28f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java new file mode 100644 index 0000000000000..276069080112d --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..808b5d040752d --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java new file mode 100644 index 0000000000000..d6d31ac1a8377 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java new file mode 100644 index 0000000000000..146e9e9c348dd --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public class GitRepoVolume { + /** + * Target directory name. Must not contain or start with '..'. If '.' is + * supplied, the volume directory will be the git repository. Otherwise, + * if specified, the volume will contain the git repository in the + * subdirectory with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /** + * Repository URL. + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /** + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * Get target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @param directory the directory value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set repository URL. + * + * @param repository the repository value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set commit hash for the specified revision. + * + * @param revision the revision value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..1fcd1544894d1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java new file mode 100644 index 0000000000000..86c7ac1e56486 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * The Dns name label for the IP. + */ + @JsonProperty(value = "dnsNameLabel") + private String dnsNameLabel; + + /** + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java new file mode 100644 index 0000000000000..9724792f3dc1e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..933f093491354 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..30ab8dbb8dcde --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the name of the resource type of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the friendly name of the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..b772484ec2e17 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java new file mode 100644 index 0000000000000..1452ee0f1c65e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java new file mode 100644 index 0000000000000..89c3e67f6e466 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..e80f0cb9f9c57 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..52fcb7fb89cc4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..2d7e11b6b02a1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java new file mode 100644 index 0000000000000..094363a0afb37 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.StartContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StartContainers. + */ +public interface StartContainers extends HasInner { + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java new file mode 100644 index 0000000000000..557bcba76f559 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * Unit of the usage result. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The name object of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java new file mode 100644 index 0000000000000..3017f616a6c1e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java new file mode 100644 index 0000000000000..c282c4c8580a7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java new file mode 100644 index 0000000000000..8d8eee9cc82aa --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * The secret volume. + */ + @JsonProperty(value = "secret") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret volume. + * + * @param secret the secret value to set + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the git repo volume. + * + * @param gitRepo the gitRepo value to set + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..4b6b03d661e49 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..855530c5c1501 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..b87ea1b000058 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public class ContainerExecResponseInner { + /** + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri") + private String webSocketUri; + + /** + * The password to start the exec command. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the uri for the exec websocket. + * + * @param webSocketUri the webSocketUri value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password to start the exec command. + * + * @param password the password value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..20a98fb8e6502 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupPropertiesInstanceView; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..c1f0866e735f0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..556033bfbd8d7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..e063c9b62e417 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..a2df543c260ff --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..e237d2933b046 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..763b6bcf859a3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * The StartContainersInner object to access its operations. + */ + private StartContainersInner startContainers; + + /** + * Gets the StartContainersInner object to access its operations. + * @return the StartContainersInner object. + */ + public StartContainersInner startContainers() { + return this.startContainers; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-02-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.startContainers = new StartContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-02-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..bdeda181d8b90 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + private StartContainers startContainers; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * @return Entry point to manage StartContainers. + */ + public StartContainers startContainers() { + if (this.startContainers == null) { + this.startContainers = new StartContainersImpl(this); + } + return this.startContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..c42273c29dd29 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..847d88938442b --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..919cec8008e01 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..f5035b3b45ac3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..4af48a1272f5f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..416e3951f3747 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..a6ec70c32ce80 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..5c741fbbf9a1c --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f332a863857cc --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..14d4494425dfc --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..ac273a371349f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java new file mode 100644 index 0000000000000..ab1ef9a847280 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecRequest; + +class StartContainersImpl extends WrapperImpl implements StartContainers { + private final ContainerInstanceManager manager; + + StartContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().startContainers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + StartContainersInner client = this.inner(); + return client.launchExecAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java new file mode 100644 index 0000000000000..df1aec7289009 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StartContainers. + */ +public class StartContainersInner { + /** The Retrofit service to perform REST calls. */ + private StartContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of StartContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StartContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(StartContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for StartContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface StartContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers launchExec" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> launchExec(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> launchExecWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.launchExec(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = launchExecDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse launchExecDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..f494e9fba76ad --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..c4743ffe3cd27 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..213866d12dd65 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java new file mode 100644 index 0000000000000..6721143ad8552 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; diff --git a/containerinstance/resource-manager/v2018_04_01/pom.xml b/containerinstance/resource-manager/v2018_04_01/pom.xml new file mode 100644 index 0000000000000..8ebf8093c6524 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2018_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java new file mode 100644 index 0000000000000..9a9f787101727 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java new file mode 100644 index 0000000000000..1cc8423871088 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java new file mode 100644 index 0000000000000..8deba7acc53f9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The start container exec request. + */ +public class ContainerExecRequest { + /** + * The command to be executed. + */ + @JsonProperty(value = "command") + private String command; + + /** + * The size of the terminal. + */ + @JsonProperty(value = "terminalSize") + private ContainerExecRequestTerminalSize terminalSize; + + /** + * Get the command to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set the command to be executed. + * + * @param command the command value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the size of the terminal. + * + * @param terminalSize the terminalSize value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..5530364a37126 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public class ContainerExecRequestTerminalSize { + /** + * The row size of the terminal. + */ + @JsonProperty(value = "row") + private Integer row; + + /** + * The column size of the terminal. + */ + @JsonProperty(value = "column") + private Integer column; + + /** + * Get the row size of the terminal. + * + * @return the row value + */ + public Integer row() { + return this.row; + } + + /** + * Set the row size of the terminal. + * + * @param row the row value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRow(Integer row) { + this.row = row; + return this; + } + + /** + * Get the column size of the terminal. + * + * @return the column value + */ + public Integer column() { + return this.column; + } + + /** + * Set the column size of the terminal. + * + * @param column the column value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withColumn(Integer column) { + this.column = column; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java new file mode 100644 index 0000000000000..471efd2d1910c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java new file mode 100644 index 0000000000000..5ce75ed879f70 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..f6e7686ed7ad2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..e32bfe7d63221 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..8fc04367010f3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java new file mode 100644 index 0000000000000..19c1898083516 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java new file mode 100644 index 0000000000000..b88818c3a2d43 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..dc51f087df09b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java new file mode 100644 index 0000000000000..ad8f81d7907de --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerLogsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs extends HasInner { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..82c4870b0674e --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java new file mode 100644 index 0000000000000..005134aa5561f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..408d13a0b28b4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java new file mode 100644 index 0000000000000..3e68e0d40760f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus", access = JsonProperty.Access.WRITE_ONLY) + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java new file mode 100644 index 0000000000000..99d5fb0fe3526 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java new file mode 100644 index 0000000000000..94ebd82e22788 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java new file mode 100644 index 0000000000000..39ff72c45df68 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public class GitRepoVolume { + /** + * Target directory name. Must not contain or start with '..'. If '.' is + * supplied, the volume directory will be the git repository. Otherwise, + * if specified, the volume will contain the git repository in the + * subdirectory with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /** + * Repository URL. + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /** + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * Get target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @param directory the directory value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set repository URL. + * + * @param repository the repository value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set commit hash for the specified revision. + * + * @param revision the revision value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java new file mode 100644 index 0000000000000..d0303a91e1425 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java new file mode 100644 index 0000000000000..ee3047e0723d6 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * The Dns name label for the IP. + */ + @JsonProperty(value = "dnsNameLabel") + private String dnsNameLabel; + + /** + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java new file mode 100644 index 0000000000000..2e0e564b4f34b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java new file mode 100644 index 0000000000000..4f8ecfa4c0cc5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java new file mode 100644 index 0000000000000..a2b490576449a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java new file mode 100644 index 0000000000000..dcf10259ad4a9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java new file mode 100644 index 0000000000000..9b9956a567d6d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java new file mode 100644 index 0000000000000..9cd513eda6169 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java new file mode 100644 index 0000000000000..5bf7aa0971631 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java new file mode 100644 index 0000000000000..4e78f46ba6e33 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java new file mode 100644 index 0000000000000..8999ae0ae6365 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java new file mode 100644 index 0000000000000..bd0aa6b94fcce --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.StartContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StartContainers. + */ +public interface StartContainers extends HasInner { + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java new file mode 100644 index 0000000000000..f2cb9fce43d00 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * Unit of the usage result. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The name object of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java new file mode 100644 index 0000000000000..c45c4c41143e0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java new file mode 100644 index 0000000000000..568c36699efaf --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java new file mode 100644 index 0000000000000..7982d7654851b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * The secret volume. + */ + @JsonProperty(value = "secret") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret volume. + * + * @param secret the secret value to set + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the git repo volume. + * + * @param gitRepo the gitRepo value to set + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java new file mode 100644 index 0000000000000..6f92c21214f68 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..5e18b6787896f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..40ea2cab935a5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public class ContainerExecResponseInner { + /** + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri", access = JsonProperty.Access.WRITE_ONLY) + private String webSocketUri; + + /** + * The password to start the exec command. + */ + @JsonProperty(value = "password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /** + * Get the uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Get the password to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..652fab22e1b5f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Container; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_04_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupPropertiesInstanceView; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..606cf23748639 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Container; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_04_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..4589c804d84a8 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..24f7ff11b629d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..eb1b5ccb4dc5a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..0c9d16997964b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..07288168f400a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * The StartContainersInner object to access its operations. + */ + private StartContainersInner startContainers; + + /** + * Gets the StartContainersInner object to access its operations. + * @return the StartContainersInner object. + */ + public StartContainersInner startContainers() { + return this.startContainers; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.startContainers = new StartContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-04-01"); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..2a494ccf10600 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Operations; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs; +import com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + private StartContainers startContainers; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * @return Entry point to manage StartContainers. + */ + public StartContainers startContainers() { + if (this.startContainers == null) { + this.startContainers = new StartContainersImpl(this); + } + return this.startContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..b6d96c09d8e13 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..2541654e026b0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ad1de6037f6a2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java new file mode 100644 index 0000000000000..bcb2e3a93fe2e --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java new file mode 100644 index 0000000000000..858439c628c4a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content", access = JsonProperty.Access.WRITE_ONLY) + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..85a8188f0835c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..bdcda8013f636 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..0b21c9a0ae5d5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..71f6a5a2bbff9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ec457f1345b2c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..f7504ee6eb424 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java new file mode 100644 index 0000000000000..310260895df2d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecRequest; + +class StartContainersImpl extends WrapperImpl implements StartContainers { + private final ContainerInstanceManager manager; + + StartContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().startContainers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + StartContainersInner client = this.inner(); + return client.launchExecAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java new file mode 100644 index 0000000000000..41825d1d61718 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StartContainers. + */ +public class StartContainersInner { + /** The Retrofit service to perform REST calls. */ + private StartContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of StartContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StartContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(StartContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for StartContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface StartContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers launchExec" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> launchExec(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> launchExecWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.launchExec(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = launchExecDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse launchExecDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..3387587a8e75f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..bd1845a83b9a2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java new file mode 100644 index 0000000000000..185355b3e94ed --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java new file mode 100644 index 0000000000000..60a429082d769 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_04_01; diff --git a/containerinstance/resource-manager/v2018_10_01/pom.xml b/containerinstance/resource-manager/v2018_10_01/pom.xml new file mode 100644 index 0000000000000..bd17f2a1058fd --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2018_10_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/AzureFileVolume.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/AzureFileVolume.java new file mode 100644 index 0000000000000..7727ce2b7c89e --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExec.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExec.java new file mode 100644 index 0000000000000..b76427e96cbd5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExec.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container execution command, for liveness or readiness probe. + */ +public class ContainerExec { + /** + * The commands to execute within the container. + */ + @JsonProperty(value = "command") + private List command; + + /** + * Get the commands to execute within the container. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container. + * + * @param command the command value to set + * @return the ContainerExec object itself. + */ + public ContainerExec withCommand(List command) { + this.command = command; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequest.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequest.java new file mode 100644 index 0000000000000..465eefbedf6a0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container exec request. + */ +public class ContainerExecRequest { + /** + * The command to be executed. + */ + @JsonProperty(value = "command") + private String command; + + /** + * The size of the terminal. + */ + @JsonProperty(value = "terminalSize") + private ContainerExecRequestTerminalSize terminalSize; + + /** + * Get the command to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set the command to be executed. + * + * @param command the command value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the size of the terminal. + * + * @param terminalSize the terminalSize value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequestTerminalSize.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..c861b2f3ad339 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecRequestTerminalSize.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public class ContainerExecRequestTerminalSize { + /** + * The row size of the terminal. + */ + @JsonProperty(value = "rows") + private Integer rows; + + /** + * The column size of the terminal. + */ + @JsonProperty(value = "cols") + private Integer cols; + + /** + * Get the row size of the terminal. + * + * @return the rows value + */ + public Integer rows() { + return this.rows; + } + + /** + * Set the row size of the terminal. + * + * @param rows the rows value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRows(Integer rows) { + this.rows = rows; + return this; + } + + /** + * Get the column size of the terminal. + * + * @return the cols value + */ + public Integer cols() { + return this.cols; + } + + /** + * Set the column size of the terminal. + * + * @param cols the cols value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withCols(Integer cols) { + this.cols = cols; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecResponse.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecResponse.java new file mode 100644 index 0000000000000..fcda45558352a --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerExecResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java new file mode 100644 index 0000000000000..ced6b2ed90495 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInner; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * @return the dnsConfig value. + */ + DnsConfiguration dnsConfig(); + + /** + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the networkProfile value. + */ + ContainerGroupNetworkProfile networkProfile(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify Diagnostics. + */ + interface WithDiagnostics { + /** + * Specifies diagnostics. + */ + WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + + /** + * The stage of the containergroup update allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + WithCreate withDnsConfig(DnsConfiguration dnsConfig); + } + + /** + * The stage of the containergroup update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + */ + WithCreate withIdentity(ContainerGroupIdentity identity); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify NetworkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies networkProfile. + */ + WithCreate withNetworkProfile(ContainerGroupNetworkProfile networkProfile); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDiagnostics, DefinitionStages.WithDnsConfig, DefinitionStages.WithIdentity, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithNetworkProfile, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupDiagnostics.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupDiagnostics.java new file mode 100644 index 0000000000000..11ad04633c758 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupDiagnostics.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group diagnostic information. + */ +public class ContainerGroupDiagnostics { + /** + * Container group log analytics information. + */ + @JsonProperty(value = "logAnalytics") + private LogAnalytics logAnalytics; + + /** + * Get container group log analytics information. + * + * @return the logAnalytics value + */ + public LogAnalytics logAnalytics() { + return this.logAnalytics; + } + + /** + * Set container group log analytics information. + * + * @param logAnalytics the logAnalytics value to set + * @return the ContainerGroupDiagnostics object itself. + */ + public ContainerGroupDiagnostics withLogAnalytics(LogAnalytics logAnalytics) { + this.logAnalytics = logAnalytics; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentity.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentity.java new file mode 100644 index 0000000000000..6a617e32bee58 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentity.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the container group. + */ +public class ContainerGroupIdentity { + /** + * The principal id of the container group identity. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id associated with the container group. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the container group. The type + * 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the container group. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * The list of user identities associated with the container group. The + * user identity dictionary key references will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principal id of the container group identity. This property will only be provided for a system assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id associated with the container group. This property will only be provided for a system assigned identity. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @param type the type value to set + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..6fad4c8f04b80 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ContainerGroupIdentityUserAssignedIdentitiesValue model. + */ +public class ContainerGroupIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIpAddressType.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIpAddressType.java new file mode 100644 index 0000000000000..1b5fecc843198 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupIpAddressType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupIpAddressType. + */ +public final class ContainerGroupIpAddressType extends ExpandableStringEnum { + /** Static value Public for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PUBLIC = fromString("Public"); + + /** Static value Private for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PRIVATE = fromString("Private"); + + /** + * Creates or finds a ContainerGroupIpAddressType from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupIpAddressType + */ + @JsonCreator + public static ContainerGroupIpAddressType fromString(String name) { + return fromString(name, ContainerGroupIpAddressType.class); + } + + /** + * @return known ContainerGroupIpAddressType values + */ + public static Collection values() { + return values(ContainerGroupIpAddressType.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProfile.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProfile.java new file mode 100644 index 0000000000000..1ae9952e8a21d --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group network profile information. + */ +public class ContainerGroupNetworkProfile { + /** + * The identifier for a network profile. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the identifier for a network profile. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identifier for a network profile. + * + * @param id the id value to set + * @return the ContainerGroupNetworkProfile object itself. + */ + public ContainerGroupNetworkProfile withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..a23f799cb1e7c --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..80089fab3dbb0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..cd63caf488822 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupUsages.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupUsages.java new file mode 100644 index 0000000000000..de7d036eb4018 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java new file mode 100644 index 0000000000000..bc2d453e5aa76 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable restartAsync(String resourceGroupName, String containerGroupName); + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String containerGroupName); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerHttpGet.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerHttpGet.java new file mode 100644 index 0000000000000..0881e828d9a77 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerHttpGet.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container Http Get settings, for liveness or readiness probe. + */ +public class ContainerHttpGet { + /** + * The path to probe. + */ + @JsonProperty(value = "path") + private String path; + + /** + * The port number to probe. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * The scheme. Possible values include: 'http', 'https'. + */ + @JsonProperty(value = "scheme") + private String scheme; + + /** + * Get the path to probe. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path to probe. + * + * @param path the path value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port number to probe. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number to probe. + * + * @param port the port value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the scheme. Possible values include: 'http', 'https'. + * + * @return the scheme value + */ + public String scheme() { + return this.scheme; + } + + /** + * Set the scheme. Possible values include: 'http', 'https'. + * + * @param scheme the scheme value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withScheme(String scheme) { + this.scheme = scheme; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..c251b6566e1c8 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..aaf7af3bfb5aa --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPort.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPort.java new file mode 100644 index 0000000000000..8e644c34e69fb --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerProbe.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerProbe.java new file mode 100644 index 0000000000000..979654b914a7d --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerProbe.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container probe, for liveness or readiness. + */ +public class ContainerProbe { + /** + * The execution command to probe. + */ + @JsonProperty(value = "exec") + private ContainerExec exec; + + /** + * The Http Get settings to probe. + */ + @JsonProperty(value = "httpGet") + private ContainerHttpGet httpGet; + + /** + * The initial delay seconds. + */ + @JsonProperty(value = "initialDelaySeconds") + private Integer initialDelaySeconds; + + /** + * The period seconds. + */ + @JsonProperty(value = "periodSeconds") + private Integer periodSeconds; + + /** + * The failure threshold. + */ + @JsonProperty(value = "failureThreshold") + private Integer failureThreshold; + + /** + * The success threshold. + */ + @JsonProperty(value = "successThreshold") + private Integer successThreshold; + + /** + * The timeout seconds. + */ + @JsonProperty(value = "timeoutSeconds") + private Integer timeoutSeconds; + + /** + * Get the execution command to probe. + * + * @return the exec value + */ + public ContainerExec exec() { + return this.exec; + } + + /** + * Set the execution command to probe. + * + * @param exec the exec value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withExec(ContainerExec exec) { + this.exec = exec; + return this; + } + + /** + * Get the Http Get settings to probe. + * + * @return the httpGet value + */ + public ContainerHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the Http Get settings to probe. + * + * @param httpGet the httpGet value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withHttpGet(ContainerHttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Get the initial delay seconds. + * + * @return the initialDelaySeconds value + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initial delay seconds. + * + * @param initialDelaySeconds the initialDelaySeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the period seconds. + * + * @return the periodSeconds value + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the period seconds. + * + * @param periodSeconds the periodSeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the failure threshold. + * + * @return the failureThreshold value + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failure threshold. + * + * @param failureThreshold the failureThreshold value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the success threshold. + * + * @return the successThreshold value + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the success threshold. + * + * @param successThreshold the successThreshold value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the timeout seconds. + * + * @return the timeoutSeconds value + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeout seconds. + * + * @param timeoutSeconds the timeoutSeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..a0e1d9bd1cbf8 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerState.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerState.java new file mode 100644 index 0000000000000..224076ba3cfb2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Containers.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Containers.java new file mode 100644 index 0000000000000..913f067a196c4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Containers.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import rx.Observable; + +/** + * Type representing Containers. + */ +public interface Containers { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/DnsConfiguration.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/DnsConfiguration.java new file mode 100644 index 0000000000000..c195b192980c3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/DnsConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS configuration for the container group. + */ +public class DnsConfiguration { + /** + * The DNS servers for the container group. + */ + @JsonProperty(value = "nameServers", required = true) + private List nameServers; + + /** + * The DNS search domains for hostname lookup in the container group. + */ + @JsonProperty(value = "searchDomains") + private String searchDomains; + + /** + * The DNS options for the container group. + */ + @JsonProperty(value = "options") + private String options; + + /** + * Get the DNS servers for the container group. + * + * @return the nameServers value + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the DNS servers for the container group. + * + * @param nameServers the nameServers value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the DNS search domains for hostname lookup in the container group. + * + * @return the searchDomains value + */ + public String searchDomains() { + return this.searchDomains; + } + + /** + * Set the DNS search domains for hostname lookup in the container group. + * + * @param searchDomains the searchDomains value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withSearchDomains(String searchDomains) { + this.searchDomains = searchDomains; + return this; + } + + /** + * Get the DNS options for the container group. + * + * @return the options value + */ + public String options() { + return this.options; + } + + /** + * Set the DNS options for the container group. + * + * @param options the options value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withOptions(String options) { + this.options = options; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/EnvironmentVariable.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/EnvironmentVariable.java new file mode 100644 index 0000000000000..bb444e09ad420 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/EnvironmentVariable.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The value of the secure environment variable. + */ + @JsonProperty(value = "secureValue") + private String secureValue; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the value of the secure environment variable. + * + * @return the secureValue value + */ + public String secureValue() { + return this.secureValue; + } + + /** + * Set the value of the secure environment variable. + * + * @param secureValue the secureValue value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withSecureValue(String secureValue) { + this.secureValue = secureValue; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Event.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Event.java new file mode 100644 index 0000000000000..df934be840a7c --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GitRepoVolume.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GitRepoVolume.java new file mode 100644 index 0000000000000..c98fd5633bd05 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public class GitRepoVolume { + /** + * Target directory name. Must not contain or start with '..'. If '.' is + * supplied, the volume directory will be the git repository. Otherwise, + * if specified, the volume will contain the git repository in the + * subdirectory with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /** + * Repository URL. + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /** + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * Get target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @param directory the directory value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set repository URL. + * + * @param repository the repository value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set commit hash for the specified revision. + * + * @param revision the revision value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuResource.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuResource.java new file mode 100644 index 0000000000000..7e3195b544c1b --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The GPU resource. + */ +public class GpuResource { + /** + * The count of the GPU resource. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /** + * The SKU of the GPU resource. Possible values include: 'K80', 'P100', + * 'V100'. + */ + @JsonProperty(value = "sku", required = true) + private GpuSku sku; + + /** + * Get the count of the GPU resource. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the count of the GPU resource. + * + * @param count the count value to set + * @return the GpuResource object itself. + */ + public GpuResource withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the SKU of the GPU resource. Possible values include: 'K80', 'P100', 'V100'. + * + * @return the sku value + */ + public GpuSku sku() { + return this.sku; + } + + /** + * Set the SKU of the GPU resource. Possible values include: 'K80', 'P100', 'V100'. + * + * @param sku the sku value to set + * @return the GpuResource object itself. + */ + public GpuResource withSku(GpuSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuSku.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuSku.java new file mode 100644 index 0000000000000..e1c88ffa036e1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/GpuSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GpuSku. + */ +public final class GpuSku extends ExpandableStringEnum { + /** Static value K80 for GpuSku. */ + public static final GpuSku K80 = fromString("K80"); + + /** Static value P100 for GpuSku. */ + public static final GpuSku P100 = fromString("P100"); + + /** Static value V100 for GpuSku. */ + public static final GpuSku V100 = fromString("V100"); + + /** + * Creates or finds a GpuSku from its string representation. + * @param name a name to look for + * @return the corresponding GpuSku + */ + @JsonCreator + public static GpuSku fromString(String name) { + return fromString(name, GpuSku.class); + } + + /** + * @return known GpuSku values + */ + public static Collection values() { + return values(GpuSku.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ImageRegistryCredential.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ImageRegistryCredential.java new file mode 100644 index 0000000000000..925fccbbaf180 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/IpAddress.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/IpAddress.java new file mode 100644 index 0000000000000..b508a11064c47 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/IpAddress.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet or private VNET. + * Possible values include: 'Public', 'Private'. + */ + @JsonProperty(value = "type", required = true) + private ContainerGroupIpAddressType type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * The Dns name label for the IP. + */ + @JsonProperty(value = "dnsNameLabel") + private String dnsNameLabel; + + /** + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet or private VNET. Possible values include: 'Public', 'Private'. + * + * @return the type value + */ + public ContainerGroupIpAddressType type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet or private VNET. Possible values include: 'Public', 'Private'. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(ContainerGroupIpAddressType type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalytics.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalytics.java new file mode 100644 index 0000000000000..332f45245dc7d --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalytics.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group log analytics information. + */ +public class LogAnalytics { + /** + * The workspace id for log analytics. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The workspace key for log analytics. + */ + @JsonProperty(value = "workspaceKey", required = true) + private String workspaceKey; + + /** + * The log type to be used. Possible values include: 'ContainerInsights', + * 'ContainerInstanceLogs'. + */ + @JsonProperty(value = "logType") + private LogAnalyticsLogType logType; + + /** + * Metadata for log analytics. + */ + @JsonProperty(value = "metadata") + private Map metadata; + + /** + * Get the workspace id for log analytics. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace id for log analytics. + * + * @param workspaceId the workspaceId value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspace key for log analytics. + * + * @return the workspaceKey value + */ + public String workspaceKey() { + return this.workspaceKey; + } + + /** + * Set the workspace key for log analytics. + * + * @param workspaceKey the workspaceKey value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceKey(String workspaceKey) { + this.workspaceKey = workspaceKey; + return this; + } + + /** + * Get the log type to be used. Possible values include: 'ContainerInsights', 'ContainerInstanceLogs'. + * + * @return the logType value + */ + public LogAnalyticsLogType logType() { + return this.logType; + } + + /** + * Set the log type to be used. Possible values include: 'ContainerInsights', 'ContainerInstanceLogs'. + * + * @param logType the logType value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withLogType(LogAnalyticsLogType logType) { + this.logType = logType; + return this; + } + + /** + * Get metadata for log analytics. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set metadata for log analytics. + * + * @param metadata the metadata value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalyticsLogType.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalyticsLogType.java new file mode 100644 index 0000000000000..f51604c7a1e51 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/LogAnalyticsLogType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LogAnalyticsLogType. + */ +public final class LogAnalyticsLogType extends ExpandableStringEnum { + /** Static value ContainerInsights for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSIGHTS = fromString("ContainerInsights"); + + /** Static value ContainerInstanceLogs for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSTANCE_LOGS = fromString("ContainerInstanceLogs"); + + /** + * Creates or finds a LogAnalyticsLogType from its string representation. + * @param name a name to look for + * @return the corresponding LogAnalyticsLogType + */ + @JsonCreator + public static LogAnalyticsLogType fromString(String name) { + return fromString(name, LogAnalyticsLogType.class); + } + + /** + * @return known LogAnalyticsLogType values + */ + public static Collection values() { + return values(LogAnalyticsLogType.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Logs.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Logs.java new file mode 100644 index 0000000000000..3fc3a7668a91c --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperatingSystemTypes.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperatingSystemTypes.java new file mode 100644 index 0000000000000..9dd60f907475f --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationDisplay.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationDisplay.java new file mode 100644 index 0000000000000..0b35c48a0e303 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the name of the resource type of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the friendly name of the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationListResult.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationListResult.java new file mode 100644 index 0000000000000..cddeee8a00f9c --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Operations.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Operations.java new file mode 100644 index 0000000000000..196779d73e9b5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Port.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Port.java new file mode 100644 index 0000000000000..6a41ebd189a0a --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceIdentityType.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceIdentityType.java new file mode 100644 index 0000000000000..8a9c82be871d2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceIdentityType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceLimits.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceLimits.java new file mode 100644 index 0000000000000..5178c105fa135 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceLimits.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * The GPU limit of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the GPU limit of this container instance. + * + * @return the gpu value + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the GPU limit of this container instance. + * + * @param gpu the gpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequests.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequests.java new file mode 100644 index 0000000000000..c7652202558d2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequests.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * The GPU request of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the GPU request of this container instance. + * + * @return the gpu value + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the GPU request of this container instance. + * + * @param gpu the gpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequirements.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequirements.java new file mode 100644 index 0000000000000..61e206bcb5426 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ServiceAssociationLinks.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ServiceAssociationLinks.java new file mode 100644 index 0000000000000..c8c542ec25017 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ServiceAssociationLinks.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import rx.Completable; + +/** + * Type representing ServiceAssociationLinks. + */ +public interface ServiceAssociationLinks { + /** + * Delete the container instance service association link for the subnet. + * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Usage.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Usage.java new file mode 100644 index 0000000000000..1da7934de5b2b --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * Unit of the usage result. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The name object of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageListResult.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageListResult.java new file mode 100644 index 0000000000000..416a93751a903 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_10_01.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageName.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageName.java new file mode 100644 index 0000000000000..331c9f6a536f7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Volume.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Volume.java new file mode 100644 index 0000000000000..adc05730c45b5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * The secret volume. + */ + @JsonProperty(value = "secret") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret volume. + * + * @param secret the secret value to set + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the git repo volume. + * + * @param gitRepo the gitRepo value to set + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/VolumeMount.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/VolumeMount.java new file mode 100644 index 0000000000000..204590b1a9502 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..573cae4d68a65 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..5efee9d6b1c52 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerExecResponseInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public class ContainerExecResponseInner { + /** + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri") + private String webSocketUri; + + /** + * The password to start the exec command. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the uri for the exec websocket. + * + * @param webSocketUri the webSocketUri value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password to start the exec command. + * + * @param password the password value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..928b5c74a35f6 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupIdentity; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_10_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_10_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupDiagnostics; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupNetworkProfile; +import com.microsoft.azure.management.containerinstance.v2018_10_01.DnsConfiguration; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public ContainerGroupDiagnostics diagnostics() { + return this.inner().diagnostics(); + } + + @Override + public DnsConfiguration dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public ContainerGroupIdentity identity() { + return this.inner().identity(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public ContainerGroupNetworkProfile networkProfile() { + return this.inner().networkProfile(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.inner().withDiagnostics(diagnostics); + return this; + } + + @Override + public ContainerGroupImpl withDnsConfig(DnsConfiguration dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ContainerGroupImpl withIdentity(ContainerGroupIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withNetworkProfile(ContainerGroupNetworkProfile networkProfile) { + this.inner().withNetworkProfile(networkProfile); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..904bf42b70b15 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupInner.java @@ -0,0 +1,339 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupIdentity; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_10_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_10_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupDiagnostics; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupNetworkProfile; +import com.microsoft.azure.management.containerinstance.v2018_10_01.DnsConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The identity of the container group, if configured. + */ + @JsonProperty(value = "identity") + private ContainerGroupIdentity identity; + + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * The diagnostic information for a container group. + */ + @JsonProperty(value = "properties.diagnostics") + private ContainerGroupDiagnostics diagnostics; + + /** + * The network profile information for a container group. + */ + @JsonProperty(value = "properties.networkProfile") + private ContainerGroupNetworkProfile networkProfile; + + /** + * The DNS config information for a container group. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfiguration dnsConfig; + + /** + * Get the identity of the container group, if configured. + * + * @return the identity value + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the container group, if configured. + * + * @param identity the identity value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the diagnostic information for a container group. + * + * @return the diagnostics value + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the network profile information for a container group. + * + * @return the networkProfile value + */ + public ContainerGroupNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the network profile information for a container group. + * + * @param networkProfile the networkProfile value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withNetworkProfile(ContainerGroupNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the DNS config information for a container group. + * + * @return the dnsConfig value + */ + public DnsConfiguration dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..566bdf1984368 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..021ce0305a999 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..fe33eecd4ccd7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable restartAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.restartAsync(resourceGroupName, containerGroupName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.stopAsync(resourceGroupName, containerGroupName).toCompletable(); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..bed713aad934e --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java @@ -0,0 +1,1293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups restart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + Observable> restart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups beginRestart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + Observable> beginRestart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restart(String resourceGroupName, String containerGroupName) { + restartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().last().body(); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restartAsync(String resourceGroupName, String containerGroupName) { + return restartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.restart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRestart(String resourceGroupName, String containerGroupName) { + beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRestartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String containerGroupName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginRestart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String containerGroupName) { + stopWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stopAsync(String resourceGroupName, String containerGroupName) { + return stopWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.stop(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInner.java new file mode 100644 index 0000000000000..d21e8318e26c0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInner.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerPort; +import com.microsoft.azure.management.containerinstance.v2018_10_01.EnvironmentVariable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ResourceRequirements; +import com.microsoft.azure.management.containerinstance.v2018_10_01.VolumeMount; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerProbe; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class ContainerInner { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * The liveness probe. + */ + @JsonProperty(value = "properties.livenessProbe") + private ContainerProbe livenessProbe; + + /** + * The readiness probe. + */ + @JsonProperty(value = "properties.readinessProbe") + private ContainerProbe readinessProbe; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Get the liveness probe. + * + * @return the livenessProbe value + */ + public ContainerProbe livenessProbe() { + return this.livenessProbe; + } + + /** + * Set the liveness probe. + * + * @param livenessProbe the livenessProbe value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withLivenessProbe(ContainerProbe livenessProbe) { + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get the readiness probe. + * + * @return the readinessProbe value + */ + public ContainerProbe readinessProbe() { + return this.readinessProbe; + } + + /** + * Set the readiness probe. + * + * @param readinessProbe the readinessProbe value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withReadinessProbe(ContainerProbe readinessProbe) { + this.readinessProbe = readinessProbe; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..6a9afa4fab679 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainersInner object to access its operations. + */ + private ContainersInner containers; + + /** + * Gets the ContainersInner object to access its operations. + * @return the ContainersInner object. + */ + public ContainersInner containers() { + return this.containers; + } + + /** + * The ServiceAssociationLinksInner object to access its operations. + */ + private ServiceAssociationLinksInner serviceAssociationLinks; + + /** + * Gets the ServiceAssociationLinksInner object to access its operations. + * @return the ServiceAssociationLinksInner object. + */ + public ServiceAssociationLinksInner serviceAssociationLinks() { + return this.serviceAssociationLinks; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-10-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containers = new ContainersInner(restClient().retrofit(), this); + this.serviceAssociationLinks = new ServiceAssociationLinksInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-10-01"); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..e005f5244e9b9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Operations; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Containers; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ServiceAssociationLinks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private Containers containers; + private ServiceAssociationLinks serviceAssociationLinks; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage Containers. + */ + public Containers containers() { + if (this.containers == null) { + this.containers = new ContainersImpl(this); + } + return this.containers; + } + + /** + * @return Entry point to manage ServiceAssociationLinks. + */ + public ServiceAssociationLinks serviceAssociationLinks() { + if (this.serviceAssociationLinks == null) { + this.serviceAssociationLinks = new ServiceAssociationLinksImpl(this); + } + return this.serviceAssociationLinks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersImpl.java new file mode 100644 index 0000000000000..c7c17003b9018 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Containers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Logs; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerExecRequest; + +class ContainersImpl extends WrapperImpl implements Containers { + private final ContainerInstanceManager manager; + + ContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().containers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainersInner client = this.inner(); + return client.listLogsAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + + @Override + public Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + ContainersInner client = this.inner(); + return client.executeCommandAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java new file mode 100644 index 0000000000000..eb66e80d512b4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerExecRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Containers. + */ +public class ContainersInner { + /** The Retrofit service to perform REST calls. */ + private ContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Containers to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.Containers listLogs" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> listLogs(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.Containers executeCommand" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> executeCommand(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listLogsWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.listLogs(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listLogsWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listLogs(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listLogsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> executeCommandWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.executeCommand(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeCommandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeCommandDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..162dcc14ea589 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsImpl.java new file mode 100644 index 0000000000000..dcba81f99e220 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsInner.java new file mode 100644 index 0000000000000..3c2c7169f9cc6 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..917f71f159c66 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..e5012ae6b96b7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..f2aa3a439f139 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..510e28e27d46f --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_10_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..7939d08225b34 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/PageImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..644b253ec2e49 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksImpl.java new file mode 100644 index 0000000000000..017782db3b08b --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksImpl.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_10_01.ServiceAssociationLinks; +import rx.Completable; + +class ServiceAssociationLinksImpl extends WrapperImpl implements ServiceAssociationLinks { + private final ContainerInstanceManager manager; + + ServiceAssociationLinksImpl(ContainerInstanceManager manager) { + super(manager.inner().serviceAssociationLinks()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + ServiceAssociationLinksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toCompletable(); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksInner.java new file mode 100644 index 0000000000000..f464eb5059b9a --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ServiceAssociationLinksInner.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceAssociationLinks. + */ +public class ServiceAssociationLinksInner { + /** The Retrofit service to perform REST calls. */ + private ServiceAssociationLinksService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ServiceAssociationLinksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceAssociationLinksInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ServiceAssociationLinksService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceAssociationLinks to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceAssociationLinksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ServiceAssociationLinks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Delete the container instance service association link for the subnet. + * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Delete the container instance service association link for the subnet. + * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Delete the container instance service association link for the subnet. + * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the container instance service association link for the subnet. + * Delete the container instance service association link for the subnet. This operation unblocks user from deleting subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, virtualNetworkName, subnetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..3c26e2fba41d7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_10_01.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..f760d444bc137 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/package-info.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/package-info.java new file mode 100644 index 0000000000000..ace0dcc2b620c --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/package-info.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/package-info.java new file mode 100644 index 0000000000000..4d32111d03c0e --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_10_01; diff --git a/containerregistry/resource-manager/v2016_06_27_preview/pom.xml b/containerregistry/resource-manager/v2016_06_27_preview/pom.xml index 0e06d66d3a534..ca2b7a844b3d2 100644 --- a/containerregistry/resource-manager/v2016_06_27_preview/pom.xml +++ b/containerregistry/resource-manager/v2016_06_27_preview/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.containerregistry.v2016_06_27_preview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-containerregistry - 1.0.0-beta - jar - Microsoft Azure SDK for ContainerRegistry Management - This package contains Microsoft ContainerRegistry Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.containerregistry.v2016_06_27_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java index 4016e3d664b87..d8c82ed32d7d4 100644 --- a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -191,6 +191,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2016-06-27-preview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2016-06-27-preview"); } } diff --git a/containerregistry/resource-manager/v2017_03_01/pom.xml b/containerregistry/resource-manager/v2017_03_01/pom.xml index 400fa19675e52..fc6968658af92 100644 --- a/containerregistry/resource-manager/v2017_03_01/pom.xml +++ b/containerregistry/resource-manager/v2017_03_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.containerregistry.v2017_03_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-containerregistry - 1.0.0-beta - jar - Microsoft Azure SDK for ContainerRegistry Management - This package contains Microsoft ContainerRegistry Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java index 37f722b9b3c3c..cf4ac3ac14498 100644 --- a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java @@ -205,6 +205,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-03-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2017-03-01"); } } diff --git a/containerregistry/resource-manager/v2017_06_01_preview/pom.xml b/containerregistry/resource-manager/v2017_06_01_preview/pom.xml index 10fb3c433354c..eb2bdb7a95a7d 100644 --- a/containerregistry/resource-manager/v2017_06_01_preview/pom.xml +++ b/containerregistry/resource-manager/v2017_06_01_preview/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.containerregistry.v2017_06_01_preview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-containerregistry - 1.0.0-beta - jar - Microsoft Azure SDK for ContainerRegistry Management - This package contains Microsoft ContainerRegistry Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_06_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java index 43b0b0e1f12a4..445e9b382432d 100644 --- a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -233,6 +233,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-06-01-preview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2017-06-01-preview"); } } diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java index 3d0a0a170ae92..f8396f0165e76 100644 --- a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java @@ -34,7 +34,7 @@ class ReplicationImpl extends CreatableUpdatableImpl - - 4.0.0 - com.microsoft.azure.containerregistry.v2017_10_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-containerregistry - 1.0.0-beta - jar - Microsoft Azure SDK for ContainerRegistry Management - This package contains Microsoft ContainerRegistry Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_10_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java index 969a1d6eac83e..81b5c0626dc3c 100644 --- a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java @@ -15,11 +15,17 @@ */ public class ImportSource { /** - * The resource identifier of the target Azure Container Registry. + * The resource identifier of the source Azure Container Registry. */ - @JsonProperty(value = "resourceId", required = true) + @JsonProperty(value = "resourceId") private String resourceId; + /** + * The address of the source registry. + */ + @JsonProperty(value = "registryUri") + private String registryUri; + /** * Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the @@ -32,7 +38,7 @@ public class ImportSource { private String sourceImage; /** - * Get the resource identifier of the target Azure Container Registry. + * Get the resource identifier of the source Azure Container Registry. * * @return the resourceId value */ @@ -41,7 +47,7 @@ public String resourceId() { } /** - * Set the resource identifier of the target Azure Container Registry. + * Set the resource identifier of the source Azure Container Registry. * * @param resourceId the resourceId value to set * @return the ImportSource object itself. @@ -51,6 +57,26 @@ public ImportSource withResourceId(String resourceId) { return this; } + /** + * Get the address of the source registry. + * + * @return the registryUri value + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the address of the source registry. + * + * @param registryUri the registryUri value to set + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + /** * Get repository name of the source image. Specify an image by repository ('hello-world'). This will use the 'latest' tag. diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java index 00526974221c3..d488c18809927 100644 --- a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java @@ -233,6 +233,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-10-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2017-10-01"); } } diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java index cedf4d7b570ec..cc0cf024dbdff 100644 --- a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java @@ -34,7 +34,7 @@ class ReplicationImpl extends CreatableUpdatableImpl - - 4.0.0 - com.microsoft.azure.containerregistry.v2018_02_01_preview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-containerregistry - 1.0.0-beta-1 - jar - Microsoft Azure SDK for ContainerRegistry Management - This package contains Microsoft ContainerRegistry Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.containerregistry.v2018_02_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java index 81a6c6c96101e..5376d6b36bc6a 100644 --- a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java @@ -15,11 +15,17 @@ */ public class ImportSource { /** - * The resource identifier of the target Azure Container Registry. + * The resource identifier of the source Azure Container Registry. */ - @JsonProperty(value = "resourceId", required = true) + @JsonProperty(value = "resourceId") private String resourceId; + /** + * The address of the source registry. + */ + @JsonProperty(value = "registryUri") + private String registryUri; + /** * Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the @@ -32,7 +38,7 @@ public class ImportSource { private String sourceImage; /** - * Get the resource identifier of the target Azure Container Registry. + * Get the resource identifier of the source Azure Container Registry. * * @return the resourceId value */ @@ -41,7 +47,7 @@ public String resourceId() { } /** - * Set the resource identifier of the target Azure Container Registry. + * Set the resource identifier of the source Azure Container Registry. * * @param resourceId the resourceId value to set * @return the ImportSource object itself. @@ -51,6 +57,26 @@ public ImportSource withResourceId(String resourceId) { return this; } + /** + * Get the address of the source registry. + * + * @return the registryUri value + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the address of the source registry. + * + * @param registryUri the registryUri value to set + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + /** * Get repository name of the source image. Specify an image by repository ('hello-world'). This will use the 'latest' tag. diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java index 5d7e05863a338..1b8c7e7c0286b 100644 --- a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java @@ -41,7 +41,7 @@ class BuildImpl extends CreatableUpdatableImpl imp this.manager = manager; // Set resource name this.buildId = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); this.buildId = IdParsingUtils.getValueFromIdByName(inner.id(), "builds"); diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java index 833b7e9febc6d..a32552a183e23 100644 --- a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java @@ -41,7 +41,7 @@ class BuildStepImpl extends CreatableUpdatableImpl + + 4.0.0 + com.microsoft.azure.containerregistry.v2018_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta-1 + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Actor.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Actor.java new file mode 100644 index 0000000000000..3b81ffec0021a --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Actor.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from + * the authorization context of the request. + */ +public class Actor { + /** + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the subject or username associated with the request context that generated the event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the subject or username associated with the request context that generated the event. + * + * @param name the name value to set + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AgentProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AgentProperties.java new file mode 100644 index 0000000000000..fa862c6f35e20 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AgentProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties that determine the run agent configuration. + */ +public class AgentProperties { + /** + * The CPU configuration in terms of number of cores required for the run. + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** + * Get the CPU configuration in terms of number of cores required for the run. + * + * @return the cpu value + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the CPU configuration in terms of number of cores required for the run. + * + * @param cpu the cpu value to set + * @return the AgentProperties object itself. + */ + public AgentProperties withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Architecture.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Architecture.java new file mode 100644 index 0000000000000..1e0c6069b9acb --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Architecture.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Architecture. + */ +public final class Architecture extends ExpandableStringEnum { + /** Static value amd64 for Architecture. */ + public static final Architecture AMD64 = fromString("amd64"); + + /** Static value x86 for Architecture. */ + public static final Architecture X86 = fromString("x86"); + + /** Static value arm for Architecture. */ + public static final Architecture ARM = fromString("arm"); + + /** + * Creates or finds a Architecture from its string representation. + * @param name a name to look for + * @return the corresponding Architecture + */ + @JsonCreator + public static Architecture fromString(String name) { + return fromString(name, Architecture.class); + } + + /** + * @return known Architecture values + */ + public static Collection values() { + return values(Architecture.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Argument.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Argument.java new file mode 100644 index 0000000000000..f53f8331c3050 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Argument.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a run argument. + */ +public class Argument { + /** + * The name of the argument. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the argument. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Flag to indicate whether the argument represents a secret and want to be + * removed from build logs. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name of the argument. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the argument. + * + * @param name the name value to set + * @return the Argument object itself. + */ + public Argument withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the argument. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the argument. + * + * @param value the value value to set + * @return the Argument object itself. + */ + public Argument withValue(String value) { + this.value = value; + return this; + } + + /** + * Get flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @param isSecret the isSecret value to set + * @return the Argument object itself. + */ + public Argument withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfo.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfo.java new file mode 100644 index 0000000000000..4f5f64aff63fa --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfo.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The authorization properties for accessing the source code repository. + */ +public class AuthInfo { + /** + * The type of Auth token. Possible values include: 'PAT', 'OAuth'. + */ + @JsonProperty(value = "tokenType", required = true) + private TokenType tokenType; + + /** + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token", required = true) + private String token; + + /** + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /** + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Time in seconds that the token remains valid. + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @param tokenType the tokenType value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the access token used to access the source control provider. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the access token used to access the source control provider. + * + * @param token the token value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refresh token used to refresh the access token. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope of the access token. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of the access token. + * + * @param scope the scope value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get time in seconds that the token remains valid. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfoUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfoUpdateParameters.java new file mode 100644 index 0000000000000..8f61179225000 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/AuthInfoUpdateParameters.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The authorization properties for accessing the source code repository. + */ +public class AuthInfoUpdateParameters { + /** + * The type of Auth token. Possible values include: 'PAT', 'OAuth'. + */ + @JsonProperty(value = "tokenType") + private TokenType tokenType; + + /** + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token") + private String token; + + /** + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /** + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Time in seconds that the token remains valid. + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @param tokenType the tokenType value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the access token used to access the source control provider. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the access token used to access the source control provider. + * + * @param token the token value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refresh token used to refresh the access token. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope of the access token. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of the access token. + * + * @param scope the scope value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get time in seconds that the token remains valid. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependency.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependency.java new file mode 100644 index 0000000000000..65decbad93b7f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependency.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that describe a base image dependency. + */ +public class BaseImageDependency { + /** + * The type of the base image dependency. Possible values include: + * 'BuildTime', 'RunTime'. + */ + @JsonProperty(value = "type") + private BaseImageDependencyType type; + + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @return the type value + */ + public BaseImageDependencyType type() { + return this.type; + } + + /** + * Set the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @param type the type value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withType(BaseImageDependencyType type) { + this.type = type; + return this; + } + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependencyType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependencyType.java new file mode 100644 index 0000000000000..e375d27cdd418 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageDependencyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageDependencyType. + */ +public final class BaseImageDependencyType extends ExpandableStringEnum { + /** Static value BuildTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType BUILD_TIME = fromString("BuildTime"); + + /** Static value RunTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType RUN_TIME = fromString("RunTime"); + + /** + * Creates or finds a BaseImageDependencyType from its string representation. + * @param name a name to look for + * @return the corresponding BaseImageDependencyType + */ + @JsonCreator + public static BaseImageDependencyType fromString(String name) { + return fromString(name, BaseImageDependencyType.class); + } + + /** + * @return known BaseImageDependencyType values + */ + public static Collection values() { + return values(BaseImageDependencyType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTrigger.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTrigger.java new file mode 100644 index 0000000000000..f5f8223e4779c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTrigger.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The trigger based on base image dependency. + */ +public class BaseImageTrigger { + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime'. + */ + @JsonProperty(value = "baseImageTriggerType", required = true) + private BaseImageTriggerType baseImageTriggerType; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @return the baseImageTriggerType value + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @param baseImageTriggerType the baseImageTriggerType value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerType.java new file mode 100644 index 0000000000000..2ccaa4ef55d42 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageTriggerType. + */ +public final class BaseImageTriggerType extends ExpandableStringEnum { + /** Static value All for BaseImageTriggerType. */ + public static final BaseImageTriggerType ALL = fromString("All"); + + /** Static value Runtime for BaseImageTriggerType. */ + public static final BaseImageTriggerType RUNTIME = fromString("Runtime"); + + /** + * Creates or finds a BaseImageTriggerType from its string representation. + * @param name a name to look for + * @return the corresponding BaseImageTriggerType + */ + @JsonCreator + public static BaseImageTriggerType fromString(String name) { + return fromString(name, BaseImageTriggerType.class); + } + + /** + * @return known BaseImageTriggerType values + */ + public static Collection values() { + return values(BaseImageTriggerType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerUpdateParameters.java new file mode 100644 index 0000000000000..0965727b39a77 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/BaseImageTriggerUpdateParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating base image dependency trigger. + */ +public class BaseImageTriggerUpdateParameters { + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime'. + */ + @JsonProperty(value = "baseImageTriggerType") + private BaseImageTriggerType baseImageTriggerType; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @return the baseImageTriggerType value + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @param baseImageTriggerType the baseImageTriggerType value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/CallbackConfig.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/CallbackConfig.java new file mode 100644 index 0000000000000..1b083f7ef1e32 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/CallbackConfig.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.CallbackConfigInner; +import java.util.Map; + +/** + * Type representing CallbackConfig. + */ +public interface CallbackConfig extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * @return the serviceUri value. + */ + String serviceUri(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildRequest.java new file mode 100644 index 0000000000000..5584232f9184f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildRequest.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a docker quick build. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("DockerBuildRequest") +public class DockerBuildRequest extends RunRequest { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source location. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /** + * The collection of override arguments to be used when executing the run. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repoistory. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source location. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source location. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the collection of override arguments to be used when executing the run. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing the run. + * + * @param arguments the arguments value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStep.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStep.java new file mode 100644 index 0000000000000..07dbfcf21097b --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStep.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +public class DockerBuildStep extends TaskStepProperties { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /** + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source context. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the collection of override arguments to be used when executing this build step. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withArguments(List arguments) { + this.arguments = arguments; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStepUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStepUpdateParameters.java new file mode 100644 index 0000000000000..57a180720f00e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/DockerBuildStepUpdateParameters.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties for updating a docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +public class DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath") + private String dockerFilePath; + + /** + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source context. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the collection of override arguments to be used when executing this build step. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withArguments(List arguments) { + this.arguments = arguments; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskRunRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskRunRequest.java new file mode 100644 index 0000000000000..1539de33bbef6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskRunRequest.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a quick task run request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTaskRunRequest") +public class EncodedTaskRunRequest extends RunRequest { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repoistory. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStep.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStep.java new file mode 100644 index 0000000000000..85115af6fe6b3 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStep.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a encoded task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTask") +public class EncodedTaskStep extends TaskStepProperties { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStepUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStepUpdateParameters.java new file mode 100644 index 0000000000000..38c7d05e93438 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EncodedTaskStepUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties for updating encoded task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTask") +public class EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent") + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Event.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Event.java new file mode 100644 index 0000000000000..9296514c0a4ce --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Event.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.EventInner; + +/** + * Type representing Event. + */ +public interface Event extends HasInner, HasManager { + /** + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventContent.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventContent.java new file mode 100644 index 0000000000000..08510c62e403f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventContent.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content of the event request message. + */ +public class EventContent { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /** + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /** + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /** + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /** + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the time at which the event occurred. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the time at which the event occurred. + * + * @param timestamp the timestamp value to set + * @return the EventContent object itself. + */ + public EventContent withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action that encompasses the provided event. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the action that encompasses the provided event. + * + * @param action the action value to set + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target of the event. + * + * @return the target value + */ + public Target target() { + return this.target; + } + + /** + * Set the target of the event. + * + * @param target the target value to set + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request that generated the event. + * + * @return the request value + */ + public Request request() { + return this.request; + } + + /** + * Set the request that generated the event. + * + * @param request the request value to set + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @return the actor value + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @param actor the actor value to set + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @return the source value + */ + public Source source() { + return this.source; + } + + /** + * Set the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @param source the source value to set + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventInfo.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventInfo.java new file mode 100644 index 0000000000000..beff2bbb39532 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventInfo.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.EventInfoInner; + +/** + * Type representing EventInfo. + */ +public interface EventInfo extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventRequestMessage.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventRequestMessage.java new file mode 100644 index 0000000000000..ab66ff8a41ad7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventRequestMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event request message sent to the service URI. + */ +public class EventRequestMessage { + /** + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /** + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event request message. + * + * @return the content value + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content of the event request message. + * + * @param content the content value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event request message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event request message. + * + * @param headers the headers value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the HTTP method used to send the event request message. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the HTTP method used to send the event request message. + * + * @param method the method value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the URI used to send the event request message. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the URI used to send the event request message. + * + * @param requestUri the requestUri value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventResponseMessage.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventResponseMessage.java new file mode 100644 index 0000000000000..3ecb0922d3526 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/EventResponseMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event response message received from the service URI. + */ +public class EventResponseMessage { + /** + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /** + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /** + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event response message. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the event response message. + * + * @param content the content value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event response message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event response message. + * + * @param headers the headers value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reason phrase of the event response message. + * + * @return the reasonPhrase value + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the status code of the event response message. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the status code of the event response message. + * + * @param statusCode the statusCode value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskRunRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskRunRequest.java new file mode 100644 index 0000000000000..31b0901a695b5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskRunRequest.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The request parameters for a scheduling run against a task file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTaskRunRequest") +public class FileTaskRunRequest extends RunRequest { + /** + * The template/definition file path relative to the source. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /** + * The values/parameters file path relative to the source. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repoistory. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * Get the template/definition file path relative to the source. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the template/definition file path relative to the source. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the values/parameters file path relative to the source. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the values/parameters file path relative to the source. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repoistory. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStep.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStep.java new file mode 100644 index 0000000000000..c716727a587f4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStep.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTask") +public class FileTaskStep extends TaskStepProperties { + /** + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /** + * The task values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the task template/definition file path relative to the source context. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the task values/parameters file path relative to the source context. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the task values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStepUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStepUpdateParameters.java new file mode 100644 index 0000000000000..9cf1c75b4651e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/FileTaskStepUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of updating a task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTask") +public class FileTaskStepUpdateParameters extends TaskStepUpdateParameters { + /** + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath") + private String taskFilePath; + + /** + * The values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the task template/definition file path relative to the source context. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the values/parameters file path relative to the source context. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageDescriptor.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageDescriptor.java new file mode 100644 index 0000000000000..3d59bc45e4b3f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageDescriptor.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties for a registry image. + */ +public class ImageDescriptor { + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageUpdateTrigger.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageUpdateTrigger.java new file mode 100644 index 0000000000000..5b51b1c0e102f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImageUpdateTrigger.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The image update trigger that caused a build. + */ +public class ImageUpdateTrigger { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The timestamp when the image update happened. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The list of image updates that caused the build. + */ + @JsonProperty(value = "images") + private List images; + + /** + * Get the unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withId(String id) { + this.id = id; + return this; + } + + /** + * Get the timestamp when the image update happened. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp when the image update happened. + * + * @param timestamp the timestamp value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the list of image updates that caused the build. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the list of image updates that caused the build. + * + * @param images the images value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withImages(List images) { + this.images = images; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportImageParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportImageParameters.java new file mode 100644 index 0000000000000..68d3003c4824d --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportImageParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportImageParameters model. + */ +public class ImportImageParameters { + /** + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /** + * List of strings of the form repo[:tag]. When tag is omitted the source + * will be used (or 'latest' if source tag is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /** + * List of strings of repository names to do a manifest only copy. No tag + * will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /** + * When Force, any existing target tags will be overwritten. When NoForce, + * any existing target tags will fail the operation before any copying + * begins. Possible values include: 'NoForce', 'Force'. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source of the image. + * + * @return the source value + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source of the image. + * + * @param source the source value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @return the targetTags value + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @param targetTags the targetTags value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @return the untaggedTargetRepositories value + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @return the mode value + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @param mode the mode value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportMode.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportMode.java new file mode 100644 index 0000000000000..a8d50071b6d6a --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImportMode. + */ +public final class ImportMode extends ExpandableStringEnum { + /** Static value NoForce for ImportMode. */ + public static final ImportMode NO_FORCE = fromString("NoForce"); + + /** Static value Force for ImportMode. */ + public static final ImportMode FORCE = fromString("Force"); + + /** + * Creates or finds a ImportMode from its string representation. + * @param name a name to look for + * @return the corresponding ImportMode + */ + @JsonCreator + public static ImportMode fromString(String name) { + return fromString(name, ImportMode.class); + } + + /** + * @return known ImportMode values + */ + public static Collection values() { + return values(ImportMode.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportSource.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportSource.java new file mode 100644 index 0000000000000..ad69fe0e1df09 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ImportSource.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportSource model. + */ +public class ImportSource { + /** + * The resource identifier of the source Azure Container Registry. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The address of the source registry. + */ + @JsonProperty(value = "registryUri") + private String registryUri; + + /** + * Repository name of the source image. + * Specify an image by repository ('hello-world'). This will use the + * 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest + * ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "sourceImage", required = true) + private String sourceImage; + + /** + * Get the resource identifier of the source Azure Container Registry. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource identifier of the source Azure Container Registry. + * + * @param resourceId the resourceId value to set + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address of the source registry. + * + * @return the registryUri value + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the address of the source registry. + * + * @param registryUri the registryUri value to set + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + + /** + * Get repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the sourceImage value + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param sourceImage the sourceImage value to set + * @return the ImportSource object itself. + */ + public ImportSource withSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OS.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OS.java new file mode 100644 index 0000000000000..a6a3d1d9b35e8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OS.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OS. + */ +public final class OS extends ExpandableStringEnum { + /** Static value Windows for OS. */ + public static final OS WINDOWS = fromString("Windows"); + + /** Static value Linux for OS. */ + public static final OS LINUX = fromString("Linux"); + + /** + * Creates or finds a OS from its string representation. + * @param name a name to look for + * @return the corresponding OS + */ + @JsonCreator + public static OS fromString(String name) { + return fromString(name, OS.class); + } + + /** + * @return known OS values + */ + public static Collection values() { + return values(OS.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDefinition.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDefinition.java new file mode 100644 index 0000000000000..5e12ec56c1cce --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDefinition.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationServiceSpecificationDefinition serviceSpecification(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDisplayDefinition.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..fd45da7cdd2c8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationMetricSpecificationDefinition.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationMetricSpecificationDefinition.java new file mode 100644 index 0000000000000..fc34776158325 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationMetricSpecificationDefinition.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of Azure Monitoring metric. + */ +public class OperationMetricSpecificationDefinition { + /** + * Metric name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Metric display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Get metric name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set metric name. + * + * @param name the name value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get metric display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set metric display name. + * + * @param displayName the displayName value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get metric description. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set metric description. + * + * @param displayDescription the displayDescription value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get metric unit. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set metric unit. + * + * @param unit the unit value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get metric aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set metric aggregation type. + * + * @param aggregationType the aggregationType value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get internal metric name. + * + * @return the internalMetricName value + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set internal metric name. + * + * @param internalMetricName the internalMetricName value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationServiceSpecificationDefinition.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationServiceSpecificationDefinition.java new file mode 100644 index 0000000000000..f9d5bccc7e2bc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/OperationServiceSpecificationDefinition.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of Azure Monitoring metrics list. + */ +public class OperationServiceSpecificationDefinition { + /** + * A list of Azure Monitoring metrics definition. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get a list of Azure Monitoring metrics definition. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set a list of Azure Monitoring metrics definition. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Operations.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Operations.java new file mode 100644 index 0000000000000..67fc425136721 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PasswordName.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PasswordName.java new file mode 100644 index 0000000000000..bf868b2c10896 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PasswordName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformProperties.java new file mode 100644 index 0000000000000..ebc01bdcbfb59 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformProperties.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The platform properties against which the run has to happen. + */ +public class PlatformProperties { + /** + * The operating system type required for the run. Possible values include: + * 'Windows', 'Linux'. + */ + @JsonProperty(value = "os", required = true) + private OS os; + + /** + * The OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** + * Variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @return the os value + */ + public OS os() { + return this.os; + } + + /** + * Set the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @param os the os value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + * + * @return the architecture value + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + * + * @param architecture the architecture value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @return the variant value + */ + public Variant variant() { + return this.variant; + } + + /** + * Set variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @param variant the variant value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withVariant(Variant variant) { + this.variant = variant; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformUpdateParameters.java new file mode 100644 index 0000000000000..fc1a23e1c22d6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PlatformUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating the platform configuration. + */ +public class PlatformUpdateParameters { + /** + * The operating system type required for the run. Possible values include: + * 'Windows', 'Linux'. + */ + @JsonProperty(value = "os") + private OS os; + + /** + * The OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** + * Variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @return the os value + */ + public OS os() { + return this.os; + } + + /** + * Set the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @param os the os value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + * + * @return the architecture value + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the OS architecture. Possible values include: 'amd64', 'x86', 'arm'. + * + * @param architecture the architecture value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @return the variant value + */ + public Variant variant() { + return this.variant; + } + + /** + * Set variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @param variant the variant value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withVariant(Variant variant) { + this.variant = variant; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PolicyStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PolicyStatus.java new file mode 100644 index 0000000000000..21a975b6c183e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/PolicyStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PolicyStatus. + */ +public final class PolicyStatus extends ExpandableStringEnum { + /** Static value enabled for PolicyStatus. */ + public static final PolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for PolicyStatus. */ + public static final PolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a PolicyStatus from its string representation. + * @param name a name to look for + * @return the corresponding PolicyStatus + */ + @JsonCreator + public static PolicyStatus fromString(String name) { + return fromString(name, PolicyStatus.class); + } + + /** + * @return known PolicyStatus values + */ + public static Collection values() { + return values(PolicyStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ProvisioningState.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ProvisioningState.java new file mode 100644 index 0000000000000..ce6c6ccc99202 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/QuarantinePolicy.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/QuarantinePolicy.java new file mode 100644 index 0000000000000..af682ca1e901e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/QuarantinePolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that represents quarantine policy for a container registry. + */ +public class QuarantinePolicy { + /** + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the QuarantinePolicy object itself. + */ + public QuarantinePolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegenerateCredentialParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..c505c0eadb396 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegenerateCredentialParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registries.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registries.java new file mode 100644 index 0000000000000..bce3095e9088d --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registries.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryPoliciesInner; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String registryName); + + /** + * Lists the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPoliciesAsync(String resourceGroupName, String registryName); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registry.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registry.java new file mode 100644 index 0000000000000..b0e249cf5ddfc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Registry.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the container registry + * @return the next definition stage +*/ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the registry definition allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + * @param adminUserEnabled The value that indicates whether the admin user is enabled + * @return the next definition stage + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + * @param storageAccount The properties of the storage account for the container registry. Only applicable to Classic SKU + * @return the next definition stage + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled, DefinitionStages.WithStorageAccount { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithSku, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + * @param adminUserEnabled The value that indicates whether the admin user is enabled + * @return the next update stage + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the container registry + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the registry update allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + * @param storageAccount The parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry + * @return the next update stage + */ + Update withStorageAccount(StorageAccountProperties storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryListCredentialsResult.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..2c6929b692c0f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryListCredentialsResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..66e17d764fc29 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameStatus.java new file mode 100644 index 0000000000000..1c87e867af459 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPassword.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPassword.java new file mode 100644 index 0000000000000..fae02b02e1eba --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPolicies.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPolicies.java new file mode 100644 index 0000000000000..758f635c5a797 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryPolicies.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryPoliciesInner; + +/** + * Type representing RegistryPolicies. + */ +public interface RegistryPolicies extends HasInner, HasManager { + /** + * @return the quarantinePolicy value. + */ + QuarantinePolicy quarantinePolicy(); + + /** + * @return the trustPolicy value. + */ + TrustPolicy trustPolicy(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..97ddffade2478 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. Only + * applicable to Classic SKU. If specified, the storage account must be in + * the same physical location as the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsage.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsage.java new file mode 100644 index 0000000000000..8260846cd1303 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota usage for a container registry. + */ +public class RegistryUsage { + /** + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The unit of measurement. Possible values include: 'Count', 'Bytes'. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name of the usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the usage. + * + * @param name the name value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit of the usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit of the usage. + * + * @param limit the limit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @return the unit value + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @param unit the unit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageListResult.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageListResult.java new file mode 100644 index 0000000000000..d31494b808989 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RegistryUsageListResultInner; +import java.util.List; + +/** + * Type representing RegistryUsageListResult. + */ +public interface RegistryUsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageUnit.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageUnit.java new file mode 100644 index 0000000000000..793e31f78848c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RegistryUsageUnit.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistryUsageUnit. + */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * @param name a name to look for + * @return the corresponding RegistryUsageUnit + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** + * @return known RegistryUsageUnit values + */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replication.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replication.java new file mode 100644 index 0000000000000..e54c48342e337 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replication.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ReplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing Replication. + */ +public interface Replication extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Replication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Replication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Replication definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the replication definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param registryName The name of the container registry + * @return the next definition stage + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the replication definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource. This cannot be changed after the resource is created + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the replication definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a Replication update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of Replication update stages. + */ + interface UpdateStages { + /** + * The stage of the replication update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ReplicationUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ReplicationUpdateParameters.java new file mode 100644 index 0000000000000..81baa39b55ec3 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/ReplicationUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a replication. + */ +public class ReplicationUpdateParameters { + /** + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags for the replication. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the replication. + * + * @param tags the tags value to set + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replications.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replications.java new file mode 100644 index 0000000000000..491ed19880a0e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Replications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ReplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replications. + */ +public interface Replications extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String replicationName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String replicationName); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Request.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Request.java new file mode 100644 index 0000000000000..bf3346acc91ff --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Request.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request that generated the event. + */ +public class Request { + /** + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /** + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the ID of the request that initiated the event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request that initiated the event. + * + * @param id the id value to set + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @param host the host value to set + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the request method that generated the event. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the request method that generated the event. + * + * @param method the method value to set + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the user agent header of the request. + * + * @return the useragent value + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the user agent header of the request. + * + * @param useragent the useragent value to set + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Run.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Run.java new file mode 100644 index 0000000000000..636c2fa24826f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Run.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RunInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Run. + */ +public interface Run extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * @return the createTime value. + */ + DateTime createTime(); + + /** + * @return the finishTime value. + */ + DateTime finishTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imageUpdateTrigger value. + */ + ImageUpdateTrigger imageUpdateTrigger(); + + /** + * @return the isArchiveEnabled value. + */ + Boolean isArchiveEnabled(); + + /** + * @return the lastUpdatedTime value. + */ + DateTime lastUpdatedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputImages value. + */ + List outputImages(); + + /** + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the runId value. + */ + String runId(); + + /** + * @return the runType value. + */ + RunType runType(); + + /** + * @return the sourceTrigger value. + */ + SourceTriggerDescriptor sourceTrigger(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + RunStatus status(); + + /** + * @return the task value. + */ + String task(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a Run update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIsArchiveEnabled { + } + + /** + * Grouping of Run update stages. + */ + interface UpdateStages { + /** + * The stage of the run update allowing to specify IsArchiveEnabled. + */ + interface WithIsArchiveEnabled { + /** + * Specifies isArchiveEnabled. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not + * @return the next update stage + */ + Update withIsArchiveEnabled(Boolean isArchiveEnabled); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunFilter.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunFilter.java new file mode 100644 index 0000000000000..78fa73ce07905 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunFilter.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that are enabled for Odata querying on runs. + */ +public class RunFilter { + /** + * The unique identifier for the run. + */ + @JsonProperty(value = "runId") + private String runId; + + /** + * The type of run. Possible values include: 'QuickBuild', 'QuickRun', + * 'AutoBuild', 'AutoRun'. + */ + @JsonProperty(value = "runType") + private RunType runType; + + /** + * The current status of the run. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', + * 'Timeout'. + */ + @JsonProperty(value = "status") + private RunStatus status; + + /** + * The create time for a run. + */ + @JsonProperty(value = "createTime") + private DateTime createTime; + + /** + * The time the run finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The list of comma-separated image manifests that were generated from the + * run. This is applicable if the run is of + * build type. + */ + @JsonProperty(value = "outputImageManifests") + private String outputImageManifests; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The name of the task that the run corresponds to. + */ + @JsonProperty(value = "taskName") + private String taskName; + + /** + * Get the unique identifier for the run. + * + * @return the runId value + */ + public String runId() { + return this.runId; + } + + /** + * Set the unique identifier for the run. + * + * @param runId the runId value to set + * @return the RunFilter object itself. + */ + public RunFilter withRunId(String runId) { + this.runId = runId; + return this; + } + + /** + * Get the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @return the runType value + */ + public RunType runType() { + return this.runType; + } + + /** + * Set the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @param runType the runType value to set + * @return the RunFilter object itself. + */ + public RunFilter withRunType(RunType runType) { + this.runType = runType; + return this; + } + + /** + * Get the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public RunStatus status() { + return this.status; + } + + /** + * Set the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the RunFilter object itself. + */ + public RunFilter withStatus(RunStatus status) { + this.status = status; + return this; + } + + /** + * Get the create time for a run. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the create time for a run. + * + * @param createTime the createTime value to set + * @return the RunFilter object itself. + */ + public RunFilter withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the run finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the run finished. + * + * @param finishTime the finishTime value to set + * @return the RunFilter object itself. + */ + public RunFilter withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of comma-separated image manifests that were generated from the run. This is applicable if the run is of + build type. + * + * @return the outputImageManifests value + */ + public String outputImageManifests() { + return this.outputImageManifests; + } + + /** + * Set the list of comma-separated image manifests that were generated from the run. This is applicable if the run is of + build type. + * + * @param outputImageManifests the outputImageManifests value to set + * @return the RunFilter object itself. + */ + public RunFilter withOutputImageManifests(String outputImageManifests) { + this.outputImageManifests = outputImageManifests; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunFilter object itself. + */ + public RunFilter withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the name of the task that the run corresponds to. + * + * @return the taskName value + */ + public String taskName() { + return this.taskName; + } + + /** + * Set the name of the task that the run corresponds to. + * + * @param taskName the taskName value to set + * @return the RunFilter object itself. + */ + public RunFilter withTaskName(String taskName) { + this.taskName = taskName; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunGetLogResult.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunGetLogResult.java new file mode 100644 index 0000000000000..ab99ac2739649 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunGetLogResult.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RunGetLogResultInner; + +/** + * Type representing RunGetLogResult. + */ +public interface RunGetLogResult extends HasInner, HasManager { + /** + * @return the logLink value. + */ + String logLink(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunRequest.java new file mode 100644 index 0000000000000..fda7672c5183b --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunRequest.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The request parameters for scheduling a run. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("RunRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DockerBuildRequest", value = DockerBuildRequest.class), + @JsonSubTypes.Type(name = "FileTaskRunRequest", value = FileTaskRunRequest.class), + @JsonSubTypes.Type(name = "TaskRunRequest", value = TaskRunRequest.class), + @JsonSubTypes.Type(name = "EncodedTaskRunRequest", value = EncodedTaskRunRequest.class) +}) +public class RunRequest { + /** + * The value that indicates whether archiving is enabled for the run or + * not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the value that indicates whether archiving is enabled for the run or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled for the run or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunRequest object itself. + */ + public RunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunStatus.java new file mode 100644 index 0000000000000..f17dea8303997 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunStatus.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RunStatus. + */ +public final class RunStatus extends ExpandableStringEnum { + /** Static value Queued for RunStatus. */ + public static final RunStatus QUEUED = fromString("Queued"); + + /** Static value Started for RunStatus. */ + public static final RunStatus STARTED = fromString("Started"); + + /** Static value Running for RunStatus. */ + public static final RunStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for RunStatus. */ + public static final RunStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for RunStatus. */ + public static final RunStatus FAILED = fromString("Failed"); + + /** Static value Canceled for RunStatus. */ + public static final RunStatus CANCELED = fromString("Canceled"); + + /** Static value Error for RunStatus. */ + public static final RunStatus ERROR = fromString("Error"); + + /** Static value Timeout for RunStatus. */ + public static final RunStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a RunStatus from its string representation. + * @param name a name to look for + * @return the corresponding RunStatus + */ + @JsonCreator + public static RunStatus fromString(String name) { + return fromString(name, RunStatus.class); + } + + /** + * @return known RunStatus values + */ + public static Collection values() { + return values(RunStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunType.java new file mode 100644 index 0000000000000..192672c3d3877 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RunType. + */ +public final class RunType extends ExpandableStringEnum { + /** Static value QuickBuild for RunType. */ + public static final RunType QUICK_BUILD = fromString("QuickBuild"); + + /** Static value QuickRun for RunType. */ + public static final RunType QUICK_RUN = fromString("QuickRun"); + + /** Static value AutoBuild for RunType. */ + public static final RunType AUTO_BUILD = fromString("AutoBuild"); + + /** Static value AutoRun for RunType. */ + public static final RunType AUTO_RUN = fromString("AutoRun"); + + /** + * Creates or finds a RunType from its string representation. + * @param name a name to look for + * @return the corresponding RunType + */ + @JsonCreator + public static RunType fromString(String name) { + return fromString(name, RunType.class); + } + + /** + * @return known RunType values + */ + public static Collection values() { + return values(RunType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunUpdateParameters.java new file mode 100644 index 0000000000000..22c5c3883a318 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/RunUpdateParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of run properties that can be updated. + */ +public class RunUpdateParameters { + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunUpdateParameters object itself. + */ + public RunUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Runs.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Runs.java new file mode 100644 index 0000000000000..d692c14771590 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Runs.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.RunsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Runs. + */ +public interface Runs extends HasInner { + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelAsync(String resourceGroupName, String registryName, String runId); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String runId); + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SetValue.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SetValue.java new file mode 100644 index 0000000000000..f66e885e381dc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SetValue.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a overridable value that can be passed to a task template. + */ +public class SetValue { + /** + * The name of the overridable value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The overridable value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Flag to indicate whether the value represents a secret or not. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name of the overridable value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the overridable value. + * + * @param name the name value to set + * @return the SetValue object itself. + */ + public SetValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the overridable value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the overridable value. + * + * @param value the value value to set + * @return the SetValue object itself. + */ + public SetValue withValue(String value) { + this.value = value; + return this; + } + + /** + * Get flag to indicate whether the value represents a secret or not. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set flag to indicate whether the value represents a secret or not. + * + * @param isSecret the isSecret value to set + * @return the SetValue object itself. + */ + public SetValue withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Sku.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Sku.java new file mode 100644 index 0000000000000..de532203dc0cc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Sku.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Classic', + * 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuName.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuName.java new file mode 100644 index 0000000000000..be86bbab23ae7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuTier.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuTier.java new file mode 100644 index 0000000000000..66ed20f73f503 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SkuTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Source.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Source.java new file mode 100644 index 0000000000000..4532d4e8db1a7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Source.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor + * initiates the event, the source generates it. + */ +public class Source { + /** + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceID; + + /** + * Get the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the running instance of an application. Changes after each restart. + * + * @return the instanceID value + */ + public String instanceID() { + return this.instanceID; + } + + /** + * Set the running instance of an application. Changes after each restart. + * + * @param instanceID the instanceID value to set + * @return the Source object itself. + */ + public Source withInstanceID(String instanceID) { + this.instanceID = instanceID; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceControlType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceControlType.java new file mode 100644 index 0000000000000..e3d0c93b7a152 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceControlType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceControlType. + */ +public final class SourceControlType extends ExpandableStringEnum { + /** Static value Github for SourceControlType. */ + public static final SourceControlType GITHUB = fromString("Github"); + + /** Static value VisualStudioTeamService for SourceControlType. */ + public static final SourceControlType VISUAL_STUDIO_TEAM_SERVICE = fromString("VisualStudioTeamService"); + + /** + * Creates or finds a SourceControlType from its string representation. + * @param name a name to look for + * @return the corresponding SourceControlType + */ + @JsonCreator + public static SourceControlType fromString(String name) { + return fromString(name, SourceControlType.class); + } + + /** + * @return known SourceControlType values + */ + public static Collection values() { + return values(SourceControlType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceProperties.java new file mode 100644 index 0000000000000..61ad3f497b134 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the source code repository. + */ +public class SourceProperties { + /** + * The type of source control service. Possible values include: 'Github', + * 'VisualStudioTeamService'. + */ + @JsonProperty(value = "sourceControlType", required = true) + private SourceControlType sourceControlType; + + /** + * The full URL to the source code respository. + */ + @JsonProperty(value = "repositoryUrl", required = true) + private String repositoryUrl; + + /** + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfo sourceControlAuthProperties; + + /** + * Get the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the full URL to the source code respository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the full URL to the source code respository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name of the source code. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch name of the source code. + * + * @param branch the branch value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @return the sourceControlAuthProperties value + */ + public AuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlAuthProperties(AuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTrigger.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTrigger.java new file mode 100644 index 0000000000000..aa3a5abd0f277 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTrigger.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a source based trigger. + */ +public class SourceTrigger { + /** + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository", required = true) + private SourceProperties sourceRepository; + + /** + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents", required = true) + private List sourceTriggerEvents; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the properties that describes the source(code) for the task. + * + * @return the sourceRepository value + */ + public SourceProperties sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceRepository(SourceProperties sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerDescriptor.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerDescriptor.java new file mode 100644 index 0000000000000..0f7236dc165b4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerDescriptor.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The source trigger that caused a run. + */ +public class SourceTriggerDescriptor { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The event type of the trigger. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /** + * The unique ID that identifies a commit. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /** + * The unique ID that identifies pull request. + */ + @JsonProperty(value = "pullRequestId") + private String pullRequestId; + + /** + * The repository URL. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /** + * The branch name in the repository. + */ + @JsonProperty(value = "branchName") + private String branchName; + + /** + * The source control provider type. + */ + @JsonProperty(value = "providerType") + private String providerType; + + /** + * Get the unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withId(String id) { + this.id = id; + return this; + } + + /** + * Get the event type of the trigger. + * + * @return the eventType value + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the event type of the trigger. + * + * @param eventType the eventType value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the unique ID that identifies a commit. + * + * @return the commitId value + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the unique ID that identifies a commit. + * + * @param commitId the commitId value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the unique ID that identifies pull request. + * + * @return the pullRequestId value + */ + public String pullRequestId() { + return this.pullRequestId; + } + + /** + * Set the unique ID that identifies pull request. + * + * @param pullRequestId the pullRequestId value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withPullRequestId(String pullRequestId) { + this.pullRequestId = pullRequestId; + return this; + } + + /** + * Get the repository URL. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repository URL. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name in the repository. + * + * @return the branchName value + */ + public String branchName() { + return this.branchName; + } + + /** + * Set the branch name in the repository. + * + * @param branchName the branchName value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * Get the source control provider type. + * + * @return the providerType value + */ + public String providerType() { + return this.providerType; + } + + /** + * Set the source control provider type. + * + * @param providerType the providerType value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withProviderType(String providerType) { + this.providerType = providerType; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerEvent.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerEvent.java new file mode 100644 index 0000000000000..79192c8988207 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerEvent.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceTriggerEvent. + */ +public final class SourceTriggerEvent extends ExpandableStringEnum { + /** Static value commit for SourceTriggerEvent. */ + public static final SourceTriggerEvent COMMIT = fromString("commit"); + + /** Static value pullrequest for SourceTriggerEvent. */ + public static final SourceTriggerEvent PULLREQUEST = fromString("pullrequest"); + + /** + * Creates or finds a SourceTriggerEvent from its string representation. + * @param name a name to look for + * @return the corresponding SourceTriggerEvent + */ + @JsonCreator + public static SourceTriggerEvent fromString(String name) { + return fromString(name, SourceTriggerEvent.class); + } + + /** + * @return known SourceTriggerEvent values + */ + public static Collection values() { + return values(SourceTriggerEvent.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerUpdateParameters.java new file mode 100644 index 0000000000000..d6c64cb117fdf --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceTriggerUpdateParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating a source based trigger. + */ +public class SourceTriggerUpdateParameters { + /** + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository") + private SourceUpdateParameters sourceRepository; + + /** + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents") + private List sourceTriggerEvents; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the properties that describes the source(code) for the task. + * + * @return the sourceRepository value + */ + public SourceUpdateParameters sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceRepository(SourceUpdateParameters sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUpdateParameters.java new file mode 100644 index 0000000000000..73ac21a69f939 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating the source code repository. + */ +public class SourceUpdateParameters { + /** + * The type of source control service. Possible values include: 'Github', + * 'VisualStudioTeamService'. + */ + @JsonProperty(value = "sourceControlType") + private SourceControlType sourceControlType; + + /** + * The full URL to the source code respository. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /** + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfoUpdateParameters sourceControlAuthProperties; + + /** + * Get the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the full URL to the source code respository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the full URL to the source code respository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name of the source code. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch name of the source code. + * + * @param branch the branch value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @return the sourceControlAuthProperties value + */ + public AuthInfoUpdateParameters sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlAuthProperties(AuthInfoUpdateParameters sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUploadDefinition.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUploadDefinition.java new file mode 100644 index 0000000000000..558c403892757 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/SourceUploadDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.SourceUploadDefinitionInner; + +/** + * Type representing SourceUploadDefinition. + */ +public interface SourceUploadDefinition extends HasInner, HasManager { + /** + * @return the relativePath value. + */ + String relativePath(); + + /** + * @return the uploadUrl value. + */ + String uploadUrl(); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Status.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Status.java new file mode 100644 index 0000000000000..bca112bc4fdc4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Status.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of an Azure resource at the time the operation was called. + */ +public class Status { + /** + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /** + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Get the short label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the detailed message for the status, including alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp when the status was changed to the current value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/StorageAccountProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/StorageAccountProperties.java new file mode 100644 index 0000000000000..5e95a23979fc6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/StorageAccountProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. Only + * applicable to Classic SKU. + */ +public class StorageAccountProperties { + /** + * The resource ID of the storage account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the resource ID of the storage account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the storage account. + * + * @param id the id value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Target.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Target.java new file mode 100644 index 0000000000000..2a66dc67ccaa6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Target.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The target of the event. + */ +public class Target { + /** + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /** + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the MIME type of the referenced object. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the MIME type of the referenced object. + * + * @param mediaType the mediaType value to set + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the number of bytes of the content. Same as Length field. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set the number of bytes of the content. Same as Length field. + * + * @param size the size value to set + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @param digest the digest value to set + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the number of bytes of the content. Same as Size field. + * + * @return the length value + */ + public Long length() { + return this.length; + } + + /** + * Set the number of bytes of the content. Same as Size field. + * + * @param length the length value to set + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the direct URL to the content. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the direct URL to the content. + * + * @param url the url value to set + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Task.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Task.java new file mode 100644 index 0000000000000..eba8d044c1582 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Task.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.TaskInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing Task. + */ +public interface Task extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + TaskStatus status(); + + /** + * @return the step value. + */ + TaskStepProperties step(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeout value. + */ + Integer timeout(); + + /** + * @return the trigger value. + */ + TriggerProperties trigger(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Task definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithPlatform, DefinitionStages.WithStep, DefinitionStages.WithCreate { + } + + /** + * Grouping of Task definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Task definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the task definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param registryName The name of the container registry + * @return the next definition stage + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the task definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource. This cannot be changed after the resource is created + * @return the next definition stage + */ + WithPlatform withLocation(String location); + } + + /** + * The stage of the task definition allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + * @param platform The platform properties against which the run has to happen + * @return the next definition stage + */ + WithStep withPlatform(PlatformProperties platform); + } + + /** + * The stage of the task definition allowing to specify Step. + */ + interface WithStep { + /** + * Specifies step. + * @param step The properties of a task step + * @return the next definition stage + */ + WithCreate withStep(TaskStepProperties step); + } + + /** + * The stage of the task definition allowing to specify AgentConfiguration. + */ + interface WithAgentConfiguration { + /** + * Specifies agentConfiguration. + * @param agentConfiguration The machine configuration of the run agent + * @return the next definition stage + */ + WithCreate withAgentConfiguration(AgentProperties agentConfiguration); + } + + /** + * The stage of the task definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The current status of task. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withStatus(TaskStatus status); + } + + /** + * The stage of the task definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the task definition allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + * @param timeout Run timeout in seconds + * @return the next definition stage + */ + WithCreate withTimeout(Integer timeout); + } + + /** + * The stage of the task definition allowing to specify Trigger. + */ + interface WithTrigger { + /** + * Specifies trigger. + * @param trigger The properties that describe all triggers for the task + * @return the next definition stage + */ + WithCreate withTrigger(TriggerProperties trigger); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAgentConfiguration, DefinitionStages.WithStatus, DefinitionStages.WithTags, DefinitionStages.WithTimeout, DefinitionStages.WithTrigger { + } + } + /** + * The template for a Task update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAgentConfiguration, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger { + } + + /** + * Grouping of Task update stages. + */ + interface UpdateStages { + /** + * The stage of the task update allowing to specify AgentConfiguration. + */ + interface WithAgentConfiguration { + /** + * Specifies agentConfiguration. + * @param agentConfiguration The machine configuration of the run agent + * @return the next update stage + */ + Update withAgentConfiguration(AgentProperties agentConfiguration); + } + + /** + * The stage of the task update allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + * @param platform The platform properties against which the run has to happen + * @return the next update stage + */ + Update withPlatform(PlatformUpdateParameters platform); + } + + /** + * The stage of the task update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The current status of task. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withStatus(TaskStatus status); + } + + /** + * The stage of the task update allowing to specify Step. + */ + interface WithStep { + /** + * Specifies step. + * @param step The properties for updating a task step + * @return the next update stage + */ + Update withStep(TaskStepUpdateParameters step); + } + + /** + * The stage of the task update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The ARM resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the task update allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + * @param timeout Run timeout in seconds + * @return the next update stage + */ + Update withTimeout(Integer timeout); + } + + /** + * The stage of the task update allowing to specify Trigger. + */ + interface WithTrigger { + /** + * Specifies trigger. + * @param trigger The properties for updating trigger properties + * @return the next update stage + */ + Update withTrigger(TriggerUpdateParameters trigger); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskRunRequest.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskRunRequest.java new file mode 100644 index 0000000000000..04a71888ef0d6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskRunRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a task run request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("TaskRunRequest") +public class TaskRunRequest extends RunRequest { + /** + * The name of task against which run has to be queued. + */ + @JsonProperty(value = "taskName", required = true) + private String taskName; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the name of task against which run has to be queued. + * + * @return the taskName value + */ + public String taskName() { + return this.taskName; + } + + /** + * Set the name of task against which run has to be queued. + * + * @param taskName the taskName value to set + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withTaskName(String taskName) { + this.taskName = taskName; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStatus.java new file mode 100644 index 0000000000000..6a88e6f0b489c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TaskStatus. + */ +public final class TaskStatus extends ExpandableStringEnum { + /** Static value Disabled for TaskStatus. */ + public static final TaskStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TaskStatus. */ + public static final TaskStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TaskStatus from its string representation. + * @param name a name to look for + * @return the corresponding TaskStatus + */ + @JsonCreator + public static TaskStatus fromString(String name) { + return fromString(name, TaskStatus.class); + } + + /** + * @return known TaskStatus values + */ + public static Collection values() { + return values(TaskStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepProperties.java new file mode 100644 index 0000000000000..15b19a914c8ec --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base properties for any task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("TaskStepProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStep.class), + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStep.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStep.class) +}) +public class TaskStepProperties { + /** + * List of base image dependencies for a step. + */ + @JsonProperty(value = "baseImageDependencies", access = JsonProperty.Access.WRITE_ONLY) + private List baseImageDependencies; + + /** + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * Get list of base image dependencies for a step. + * + * @return the baseImageDependencies value + */ + public List baseImageDependencies() { + return this.baseImageDependencies; + } + + /** + * Get the URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set + * @return the TaskStepProperties object itself. + */ + public TaskStepProperties withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepUpdateParameters.java new file mode 100644 index 0000000000000..f07e7ee9a5693 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskStepUpdateParameters.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base properties for updating any task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("TaskStepUpdateParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class), + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStepUpdateParameters.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStepUpdateParameters.class) +}) +public class TaskStepUpdateParameters { + /** + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * Get the URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set + * @return the TaskStepUpdateParameters object itself. + */ + public TaskStepUpdateParameters withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskUpdateParameters.java new file mode 100644 index 0000000000000..1a0a169153657 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TaskUpdateParameters.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a task. + */ +@JsonFlatten +public class TaskUpdateParameters { + /** + * The current status of task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformUpdateParameters platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The properties for updating a task step. + */ + @JsonProperty(value = "properties.step") + private TaskStepUpdateParameters step; + + /** + * The properties for updating trigger properties. + */ + @JsonProperty(value = "properties.trigger") + private TriggerUpdateParameters trigger; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformUpdateParameters platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withPlatform(PlatformUpdateParameters platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the properties for updating a task step. + * + * @return the step value + */ + public TaskStepUpdateParameters step() { + return this.step; + } + + /** + * Set the properties for updating a task step. + * + * @param step the step value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStep(TaskStepUpdateParameters step) { + this.step = step; + return this; + } + + /** + * Get the properties for updating trigger properties. + * + * @return the trigger value + */ + public TriggerUpdateParameters trigger() { + return this.trigger; + } + + /** + * Set the properties for updating trigger properties. + * + * @param trigger the trigger value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTrigger(TriggerUpdateParameters trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Tasks.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Tasks.java new file mode 100644 index 0000000000000..ac9fa83427530 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Tasks.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.TasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tasks. + */ +public interface Tasks extends SupportsCreating, HasInner { + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String taskName); + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String taskName); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TokenType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TokenType.java new file mode 100644 index 0000000000000..1dd27163f26c9 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TokenType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenType. + */ +public final class TokenType extends ExpandableStringEnum { + /** Static value PAT for TokenType. */ + public static final TokenType PAT = fromString("PAT"); + + /** Static value OAuth for TokenType. */ + public static final TokenType OAUTH = fromString("OAuth"); + + /** + * Creates or finds a TokenType from its string representation. + * @param name a name to look for + * @return the corresponding TokenType + */ + @JsonCreator + public static TokenType fromString(String name) { + return fromString(name, TokenType.class); + } + + /** + * @return known TokenType values + */ + public static Collection values() { + return values(TokenType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerProperties.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerProperties.java new file mode 100644 index 0000000000000..3a2eff3043d6f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerProperties.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a trigger. + */ +public class TriggerProperties { + /** + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /** + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTrigger baseImageTrigger; + + /** + * Get the collection of triggers based on source code repository. + * + * @return the sourceTriggers value + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set + * @return the TriggerProperties object itself. + */ + public TriggerProperties withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the trigger based on base image dependencies. + * + * @return the baseImageTrigger value + */ + public BaseImageTrigger baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the TriggerProperties object itself. + */ + public TriggerProperties withBaseImageTrigger(BaseImageTrigger baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerStatus.java new file mode 100644 index 0000000000000..4d58f970a5d2c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TriggerStatus. + */ +public final class TriggerStatus extends ExpandableStringEnum { + /** Static value Disabled for TriggerStatus. */ + public static final TriggerStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TriggerStatus. */ + public static final TriggerStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TriggerStatus from its string representation. + * @param name a name to look for + * @return the corresponding TriggerStatus + */ + @JsonCreator + public static TriggerStatus fromString(String name) { + return fromString(name, TriggerStatus.class); + } + + /** + * @return known TriggerStatus values + */ + public static Collection values() { + return values(TriggerStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerUpdateParameters.java new file mode 100644 index 0000000000000..611d7f8f26260 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TriggerUpdateParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating triggers. + */ +public class TriggerUpdateParameters { + /** + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /** + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerUpdateParameters baseImageTrigger; + + /** + * Get the collection of triggers based on source code repository. + * + * @return the sourceTriggers value + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the trigger based on base image dependencies. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerUpdateParameters baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withBaseImageTrigger(BaseImageTriggerUpdateParameters baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicy.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicy.java new file mode 100644 index 0000000000000..09603327d1e0a --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicy.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that represents content trust policy for a container registry. + */ +public class TrustPolicy { + /** + * The type of trust policy. Possible values include: 'Notary'. + */ + @JsonProperty(value = "type") + private TrustPolicyType type; + + /** + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the type of trust policy. Possible values include: 'Notary'. + * + * @return the type value + */ + public TrustPolicyType type() { + return this.type; + } + + /** + * Set the type of trust policy. Possible values include: 'Notary'. + * + * @param type the type value to set + * @return the TrustPolicy object itself. + */ + public TrustPolicy withType(TrustPolicyType type) { + this.type = type; + return this; + } + + /** + * Get the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the TrustPolicy object itself. + */ + public TrustPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicyType.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicyType.java new file mode 100644 index 0000000000000..6ed2c989834f0 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/TrustPolicyType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrustPolicyType. + */ +public final class TrustPolicyType extends ExpandableStringEnum { + /** Static value Notary for TrustPolicyType. */ + public static final TrustPolicyType NOTARY = fromString("Notary"); + + /** + * Creates or finds a TrustPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding TrustPolicyType + */ + @JsonCreator + public static TrustPolicyType fromString(String name) { + return fromString(name, TrustPolicyType.class); + } + + /** + * @return known TrustPolicyType values + */ + public static Collection values() { + return values(TrustPolicyType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Variant.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Variant.java new file mode 100644 index 0000000000000..174e161c51db2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Variant.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Variant. + */ +public final class Variant extends ExpandableStringEnum { + /** Static value v6 for Variant. */ + public static final Variant V6 = fromString("v6"); + + /** Static value v7 for Variant. */ + public static final Variant V7 = fromString("v7"); + + /** Static value v8 for Variant. */ + public static final Variant V8 = fromString("v8"); + + /** + * Creates or finds a Variant from its string representation. + * @param name a name to look for + * @return the corresponding Variant + */ + @JsonCreator + public static Variant fromString(String name) { + return fromString(name, Variant.class); + } + + /** + * @return known Variant values + */ + public static Collection values() { + return values(Variant.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhook.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhook.java new file mode 100644 index 0000000000000..1fdbc44c45361 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhook.java @@ -0,0 +1,276 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.WebhookInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.ContainerRegistryManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing Webhook. + */ +public interface Webhook extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the status value. + */ + WebhookStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Webhook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithLocation, DefinitionStages.WithServiceUri, DefinitionStages.WithCreate { + } + + /** + * Grouping of Webhook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Webhook definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the webhook definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param registryName The name of the container registry + * @return the next definition stage + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the webhook definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of actions that trigger the webhook to post notifications + * @return the next definition stage + */ + WithLocation withActions(List actions); + } + + /** + * The stage of the webhook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the webhook. This cannot be changed after the resource is created + * @return the next definition stage + */ + WithServiceUri withLocation(String location); + } + + /** + * The stage of the webhook definition allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + * @param serviceUri The service URI for the webhook to post notifications + * @return the next definition stage + */ + WithCreate withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook definition allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + * @param customHeaders Custom headers that will be added to the webhook notifications + * @return the next definition stage + */ + WithCreate withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the webhook definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled' + * @return the next definition stage + */ + WithCreate withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the webhook + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCustomHeaders, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithTags { + } + } + /** + * The template for a Webhook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithCustomHeaders, UpdateStages.WithScope, UpdateStages.WithServiceUri, UpdateStages.WithStatus, UpdateStages.WithTags { + } + + /** + * Grouping of Webhook update stages. + */ + interface UpdateStages { + /** + * The stage of the webhook update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of actions that trigger the webhook to post notifications + * @return the next update stage + */ + Update withActions(List actions); + } + + /** + * The stage of the webhook update allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + * @param customHeaders Custom headers that will be added to the webhook notifications + * @return the next update stage + */ + Update withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events + * @return the next update stage + */ + Update withScope(String scope); + } + + /** + * The stage of the webhook update allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + * @param serviceUri The service URI for the webhook to post notifications + * @return the next update stage + */ + Update withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled' + * @return the next update stage + */ + Update withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the webhook + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookAction.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookAction.java new file mode 100644 index 0000000000000..75da739a7b577 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookAction.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookAction. + */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** Static value quarantine for WebhookAction. */ + public static final WebhookAction QUARANTINE = fromString("quarantine"); + + /** + * Creates or finds a WebhookAction from its string representation. + * @param name a name to look for + * @return the corresponding WebhookAction + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** + * @return known WebhookAction values + */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookCreateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookCreateParameters.java new file mode 100644 index 0000000000000..e903312f2b215 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookCreateParameters.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a webhook. + */ +@JsonFlatten +public class WebhookCreateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookStatus.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookStatus.java new file mode 100644 index 0000000000000..b4b9a7ed62c40 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookStatus. + */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * @param name a name to look for + * @return the corresponding WebhookStatus + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** + * @return known WebhookStatus values + */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookUpdateParameters.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookUpdateParameters.java new file mode 100644 index 0000000000000..8aacc76447602 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/WebhookUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a webhook. + */ +@JsonFlatten +public class WebhookUpdateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri") + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhooks.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhooks.java new file mode 100644 index 0000000000000..e83e737633873 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/Webhooks.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.implementation.WebhooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Webhooks. + */ +public interface Webhooks extends SupportsCreating, HasInner { + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable pingAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String webhookName); + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigImpl.java new file mode 100644 index 0000000000000..24198fa345f0e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.CallbackConfig; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CallbackConfigImpl extends WrapperImpl implements CallbackConfig { + private final ContainerRegistryManager manager; + CallbackConfigImpl(CallbackConfigInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Map customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String serviceUri() { + return this.inner().serviceUri(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigInner.java new file mode 100644 index 0000000000000..d8014bf926001 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/CallbackConfigInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of service URI and custom headers for the webhook. + */ +public class CallbackConfigInner { + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + private Map customHeaders; + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..6346db47ecd2d --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ReplicationsInner object to access its operations. + */ + private ReplicationsInner replications; + + /** + * Gets the ReplicationsInner object to access its operations. + * @return the ReplicationsInner object. + */ + public ReplicationsInner replications() { + return this.replications; + } + + /** + * The WebhooksInner object to access its operations. + */ + private WebhooksInner webhooks; + + /** + * Gets the WebhooksInner object to access its operations. + * @return the WebhooksInner object. + */ + public WebhooksInner webhooks() { + return this.webhooks; + } + + /** + * The RunsInner object to access its operations. + */ + private RunsInner runs; + + /** + * Gets the RunsInner object to access its operations. + * @return the RunsInner object. + */ + public RunsInner runs() { + return this.runs; + } + + /** + * The TasksInner object to access its operations. + */ + private TasksInner tasks; + + /** + * Gets the TasksInner object to access its operations. + * @return the TasksInner object. + */ + public TasksInner tasks() { + return this.tasks; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.replications = new ReplicationsInner(restClient().retrofit(), this); + this.webhooks = new WebhooksInner(restClient().retrofit(), this); + this.runs = new RunsInner(restClient().retrofit(), this); + this.tasks = new TasksInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2018-09-01"); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..92be7073e8196 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ContainerRegistryManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Registries; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Operations; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Replications; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Runs; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + private Replications replications; + private Webhooks webhooks; + private Runs runs; + private Tasks tasks; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(this); + } + return this.replications; + } + + /** + * @return Entry point to manage Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(this); + } + return this.webhooks; + } + + /** + * @return Entry point to manage Runs. + */ + public Runs runs() { + if (this.runs == null) { + this.runs = new RunsImpl(this); + } + return this.runs; + } + + /** + * @return Entry point to manage Tasks. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(this); + } + return this.tasks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventImpl.java new file mode 100644 index 0000000000000..be81f6e612bd7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Event; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventResponseMessage; + +class EventImpl extends WrapperImpl implements Event { + private final ContainerRegistryManager manager; + EventImpl(EventInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public EventRequestMessage eventRequestMessage() { + return this.inner().eventRequestMessage(); + } + + @Override + public EventResponseMessage eventResponseMessage() { + return this.inner().eventResponseMessage(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoImpl.java new file mode 100644 index 0000000000000..3fa3d41f9d2bc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventInfoImpl extends WrapperImpl implements EventInfo { + private final ContainerRegistryManager manager; + EventInfoImpl(EventInfoInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoInner.java new file mode 100644 index 0000000000000..6814e32be2fdb --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The basic information of an event. + */ +public class EventInfoInner { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInner.java new file mode 100644 index 0000000000000..b415524e42d74 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/EventInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event for a webhook. + */ +public class EventInner extends EventInfoInner { + /** + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /** + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the event request message sent to the service URI. + * + * @return the eventRequestMessage value + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the event response message received from the service URI. + * + * @return the eventResponseMessage value + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..fc710c3c04001 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..cbef059026135 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationDisplayDefinition; +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationServiceSpecificationDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionInner.java new file mode 100644 index 0000000000000..ace575da8813a --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationDefinitionInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationDisplayDefinition; +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The definition of a container registry operation. + */ +@JsonFlatten +public class OperationDefinitionInner { + /** + * The origin information of the container registry operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * The definition of Azure Monitoring service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationServiceSpecificationDefinition serviceSpecification; + + /** + * Get the origin information of the container registry operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin information of the container registry operation. + * + * @param origin the origin value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + + /** + * Get the definition of Azure Monitoring service. + * + * @return the serviceSpecification value + */ + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the definition of Azure Monitoring service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withServiceSpecification(OperationServiceSpecificationDefinition serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7578001b2f524 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_09_01.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..0c469c7aa7b62 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2017-10-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/PageImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..89b4313b81597 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..418f8bcbbe15a --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesImpl.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Registries; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryPolicies; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Run; +import com.microsoft.azure.management.containerregistry.v2018_09_01.SourceUploadDefinition; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PasswordName; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunRequest; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUsageListResult; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + RegistriesInner client = this.inner(); + return client.importImageAsync(resourceGroupName, registryName, parameters).toCompletable(); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable updatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + RegistriesInner client = this.inner(); + return client.updatePoliciesAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters) + .map(new Func1() { + @Override + public RegistryPolicies call(RegistryPoliciesInner inner) { + return new RegistryPoliciesImpl(inner, manager()); + } + }); + } + + @Override + public Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + RegistriesInner client = this.inner(); + return client.scheduleRunAsync(resourceGroupName, registryName, runRequest) + .map(new Func1() { + @Override + public Run call(RunInner inner) { + return new RunImpl(inner, manager()); + } + }); + } + + @Override + public Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.getBuildSourceUploadUrlAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public SourceUploadDefinition call(SourceUploadDefinitionInner inner) { + return new SourceUploadDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryUsageListResult call(RegistryUsageListResultInner inner) { + return new RegistryUsageListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPoliciesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listPoliciesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryPolicies call(RegistryPoliciesInner inner) { + return new RegistryPoliciesImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..db414d59bf6ed --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java @@ -0,0 +1,2190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PasswordName; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries importImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> importImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginImportImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> beginImportImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listPolicies" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies") + Observable> listPolicies(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries updatePolicies" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies") + Observable> updatePolicies(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryPoliciesInner registryPoliciesUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginUpdatePolicies" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies") + Observable> beginUpdatePolicies(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryPoliciesInner registryPoliciesUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries scheduleRun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + Observable> scheduleRun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RunRequest runRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries beginScheduleRun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + Observable> beginScheduleRun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RunRequest runRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries getBuildSourceUploadUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + Observable> getBuildSourceUploadUrl(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().last().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> importImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.importImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginImportImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginImportImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01"; + return service.beginImportImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginImportImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginImportImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().last().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "2017-10-01"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "2017-10-01"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().last().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "2017-10-01"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.listCredentials(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); + regenerateCredentialParameters.withName(name); + return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryUsageListResultInner object if successful. + */ + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryUsageListResultInner>() { + @Override + public RegistryUsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryPoliciesInner object if successful. + */ + public RegistryPoliciesInner listPolicies(String resourceGroupName, String registryName) { + return listPoliciesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listPoliciesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listPoliciesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryPoliciesInner object + */ + public Observable listPoliciesAsync(String resourceGroupName, String registryName) { + return listPoliciesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryPoliciesInner>() { + @Override + public RegistryPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryPoliciesInner object + */ + public Observable> listPoliciesWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.listPolicies(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listPoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryPoliciesInner object if successful. + */ + public RegistryPoliciesInner updatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + return updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters), serviceCallback); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + return updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).map(new Func1, RegistryPoliciesInner>() { + @Override + public RegistryPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updatePoliciesWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryPoliciesUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryPoliciesUpdateParameters is required and cannot be null."); + } + Validator.validate(registryPoliciesUpdateParameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.updatePolicies(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryPoliciesUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryPoliciesInner object if successful. + */ + public RegistryPoliciesInner beginUpdatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + return beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters), serviceCallback); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryPoliciesInner object + */ + public Observable beginUpdatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + return beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).map(new Func1, RegistryPoliciesInner>() { + @Override + public RegistryPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the policies for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryPoliciesUpdateParameters The parameters for updating policies of a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryPoliciesInner object + */ + public Observable> beginUpdatePoliciesWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryPoliciesUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryPoliciesUpdateParameters is required and cannot be null."); + } + Validator.validate(registryPoliciesUpdateParameters); + final String apiVersion = "2017-10-01"; + return service.beginUpdatePolicies(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryPoliciesUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().last().body(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest), serviceCallback); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scheduleRunWithServiceResponseAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runRequest == null) { + throw new IllegalArgumentException("Parameter runRequest is required and cannot be null."); + } + Validator.validate(runRequest); + final String apiVersion = "2018-09-01"; + Observable> observable = service.scheduleRun(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, runRequest, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner beginScheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().single().body(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest), serviceCallback); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginScheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginScheduleRunWithServiceResponseAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runRequest == null) { + throw new IllegalArgumentException("Parameter runRequest is required and cannot be null."); + } + Validator.validate(runRequest); + final String apiVersion = "2018-09-01"; + return service.beginScheduleRun(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, runRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScheduleRunDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScheduleRunDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SourceUploadDefinitionInner object if successful. + */ + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceUploadDefinitionInner object + */ + public Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, SourceUploadDefinitionInner>() { + @Override + public SourceUploadDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceUploadDefinitionInner object + */ + public Observable> getBuildSourceUploadUrlWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.getBuildSourceUploadUrl(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBuildSourceUploadUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBuildSourceUploadUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..83691c502116c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Status; +import com.microsoft.azure.management.containerregistry.v2018_09_01.StorageAccountProperties; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + if (isInCreateMode()) { + this.inner().withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryInner.java new file mode 100644 index 0000000000000..8ff0a1cbef071 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Status; +import com.microsoft.azure.management.containerregistry.v2018_09_01.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. Only + * applicable to Classic SKU. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the container registry at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..22b1714e3c9e4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..27cb1133f0520 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..5a14d067238c4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..e945b9231f914 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesImpl.java new file mode 100644 index 0000000000000..0cd46770d4bad --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryPolicies; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.QuarantinePolicy; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TrustPolicy; + +class RegistryPoliciesImpl extends WrapperImpl implements RegistryPolicies { + private final ContainerRegistryManager manager; + RegistryPoliciesImpl(RegistryPoliciesInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public QuarantinePolicy quarantinePolicy() { + return this.inner().quarantinePolicy(); + } + + @Override + public TrustPolicy trustPolicy() { + return this.inner().trustPolicy(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesInner.java new file mode 100644 index 0000000000000..ac17df5b30d22 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryPoliciesInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.QuarantinePolicy; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TrustPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that represents policies for a container registry. + */ +public class RegistryPoliciesInner { + /** + * An object that represents quarantine policy for a container registry. + */ + @JsonProperty(value = "quarantinePolicy") + private QuarantinePolicy quarantinePolicy; + + /** + * An object that represents content trust policy for a container registry. + */ + @JsonProperty(value = "trustPolicy") + private TrustPolicy trustPolicy; + + /** + * Get an object that represents quarantine policy for a container registry. + * + * @return the quarantinePolicy value + */ + public QuarantinePolicy quarantinePolicy() { + return this.quarantinePolicy; + } + + /** + * Set an object that represents quarantine policy for a container registry. + * + * @param quarantinePolicy the quarantinePolicy value to set + * @return the RegistryPoliciesInner object itself. + */ + public RegistryPoliciesInner withQuarantinePolicy(QuarantinePolicy quarantinePolicy) { + this.quarantinePolicy = quarantinePolicy; + return this; + } + + /** + * Get an object that represents content trust policy for a container registry. + * + * @return the trustPolicy value + */ + public TrustPolicy trustPolicy() { + return this.trustPolicy; + } + + /** + * Set an object that represents content trust policy for a container registry. + * + * @param trustPolicy the trustPolicy value to set + * @return the RegistryPoliciesInner object itself. + */ + public RegistryPoliciesInner withTrustPolicy(TrustPolicy trustPolicy) { + this.trustPolicy = trustPolicy; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 0000000000000..4ff0b0b855409 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUsage; + +class RegistryUsageListResultImpl extends WrapperImpl implements RegistryUsageListResult { + private final ContainerRegistryManager manager; + RegistryUsageListResultImpl(RegistryUsageListResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultInner.java new file mode 100644 index 0000000000000..b25add259c053 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistryUsageListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get container registry quota usages. + */ +public class RegistryUsageListResultInner { + /** + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of container registry quota usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of container registry quota usages. + * + * @param value the value value to set + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationImpl.java new file mode 100644 index 0000000000000..a3d3304eb892e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Replication; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Status; + +class ReplicationImpl extends CreatableUpdatableImpl implements Replication, Replication.Definition, Replication.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String replicationName; + + ReplicationImpl(String name, ContainerRegistryManager manager) { + super(name, new ReplicationInner()); + this.manager = manager; + // Set resource name + this.replicationName = name; + // + } + + ReplicationImpl(ReplicationInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.replicationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.replicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "replications"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.getAsync(this.resourceGroupName, this.registryName, this.replicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ReplicationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ReplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationInner.java new file mode 100644 index 0000000000000..d482da289448c --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationInner.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a replication for a container registry. + */ +@JsonFlatten +public class ReplicationInner extends Resource { + /** + * The provisioning state of the replication at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * Get the provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the replication at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsImpl.java new file mode 100644 index 0000000000000..e7a0faf449a9d --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Replications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Replication; + +class ReplicationsImpl extends WrapperImpl implements Replications { + private final ContainerRegistryManager manager; + + ReplicationsImpl(ContainerRegistryManager manager) { + super(manager.inner().replications()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ReplicationImpl define(String name) { + return wrapModel(name); + } + + private ReplicationImpl wrapModel(ReplicationInner inner) { + return new ReplicationImpl(inner, manager()); + } + + private ReplicationImpl wrapModel(String name) { + return new ReplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ReplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, replicationName) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, replicationName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsInner.java new file mode 100644 index 0000000000000..b0fba1cc46fd9 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/ReplicationsInner.java @@ -0,0 +1,1118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ReplicationUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replications. + */ +public class ReplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ReplicationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ReplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replications to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Replications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner create(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().last().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "2017-10-01"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginCreate(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().single().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "2017-10-01"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String replicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2017-10-01"; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2017-10-01"; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultImpl.java new file mode 100644 index 0000000000000..c08b8b984a31d --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunGetLogResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RunGetLogResultImpl extends WrapperImpl implements RunGetLogResult { + private final ContainerRegistryManager manager; + RunGetLogResultImpl(RunGetLogResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String logLink() { + return this.inner().logLink(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultInner.java new file mode 100644 index 0000000000000..caa81c4c8dce7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunGetLogResultInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of get log link operation. + */ +public class RunGetLogResultInner { + /** + * The link to logs for a run on a azure container registry. + */ + @JsonProperty(value = "logLink") + private String logLink; + + /** + * Get the link to logs for a run on a azure container registry. + * + * @return the logLink value + */ + public String logLink() { + return this.logLink; + } + + /** + * Set the link to logs for a run on a azure container registry. + * + * @param logLink the logLink value to set + * @return the RunGetLogResultInner object itself. + */ + public RunGetLogResultInner withLogLink(String logLink) { + this.logLink = logLink; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunImpl.java new file mode 100644 index 0000000000000..212203f91ded2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunImpl.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Run; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.AgentProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImageUpdateTrigger; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunType; +import com.microsoft.azure.management.containerregistry.v2018_09_01.SourceTriggerDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunStatus; + +class RunImpl extends CreatableUpdatableImpl implements Run, Run.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String runId; + private Boolean uisArchiveEnabled; + + RunImpl(String name, ContainerRegistryManager manager) { + super(name, new RunInner()); + this.manager = manager; + // Set resource name + this.runId = name; + // + } + + RunImpl(RunInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.runId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.runId = IdParsingUtils.getValueFromIdByName(inner.id(), "runs"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RunsInner client = this.manager().inner().runs(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + RunsInner client = this.manager().inner().runs(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.runId, this.uisArchiveEnabled) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RunsInner client = this.manager().inner().runs(); + return client.getAsync(this.resourceGroupName, this.registryName, this.runId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AgentProperties agentConfiguration() { + return this.inner().agentConfiguration(); + } + + @Override + public DateTime createTime() { + return this.inner().createTime(); + } + + @Override + public DateTime finishTime() { + return this.inner().finishTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImageUpdateTrigger imageUpdateTrigger() { + return this.inner().imageUpdateTrigger(); + } + + @Override + public Boolean isArchiveEnabled() { + return this.inner().isArchiveEnabled(); + } + + @Override + public DateTime lastUpdatedTime() { + return this.inner().lastUpdatedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputImages() { + return this.inner().outputImages(); + } + + @Override + public PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String runId() { + return this.inner().runId(); + } + + @Override + public RunType runType() { + return this.inner().runType(); + } + + @Override + public SourceTriggerDescriptor sourceTrigger() { + return this.inner().sourceTrigger(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public RunStatus status() { + return this.inner().status(); + } + + @Override + public String task() { + return this.inner().task(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RunImpl withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.uisArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunInner.java new file mode 100644 index 0000000000000..e892261af1229 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunInner.java @@ -0,0 +1,426 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunType; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ImageUpdateTrigger; +import com.microsoft.azure.management.containerregistry.v2018_09_01.SourceTriggerDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Run resource properties. + */ +@JsonFlatten +public class RunInner extends ProxyResource { + /** + * The unique identifier for the run. + */ + @JsonProperty(value = "properties.runId") + private String runId; + + /** + * The current status of the run. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', + * 'Timeout'. + */ + @JsonProperty(value = "properties.status") + private RunStatus status; + + /** + * The last updated time for the run. + */ + @JsonProperty(value = "properties.lastUpdatedTime") + private DateTime lastUpdatedTime; + + /** + * The type of run. Possible values include: 'QuickBuild', 'QuickRun', + * 'AutoBuild', 'AutoRun'. + */ + @JsonProperty(value = "properties.runType") + private RunType runType; + + /** + * The time the run was scheduled. + */ + @JsonProperty(value = "properties.createTime") + private DateTime createTime; + + /** + * The time the run started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The time the run finished. + */ + @JsonProperty(value = "properties.finishTime") + private DateTime finishTime; + + /** + * The list of all images that were generated from the run. This is + * applicable if the run generates base image dependencies. + */ + @JsonProperty(value = "properties.outputImages") + private List outputImages; + + /** + * The task against which run was scheduled. + */ + @JsonProperty(value = "properties.task") + private String task; + + /** + * The image update trigger that caused the run. This is applicable if the + * task has base image trigger configured. + */ + @JsonProperty(value = "properties.imageUpdateTrigger") + private ImageUpdateTrigger imageUpdateTrigger; + + /** + * The source trigger that caused the run. + */ + @JsonProperty(value = "properties.sourceTrigger") + private SourceTriggerDescriptor sourceTrigger; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "properties.isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The platform properties against which the run will happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The provisioning state of a run. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get the unique identifier for the run. + * + * @return the runId value + */ + public String runId() { + return this.runId; + } + + /** + * Set the unique identifier for the run. + * + * @param runId the runId value to set + * @return the RunInner object itself. + */ + public RunInner withRunId(String runId) { + this.runId = runId; + return this; + } + + /** + * Get the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public RunStatus status() { + return this.status; + } + + /** + * Set the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the RunInner object itself. + */ + public RunInner withStatus(RunStatus status) { + this.status = status; + return this; + } + + /** + * Get the last updated time for the run. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the last updated time for the run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the RunInner object itself. + */ + public RunInner withLastUpdatedTime(DateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @return the runType value + */ + public RunType runType() { + return this.runType; + } + + /** + * Set the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @param runType the runType value to set + * @return the RunInner object itself. + */ + public RunInner withRunType(RunType runType) { + this.runType = runType; + return this; + } + + /** + * Get the time the run was scheduled. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the time the run was scheduled. + * + * @param createTime the createTime value to set + * @return the RunInner object itself. + */ + public RunInner withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the run started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the time the run started. + * + * @param startTime the startTime value to set + * @return the RunInner object itself. + */ + public RunInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time the run finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the run finished. + * + * @param finishTime the finishTime value to set + * @return the RunInner object itself. + */ + public RunInner withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of all images that were generated from the run. This is applicable if the run generates base image dependencies. + * + * @return the outputImages value + */ + public List outputImages() { + return this.outputImages; + } + + /** + * Set the list of all images that were generated from the run. This is applicable if the run generates base image dependencies. + * + * @param outputImages the outputImages value to set + * @return the RunInner object itself. + */ + public RunInner withOutputImages(List outputImages) { + this.outputImages = outputImages; + return this; + } + + /** + * Get the task against which run was scheduled. + * + * @return the task value + */ + public String task() { + return this.task; + } + + /** + * Set the task against which run was scheduled. + * + * @param task the task value to set + * @return the RunInner object itself. + */ + public RunInner withTask(String task) { + this.task = task; + return this; + } + + /** + * Get the image update trigger that caused the run. This is applicable if the task has base image trigger configured. + * + * @return the imageUpdateTrigger value + */ + public ImageUpdateTrigger imageUpdateTrigger() { + return this.imageUpdateTrigger; + } + + /** + * Set the image update trigger that caused the run. This is applicable if the task has base image trigger configured. + * + * @param imageUpdateTrigger the imageUpdateTrigger value to set + * @return the RunInner object itself. + */ + public RunInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { + this.imageUpdateTrigger = imageUpdateTrigger; + return this; + } + + /** + * Get the source trigger that caused the run. + * + * @return the sourceTrigger value + */ + public SourceTriggerDescriptor sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the source trigger that caused the run. + * + * @param sourceTrigger the sourceTrigger value to set + * @return the RunInner object itself. + */ + public RunInner withSourceTrigger(SourceTriggerDescriptor sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunInner object itself. + */ + public RunInner withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the platform properties against which the run will happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run will happen. + * + * @param platform the platform value to set + * @return the RunInner object itself. + */ + public RunInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the RunInner object itself. + */ + public RunInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @param provisioningState the provisioningState value to set + * @return the RunInner object itself. + */ + public RunInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsImpl.java new file mode 100644 index 0000000000000..6526a261434d8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Runs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunGetLogResult; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Run; + +class RunsImpl extends WrapperImpl implements Runs { + private final ContainerRegistryManager manager; + + RunsImpl(ContainerRegistryManager manager) { + super(manager.inner().runs()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + private RunImpl wrapModel(RunInner inner) { + return new RunImpl(inner, manager()); + } + + @Override + public Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.getLogSasUrlAsync(resourceGroupName, registryName, runId) + .map(new Func1() { + @Override + public RunGetLogResult call(RunGetLogResultInner inner) { + return new RunGetLogResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable cancelAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.cancelAsync(resourceGroupName, registryName, runId).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + RunsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Run call(RunInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, runId) + .map(new Func1() { + @Override + public Run call(RunInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java new file mode 100644 index 0000000000000..5deb59bab107f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java @@ -0,0 +1,1143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_09_01.RunUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Runs. + */ +public class RunsInner { + /** The Retrofit service to perform REST calls. */ + private RunsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RunsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RunsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RunsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Runs to be + * used by Retrofit to perform actually REST calls. + */ + interface RunsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RunUpdateParameters runUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RunUpdateParameters runUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs getLogSasUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl") + Observable> getLogSasUrl(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs beginCancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") + Observable> beginCancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Runs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RunInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RunInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, registryName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + return listSinglePageAsync(resourceGroupName, registryName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the runs for a registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + ServiceResponse> * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner get(String resourceGroupName, String registryName, String runId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String runId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner update(String resourceGroupName, String registryName, String runId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().last().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String runId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + final Boolean isArchiveEnabled = null; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner update(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).toBlocking().last().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner beginUpdate(String resourceGroupName, String registryName, String runId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String runId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + final Boolean isArchiveEnabled = null; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunInner object if successful. + */ + public RunInner beginUpdate(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).toBlocking().single().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RunGetLogResultInner object if successful. + */ + public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLogSasUrlAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunGetLogResultInner object + */ + public Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunGetLogResultInner>() { + @Override + public RunGetLogResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunGetLogResultInner object + */ + public Observable> getLogSasUrlWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.getLogSasUrl(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLogSasUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLogSasUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancel(String resourceGroupName, String registryName, String runId) { + cancelWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().last().body(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable cancelAsync(String resourceGroupName, String registryName, String runId) { + return cancelWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + Observable> observable = service.cancel(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCancel(String resourceGroupName, String registryName, String runId) { + beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCancelAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCancelAsync(String resourceGroupName, String registryName, String runId) { + return beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCancelWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.beginCancel(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the runs for a registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RunInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the runs for a registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the runs for a registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the runs for a registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionImpl.java new file mode 100644 index 0000000000000..8e5c32e18d50e --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.SourceUploadDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SourceUploadDefinitionImpl extends WrapperImpl implements SourceUploadDefinition { + private final ContainerRegistryManager manager; + SourceUploadDefinitionImpl(SourceUploadDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String relativePath() { + return this.inner().relativePath(); + } + + @Override + public String uploadUrl() { + return this.inner().uploadUrl(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionInner.java new file mode 100644 index 0000000000000..10e61df5394ad --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/SourceUploadDefinitionInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a response to source upload request. + */ +public class SourceUploadDefinitionInner { + /** + * The URL where the client can upload the source. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * The relative path to the source. This is used to submit the subsequent + * queue build request. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Get the URL where the client can upload the source. + * + * @return the uploadUrl value + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the URL where the client can upload the source. + * + * @param uploadUrl the uploadUrl value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Get the relative path to the source. This is used to submit the subsequent queue build request. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relative path to the source. This is used to submit the subsequent queue build request. + * + * @param relativePath the relativePath value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskImpl.java new file mode 100644 index 0000000000000..8be39a27a7adc --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskImpl.java @@ -0,0 +1,259 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Task; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskStatus; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskStepProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TriggerProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PlatformUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskStepUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TriggerUpdateParameters; +import rx.functions.Func1; + +class TaskImpl extends CreatableUpdatableImpl implements Task, Task.Definition, Task.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String taskName; + private TaskUpdateParameters updateParameter; + + TaskImpl(String name, ContainerRegistryManager manager) { + super(name, new TaskInner()); + this.manager = manager; + // Set resource name + this.taskName = name; + // + this.updateParameter = new TaskUpdateParameters(); + } + + TaskImpl(TaskInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.taskName = IdParsingUtils.getValueFromIdByName(inner.id(), "tasks"); + // + this.updateParameter = new TaskUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.taskName, this.inner()) + .map(new Func1() { + @Override + public TaskInner call(TaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.taskName, this.updateParameter) + .map(new Func1() { + @Override + public TaskInner call(TaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.taskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new TaskUpdateParameters(); + } + + @Override + public AgentProperties agentConfiguration() { + return this.inner().agentConfiguration(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public TaskStatus status() { + return this.inner().status(); + } + + @Override + public TaskStepProperties step() { + return this.inner().step(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Integer timeout() { + return this.inner().timeout(); + } + + @Override + public TriggerProperties trigger() { + return this.inner().trigger(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TaskImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public TaskImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public TaskImpl withPlatform(PlatformProperties platform) { + this.inner().withPlatform(platform); + return this; + } + + @Override + public TaskImpl withStep(TaskStepProperties step) { + this.inner().withStep(step); + return this; + } + + @Override + public TaskImpl withTrigger(TriggerProperties trigger) { + this.inner().withTrigger(trigger); + return this; + } + + @Override + public TaskImpl withPlatform(PlatformUpdateParameters platform) { + this.updateParameter.withPlatform(platform); + return this; + } + + @Override + public TaskImpl withStep(TaskStepUpdateParameters step) { + this.updateParameter.withStep(step); + return this; + } + + @Override + public TaskImpl withTrigger(TriggerUpdateParameters trigger) { + this.updateParameter.withTrigger(trigger); + return this; + } + + @Override + public TaskImpl withAgentConfiguration(AgentProperties agentConfiguration) { + if (isInCreateMode()) { + this.inner().withAgentConfiguration(agentConfiguration); + } else { + this.updateParameter.withAgentConfiguration(agentConfiguration); + } + return this; + } + + @Override + public TaskImpl withStatus(TaskStatus status) { + if (isInCreateMode()) { + this.inner().withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public TaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public TaskImpl withTimeout(Integer timeout) { + if (isInCreateMode()) { + this.inner().withTimeout(timeout); + } else { + this.updateParameter.withTimeout(timeout); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskInner.java new file mode 100644 index 0000000000000..a8ed57f81df90 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TaskInner.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskStatus; +import com.microsoft.azure.management.containerregistry.v2018_09_01.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskStepProperties; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TriggerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + */ +@JsonFlatten +public class TaskInner extends Resource { + /** + * The provisioning state of the task. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The creation date of task. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The current status of task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The properties of a task step. + */ + @JsonProperty(value = "properties.step", required = true) + private TaskStepProperties step; + + /** + * The properties that describe all triggers for the task. + */ + @JsonProperty(value = "properties.trigger") + private TriggerProperties trigger; + + /** + * Get the provisioning state of the task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creation date of task. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TaskInner object itself. + */ + public TaskInner withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the TaskInner object itself. + */ + public TaskInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the TaskInner object itself. + */ + public TaskInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the TaskInner object itself. + */ + public TaskInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the properties of a task step. + * + * @return the step value + */ + public TaskStepProperties step() { + return this.step; + } + + /** + * Set the properties of a task step. + * + * @param step the step value to set + * @return the TaskInner object itself. + */ + public TaskInner withStep(TaskStepProperties step) { + this.step = step; + return this; + } + + /** + * Get the properties that describe all triggers for the task. + * + * @return the trigger value + */ + public TriggerProperties trigger() { + return this.trigger; + } + + /** + * Set the properties that describe all triggers for the task. + * + * @param trigger the trigger value to set + * @return the TaskInner object itself. + */ + public TaskInner withTrigger(TriggerProperties trigger) { + this.trigger = trigger; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksImpl.java new file mode 100644 index 0000000000000..4389897eb8028 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksImpl.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Task; + +class TasksImpl extends WrapperImpl implements Tasks { + private final ContainerRegistryManager manager; + + TasksImpl(ContainerRegistryManager manager) { + super(manager.inner().tasks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public TaskImpl define(String name) { + return wrapModel(name); + } + + private TaskImpl wrapModel(TaskInner inner) { + return new TaskImpl(inner, manager()); + } + + private TaskImpl wrapModel(String name) { + return new TaskImpl(name, this.manager()); + } + + @Override + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.getDetailsAsync(resourceGroupName, registryName, taskName) + .map(new Func1() { + @Override + public Task call(TaskInner inner) { + return new TaskImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + TasksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Task call(TaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, taskName) + .map(new Func1() { + @Override + public Task call(TaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, taskName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java new file mode 100644 index 0000000000000..5e3c0e8b72165 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java @@ -0,0 +1,1052 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_09_01.TaskUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tasks. + */ +public class TasksInner { + /** The Retrofit service to perform REST calls. */ + private TasksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TasksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(TasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tasks to be + * used by Retrofit to perform actually REST calls. + */ + interface TasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskInner taskCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskInner taskCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskUpdateParameters taskUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskUpdateParameters taskUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks getDetails" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails") + Observable> getDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Tasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TaskInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner get(String resourceGroupName, String registryName, String taskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String taskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters), serviceCallback); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskCreateParameters == null) { + throw new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null."); + } + Validator.validate(taskCreateParameters); + final String apiVersion = "2018-09-01"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner beginCreate(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters), serviceCallback); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskCreateParameters == null) { + throw new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null."); + } + Validator.validate(taskCreateParameters); + final String apiVersion = "2018-09-01"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskCreateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String taskName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().last().body(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String taskName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String taskName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String taskName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner update(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters), serviceCallback); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null."); + } + Validator.validate(taskUpdateParameters); + final String apiVersion = "2018-09-01"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner beginUpdate(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters), serviceCallback); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null."); + } + Validator.validate(taskUpdateParameters); + final String apiVersion = "2018-09-01"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskInner object if successful. + */ + public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDetailsAsync(String resourceGroupName, String registryName, String taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> getDetailsWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2018-09-01"; + return service.getDetails(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDetailsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TaskInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookImpl.java new file mode 100644 index 0000000000000..051e8959a9e70 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.Webhook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookStatus; +import rx.functions.Func1; + +class WebhookImpl extends CreatableUpdatableImpl implements Webhook, Webhook.Definition, Webhook.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String webhookName; + private WebhookCreateParameters createParameter; + private WebhookUpdateParameters updateParameter; + + WebhookImpl(String name, ContainerRegistryManager manager) { + super(name, new WebhookInner()); + this.manager = manager; + // Set resource name + this.webhookName = name; + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + WebhookImpl(WebhookInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.webhookName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.webhookName = IdParsingUtils.getValueFromIdByName(inner.id(), "webhooks"); + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.webhookName, this.createParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.webhookName, this.updateParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.webhookName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public WebhookStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public WebhookImpl withLocation(String location) { + this.createParameter.withLocation(location); + return this; + } + + @Override + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createParameter.withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createParameter.withServiceUri(serviceUri); + } else { + this.updateParameter.withServiceUri(serviceUri); + } + return this; + } + + @Override + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createParameter.withCustomHeaders(customHeaders); + } else { + this.updateParameter.withCustomHeaders(customHeaders); + } + return this; + } + + @Override + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createParameter.withScope(scope); + } else { + this.updateParameter.withScope(scope); + } + return this; + } + + @Override + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createParameter.withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookInner.java new file mode 100644 index 0000000000000..fe562396c3c20 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhookInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookStatus; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2018_09_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a webhook for a container registry. + */ +@JsonFlatten +public class WebhookInner extends Resource { + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * The provisioning state of the webhook at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksImpl.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksImpl.java new file mode 100644 index 0000000000000..3a6ff2fc9630b --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_09_01.EventInfo; +import com.microsoft.azure.management.containerregistry.v2018_09_01.CallbackConfig; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Event; +import com.microsoft.azure.management.containerregistry.v2018_09_01.Webhook; + +class WebhooksImpl extends WrapperImpl implements Webhooks { + private final ContainerRegistryManager manager; + + WebhooksImpl(ContainerRegistryManager manager) { + super(manager.inner().webhooks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public WebhookImpl define(String name) { + return wrapModel(name); + } + + private WebhookImpl wrapModel(WebhookInner inner) { + return new WebhookImpl(inner, manager()); + } + + private WebhookImpl wrapModel(String name) { + return new WebhookImpl(name, this.manager()); + } + + @Override + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.pingAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public EventInfo call(EventInfoInner inner) { + return new EventInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getCallbackConfigAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public CallbackConfig call(CallbackConfigInner inner) { + return new CallbackConfigImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + WebhooksInner client = this.inner(); + return client.listEventsAsync(resourceGroupName, registryName, webhookName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Event call(EventInner inner) { + return new EventImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + WebhooksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, webhookName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java new file mode 100644 index 0000000000000..b4f31e2507add --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java @@ -0,0 +1,1396 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2018_09_01.WebhookUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Webhooks. + */ +public class WebhooksInner { + /** The Retrofit service to perform REST calls. */ + private WebhooksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(WebhooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Webhooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WebhooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks ping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping") + Observable> ping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks getCallbackConfig" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + Observable> getCallbackConfig(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks listEvents" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents") + Observable> listEvents(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_09_01.Webhooks listEventsNext" }) + @GET + Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner create(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginCreate(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "2017-10-01"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().last().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String webhookName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner update(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "2017-10-01"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventInfoInner object if successful. + */ + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture pingAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, EventInfoInner>() { + @Override + public EventInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable> pingWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.ping(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = pingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse pingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CallbackConfigInner object if successful. + */ + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, CallbackConfigInner>() { + @Override + public CallbackConfigInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable> getCallbackConfigWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.getCallbackConfig(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCallbackConfigDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCallbackConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEvents(final String resourceGroupName, final String registryName, final String webhookName) { + ServiceResponse> response = listEventsSinglePageAsync(resourceGroupName, registryName, webhookName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsSinglePageAsync(final String resourceGroupName, final String registryName, final String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + return service.listEvents(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEventsNext(final String nextPageLink) { + ServiceResponse> response = listEventsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsNextAsync(final String nextPageLink) { + return listEventsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listEventsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/package-info.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/package-info.java new file mode 100644 index 0000000000000..d4ca7fe39559f --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2018_09_01.implementation; diff --git a/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/package-info.java b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/package-info.java new file mode 100644 index 0000000000000..2893e68eb2fd5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2018_09_01; diff --git a/containerservice/resource-manager/pom.xml b/containerservice/resource-manager/pom.xml index 919bcf86cc3a3..dc31a7e70f226 100644 --- a/containerservice/resource-manager/pom.xml +++ b/containerservice/resource-manager/pom.xml @@ -8,7 +8,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../pom.xml azure-mgmt-containerservice-parent diff --git a/containerservice/resource-manager/v2017_07_01/pom.xml b/containerservice/resource-manager/v2017_07_01/pom.xml index 52b66defaebea..6ed5b1a8c4d7b 100644 --- a/containerservice/resource-manager/v2017_07_01/pom.xml +++ b/containerservice/resource-manager/v2017_07_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-containerservice diff --git a/containerservice/resource-manager/v2017_08_31/pom.xml b/containerservice/resource-manager/v2017_08_31/pom.xml index 31bcb22c55019..a0d6379e050c8 100644 --- a/containerservice/resource-manager/v2017_08_31/pom.xml +++ b/containerservice/resource-manager/v2017_08_31/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-containerservice diff --git a/containerservice/resource-manager/v2017_09_30/pom.xml b/containerservice/resource-manager/v2017_09_30/pom.xml index 2948c3299af7c..8597573292049 100644 --- a/containerservice/resource-manager/v2017_09_30/pom.xml +++ b/containerservice/resource-manager/v2017_09_30/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-containerservice diff --git a/cosmosdb/resource-manager/v2015_04_08/pom.xml b/cosmosdb/resource-manager/v2015_04_08/pom.xml index 96875c2aa7565..96b27807922e9 100644 --- a/cosmosdb/resource-manager/v2015_04_08/pom.xml +++ b/cosmosdb/resource-manager/v2015_04_08/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-documentdb diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/pom.xml b/datalakeanalytics/resource-manager/v2015_10_01_preview/pom.xml new file mode 100644 index 0000000000000..648468c5d4020 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.datalakeanalytics.v2015_10_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datalakeanalytics + 1.0.0-beta-2 + jar + Microsoft Azure SDK for DataLakeAnalytics Management + This package contains Microsoft DataLakeAnalytics Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Accounts.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Accounts.java new file mode 100644 index 0000000000000..ef77cbd9be9af --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Accounts.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.StorageAccountInfo; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.BlobContainer; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeStoreAccountInfo; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStorageAccountsAsync(final String resourceGroupName, final String accountName); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName); + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddDataLakeStoreParameters.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddDataLakeStoreParameters.java new file mode 100644 index 0000000000000..f4e6dce99a108 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddDataLakeStoreParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional Data Lake Store parameters. + */ +public class AddDataLakeStoreParameters { + /** + * the properties for the Data Lake Store account being added. + */ + @JsonProperty(value = "properties", required = true) + private DataLakeStoreAccountInfoProperties properties; + + /** + * Get the properties for the Data Lake Store account being added. + * + * @return the properties value + */ + public DataLakeStoreAccountInfoProperties properties() { + return this.properties; + } + + /** + * Set the properties for the Data Lake Store account being added. + * + * @param properties the properties value to set + * @return the AddDataLakeStoreParameters object itself. + */ + public AddDataLakeStoreParameters withProperties(DataLakeStoreAccountInfoProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddStorageAccountParameters.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddStorageAccountParameters.java new file mode 100644 index 0000000000000..a6f2e94b3ca15 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AddStorageAccountParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional Azure Storage account parameters. + */ +public class AddStorageAccountParameters { + /** + * the properties for the Azure Storage account being added. + */ + @JsonProperty(value = "properties", required = true) + private StorageAccountProperties properties; + + /** + * Get the properties for the Azure Storage account being added. + * + * @return the properties value + */ + public StorageAccountProperties properties() { + return this.properties; + } + + /** + * Set the properties for the Azure Storage account being added. + * + * @param properties the properties value to set + * @return the AddStorageAccountParameters object itself. + */ + public AddStorageAccountParameters withProperties(StorageAccountProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AzureAsyncOperationResult.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AzureAsyncOperationResult.java new file mode 100644 index 0000000000000..fec3f5cea72ea --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/AzureAsyncOperationResult.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is inprogress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * the status of the AzureAsuncOperation. Possible values include: + * 'InProgress', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatus status; + + /** + * The error property. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Get the status of the AzureAsuncOperation. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public OperationStatus status() { + return this.status; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainer.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainer.java new file mode 100644 index 0000000000000..6c6e2ca84a0ab --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainer.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.BlobContainerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsManager; + +/** + * Type representing BlobContainer. + */ +public interface BlobContainer extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + BlobContainerProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainerProperties.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainerProperties.java new file mode 100644 index 0000000000000..b9ec3cbf7d240 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/BlobContainerProperties.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage blob container properties information. + */ +public class BlobContainerProperties { + /** + * the last modified time of the blob container. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get the last modified time of the blob container. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccount.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccount.java new file mode 100644 index 0000000000000..bee9c1e0b5a4b --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccount.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsAccountInner; + +/** + * Type representing DataLakeAnalyticsAccount. + */ +public interface DataLakeAnalyticsAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the properties value. + */ + DataLakeAnalyticsAccountProperties properties(); + + /** + * The entirety of the DataLakeAnalyticsAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataLakeAnalyticsAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataLakeAnalyticsAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataLakeAnalyticsAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties defined by Data Lake Analytics all properties are specific to each resource provider + * @return the next definition stage + */ + WithCreate withProperties(DataLakeAnalyticsAccountProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProperties { + } + } + /** + * The template for a DataLakeAnalyticsAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of DataLakeAnalyticsAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the datalakeanalyticsaccount update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties defined by Data Lake Analytics all properties are specific to each resource provider + * @return the next update stage + */ + Update withProperties(DataLakeAnalyticsAccountProperties properties); + } + + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountProperties.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountProperties.java new file mode 100644 index 0000000000000..2161ad56918ab --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountProperties.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import java.util.List; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeStoreAccountInfoInner; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.StorageAccountInfoInner; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The account specific properties that are associated with an underlying Data + * Lake Analytics account. + */ +public class DataLakeAnalyticsAccountProperties { + /** + * the provisioning status of the Data Lake Analytics account. Possible + * values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /** + * the state of the Data Lake Analytics account. Possible values include: + * 'active', 'suspended'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /** + * the default data lake storage account associated with this Data Lake + * Analytics account. + */ + @JsonProperty(value = "defaultDataLakeStoreAccount") + private String defaultDataLakeStoreAccount; + + /** + * the maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /** + * the maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "maxJobCount") + private Integer maxJobCount; + + /** + * the list of Data Lake storage accounts associated with this account. + */ + @JsonProperty(value = "dataLakeStoreAccounts") + private List dataLakeStoreAccounts; + + /** + * the list of Azure Blob storage accounts associated with this account. + */ + @JsonProperty(value = "storageAccounts") + private List storageAccounts; + + /** + * the account creation time. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * the account last modified time. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * the full CName endpoint for this account. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the provisioning status of the Data Lake Analytics account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + * + * @return the provisioningState value + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state of the Data Lake Analytics account. Possible values include: 'active', 'suspended'. + * + * @return the state value + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the default data lake storage account associated with this Data Lake Analytics account. + * + * @return the defaultDataLakeStoreAccount value + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Set the default data lake storage account associated with this Data Lake Analytics account. + * + * @param defaultDataLakeStoreAccount the defaultDataLakeStoreAccount value to set + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount) { + this.defaultDataLakeStoreAccount = defaultDataLakeStoreAccount; + return this; + } + + /** + * Get the maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the list of Data Lake storage accounts associated with this account. + * + * @return the dataLakeStoreAccounts value + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the list of Data Lake storage accounts associated with this account. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withDataLakeStoreAccounts(List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + return this; + } + + /** + * Get the list of Azure Blob storage accounts associated with this account. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the list of Azure Blob storage accounts associated with this account. + * + * @param storageAccounts the storageAccounts value to set + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the full CName endpoint for this account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountState.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountState.java new file mode 100644 index 0000000000000..2489fb4c9facc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountState. + */ +public enum DataLakeAnalyticsAccountState { + /** Enum value active. */ + ACTIVE("active"), + + /** Enum value suspended. */ + SUSPENDED("suspended"); + + /** The actual serialized value for a DataLakeAnalyticsAccountState instance. */ + private String value; + + DataLakeAnalyticsAccountState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountState fromString(String value) { + DataLakeAnalyticsAccountState[] items = DataLakeAnalyticsAccountState.values(); + for (DataLakeAnalyticsAccountState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountStatus.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountStatus.java new file mode 100644 index 0000000000000..6f9f4f6f2a4b7 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeAnalyticsAccountStatus.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountStatus. + */ +public enum DataLakeAnalyticsAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a DataLakeAnalyticsAccountStatus instance. */ + private String value; + + DataLakeAnalyticsAccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountStatus fromString(String value) { + DataLakeAnalyticsAccountStatus[] items = DataLakeAnalyticsAccountStatus.values(); + for (DataLakeAnalyticsAccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfo.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfo.java new file mode 100644 index 0000000000000..78ef4170bfacc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfo.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeStoreAccountInfoInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsManager; + +/** + * Type representing DataLakeStoreAccountInfo. + */ +public interface DataLakeStoreAccountInfo extends HasInner, HasManager { + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + DataLakeStoreAccountInfoProperties properties(); + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfoProperties.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfoProperties.java new file mode 100644 index 0000000000000..fafb220294565 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/DataLakeStoreAccountInfoProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account properties information. + */ +public class DataLakeStoreAccountInfoProperties { + /** + * the optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "suffix") + private String suffix; + + /** + * Get the optional suffix for the Data Lake Store account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set + * @return the DataLakeStoreAccountInfoProperties object itself. + */ + public DataLakeStoreAccountInfoProperties withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Error.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Error.java new file mode 100644 index 0000000000000..3b2790b2455b0 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/Error.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Generic resource error information. + */ +public class Error { + /** + * the HTTP status code or error code associated with this error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * the error message to display. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * the target of the error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * the list of error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * the inner exceptions or errors, if any. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private InnerError innerError; + + /** + * Get the HTTP status code or error code associated with this error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message to display. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the list of error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the inner exceptions or errors, if any. + * + * @return the innerError value + */ + public InnerError innerError() { + return this.innerError; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/ErrorDetails.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/ErrorDetails.java new file mode 100644 index 0000000000000..5b33c841d15db --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/ErrorDetails.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Generic resource error details information. + */ +public class ErrorDetails { + /** + * the HTTP status code or error code associated with this error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * the error message localized based on Accept-Language. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * the target of the particular error (for example, the name of the + * property in error). + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the HTTP status code or error code associated with this error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message localized based on Accept-Language. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error (for example, the name of the property in error). + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/InnerError.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/InnerError.java new file mode 100644 index 0000000000000..161e53bf0b2dd --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/InnerError.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Generic resource inner error information. + */ +public class InnerError { + /** + * the stack trace for the error. + */ + @JsonProperty(value = "trace", access = JsonProperty.Access.WRITE_ONLY) + private String trace; + + /** + * the context for the error message. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private String context; + + /** + * Get the stack trace for the error. + * + * @return the trace value + */ + public String trace() { + return this.trace; + } + + /** + * Get the context for the error message. + * + * @return the context value + */ + public String context() { + return this.context; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/OperationStatus.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/OperationStatus.java new file mode 100644 index 0000000000000..0394fdfacc79f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/OperationStatus.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationStatus. + */ +public enum OperationStatus { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a OperationStatus instance. */ + private 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. + */ + @JsonCreator + public static OperationStatus fromString(String value) { + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/SasTokenInfo.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/SasTokenInfo.java new file mode 100644 index 0000000000000..baceebd993825 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/SasTokenInfo.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.SasTokenInfoInner; + +/** + * Type representing SasTokenInfo. + */ +public interface SasTokenInfo extends HasInner, HasManager { + /** + * @return the accessToken value. + */ + String accessToken(); + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountInfo.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountInfo.java new file mode 100644 index 0000000000000..4de0d83eb4a41 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountInfo.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.StorageAccountInfoInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation.DataLakeAnalyticsManager; + +/** + * Type representing StorageAccountInfo. + */ +public interface StorageAccountInfo extends HasInner, HasManager { + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + StorageAccountProperties properties(); + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountProperties.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountProperties.java new file mode 100644 index 0000000000000..62e151338121d --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/StorageAccountProperties.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage account properties information. + */ +public class StorageAccountProperties { + /** + * the access key associated with this Azure Storage account that will be + * used to connect to it. + */ + @JsonProperty(value = "accessKey", required = true) + private String accessKey; + + /** + * the optional suffix for the Data Lake account. + */ + @JsonProperty(value = "suffix") + private String suffix; + + /** + * Get the access key associated with this Azure Storage account that will be used to connect to it. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the access key associated with this Azure Storage account that will be used to connect to it. + * + * @param accessKey the accessKey value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the optional suffix for the Data Lake account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the Data Lake account. + * + * @param suffix the suffix value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..afdf3bd4923d8 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsImpl.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeAnalyticsAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.AddStorageAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.AddDataLakeStoreParameters; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.StorageAccountInfo; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.BlobContainer; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.SasTokenInfo; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeStoreAccountInfo; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataLakeAnalyticsAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + AccountsInner client = this.inner(); + return client.addStorageAccountAsync(resourceGroupName, accountName, storageAccountName, parameters).toCompletable(); + } + + @Override + public Completable addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + AccountsInner client = this.inner(); + return client.addDataLakeStoreAccountAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).toCompletable(); + } + + @Override + protected DataLakeAnalyticsAccountImpl wrapModel(DataLakeAnalyticsAccountInner inner) { + return new DataLakeAnalyticsAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected DataLakeAnalyticsAccountImpl wrapModel(String name) { + return new DataLakeAnalyticsAccountImpl(name, new DataLakeAnalyticsAccountInner(), this.manager()); + } + + private StorageAccountInfoImpl wrapStorageAccountInfoModel(StorageAccountInfoInner inner) { + return new StorageAccountInfoImpl(inner, manager()); + } + + private BlobContainerImpl wrapBlobContainerModel(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + + private DataLakeStoreAccountInfoImpl wrapDataLakeStoreAccountInfoModel(DataLakeStoreAccountInfoInner inner) { + return new DataLakeStoreAccountInfoImpl(inner, manager()); + } + + private Observable getStorageAccountInfoInnerUsingAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "accounts"); + String storageAccountName = IdParsingUtils.getValueFromIdByName(id, "StorageAccounts"); + AccountsInner client = this.inner(); + return client.getStorageAccountAsync(resourceGroupName, accountName, storageAccountName); + } + + private Observable getBlobContainerInnerUsingAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "accounts"); + String storageAccountName = IdParsingUtils.getValueFromIdByName(id, "StorageAccounts"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "Containers"); + AccountsInner client = this.inner(); + return client.getStorageContainerAsync(resourceGroupName, accountName, storageAccountName, containerName); + } + + private Observable getDataLakeStoreAccountInfoInnerUsingAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "accounts"); + String dataLakeStoreAccountName = IdParsingUtils.getValueFromIdByName(id, "DataLakeStoreAccounts"); + AccountsInner client = this.inner(); + return client.getDataLakeStoreAccountAsync(resourceGroupName, accountName, dataLakeStoreAccountName); + } + + @Override + public Observable getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName) { + AccountsInner client = this.inner(); + return client.getStorageAccountAsync(resourceGroupName, accountName, storageAccountName) + .map(new Func1() { + @Override + public StorageAccountInfo call(StorageAccountInfoInner inner) { + return wrapStorageAccountInfoModel(inner); + } + }); + } + + @Override + public Observable listStorageAccountsAsync(final String resourceGroupName, final String accountName) { + AccountsInner client = this.inner(); + return client.listStorageAccountsAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageAccountInfo call(StorageAccountInfoInner inner) { + return wrapStorageAccountInfoModel(inner); + } + }); + } + + @Override + public Completable deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName) { + AccountsInner client = this.inner(); + return client.deleteStorageAccountAsync(resourceGroupName, accountName, storageAccountName).toCompletable(); + } + + @Override + public Completable updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + AccountsInner client = this.inner(); + return client.updateStorageAccountAsync(resourceGroupName, accountName, storageAccountName, parameters).toCompletable(); + } + + @Override + public Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + AccountsInner client = this.inner(); + return client.getStorageContainerAsync(resourceGroupName, accountName, storageAccountName, containerName) + .map(new Func1() { + @Override + public BlobContainer call(BlobContainerInner inner) { + return wrapBlobContainerModel(inner); + } + }); + } + + @Override + public Observable listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + AccountsInner client = this.inner(); + return client.listStorageContainersAsync(resourceGroupName, accountName, storageAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BlobContainer call(BlobContainerInner inner) { + return wrapBlobContainerModel(inner); + } + }); + } + + @Override + public Observable listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + AccountsInner client = this.inner(); + return client.listSasTokensAsync(resourceGroupName, accountName, storageAccountName, containerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SasTokenInfo call(SasTokenInfoInner inner) { + return new SasTokenInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + AccountsInner client = this.inner(); + return client.getDataLakeStoreAccountAsync(resourceGroupName, accountName, dataLakeStoreAccountName) + .map(new Func1() { + @Override + public DataLakeStoreAccountInfo call(DataLakeStoreAccountInfoInner inner) { + return wrapDataLakeStoreAccountInfoModel(inner); + } + }); + } + + @Override + public Observable listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName) { + AccountsInner client = this.inner(); + return client.listDataLakeStoreAccountsAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccountInfo call(DataLakeStoreAccountInfoInner inner) { + return wrapDataLakeStoreAccountInfoModel(inner); + } + }); + } + + @Override + public Completable deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + AccountsInner client = this.inner(); + return client.deleteDataLakeStoreAccountAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toCompletable(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java new file mode 100644 index 0000000000000..f78bff62c47ce --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java @@ -0,0 +1,3597 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.AddDataLakeStoreParameters; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.AddStorageAccountParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts getStorageAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Observable> getStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts deleteStorageAccount" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", method = "DELETE", hasBody = true) + Observable> deleteStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts updateStorageAccount" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Observable> updateStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Body AddStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts addStorageAccount" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Observable> addStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Body AddStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts getStorageContainer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}") + Observable> getStorageContainer(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listStorageContainers" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers") + Observable> listStorageContainers(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listSasTokens" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}/listSasTokens") + Observable> listSasTokens(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts getDataLakeStoreAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}") + Observable> getDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts deleteDataLakeStoreAccount" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", method = "DELETE", hasBody = true) + Observable> deleteDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts addDataLakeStoreAccount" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}") + Observable> addDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Body AddDataLakeStoreParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listStorageAccounts" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/") + Observable> listStorageAccounts(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listDataLakeStoreAccounts" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/") + Observable> listDataLakeStoreAccounts(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listStorageContainersNext" }) + @GET + Observable> listStorageContainersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listSasTokensNext" }) + @GET + Observable> listSasTokensNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listStorageAccountsNext" }) + @GET + Observable> listStorageAccountsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listDataLakeStoreAccountsNext" }) + @GET + Observable> listDataLakeStoreAccountsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInfoInner object if successful. + */ + public StorageAccountInfoInner getStorageAccount(String resourceGroupName, String accountName, String storageAccountName) { + return getStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInfoInner object + */ + public Observable getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName) { + return getStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1, StorageAccountInfoInner>() { + @Override + public StorageAccountInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInfoInner object + */ + public Observable> getStorageAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteStorageAccount(String resourceGroupName, String accountName, String storageAccountName) { + deleteStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName) { + return deleteStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteStorageAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + updateStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + return updateStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateStorageAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.updateStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void addStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + addStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + return addStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addStorageAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.addStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner getStorageContainer(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName), serviceCallback); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> getStorageContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getStorageContainer(resourceGroupName, accountName, storageAccountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStorageContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStorageContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BlobContainerInner> object if successful. + */ + public PagedList listStorageContainers(final String resourceGroupName, final String accountName, final String storageAccountName) { + ServiceResponse> response = listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BlobContainerInner> object + */ + public Observable> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + return listStorageContainersWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BlobContainerInner> object + */ + public Observable>> listStorageContainersWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + return listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageContainersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + ServiceResponse> * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BlobContainerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageContainersSinglePageAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listStorageContainers(resourceGroupName, accountName, storageAccountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageContainersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageContainersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasTokenInfoInner> object if successful. + */ + public PagedList listSasTokens(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + ServiceResponse> response = listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInfoInner> object + */ + public Observable> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + return listSasTokensWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInfoInner> object + */ + public Observable>> listSasTokensWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + return listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSasTokensNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + ServiceResponse> * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + ServiceResponse> * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasTokenInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSasTokensSinglePageAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSasTokens(resourceGroupName, accountName, storageAccountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSasTokensDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSasTokensDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInfoInner object if successful. + */ + public DataLakeStoreAccountInfoInner getDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInfoInner object + */ + public Observable getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1, DataLakeStoreAccountInfoInner>() { + @Override + public DataLakeStoreAccountInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInfoInner object + */ + public Observable> getDataLakeStoreAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDataLakeStoreAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + deleteDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return deleteDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteDataLakeStoreAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDataLakeStoreAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void addDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + return addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addDataLakeStoreAccountWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.addDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addDataLakeStoreAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInfoInner> object if successful. + */ + public PagedList listStorageAccounts(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listStorageAccountsSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageAccountsSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable> listStorageAccountsAsync(final String resourceGroupName, final String accountName) { + return listStorageAccountsWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable>> listStorageAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listStorageAccountsSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageAccountsSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.listStorageAccounts(resourceGroupName, accountName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInfoInner> object if successful. + */ + public PagedList listStorageAccounts(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listStorageAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable> listStorageAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listStorageAccountsWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable>> listStorageAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listStorageAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + ServiceResponse> * @param filter The OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageAccountsSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listStorageAccounts(resourceGroupName, accountName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageAccountsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInfoInner> object if successful. + */ + public PagedList listDataLakeStoreAccounts(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName) { + return listDataLakeStoreAccountsWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDataLakeStoreAccountsSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInfoInner> object if successful. + */ + public PagedList listDataLakeStoreAccounts(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listDataLakeStoreAccountsWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName, filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDataLakeStoreAccountsSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDataLakeStoreAccountsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.list(this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listWithServiceResponseAsync(filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner create(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().body(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner beginCreate(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner update(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner beginUpdate(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BlobContainerInner> object if successful. + */ + public PagedList listStorageContainersNext(final String nextPageLink) { + ServiceResponse> response = listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageContainersNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageContainersNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BlobContainerInner> object + */ + public Observable> listStorageContainersNextAsync(final String nextPageLink) { + return listStorageContainersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BlobContainerInner> object + */ + public Observable>> listStorageContainersNextWithServiceResponseAsync(final String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageContainersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BlobContainerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageContainersNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listStorageContainersNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageContainersNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageContainersNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasTokenInfoInner> object if successful. + */ + public PagedList listSasTokensNext(final String nextPageLink) { + ServiceResponse> response = listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSasTokensNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSasTokensNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInfoInner> object + */ + public Observable> listSasTokensNextAsync(final String nextPageLink) { + return listSasTokensNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInfoInner> object + */ + public Observable>> listSasTokensNextWithServiceResponseAsync(final String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSasTokensNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasTokenInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSasTokensNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSasTokensNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSasTokensNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSasTokensNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInfoInner> object if successful. + */ + public PagedList listStorageAccountsNext(final String nextPageLink) { + ServiceResponse> response = listStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageAccountsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable> listStorageAccountsNextAsync(final String nextPageLink) { + return listStorageAccountsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInfoInner> object + */ + public Observable>> listStorageAccountsNextWithServiceResponseAsync(final String nextPageLink) { + return listStorageAccountsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageAccountsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listStorageAccountsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageAccountsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageAccountsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInfoInner> object if successful. + */ + public PagedList listDataLakeStoreAccountsNext(final String nextPageLink) { + ServiceResponse> response = listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listDataLakeStoreAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable> listDataLakeStoreAccountsNextAsync(final String nextPageLink) { + return listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInfoInner> object + */ + public Observable>> listDataLakeStoreAccountsNextWithServiceResponseAsync(final String nextPageLink) { + return listDataLakeStoreAccountsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDataLakeStoreAccountsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listDataLakeStoreAccountsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDataLakeStoreAccountsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerImpl.java new file mode 100644 index 0000000000000..ca1c99901b129 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.BlobContainer; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.BlobContainerProperties; + +class BlobContainerImpl extends IndexableRefreshableWrapperImpl implements BlobContainer { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String storageAccountName; + private String containerName; + + BlobContainerImpl(BlobContainerInner inner, DataLakeAnalyticsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.storageAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "StorageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "Containers"); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getStorageContainerAsync(this.resourceGroupName, this.accountName, this.storageAccountName, this.containerName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public BlobContainerProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerInner.java new file mode 100644 index 0000000000000..d6c6bdcd6d05c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/BlobContainerInner.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.BlobContainerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage blob container information. + */ +public class BlobContainerInner { + /** + * the name of the blob container. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * the unique identifier of the blob container. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * the type of the blob container. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * the properties of the blob container. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private BlobContainerProperties properties; + + /** + * Get the name of the blob container. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the unique identifier of the blob container. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the type of the blob container. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the properties of the blob container. + * + * @return the properties value + */ + public BlobContainerProperties properties() { + return this.properties; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountImpl.java new file mode 100644 index 0000000000000..53f4145286932 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeAnalyticsAccount; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeAnalyticsAccountProperties; + +class DataLakeAnalyticsAccountImpl extends GroupableResourceCoreImpl implements DataLakeAnalyticsAccount, DataLakeAnalyticsAccount.Definition, DataLakeAnalyticsAccount.Update { + DataLakeAnalyticsAccountImpl(String name, DataLakeAnalyticsAccountInner inner, DataLakeAnalyticsManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DataLakeAnalyticsAccountProperties properties() { + return this.inner().properties(); + } + + @Override + public DataLakeAnalyticsAccountImpl withProperties(DataLakeAnalyticsAccountProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountInner.java new file mode 100644 index 0000000000000..bf44168927823 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import java.util.Map; + +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeAnalyticsAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics account object, containing all information associated + * with the named Data Lake Analytics account. + */ +public class DataLakeAnalyticsAccountInner extends Resource { + /** + * the properties defined by Data Lake Analytics all properties are + * specific to each resource provider. + */ + @JsonProperty(value = "properties") + private DataLakeAnalyticsAccountProperties properties; + + /** + * Get the properties defined by Data Lake Analytics all properties are specific to each resource provider. + * + * @return the properties value + */ + public DataLakeAnalyticsAccountProperties properties() { + return this.properties; + } + + /** + * Set the properties defined by Data Lake Analytics all properties are specific to each resource provider. + * + * @param properties the properties value to set + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withProperties(DataLakeAnalyticsAccountProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountManagementClientImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountManagementClientImpl.java new file mode 100644 index 0000000000000..ff1245625dd55 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsAccountManagementClientImpl.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataLakeAnalyticsAccountManagementClientImpl class. + */ +public class DataLakeAnalyticsAccountManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataLakeAnalyticsAccountManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataLakeAnalyticsAccountManagementClient", "2015-10-01-preview"); + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsManager.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsManager.java new file mode 100644 index 0000000000000..c0150fa7d6581 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeAnalyticsManager.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.Accounts; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataLakeAnalytics resource management. + */ +public final class DataLakeAnalyticsManager extends ManagerCore { + private Accounts accounts; + /** + * Get a Configurable instance that can be used to create DataLakeAnalyticsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataLakeAnalyticsManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataLakeAnalyticsManager + */ + public static DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataLakeAnalyticsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataLakeAnalyticsManager + */ + public static DataLakeAnalyticsManager authenticate(RestClient restClient, String subscriptionId) { + return new DataLakeAnalyticsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataLakeAnalytics management API entry points that work across subscriptions + */ + DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataLakeAnalyticsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataLakeAnalyticsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataLakeAnalyticsAccountManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoImpl.java new file mode 100644 index 0000000000000..e5129293168fc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeStoreAccountInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeStoreAccountInfoProperties; + +class DataLakeStoreAccountInfoImpl extends WrapperImpl implements DataLakeStoreAccountInfo { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String dataLakeStoreAccountName; + + DataLakeStoreAccountInfoImpl(DataLakeStoreAccountInfoInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DataLakeStoreAccountInfoProperties properties() { + return this.inner().properties(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoInner.java new file mode 100644 index 0000000000000..9ca1f9197200b --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/DataLakeStoreAccountInfoInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.DataLakeStoreAccountInfoProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account information. + */ +public class DataLakeStoreAccountInfoInner { + /** + * the account name of the Data Lake Store account. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * the properties associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties") + private DataLakeStoreAccountInfoProperties properties; + + /** + * Get the account name of the Data Lake Store account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the account name of the Data Lake Store account. + * + * @param name the name value to set + * @return the DataLakeStoreAccountInfoInner object itself. + */ + public DataLakeStoreAccountInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties associated with this Data Lake Store account. + * + * @return the properties value + */ + public DataLakeStoreAccountInfoProperties properties() { + return this.properties; + } + + /** + * Set the properties associated with this Data Lake Store account. + * + * @param properties the properties value to set + * @return the DataLakeStoreAccountInfoInner object itself. + */ + public DataLakeStoreAccountInfoInner withProperties(DataLakeStoreAccountInfoProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/IdParsingUtils.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..2bd77d1f9a1cf --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/PageImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..56586700bcace --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoImpl.java new file mode 100644 index 0000000000000..6b92c11bf074c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.SasTokenInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SasTokenInfoImpl extends WrapperImpl implements SasTokenInfo { + private final DataLakeAnalyticsManager manager; + SasTokenInfoImpl(SasTokenInfoInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public String accessToken() { + return this.inner().accessToken(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoInner.java new file mode 100644 index 0000000000000..3960a21d26a1e --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/SasTokenInfoInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SAS token information. + */ +public class SasTokenInfoInner { + /** + * the access token for the associated Azure Storage Container. + */ + @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) + private String accessToken; + + /** + * Get the access token for the associated Azure Storage Container. + * + * @return the accessToken value + */ + public String accessToken() { + return this.accessToken; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoImpl.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoImpl.java new file mode 100644 index 0000000000000..7abe62b4cb4bb --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.StorageAccountInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.StorageAccountProperties; + +class StorageAccountInfoImpl extends WrapperImpl implements StorageAccountInfo { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String storageAccountName; + + StorageAccountInfoImpl(StorageAccountInfoInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public StorageAccountProperties properties() { + return this.inner().properties(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoInner.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoInner.java new file mode 100644 index 0000000000000..b48004235a803 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/StorageAccountInfoInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage account information. + */ +public class StorageAccountInfoInner { + /** + * the account name associated with the Azure storage account. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * the properties associated with this storage account. + */ + @JsonProperty(value = "properties", required = true) + private StorageAccountProperties properties; + + /** + * Get the account name associated with the Azure storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the account name associated with the Azure storage account. + * + * @param name the name value to set + * @return the StorageAccountInfoInner object itself. + */ + public StorageAccountInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties associated with this storage account. + * + * @return the properties value + */ + public StorageAccountProperties properties() { + return this.properties; + } + + /** + * Set the properties associated with this storage account. + * + * @param properties the properties value to set + * @return the StorageAccountInfoInner object itself. + */ + public StorageAccountInfoInner withProperties(StorageAccountProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/package-info.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..247a4ee3c8499 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataLakeAnalyticsAccountManagementClient. + * Creates an Azure Data Lake Analytics account management client. + */ +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview.implementation; diff --git a/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/package-info.java b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/package-info.java new file mode 100644 index 0000000000000..5818ff73fae14 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataLakeAnalyticsAccountManagementClient. + * Creates an Azure Data Lake Analytics account management client. + */ +package com.microsoft.azure.management.datalakeanalytics.v2015_10_01_preview; diff --git a/datalakeanalytics/resource-manager/v2016_11_01/pom.xml b/datalakeanalytics/resource-manager/v2016_11_01/pom.xml new file mode 100644 index 0000000000000..63244e88e6e58 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.datalakeanalytics.v2016_11_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datalakeanalytics + 1.0.0-beta-2 + jar + Microsoft Azure SDK for DataLakeAnalytics Management + This package contains Microsoft DataLakeAnalytics Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AADObjectType.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AADObjectType.java new file mode 100644 index 0000000000000..657f141e77a33 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AADObjectType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AADObjectType. + */ +public final class AADObjectType extends ExpandableStringEnum { + /** Static value User for AADObjectType. */ + public static final AADObjectType USER = fromString("User"); + + /** Static value Group for AADObjectType. */ + public static final AADObjectType GROUP = fromString("Group"); + + /** Static value ServicePrincipal for AADObjectType. */ + public static final AADObjectType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** + * Creates or finds a AADObjectType from its string representation. + * @param name a name to look for + * @return the corresponding AADObjectType + */ + @JsonCreator + public static AADObjectType fromString(String name) { + return fromString(name, AADObjectType.class); + } + + /** + * @return known AADObjectType values + */ + public static Collection values() { + return values(AADObjectType.class); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Accounts.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Accounts.java new file mode 100644 index 0000000000000..ef81271a05aac --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Accounts.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreParameters.java new file mode 100644 index 0000000000000..4bad32ce4824a --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to add a new Data Lake Store account. + */ +@JsonFlatten +public class AddDataLakeStoreParameters { + /** + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the optional suffix for the Data Lake Store account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set + * @return the AddDataLakeStoreParameters object itself. + */ + public AddDataLakeStoreParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreWithAccountParameters.java new file mode 100644 index 0000000000000..5b511eee7a096 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddDataLakeStoreWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to add a new Data Lake Store account while creating a + * new Data Lake Analytics account. + */ +@JsonFlatten +public class AddDataLakeStoreWithAccountParameters { + /** + * The unique name of the Data Lake Store account to add. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the unique name of the Data Lake Store account to add. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the Data Lake Store account to add. + * + * @param name the name value to set + * @return the AddDataLakeStoreWithAccountParameters object itself. + */ + public AddDataLakeStoreWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the optional suffix for the Data Lake Store account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set + * @return the AddDataLakeStoreWithAccountParameters object itself. + */ + public AddDataLakeStoreWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountParameters.java new file mode 100644 index 0000000000000..f4dac48312c00 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to add a new Azure Storage account. + */ +@JsonFlatten +public class AddStorageAccountParameters { + /** + * The access key associated with this Azure Storage account that will be + * used to connect to it. + */ + @JsonProperty(value = "properties.accessKey", required = true) + private String accessKey; + + /** + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the access key associated with this Azure Storage account that will be used to connect to it. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the access key associated with this Azure Storage account that will be used to connect to it. + * + * @param accessKey the accessKey value to set + * @return the AddStorageAccountParameters object itself. + */ + public AddStorageAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the optional suffix for the storage account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the storage account. + * + * @param suffix the suffix value to set + * @return the AddStorageAccountParameters object itself. + */ + public AddStorageAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountWithAccountParameters.java new file mode 100644 index 0000000000000..40d58677457cf --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/AddStorageAccountWithAccountParameters.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to add a new Azure Storage account while creating a new + * Data Lake Analytics account. + */ +@JsonFlatten +public class AddStorageAccountWithAccountParameters { + /** + * The unique name of the Azure Storage account to add. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The access key associated with this Azure Storage account that will be + * used to connect to it. + */ + @JsonProperty(value = "properties.accessKey", required = true) + private String accessKey; + + /** + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the unique name of the Azure Storage account to add. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the Azure Storage account to add. + * + * @param name the name value to set + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the access key associated with this Azure Storage account that will be used to connect to it. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the access key associated with this Azure Storage account that will be used to connect to it. + * + * @param accessKey the accessKey value to set + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the optional suffix for the storage account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the storage account. + * + * @param suffix the suffix value to set + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CapabilityInformation.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CapabilityInformation.java new file mode 100644 index 0000000000000..34cc0c3dc4da3 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CapabilityInformation.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.CapabilityInformationInner; +import java.util.UUID; + +/** + * Type representing CapabilityInformation. + */ +public interface CapabilityInformation extends HasInner, HasManager { + /** + * @return the accountCount value. + */ + Integer accountCount(); + + /** + * @return the maxAccountCount value. + */ + Integer maxAccountCount(); + + /** + * @return the migrationState value. + */ + Boolean migrationState(); + + /** + * @return the state value. + */ + SubscriptionState state(); + + /** + * @return the subscriptionId value. + */ + UUID subscriptionId(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CheckNameAvailabilityParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..3f6224547ef4f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CheckNameAvailabilityParameters.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Analytics account name availability check parameters. + */ +public class CheckNameAvailabilityParameters { + /** + * The Data Lake Analytics name to check availability for. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type. Note: This should not be set by the user, as the + * constant value is Microsoft.DataLakeAnalytics/accounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the Data Lake Analytics name to check availability for. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.DataLakeAnalytics/accounts"; + } + + /** + * Get the Data Lake Analytics name to check availability for. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Data Lake Analytics name to check availability for. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type. Note: This should not be set by the user, as the constant value is Microsoft.DataLakeAnalytics/accounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Note: This should not be set by the user, as the constant value is Microsoft.DataLakeAnalytics/accounts. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicies.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicies.java new file mode 100644 index 0000000000000..819dafa5ada86 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicies.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.ComputePoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ComputePolicies. + */ +public interface ComputePolicies extends SupportsCreating, HasInner { + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String computePolicyName); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicy.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicy.java new file mode 100644 index 0000000000000..d9d6b0c381051 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/ComputePolicy.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.ComputePolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import java.util.UUID; + +/** + * Type representing ComputePolicy. + */ +public interface ComputePolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the maxDegreeOfParallelismPerJob value. + */ + Integer maxDegreeOfParallelismPerJob(); + + /** + * @return the minPriorityPerJob value. + */ + Integer minPriorityPerJob(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the objectId value. + */ + UUID objectId(); + + /** + * @return the objectType value. + */ + AADObjectType objectType(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ComputePolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithObjectId, DefinitionStages.WithObjectType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ComputePolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ComputePolicy definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the computepolicy definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group + * @param accountName The name of the Data Lake Analytics account + * @return the next definition stage + */ + WithObjectId withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the computepolicy definition allowing to specify ObjectId. + */ + interface WithObjectId { + /** + * Specifies objectId. + * @param objectId The AAD object identifier for the entity to create a policy for + * @return the next definition stage + */ + WithObjectType withObjectId(UUID objectId); + } + + /** + * The stage of the computepolicy definition allowing to specify ObjectType. + */ + interface WithObjectType { + /** + * Specifies objectType. + * @param objectType The type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal' + * @return the next definition stage + */ + WithCreate withObjectType(AADObjectType objectType); + } + + /** + * The stage of the computepolicy definition allowing to specify MaxDegreeOfParallelismPerJob. + */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies maxDegreeOfParallelismPerJob. + * @param maxDegreeOfParallelismPerJob The maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed + * @return the next definition stage + */ + WithCreate withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + + /** + * The stage of the computepolicy definition allowing to specify MinPriorityPerJob. + */ + interface WithMinPriorityPerJob { + /** + * Specifies minPriorityPerJob. + * @param minPriorityPerJob The minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed + * @return the next definition stage + */ + WithCreate withMinPriorityPerJob(Integer minPriorityPerJob); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithMaxDegreeOfParallelismPerJob, DefinitionStages.WithMinPriorityPerJob { + } + } + /** + * The template for a ComputePolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithMaxDegreeOfParallelismPerJob, UpdateStages.WithMinPriorityPerJob, UpdateStages.WithObjectId, UpdateStages.WithObjectType { + } + + /** + * Grouping of ComputePolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the computepolicy update allowing to specify MaxDegreeOfParallelismPerJob. + */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies maxDegreeOfParallelismPerJob. + * @param maxDegreeOfParallelismPerJob The maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed + * @return the next update stage + */ + Update withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + + /** + * The stage of the computepolicy update allowing to specify MinPriorityPerJob. + */ + interface WithMinPriorityPerJob { + /** + * Specifies minPriorityPerJob. + * @param minPriorityPerJob The minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed + * @return the next update stage + */ + Update withMinPriorityPerJob(Integer minPriorityPerJob); + } + + /** + * The stage of the computepolicy update allowing to specify ObjectId. + */ + interface WithObjectId { + /** + * Specifies objectId. + * @param objectId The AAD object identifier for the entity to create a policy for + * @return the next update stage + */ + Update withObjectId(UUID objectId); + } + + /** + * The stage of the computepolicy update allowing to specify ObjectType. + */ + interface WithObjectType { + /** + * Specifies objectType. + * @param objectType The type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal' + * @return the next update stage + */ + Update withObjectType(AADObjectType objectType); + } + + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateComputePolicyWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateComputePolicyWithAccountParameters.java new file mode 100644 index 0000000000000..76948da49f164 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateComputePolicyWithAccountParameters.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new compute policy while creating a new Data + * Lake Analytics account. + */ +@JsonFlatten +public class CreateComputePolicyWithAccountParameters { + /** + * The unique name of the compute policy to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", required = true) + private UUID objectId; + + /** + * The type of AAD object the object identifier refers to. Possible values + * include: 'User', 'Group', 'ServicePrincipal'. + */ + @JsonProperty(value = "properties.objectType", required = true) + private AADObjectType objectType; + + /** + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the unique name of the compute policy to create. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the compute policy to create. + * + * @param name the name value to set + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the AAD object identifier for the entity to create a policy for. + * + * @return the objectId value + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @return the objectType value + */ + public AADObjectType objectType() { + return this.objectType; + } + + /** + * Set the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @param objectType the objectType value to set + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withObjectType(AADObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateDataLakeAnalyticsAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateDataLakeAnalyticsAccountParameters.java new file mode 100644 index 0000000000000..454879fb51abe --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateDataLakeAnalyticsAccountParameters.java @@ -0,0 +1,418 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters to use for creating a Data Lake Analytics account. + */ +@JsonFlatten +public class CreateDataLakeAnalyticsAccountParameters { + /** + * The resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The default Data Lake Store account associated with this account. + */ + @JsonProperty(value = "properties.defaultDataLakeStoreAccount", required = true) + private String defaultDataLakeStoreAccount; + + /** + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts", required = true) + private List dataLakeStoreAccounts; + + /** + * The list of Azure Blob Storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies") + private List computePolicies; + + /** + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /** + * The current state of the IP address firewall for this account. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The commitment tier for the next month. Possible values include: + * 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', + * 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /** + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount") + private Integer maxJobCount; + + /** + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /** + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention") + private Integer queryStoreRetention; + + /** + * Get the resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the resource location. + * + * @param location the location value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Set the default Data Lake Store account associated with this account. + * + * @param defaultDataLakeStoreAccount the defaultDataLakeStoreAccount value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount) { + this.defaultDataLakeStoreAccount = defaultDataLakeStoreAccount; + return this; + } + + /** + * Get the list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the list of Data Lake Store accounts associated with this account. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withDataLakeStoreAccounts(List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + return this; + } + + /** + * Get the list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the list of Azure Blob Storage accounts associated with this account. + * + * @param storageAccounts the storageAccounts value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the list of compute policies associated with this account. + * + * @return the computePolicies value + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Set the list of compute policies associated with this account. + * + * @param computePolicies the computePolicies value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withComputePolicies(List computePolicies) { + this.computePolicies = computePolicies; + return this; + } + + /** + * Get the list of firewall rules associated with this account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the list of firewall rules associated with this account. + * + * @param firewallRules the firewallRules value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the current state of the IP address firewall for this account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the current state of the IP address firewall for this account. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallState the firewallState value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the commitment tier for the next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the commitment tier for the next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @param newTier the newTier value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the maximum supported degree of parallelism per job for this account. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum supported degree of parallelism per job for this account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum supported priority per job for this account. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Get the number of days that job metadata is retained. + * + * @return the queryStoreRetention value + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateFirewallRuleWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateFirewallRuleWithAccountParameters.java new file mode 100644 index 0000000000000..4defc33373c39 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateFirewallRuleWithAccountParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new firewall rule while creating a new Data + * Lake Analytics account. + */ +@JsonFlatten +public class CreateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the unique name of the firewall rule to create. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the firewall rule to create. + * + * @param name the name value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateComputePolicyParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateComputePolicyParameters.java new file mode 100644 index 0000000000000..96c820ddbb464 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateComputePolicyParameters.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new compute policy. + */ +@JsonFlatten +public class CreateOrUpdateComputePolicyParameters { + /** + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", required = true) + private UUID objectId; + + /** + * The type of AAD object the object identifier refers to. Possible values + * include: 'User', 'Group', 'ServicePrincipal'. + */ + @JsonProperty(value = "properties.objectType", required = true) + private AADObjectType objectType; + + /** + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the AAD object identifier for the entity to create a policy for. + * + * @return the objectId value + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @return the objectType value + */ + public AADObjectType objectType() { + return this.objectType; + } + + /** + * Set the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @param objectType the objectType value to set + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withObjectType(AADObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java new file mode 100644 index 0000000000000..2c4aa5bbdbb53 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new firewall rule. + */ +@JsonFlatten +public class CreateOrUpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccount.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccount.java new file mode 100644 index 0000000000000..b1e7bd2076805 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccount.java @@ -0,0 +1,481 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import java.util.List; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsAccountInner; + +/** + * Type representing DataLakeAnalyticsAccount. + */ +public interface DataLakeAnalyticsAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accountId value. + */ + UUID accountId(); + + /** + * @return the computePolicies value. + */ + List computePolicies(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the currentTier value. + */ + TierType currentTier(); + + /** + * @return the dataLakeStoreAccounts value. + */ + List dataLakeStoreAccounts(); + + /** + * @return the defaultDataLakeStoreAccount value. + */ + String defaultDataLakeStoreAccount(); + + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the firewallAllowAzureIps value. + */ + FirewallAllowAzureIpsState firewallAllowAzureIps(); + + /** + * @return the firewallRules value. + */ + List firewallRules(); + + /** + * @return the firewallState value. + */ + FirewallState firewallState(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the maxDegreeOfParallelism value. + */ + Integer maxDegreeOfParallelism(); + + /** + * @return the maxDegreeOfParallelismPerJob value. + */ + Integer maxDegreeOfParallelismPerJob(); + + /** + * @return the maxJobCount value. + */ + Integer maxJobCount(); + + /** + * @return the minPriorityPerJob value. + */ + Integer minPriorityPerJob(); + + /** + * @return the newTier value. + */ + TierType newTier(); + + /** + * @return the provisioningState value. + */ + DataLakeAnalyticsAccountStatus provisioningState(); + + /** + * @return the queryStoreRetention value. + */ + Integer queryStoreRetention(); + + /** + * @return the state value. + */ + DataLakeAnalyticsAccountState state(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * @return the systemMaxDegreeOfParallelism value. + */ + Integer systemMaxDegreeOfParallelism(); + + /** + * @return the systemMaxJobCount value. + */ + Integer systemMaxJobCount(); + + /** + * The entirety of the DataLakeAnalyticsAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithDataLakeStoreAccounts, DefinitionStages.WithDefaultDataLakeStoreAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataLakeAnalyticsAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataLakeAnalyticsAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataLakeAnalyticsAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify DataLakeStoreAccounts. + */ + interface WithDataLakeStoreAccounts { + /** + * Specifies dataLakeStoreAccounts. + * @param dataLakeStoreAccounts The list of Data Lake Store accounts associated with this account + * @return the next definition stage +*/ + WithDefaultDataLakeStoreAccount withDataLakeStoreAccountsForCreate(List dataLakeStoreAccounts); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify DefaultDataLakeStoreAccount. + */ + interface WithDefaultDataLakeStoreAccount { + /** + * Specifies defaultDataLakeStoreAccount. + * @param defaultDataLakeStoreAccount The default Data Lake Store account associated with this account + * @return the next definition stage +*/ + WithCreate withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify ComputePolicies. + */ + interface WithComputePolicies { + /** + * Specifies computePolicies. + * @param computePolicies The list of compute policies associated with this account + * @return the next definition stage + */ + WithCreate withComputePoliciesForCreate(List computePolicies); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify FirewallAllowAzureIps. + */ + interface WithFirewallAllowAzureIps { + /** + * Specifies firewallAllowAzureIps. + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify FirewallRules. + */ + interface WithFirewallRules { + /** + * Specifies firewallRules. + * @param firewallRules The list of firewall rules associated with this account + * @return the next definition stage + */ + WithCreate withFirewallRulesForCreate(List firewallRules); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify FirewallState. + */ + interface WithFirewallState { + /** + * Specifies firewallState. + * @param firewallState The current state of the IP address firewall for this account. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withFirewallState(FirewallState firewallState); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify MaxDegreeOfParallelism. + */ + interface WithMaxDegreeOfParallelism { + /** + * Specifies maxDegreeOfParallelism. + * @param maxDegreeOfParallelism The maximum supported degree of parallelism for this account + * @return the next definition stage + */ + WithCreate withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify MaxDegreeOfParallelismPerJob. + */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies maxDegreeOfParallelismPerJob. + * @param maxDegreeOfParallelismPerJob The maximum supported degree of parallelism per job for this account + * @return the next definition stage + */ + WithCreate withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify MaxJobCount. + */ + interface WithMaxJobCount { + /** + * Specifies maxJobCount. + * @param maxJobCount The maximum supported jobs running under the account at the same time + * @return the next definition stage + */ + WithCreate withMaxJobCount(Integer maxJobCount); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify MinPriorityPerJob. + */ + interface WithMinPriorityPerJob { + /** + * Specifies minPriorityPerJob. + * @param minPriorityPerJob The minimum supported priority per job for this account + * @return the next definition stage + */ + WithCreate withMinPriorityPerJob(Integer minPriorityPerJob); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify NewTier. + */ + interface WithNewTier { + /** + * Specifies newTier. + * @param newTier The commitment tier for the next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * @return the next definition stage + */ + WithCreate withNewTier(TierType newTier); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify QueryStoreRetention. + */ + interface WithQueryStoreRetention { + /** + * Specifies queryStoreRetention. + * @param queryStoreRetention The number of days that job metadata is retained + * @return the next definition stage + */ + WithCreate withQueryStoreRetention(Integer queryStoreRetention); + } + + /** + * The stage of the datalakeanalyticsaccount definition allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The list of Azure Blob Storage accounts associated with this account + * @return the next definition stage + */ + WithCreate withStorageAccountsForCreate(List storageAccounts); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithComputePolicies, DefinitionStages.WithFirewallAllowAzureIps, DefinitionStages.WithFirewallRules, DefinitionStages.WithFirewallState, DefinitionStages.WithMaxDegreeOfParallelism, DefinitionStages.WithMaxDegreeOfParallelismPerJob, DefinitionStages.WithMaxJobCount, DefinitionStages.WithMinPriorityPerJob, DefinitionStages.WithNewTier, DefinitionStages.WithQueryStoreRetention, DefinitionStages.WithStorageAccounts { + } + } + /** + * The template for a DataLakeAnalyticsAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithComputePolicies, UpdateStages.WithDataLakeStoreAccounts, UpdateStages.WithFirewallAllowAzureIps, UpdateStages.WithFirewallRules, UpdateStages.WithFirewallState, UpdateStages.WithMaxDegreeOfParallelism, UpdateStages.WithMaxDegreeOfParallelismPerJob, UpdateStages.WithMaxJobCount, UpdateStages.WithMinPriorityPerJob, UpdateStages.WithNewTier, UpdateStages.WithQueryStoreRetention, UpdateStages.WithStorageAccounts { + } + + /** + * Grouping of DataLakeAnalyticsAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the datalakeanalyticsaccount update allowing to specify ComputePolicies. + */ + interface WithComputePolicies { + /** + * Specifies computePolicies. + * @param computePolicies The list of compute policies associated with this account + * @return the next update stage + */ + Update withComputePoliciesForUpdate(List computePolicies); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify DataLakeStoreAccounts. + */ + interface WithDataLakeStoreAccounts { + /** + * Specifies dataLakeStoreAccounts. + * @param dataLakeStoreAccounts The list of Data Lake Store accounts associated with this account + * @return the next update stage + */ + Update withDataLakeStoreAccountsForUpdate(List dataLakeStoreAccounts); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify FirewallAllowAzureIps. + */ + interface WithFirewallAllowAzureIps { + /** + * Specifies firewallAllowAzureIps. + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify FirewallRules. + */ + interface WithFirewallRules { + /** + * Specifies firewallRules. + * @param firewallRules The list of firewall rules associated with this account + * @return the next update stage + */ + Update withFirewallRulesForUpdate(List firewallRules); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify FirewallState. + */ + interface WithFirewallState { + /** + * Specifies firewallState. + * @param firewallState The current state of the IP address firewall for this account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withFirewallState(FirewallState firewallState); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify MaxDegreeOfParallelism. + */ + interface WithMaxDegreeOfParallelism { + /** + * Specifies maxDegreeOfParallelism. + * @param maxDegreeOfParallelism The maximum supported degree of parallelism for this account + * @return the next update stage + */ + Update withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify MaxDegreeOfParallelismPerJob. + */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies maxDegreeOfParallelismPerJob. + * @param maxDegreeOfParallelismPerJob The maximum supported degree of parallelism per job for this account + * @return the next update stage + */ + Update withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify MaxJobCount. + */ + interface WithMaxJobCount { + /** + * Specifies maxJobCount. + * @param maxJobCount The maximum supported jobs running under the account at the same time + * @return the next update stage + */ + Update withMaxJobCount(Integer maxJobCount); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify MinPriorityPerJob. + */ + interface WithMinPriorityPerJob { + /** + * Specifies minPriorityPerJob. + * @param minPriorityPerJob The minimum supported priority per job for this account + * @return the next update stage + */ + Update withMinPriorityPerJob(Integer minPriorityPerJob); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify NewTier. + */ + interface WithNewTier { + /** + * Specifies newTier. + * @param newTier The commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * @return the next update stage + */ + Update withNewTier(TierType newTier); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify QueryStoreRetention. + */ + interface WithQueryStoreRetention { + /** + * Specifies queryStoreRetention. + * @param queryStoreRetention The number of days that job metadata is retained + * @return the next update stage + */ + Update withQueryStoreRetention(Integer queryStoreRetention); + } + + /** + * The stage of the datalakeanalyticsaccount update allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The list of Azure Blob storage accounts associated with this account + * @return the next update stage + */ + Update withStorageAccountsForUpdate(List storageAccounts); + } + + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountState.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountState.java new file mode 100644 index 0000000000000..de9e52b00b9b7 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountState. + */ +public enum DataLakeAnalyticsAccountState { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Suspended. */ + SUSPENDED("Suspended"); + + /** The actual serialized value for a DataLakeAnalyticsAccountState instance. */ + private String value; + + DataLakeAnalyticsAccountState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountState fromString(String value) { + DataLakeAnalyticsAccountState[] items = DataLakeAnalyticsAccountState.values(); + for (DataLakeAnalyticsAccountState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountStatus.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountStatus.java new file mode 100644 index 0000000000000..a71ca5fe65385 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsAccountStatus.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountStatus. + */ +public enum DataLakeAnalyticsAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"), + + /** Enum value Undeleting. */ + UNDELETING("Undeleting"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a DataLakeAnalyticsAccountStatus instance. */ + private String value; + + DataLakeAnalyticsAccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountStatus fromString(String value) { + DataLakeAnalyticsAccountStatus[] items = DataLakeAnalyticsAccountStatus.values(); + for (DataLakeAnalyticsAccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccountInformation.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccountInformation.java new file mode 100644 index 0000000000000..a3310577903b5 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccountInformation.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeStoreAccountInformationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; + +/** + * Type representing DataLakeStoreAccountInformation. + */ +public interface DataLakeStoreAccountInformation extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the suffix value. + */ + String suffix(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccounts.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccounts.java new file mode 100644 index 0000000000000..cfe0a80fc236c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeStoreAccounts.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeStoreAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataLakeStoreAccounts. + */ +public interface DataLakeStoreAccounts extends HasInner { + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallAllowAzureIpsState.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallAllowAzureIpsState.java new file mode 100644 index 0000000000000..89e9ca8903e1d --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallAllowAzureIpsState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FirewallAllowAzureIpsState. + */ +public enum FirewallAllowAzureIpsState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallAllowAzureIpsState instance. */ + private String value; + + FirewallAllowAzureIpsState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallAllowAzureIpsState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallAllowAzureIpsState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallAllowAzureIpsState fromString(String value) { + FirewallAllowAzureIpsState[] items = FirewallAllowAzureIpsState.values(); + for (FirewallAllowAzureIpsState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRule.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRule.java new file mode 100644 index 0000000000000..b52386b83fd88 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRule.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.FirewallRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; + +/** + * Type representing FirewallRule. + */ +public interface FirewallRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FirewallRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithEndIpAddress, DefinitionStages.WithStartIpAddress, DefinitionStages.WithCreate { + } + + /** + * Grouping of FirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FirewallRule definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the firewallrule definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group + * @param accountName The name of the Data Lake Analytics account + * @return the next definition stage + */ + WithEndIpAddress withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the firewallrule definition allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next definition stage + */ + WithStartIpAddress withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule definition allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next definition stage + */ + WithCreate withStartIpAddress(String startIpAddress); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a FirewallRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEndIpAddress, UpdateStages.WithStartIpAddress { + } + + /** + * Grouping of FirewallRule update stages. + */ + interface UpdateStages { + /** + * The stage of the firewallrule update allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next update stage + */ + Update withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule update allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next update stage + */ + Update withStartIpAddress(String startIpAddress); + } + + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRules.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRules.java new file mode 100644 index 0000000000000..efd6587f17e25 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.FirewallRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FirewallRules. + */ +public interface FirewallRules extends SupportsCreating, HasInner { + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallState.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallState.java new file mode 100644 index 0000000000000..54abcb5819cde --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/FirewallState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FirewallState. + */ +public enum FirewallState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallState instance. */ + private String value; + + FirewallState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallState fromString(String value) { + FirewallState[] items = FirewallState.values(); + for (FirewallState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Locations.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Locations.java new file mode 100644 index 0000000000000..24e18ea978eee --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Locations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCapabilityAsync(String location); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/NameAvailabilityInformation.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/NameAvailabilityInformation.java new file mode 100644 index 0000000000000..057884426330f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/NameAvailabilityInformation.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.NameAvailabilityInformationInner; + +/** + * Type representing NameAvailabilityInformation. + */ +public interface NameAvailabilityInformation extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationDisplay.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationDisplay.java new file mode 100644 index 0000000000000..7084f17772cbd --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a particular operation. + */ +public class OperationDisplay { + /** + * The resource provider of the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The resource type of the operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * A friendly name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * A friendly description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the resource provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get a friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get a friendly description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationListResult.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationListResult.java new file mode 100644 index 0000000000000..3b2f4a3b1bbb0 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationOrigin.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationOrigin.java new file mode 100644 index 0000000000000..c35cb25e96473 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/OperationOrigin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationOrigin. + */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** Static value user,system for OperationOrigin. */ + public static final OperationOrigin USERSYSTEM = fromString("user,system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * @param name a name to look for + * @return the corresponding OperationOrigin + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** + * @return known OperationOrigin values + */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Operations.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Operations.java new file mode 100644 index 0000000000000..fa2464d1dc216 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SasTokenInformation.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SasTokenInformation.java new file mode 100644 index 0000000000000..71b62d38c0cbc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SasTokenInformation.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.SasTokenInformationInner; + +/** + * Type representing SasTokenInformation. + */ +public interface SasTokenInformation extends HasInner, HasManager { + /** + * @return the accessToken value. + */ + String accessToken(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccountInformation.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccountInformation.java new file mode 100644 index 0000000000000..b3d0f365d1ae4 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccountInformation.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.StorageAccountInformationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; + +/** + * Type representing StorageAccountInformation. + */ +public interface StorageAccountInformation extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the suffix value. + */ + String suffix(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccounts.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccounts.java new file mode 100644 index 0000000000000..5c3cc75b381df --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageAccounts.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.StorageAccountsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageContainer; + +/** + * Type representing StorageAccounts. + */ +public interface StorageAccounts extends HasInner { + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAsync(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageContainer.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageContainer.java new file mode 100644 index 0000000000000..5dba6604b960e --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/StorageContainer.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.StorageContainerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import org.joda.time.DateTime; + +/** + * Type representing StorageContainer. + */ +public interface StorageContainer extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SubscriptionState.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SubscriptionState.java new file mode 100644 index 0000000000000..bdad93cffc75b --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/SubscriptionState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SubscriptionState. + */ +public final class SubscriptionState extends ExpandableStringEnum { + /** Static value Registered for SubscriptionState. */ + public static final SubscriptionState REGISTERED = fromString("Registered"); + + /** Static value Suspended for SubscriptionState. */ + public static final SubscriptionState SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for SubscriptionState. */ + public static final SubscriptionState DELETED = fromString("Deleted"); + + /** Static value Unregistered for SubscriptionState. */ + public static final SubscriptionState UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for SubscriptionState. */ + public static final SubscriptionState WARNED = fromString("Warned"); + + /** + * Creates or finds a SubscriptionState from its string representation. + * @param name a name to look for + * @return the corresponding SubscriptionState + */ + @JsonCreator + public static SubscriptionState fromString(String name) { + return fromString(name, SubscriptionState.class); + } + + /** + * @return known SubscriptionState values + */ + public static Collection values() { + return values(SubscriptionState.class); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/TierType.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/TierType.java new file mode 100644 index 0000000000000..29c6ab8d39f79 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/TierType.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TierType. + */ +public enum TierType { + /** Enum value Consumption. */ + CONSUMPTION("Consumption"), + + /** Enum value Commitment_100AUHours. */ + COMMITMENT_100AUHOURS("Commitment_100AUHours"), + + /** Enum value Commitment_500AUHours. */ + COMMITMENT_500AUHOURS("Commitment_500AUHours"), + + /** Enum value Commitment_1000AUHours. */ + COMMITMENT_1000AUHOURS("Commitment_1000AUHours"), + + /** Enum value Commitment_5000AUHours. */ + COMMITMENT_5000AUHOURS("Commitment_5000AUHours"), + + /** Enum value Commitment_10000AUHours. */ + COMMITMENT_10000AUHOURS("Commitment_10000AUHours"), + + /** Enum value Commitment_50000AUHours. */ + COMMITMENT_50000AUHOURS("Commitment_50000AUHours"), + + /** Enum value Commitment_100000AUHours. */ + COMMITMENT_100000AUHOURS("Commitment_100000AUHours"), + + /** Enum value Commitment_500000AUHours. */ + COMMITMENT_500000AUHOURS("Commitment_500000AUHours"); + + /** The actual serialized value for a TierType instance. */ + private String value; + + TierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TierType instance. + * + * @param value the serialized value to parse. + * @return the parsed TierType object, or null if unable to parse. + */ + @JsonCreator + public static TierType fromString(String value) { + TierType[] items = TierType.values(); + for (TierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyParameters.java new file mode 100644 index 0000000000000..6c11087b8cfcc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyParameters.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a compute policy. + */ +@JsonFlatten +public class UpdateComputePolicyParameters { + /** + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId") + private UUID objectId; + + /** + * The type of AAD object the object identifier refers to. Possible values + * include: 'User', 'Group', 'ServicePrincipal'. + */ + @JsonProperty(value = "properties.objectType") + private AADObjectType objectType; + + /** + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the AAD object identifier for the entity to create a policy for. + * + * @return the objectId value + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @return the objectType value + */ + public AADObjectType objectType() { + return this.objectType; + } + + /** + * Set the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @param objectType the objectType value to set + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withObjectType(AADObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyWithAccountParameters.java new file mode 100644 index 0000000000000..8f399262929fa --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateComputePolicyWithAccountParameters.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a compute policy while updating a Data Lake + * Analytics account. + */ +@JsonFlatten +public class UpdateComputePolicyWithAccountParameters { + /** + * The unique name of the compute policy to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId") + private UUID objectId; + + /** + * The type of AAD object the object identifier refers to. Possible values + * include: 'User', 'Group', 'ServicePrincipal'. + */ + @JsonProperty(value = "properties.objectType") + private AADObjectType objectType; + + /** + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the unique name of the compute policy to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the compute policy to update. + * + * @param name the name value to set + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the AAD object identifier for the entity to create a policy for. + * + * @return the objectId value + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @return the objectType value + */ + public AADObjectType objectType() { + return this.objectType; + } + + /** + * Set the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @param objectType the objectType value to set + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withObjectType(AADObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum degree of parallelism per job this user can use to submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum priority per job this user can use to submit jobs. This property, the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeAnalyticsAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeAnalyticsAccountParameters.java new file mode 100644 index 0000000000000..519a969a8e177 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeAnalyticsAccountParameters.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters that can be used to update an existing Data Lake Analytics + * account. + */ +@JsonFlatten +public class UpdateDataLakeAnalyticsAccountParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts") + private List dataLakeStoreAccounts; + + /** + * The list of Azure Blob storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies") + private List computePolicies; + + /** + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /** + * The current state of the IP address firewall for this account. Disabling + * the firewall does not remove existing rules, they will just be ignored + * until the firewall is re-enabled. Possible values include: 'Enabled', + * 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The commitment tier to use for next month. Possible values include: + * 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', + * 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /** + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount") + private Integer maxJobCount; + + /** + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /** + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention") + private Integer queryStoreRetention; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the list of Data Lake Store accounts associated with this account. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withDataLakeStoreAccounts(List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + return this; + } + + /** + * Get the list of Azure Blob storage accounts associated with this account. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the list of Azure Blob storage accounts associated with this account. + * + * @param storageAccounts the storageAccounts value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the list of compute policies associated with this account. + * + * @return the computePolicies value + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Set the list of compute policies associated with this account. + * + * @param computePolicies the computePolicies value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withComputePolicies(List computePolicies) { + this.computePolicies = computePolicies; + return this; + } + + /** + * Get the list of firewall rules associated with this account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the list of firewall rules associated with this account. + * + * @param firewallRules the firewallRules value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the current state of the IP address firewall for this account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the current state of the IP address firewall for this account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallState the firewallState value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @param newTier the newTier value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the maximum supported degree of parallelism per job for this account. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maximum supported degree of parallelism per job for this account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minimum supported priority per job for this account. + * + * @param minPriorityPerJob the minPriorityPerJob value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Get the number of days that job metadata is retained. + * + * @return the queryStoreRetention value + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeStoreWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeStoreWithAccountParameters.java new file mode 100644 index 0000000000000..3e4f4bdaa2f38 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateDataLakeStoreWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a Data Lake Store account while updating a + * Data Lake Analytics account. + */ +@JsonFlatten +public class UpdateDataLakeStoreWithAccountParameters { + /** + * The unique name of the Data Lake Store account to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the unique name of the Data Lake Store account to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the Data Lake Store account to update. + * + * @param name the name value to set + * @return the UpdateDataLakeStoreWithAccountParameters object itself. + */ + public UpdateDataLakeStoreWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the optional suffix for the Data Lake Store account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set + * @return the UpdateDataLakeStoreWithAccountParameters object itself. + */ + public UpdateDataLakeStoreWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleParameters.java new file mode 100644 index 0000000000000..953bb9844b97e --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a firewall rule. + */ +@JsonFlatten +public class UpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java new file mode 100644 index 0000000000000..ecb895fad53dc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a firewall rule while updating a Data Lake + * Analytics account. + */ +@JsonFlatten +public class UpdateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the unique name of the firewall rule to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the firewall rule to update. + * + * @param name the name value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountParameters.java new file mode 100644 index 0000000000000..31ca4e4a7cd7f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update an Azure Storage account. + */ +@JsonFlatten +public class UpdateStorageAccountParameters { + /** + * The updated access key associated with this Azure Storage account that + * will be used to connect to it. + */ + @JsonProperty(value = "properties.accessKey") + private String accessKey; + + /** + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the updated access key associated with this Azure Storage account that will be used to connect to it. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the updated access key associated with this Azure Storage account that will be used to connect to it. + * + * @param accessKey the accessKey value to set + * @return the UpdateStorageAccountParameters object itself. + */ + public UpdateStorageAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the optional suffix for the storage account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the storage account. + * + * @param suffix the suffix value to set + * @return the UpdateStorageAccountParameters object itself. + */ + public UpdateStorageAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountWithAccountParameters.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountWithAccountParameters.java new file mode 100644 index 0000000000000..0a5efe31c4f12 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/UpdateStorageAccountWithAccountParameters.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update an Azure Storage account while updating a Data + * Lake Analytics account. + */ +@JsonFlatten +public class UpdateStorageAccountWithAccountParameters { + /** + * The unique name of the Azure Storage account to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The updated access key associated with this Azure Storage account that + * will be used to connect to it. + */ + @JsonProperty(value = "properties.accessKey") + private String accessKey; + + /** + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the unique name of the Azure Storage account to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the Azure Storage account to update. + * + * @param name the name value to set + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the updated access key associated with this Azure Storage account that will be used to connect to it. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the updated access key associated with this Azure Storage account that will be used to connect to it. + * + * @param accessKey the accessKey value to set + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the optional suffix for the storage account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the optional suffix for the storage account. + * + * @param suffix the suffix value to set + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..7e328372cea83 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.NameAvailabilityInformation; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CheckNameAvailabilityParameters; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(DataLakeAnalyticsAccountBasicInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeAnalyticsAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeAnalyticsAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AccountsInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(DataLakeAnalyticsAccountBasicInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeAnalyticsAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + AccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeAnalyticsAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccount call(DataLakeAnalyticsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataLakeAnalyticsAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DataLakeAnalyticsAccountImpl wrapModel(DataLakeAnalyticsAccountInner inner) { + return new DataLakeAnalyticsAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected DataLakeAnalyticsAccountImpl wrapModel(String name) { + return new DataLakeAnalyticsAccountImpl(name, new DataLakeAnalyticsAccountInner(), this.manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) { + AccountsInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, parameters) + .map(new Func1() { + @Override + public NameAvailabilityInformation call(NameAvailabilityInformationInner inner) { + return new NameAvailabilityInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java new file mode 100644 index 0000000000000..683f23f5425ef --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java @@ -0,0 +1,1662 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateDataLakeAnalyticsAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateDataLakeAnalyticsAccountParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body CreateDataLakeAnalyticsAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body CreateDataLakeAnalyticsAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body UpdateDataLakeAnalyticsAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body UpdateDataLakeAnalyticsAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Body CheckNameAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.list(this.client.subscriptionId(), filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listSinglePageAsync(filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listWithServiceResponseAsync(filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listSinglePageAsync(filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner create(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner beginCreate(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner update(String resourceGroupName, String accountName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateDataLakeAnalyticsAccountParameters parameters = null; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner update(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner beginUpdate(String resourceGroupName, String accountName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateDataLakeAnalyticsAccountParameters parameters = null; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeAnalyticsAccountInner object if successful. + */ + public DataLakeAnalyticsAccountInner beginUpdate(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeAnalyticsAccountInner>() { + @Override + public DataLakeAnalyticsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeAnalyticsAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityInformationInner object if successful. + */ + public NameAvailabilityInformationInner checkNameAvailability(String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInformationInner object + */ + public Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityInformationInner>() { + @Override + public NameAvailabilityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInformationInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, CheckNameAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), location, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeAnalyticsAccountBasicInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeAnalyticsAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationImpl.java new file mode 100644 index 0000000000000..710469c1151f5 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CapabilityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.SubscriptionState; +import java.util.UUID; + +class CapabilityInformationImpl extends WrapperImpl implements CapabilityInformation { + private final DataLakeAnalyticsManager manager; + CapabilityInformationImpl(CapabilityInformationInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public Integer accountCount() { + return this.inner().accountCount(); + } + + @Override + public Integer maxAccountCount() { + return this.inner().maxAccountCount(); + } + + @Override + public Boolean migrationState() { + return this.inner().migrationState(); + } + + @Override + public SubscriptionState state() { + return this.inner().state(); + } + + @Override + public UUID subscriptionId() { + return this.inner().subscriptionId(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationInner.java new file mode 100644 index 0000000000000..e2cc9639b1f34 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/CapabilityInformationInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.SubscriptionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subscription-level properties and limits for Data Lake Analytics. + */ +public class CapabilityInformationInner { + /** + * The subscription credentials that uniquely identifies the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; + + /** + * The subscription state. Possible values include: 'Registered', + * 'Suspended', 'Deleted', 'Unregistered', 'Warned'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SubscriptionState state; + + /** + * The maximum supported number of accounts under this subscription. + */ + @JsonProperty(value = "maxAccountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxAccountCount; + + /** + * The current number of accounts under this subscription. + */ + @JsonProperty(value = "accountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer accountCount; + + /** + * The Boolean value of true or false to indicate the maintenance state. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private Boolean migrationState; + + /** + * Get the subscription credentials that uniquely identifies the subscription. + * + * @return the subscriptionId value + */ + public UUID subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscription state. Possible values include: 'Registered', 'Suspended', 'Deleted', 'Unregistered', 'Warned'. + * + * @return the state value + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Get the maximum supported number of accounts under this subscription. + * + * @return the maxAccountCount value + */ + public Integer maxAccountCount() { + return this.maxAccountCount; + } + + /** + * Get the current number of accounts under this subscription. + * + * @return the accountCount value + */ + public Integer accountCount() { + return this.accountCount; + } + + /** + * Get the Boolean value of true or false to indicate the maintenance state. + * + * @return the migrationState value + */ + public Boolean migrationState() { + return this.migrationState; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesImpl.java new file mode 100644 index 0000000000000..1c35360a32770 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicy; + +class ComputePoliciesImpl extends WrapperImpl implements ComputePolicies { + private final DataLakeAnalyticsManager manager; + + ComputePoliciesImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().computePolicies()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public ComputePolicyImpl define(String name) { + return wrapModel(name); + } + + private ComputePolicyImpl wrapModel(ComputePolicyInner inner) { + return new ComputePolicyImpl(inner, manager()); + } + + private ComputePolicyImpl wrapModel(String name) { + return new ComputePolicyImpl(name, this.manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + ComputePoliciesInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ComputePolicy call(ComputePolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String computePolicyName) { + ComputePoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, computePolicyName) + .map(new Func1() { + @Override + public ComputePolicy call(ComputePolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String computePolicyName) { + ComputePoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, computePolicyName).toCompletable(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java new file mode 100644 index 0000000000000..ae9cac62d5cfc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateOrUpdateComputePolicyParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateComputePolicyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ComputePolicies. + */ +public class ComputePoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ComputePoliciesService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of ComputePoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComputePoliciesInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(ComputePoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ComputePolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ComputePoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("computePolicyName") String computePolicyName, @Body CreateOrUpdateComputePolicyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("computePolicyName") String computePolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("computePolicyName") String computePolicyName, @Body UpdateComputePolicyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("computePolicyName") String computePolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ComputePolicyInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ComputePolicyInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ComputePolicyInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ComputePolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComputePolicyInner object if successful. + */ + public ComputePolicyInner createOrUpdate(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per job property, min priority per job property, or both must be present. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters).map(new Func1, ComputePolicyInner>() { + @Override + public ComputePolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (computePolicyName == null) { + throw new IllegalArgumentException("Parameter computePolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, computePolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComputePolicyInner object if successful. + */ + public ComputePolicyInner get(String resourceGroupName, String accountName, String computePolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String computePolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName), serviceCallback); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String computePolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).map(new Func1, ComputePolicyInner>() { + @Override + public ComputePolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String computePolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (computePolicyName == null) { + throw new IllegalArgumentException("Parameter computePolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, computePolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComputePolicyInner object if successful. + */ + public ComputePolicyInner update(String resourceGroupName, String accountName, String computePolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).toBlocking().single().body(); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String computePolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName), serviceCallback); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String computePolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).map(new Func1, ComputePolicyInner>() { + @Override + public ComputePolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String computePolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (computePolicyName == null) { + throw new IllegalArgumentException("Parameter computePolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateComputePolicyParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, computePolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComputePolicyInner object if successful. + */ + public ComputePolicyInner update(String resourceGroupName, String accountName, String computePolicyName, UpdateComputePolicyParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String computePolicyName, UpdateComputePolicyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters), serviceCallback); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String computePolicyName, UpdateComputePolicyParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters).map(new Func1, ComputePolicyInner>() { + @Override + public ComputePolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComputePolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String computePolicyName, UpdateComputePolicyParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (computePolicyName == null) { + throw new IllegalArgumentException("Parameter computePolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, computePolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String computePolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).toBlocking().single().body(); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String computePolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName), serviceCallback); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String computePolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String computePolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (computePolicyName == null) { + throw new IllegalArgumentException("Parameter computePolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, computePolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ComputePolicyInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ComputePolicyInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ComputePolicyInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account supports, at most, 50 policies. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ComputePolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyImpl.java new file mode 100644 index 0000000000000..7aa7bea2919c3 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateComputePolicyParameters; +import java.util.UUID; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateOrUpdateComputePolicyParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AADObjectType; +import rx.functions.Func1; + +class ComputePolicyImpl extends CreatableUpdatableImpl implements ComputePolicy, ComputePolicy.Definition, ComputePolicy.Update { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String computePolicyName; + private CreateOrUpdateComputePolicyParameters createParameter; + private UpdateComputePolicyParameters updateParameter; + + ComputePolicyImpl(String name, DataLakeAnalyticsManager manager) { + super(name, new ComputePolicyInner()); + this.manager = manager; + // Set resource name + this.computePolicyName = name; + // + this.createParameter = new CreateOrUpdateComputePolicyParameters(); + this.updateParameter = new UpdateComputePolicyParameters(); + } + + ComputePolicyImpl(ComputePolicyInner inner, DataLakeAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.computePolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.computePolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "computePolicies"); + // + this.createParameter = new CreateOrUpdateComputePolicyParameters(); + this.updateParameter = new UpdateComputePolicyParameters(); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ComputePoliciesInner client = this.manager().inner().computePolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.computePolicyName, this.createParameter) + .map(new Func1() { + @Override + public ComputePolicyInner call(ComputePolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ComputePoliciesInner client = this.manager().inner().computePolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.computePolicyName, this.updateParameter) + .map(new Func1() { + @Override + public ComputePolicyInner call(ComputePolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ComputePoliciesInner client = this.manager().inner().computePolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.computePolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateOrUpdateComputePolicyParameters(); + this.updateParameter = new UpdateComputePolicyParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer maxDegreeOfParallelismPerJob() { + return this.inner().maxDegreeOfParallelismPerJob(); + } + + @Override + public Integer minPriorityPerJob() { + return this.inner().minPriorityPerJob(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public UUID objectId() { + return this.inner().objectId(); + } + + @Override + public AADObjectType objectType() { + return this.inner().objectType(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ComputePolicyImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ComputePolicyImpl withObjectId(UUID objectId) { + if (isInCreateMode()) { + this.createParameter.withObjectId(objectId); + } else { + this.updateParameter.withObjectId(objectId); + } + return this; + } + + @Override + public ComputePolicyImpl withObjectType(AADObjectType objectType) { + if (isInCreateMode()) { + this.createParameter.withObjectType(objectType); + } else { + this.updateParameter.withObjectType(objectType); + } + return this; + } + + @Override + public ComputePolicyImpl withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + if (isInCreateMode()) { + this.createParameter.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + } else { + this.updateParameter.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + } + return this; + } + + @Override + public ComputePolicyImpl withMinPriorityPerJob(Integer minPriorityPerJob) { + if (isInCreateMode()) { + this.createParameter.withMinPriorityPerJob(minPriorityPerJob); + } else { + this.updateParameter.withMinPriorityPerJob(minPriorityPerJob); + } + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyInner.java new file mode 100644 index 0000000000000..b978fafcabfe2 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePolicyInner.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AADObjectType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Analytics compute policy information. + */ +@JsonFlatten +public class ComputePolicyInner extends SubResource { + /** + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID objectId; + + /** + * The type of AAD object the object identifier refers to. Possible values + * include: 'User', 'Group', 'ServicePrincipal'. + */ + @JsonProperty(value = "properties.objectType", access = JsonProperty.Access.WRITE_ONLY) + private AADObjectType objectType; + + /** + * The maximum degree of parallelism per job this user can use to submit + * jobs. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum priority per job this user can use to submit jobs. + */ + @JsonProperty(value = "properties.minPriorityPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer minPriorityPerJob; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the AAD object identifier for the entity to create a policy for. + * + * @return the objectId value + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Get the type of AAD object the object identifier refers to. Possible values include: 'User', 'Group', 'ServicePrincipal'. + * + * @return the objectType value + */ + public AADObjectType objectType() { + return this.objectType; + } + + /** + * Get the maximum degree of parallelism per job this user can use to submit jobs. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Get the minimum priority per job this user can use to submit jobs. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountBasicInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountBasicInner.java new file mode 100644 index 0000000000000..97eceba58e33c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountBasicInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountStatus; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Data Lake Analytics account object, containing all information associated + * with the named Data Lake Analytics account. + */ +@JsonFlatten +@SkipParentValidation +public class DataLakeAnalyticsAccountBasicInner extends Resource { + /** + * The unique identifier associated with this Data Lake Analytics account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /** + * The provisioning status of the Data Lake Analytics account. Possible + * values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', + * 'Undeleting', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /** + * The state of the Data Lake Analytics account. Possible values include: + * 'Active', 'Suspended'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /** + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioning status of the Data Lake Analytics account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled'. + * + * @return the provisioningState value + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state of the Data Lake Analytics account. Possible values include: 'Active', 'Suspended'. + * + * @return the state value + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the full CName endpoint for this account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountImpl.java new file mode 100644 index 0000000000000..704fd0b4946fc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountImpl.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccount; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateDataLakeAnalyticsAccountParameters; +import java.util.List; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateDataLakeAnalyticsAccountParameters; +import java.util.UUID; +import java.util.ArrayList; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicy; +import org.joda.time.DateTime; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.TierType; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccountInformation; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallAllowAzureIpsState; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRule; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallState; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountStatus; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountState; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccountInformation; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AddDataLakeStoreWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateComputePolicyWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateFirewallRuleWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AddStorageAccountWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateComputePolicyWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateDataLakeStoreWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateFirewallRuleWithAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateStorageAccountWithAccountParameters; +import rx.functions.Func1; + +class DataLakeAnalyticsAccountImpl extends GroupableResourceCoreImpl implements DataLakeAnalyticsAccount, DataLakeAnalyticsAccount.Definition, DataLakeAnalyticsAccount.Update { + private CreateDataLakeAnalyticsAccountParameters createParameter; + private UpdateDataLakeAnalyticsAccountParameters updateParameter; + DataLakeAnalyticsAccountImpl(String name, DataLakeAnalyticsAccountInner inner, DataLakeAnalyticsManager manager) { + super(name, inner, manager); + this.createParameter = new CreateDataLakeAnalyticsAccountParameters(); + this.updateParameter = new UpdateDataLakeAnalyticsAccountParameters(); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccountInner call(DataLakeAnalyticsAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DataLakeAnalyticsAccountInner call(DataLakeAnalyticsAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateDataLakeAnalyticsAccountParameters(); + this.updateParameter = new UpdateDataLakeAnalyticsAccountParameters(); + } + + @Override + public UUID accountId() { + return this.inner().accountId(); + } + + @Override + public List computePolicies() { + List lst = new ArrayList(); + if (this.inner().computePolicies() != null) { + for (ComputePolicyInner inner : this.inner().computePolicies()) { + lst.add( new ComputePolicyImpl(inner, manager())); + } + } + return lst; + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public TierType currentTier() { + return this.inner().currentTier(); + } + + @Override + public List dataLakeStoreAccounts() { + List lst = new ArrayList(); + if (this.inner().dataLakeStoreAccounts() != null) { + for (DataLakeStoreAccountInformationInner inner : this.inner().dataLakeStoreAccounts()) { + lst.add( new DataLakeStoreAccountInformationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String defaultDataLakeStoreAccount() { + return this.inner().defaultDataLakeStoreAccount(); + } + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.inner().firewallAllowAzureIps(); + } + + @Override + public List firewallRules() { + List lst = new ArrayList(); + if (this.inner().firewallRules() != null) { + for (FirewallRuleInner inner : this.inner().firewallRules()) { + lst.add( new FirewallRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public FirewallState firewallState() { + return this.inner().firewallState(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public Integer maxDegreeOfParallelism() { + return this.inner().maxDegreeOfParallelism(); + } + + @Override + public Integer maxDegreeOfParallelismPerJob() { + return this.inner().maxDegreeOfParallelismPerJob(); + } + + @Override + public Integer maxJobCount() { + return this.inner().maxJobCount(); + } + + @Override + public Integer minPriorityPerJob() { + return this.inner().minPriorityPerJob(); + } + + @Override + public TierType newTier() { + return this.inner().newTier(); + } + + @Override + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Integer queryStoreRetention() { + return this.inner().queryStoreRetention(); + } + + @Override + public DataLakeAnalyticsAccountState state() { + return this.inner().state(); + } + + @Override + public List storageAccounts() { + List lst = new ArrayList(); + if (this.inner().storageAccounts() != null) { + for (StorageAccountInformationInner inner : this.inner().storageAccounts()) { + lst.add( new StorageAccountInformationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Integer systemMaxDegreeOfParallelism() { + return this.inner().systemMaxDegreeOfParallelism(); + } + + @Override + public Integer systemMaxJobCount() { + return this.inner().systemMaxJobCount(); + } + + @Override + public DataLakeAnalyticsAccountImpl withDataLakeStoreAccountsForCreate(List dataLakeStoreAccounts) { + this.createParameter.withDataLakeStoreAccounts(dataLakeStoreAccounts); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount) { + this.createParameter.withDefaultDataLakeStoreAccount(defaultDataLakeStoreAccount); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withComputePoliciesForCreate(List computePolicies) { + this.createParameter.withComputePolicies(computePolicies); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withFirewallRulesForCreate(List firewallRules) { + this.createParameter.withFirewallRules(firewallRules); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withStorageAccountsForCreate(List storageAccounts) { + this.createParameter.withStorageAccounts(storageAccounts); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withComputePoliciesForUpdate(List computePolicies) { + this.updateParameter.withComputePolicies(computePolicies); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withDataLakeStoreAccountsForUpdate(List dataLakeStoreAccounts) { + this.updateParameter.withDataLakeStoreAccounts(dataLakeStoreAccounts); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withFirewallRulesForUpdate(List firewallRules) { + this.updateParameter.withFirewallRules(firewallRules); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withStorageAccountsForUpdate(List storageAccounts) { + this.updateParameter.withStorageAccounts(storageAccounts); + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + if (isInCreateMode()) { + this.createParameter.withFirewallAllowAzureIps(firewallAllowAzureIps); + } else { + this.updateParameter.withFirewallAllowAzureIps(firewallAllowAzureIps); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withFirewallState(FirewallState firewallState) { + if (isInCreateMode()) { + this.createParameter.withFirewallState(firewallState); + } else { + this.updateParameter.withFirewallState(firewallState); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + if (isInCreateMode()) { + this.createParameter.withMaxDegreeOfParallelism(maxDegreeOfParallelism); + } else { + this.updateParameter.withMaxDegreeOfParallelism(maxDegreeOfParallelism); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + if (isInCreateMode()) { + this.createParameter.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + } else { + this.updateParameter.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withMaxJobCount(Integer maxJobCount) { + if (isInCreateMode()) { + this.createParameter.withMaxJobCount(maxJobCount); + } else { + this.updateParameter.withMaxJobCount(maxJobCount); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withMinPriorityPerJob(Integer minPriorityPerJob) { + if (isInCreateMode()) { + this.createParameter.withMinPriorityPerJob(minPriorityPerJob); + } else { + this.updateParameter.withMinPriorityPerJob(minPriorityPerJob); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withNewTier(TierType newTier) { + if (isInCreateMode()) { + this.createParameter.withNewTier(newTier); + } else { + this.updateParameter.withNewTier(newTier); + } + return this; + } + + @Override + public DataLakeAnalyticsAccountImpl withQueryStoreRetention(Integer queryStoreRetention) { + if (isInCreateMode()) { + this.createParameter.withQueryStoreRetention(queryStoreRetention); + } else { + this.updateParameter.withQueryStoreRetention(queryStoreRetention); + } + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountInner.java new file mode 100644 index 0000000000000..a7fbec4010220 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountInner.java @@ -0,0 +1,381 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountStatus; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeAnalyticsAccountState; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallState; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallAllowAzureIpsState; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.TierType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Data Lake Analytics account object, containing all information associated + * with the named Data Lake Analytics account. + */ +@JsonFlatten +@SkipParentValidation +public class DataLakeAnalyticsAccountInner extends Resource { + /** + * The unique identifier associated with this Data Lake Analytics account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /** + * The provisioning status of the Data Lake Analytics account. Possible + * values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', + * 'Undeleting', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /** + * The state of the Data Lake Analytics account. Possible values include: + * 'Active', 'Suspended'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /** + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * The default Data Lake Store account associated with this account. + */ + @JsonProperty(value = "properties.defaultDataLakeStoreAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDataLakeStoreAccount; + + /** + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List dataLakeStoreAccounts; + + /** + * The list of Azure Blob Storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List storageAccounts; + + /** + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies", access = JsonProperty.Access.WRITE_ONLY) + private List computePolicies; + + /** + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules", access = JsonProperty.Access.WRITE_ONLY) + private List firewallRules; + + /** + * The current state of the IP address firewall for this account. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState", access = JsonProperty.Access.WRITE_ONLY) + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps", access = JsonProperty.Access.WRITE_ONLY) + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The commitment tier for the next month. Possible values include: + * 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', + * 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + */ + @JsonProperty(value = "properties.newTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType newTier; + + /** + * The commitment tier in use for the current month. Possible values + * include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', + * 'Commitment_5000AUHours', 'Commitment_10000AUHours', + * 'Commitment_50000AUHours', 'Commitment_100000AUHours', + * 'Commitment_500000AUHours'. + */ + @JsonProperty(value = "properties.currentTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType currentTier; + + /** + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxJobCount; + + /** + * The system defined maximum supported jobs running under the account at + * the same time, which restricts the maximum number of running jobs the + * user can set for the account. + */ + @JsonProperty(value = "properties.systemMaxJobCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxJobCount; + + /** + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxDegreeOfParallelism; + + /** + * The system defined maximum supported degree of parallelism for this + * account, which restricts the maximum value of parallelism the user can + * set for the account. + */ + @JsonProperty(value = "properties.systemMaxDegreeOfParallelism", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxDegreeOfParallelism; + + /** + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxDegreeOfParallelismPerJob; + + /** + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer minPriorityPerJob; + + /** + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention", access = JsonProperty.Access.WRITE_ONLY) + private Integer queryStoreRetention; + + /** + * Get the unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioning status of the Data Lake Analytics account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled'. + * + * @return the provisioningState value + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state of the Data Lake Analytics account. Possible values include: 'Active', 'Suspended'. + * + * @return the state value + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the full CName endpoint for this account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Get the list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Get the list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Get the list of compute policies associated with this account. + * + * @return the computePolicies value + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Get the list of firewall rules associated with this account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Get the current state of the IP address firewall for this account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Get the commitment tier for the next month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Get the commitment tier in use for the current month. Possible values include: 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours'. + * + * @return the currentTier value + */ + public TierType currentTier() { + return this.currentTier; + } + + /** + * Get the maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Get the system defined maximum supported jobs running under the account at the same time, which restricts the maximum number of running jobs the user can set for the account. + * + * @return the systemMaxJobCount value + */ + public Integer systemMaxJobCount() { + return this.systemMaxJobCount; + } + + /** + * Get the maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Get the system defined maximum supported degree of parallelism for this account, which restricts the maximum value of parallelism the user can set for the account. + * + * @return the systemMaxDegreeOfParallelism value + */ + public Integer systemMaxDegreeOfParallelism() { + return this.systemMaxDegreeOfParallelism; + } + + /** + * Get the maximum supported degree of parallelism per job for this account. + * + * @return the maxDegreeOfParallelismPerJob value + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Get the minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Get the number of days that job metadata is retained. + * + * @return the queryStoreRetention value + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountManagementClientImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountManagementClientImpl.java new file mode 100644 index 0000000000000..bad48b3065ae6 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsAccountManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataLakeAnalyticsAccountManagementClientImpl class. + */ +public class DataLakeAnalyticsAccountManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataLakeAnalyticsAccountManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The DataLakeStoreAccountsInner object to access its operations. + */ + private DataLakeStoreAccountsInner dataLakeStoreAccounts; + + /** + * Gets the DataLakeStoreAccountsInner object to access its operations. + * @return the DataLakeStoreAccountsInner object. + */ + public DataLakeStoreAccountsInner dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * The StorageAccountsInner object to access its operations. + */ + private StorageAccountsInner storageAccounts; + + /** + * Gets the StorageAccountsInner object to access its operations. + * @return the StorageAccountsInner object. + */ + public StorageAccountsInner storageAccounts() { + return this.storageAccounts; + } + + /** + * The ComputePoliciesInner object to access its operations. + */ + private ComputePoliciesInner computePolicies; + + /** + * Gets the ComputePoliciesInner object to access its operations. + * @return the ComputePoliciesInner object. + */ + public ComputePoliciesInner computePolicies() { + return this.computePolicies; + } + + /** + * The FirewallRulesInner object to access its operations. + */ + private FirewallRulesInner firewallRules; + + /** + * Gets the FirewallRulesInner object to access its operations. + * @return the FirewallRulesInner object. + */ + public FirewallRulesInner firewallRules() { + return this.firewallRules; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataLakeAnalyticsAccountManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-11-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.dataLakeStoreAccounts = new DataLakeStoreAccountsInner(restClient().retrofit(), this); + this.storageAccounts = new StorageAccountsInner(restClient().retrofit(), this); + this.computePolicies = new ComputePoliciesInner(restClient().retrofit(), this); + this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataLakeAnalyticsAccountManagementClient", "2016-11-01"); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsManager.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsManager.java new file mode 100644 index 0000000000000..19e4ef24729e5 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeAnalyticsManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Accounts; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.ComputePolicies; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Operations; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Locations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataLakeAnalytics resource management. + */ +public final class DataLakeAnalyticsManager extends ManagerCore { + private Accounts accounts; + private DataLakeStoreAccounts dataLakeStoreAccounts; + private StorageAccounts storageAccounts; + private ComputePolicies computePolicies; + private FirewallRules firewallRules; + private Operations operations; + private Locations locations; + /** + * Get a Configurable instance that can be used to create DataLakeAnalyticsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataLakeAnalyticsManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataLakeAnalyticsManager + */ + public static DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataLakeAnalyticsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataLakeAnalyticsManager + */ + public static DataLakeAnalyticsManager authenticate(RestClient restClient, String subscriptionId) { + return new DataLakeAnalyticsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataLakeAnalyticsManager that exposes DataLakeAnalytics management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataLakeAnalytics management API entry points that work across subscriptions + */ + DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * @return Entry point to manage DataLakeStoreAccounts. + */ + public DataLakeStoreAccounts dataLakeStoreAccounts() { + if (this.dataLakeStoreAccounts == null) { + this.dataLakeStoreAccounts = new DataLakeStoreAccountsImpl(this); + } + return this.dataLakeStoreAccounts; + } + + /** + * @return Entry point to manage StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(this); + } + return this.storageAccounts; + } + + /** + * @return Entry point to manage ComputePolicies. + */ + public ComputePolicies computePolicies() { + if (this.computePolicies == null) { + this.computePolicies = new ComputePoliciesImpl(this); + } + return this.computePolicies; + } + + /** + * @return Entry point to manage FirewallRules. + */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(this); + } + return this.firewallRules; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataLakeAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataLakeAnalyticsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataLakeAnalyticsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataLakeAnalyticsAccountManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationImpl.java new file mode 100644 index 0000000000000..2ce21ce7ad912 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccountInformation; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class DataLakeStoreAccountInformationImpl extends IndexableRefreshableWrapperImpl implements DataLakeStoreAccountInformation { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String dataLakeStoreAccountName; + + DataLakeStoreAccountInformationImpl(DataLakeStoreAccountInformationInner inner, DataLakeAnalyticsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.dataLakeStoreAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataLakeStoreAccounts"); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DataLakeStoreAccountsInner client = this.manager().inner().dataLakeStoreAccounts(); + return client.getAsync(this.resourceGroupName, this.accountName, this.dataLakeStoreAccountName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String suffix() { + return this.inner().suffix(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationInner.java new file mode 100644 index 0000000000000..65231a57fe0d0 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountInformationInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Store account information. + */ +@JsonFlatten +public class DataLakeStoreAccountInformationInner extends SubResource { + /** + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix", access = JsonProperty.Access.WRITE_ONLY) + private String suffix; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the optional suffix for the Data Lake Store account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsImpl.java new file mode 100644 index 0000000000000..21c1992f4fccf --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccountInformation; + +class DataLakeStoreAccountsImpl extends WrapperImpl implements DataLakeStoreAccounts { + private final DataLakeAnalyticsManager manager; + + DataLakeStoreAccountsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().dataLakeStoreAccounts()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + private DataLakeStoreAccountInformationImpl wrapModel(DataLakeStoreAccountInformationInner inner) { + return new DataLakeStoreAccountInformationImpl(inner, manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + DataLakeStoreAccountsInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccountInformation call(DataLakeStoreAccountInformationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + DataLakeStoreAccountsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, dataLakeStoreAccountName) + .map(new Func1() { + @Override + public DataLakeStoreAccountInformation call(DataLakeStoreAccountInformationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + DataLakeStoreAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toCompletable(); + } + + @Override + public Completable addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + DataLakeStoreAccountsInner client = this.inner(); + return client.addAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toCompletable(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java new file mode 100644 index 0000000000000..0849c22c215df --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AddDataLakeStoreParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataLakeStoreAccounts. + */ +public class DataLakeStoreAccountsInner { + /** The Retrofit service to perform REST calls. */ + private DataLakeStoreAccountsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of DataLakeStoreAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataLakeStoreAccountsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(DataLakeStoreAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeStoreAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface DataLakeStoreAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/dataLakeStoreAccounts") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts add" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}") + Observable> add(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Body AddDataLakeStoreParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.DataLakeStoreAccounts listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInformationInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInformationInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void add(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final AddDataLakeStoreParameters parameters = null; + return service.add(this.client.subscriptionId(), resourceGroupName, accountName, dataLakeStoreAccountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void add(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + return addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.add(this.client.subscriptionId(), resourceGroupName, accountName, dataLakeStoreAccountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInformationInner object if successful. + */ + public DataLakeStoreAccountInformationInner get(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInformationInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1, DataLakeStoreAccountInformationInner>() { + @Override + public DataLakeStoreAccountInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInformationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, dataLakeStoreAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, dataLakeStoreAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInformationInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInformationInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleImpl.java new file mode 100644 index 0000000000000..619ac1bb8a883 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateFirewallRuleParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateOrUpdateFirewallRuleParameters; +import rx.functions.Func1; + +class FirewallRuleImpl extends CreatableUpdatableImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String firewallRuleName; + private CreateOrUpdateFirewallRuleParameters createParameter; + private UpdateFirewallRuleParameters updateParameter; + + FirewallRuleImpl(String name, DataLakeAnalyticsManager manager) { + super(name, new FirewallRuleInner()); + this.manager = manager; + // Set resource name + this.firewallRuleName = name; + // + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + FirewallRuleImpl(FirewallRuleInner inner, DataLakeAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.firewallRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.firewallRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules"); + // + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.firewallRuleName, this.createParameter) + .map(new Func1() { + @Override + public FirewallRuleInner call(FirewallRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.firewallRuleName, this.updateParameter) + .map(new Func1() { + @Override + public FirewallRuleInner call(FirewallRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.getAsync(this.resourceGroupName, this.accountName, this.firewallRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + @Override + public String endIpAddress() { + return this.inner().endIpAddress(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String startIpAddress() { + return this.inner().startIpAddress(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FirewallRuleImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public FirewallRuleImpl withEndIpAddress(String endIpAddress) { + if (isInCreateMode()) { + this.createParameter.withEndIpAddress(endIpAddress); + } else { + this.updateParameter.withEndIpAddress(endIpAddress); + } + return this; + } + + @Override + public FirewallRuleImpl withStartIpAddress(String startIpAddress) { + if (isInCreateMode()) { + this.createParameter.withStartIpAddress(startIpAddress); + } else { + this.updateParameter.withStartIpAddress(startIpAddress); + } + return this; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleInner.java new file mode 100644 index 0000000000000..5f8a7e8a9323c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRuleInner.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Analytics firewall rule information. + */ +@JsonFlatten +public class FirewallRuleInner extends SubResource { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String endIpAddress; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesImpl.java new file mode 100644 index 0000000000000..5dd1ee4161276 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRule; + +class FirewallRulesImpl extends WrapperImpl implements FirewallRules { + private final DataLakeAnalyticsManager manager; + + FirewallRulesImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().firewallRules()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public FirewallRuleImpl define(String name) { + return wrapModel(name); + } + + private FirewallRuleImpl wrapModel(FirewallRuleInner inner) { + return new FirewallRuleImpl(inner, manager()); + } + + private FirewallRuleImpl wrapModel(String name) { + return new FirewallRuleImpl(name, this.manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + FirewallRulesInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, firewallRuleName) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, firewallRuleName).toCompletable(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesInner.java new file mode 100644 index 0000000000000..3287c784cee26 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/FirewallRulesInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CreateOrUpdateFirewallRuleParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateFirewallRuleParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in FirewallRules. + */ +public class FirewallRulesInner { + /** The Retrofit service to perform REST calls. */ + private FirewallRulesService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FirewallRulesInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(FirewallRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FirewallRules to be + * used by Retrofit to perform actually REST calls. + */ + interface FirewallRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Body CreateOrUpdateFirewallRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Body UpdateFirewallRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.FirewallRules listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner createOrUpdate(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateFirewallRuleParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/IdParsingUtils.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..d1789487939dc --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..90907983fc380 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.CapabilityInformation; + +class LocationsImpl extends WrapperImpl implements Locations { + private final DataLakeAnalyticsManager manager; + + LocationsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable getCapabilityAsync(String location) { + LocationsInner client = this.inner(); + return client.getCapabilityAsync(location) + .map(new Func1() { + @Override + public CapabilityInformation call(CapabilityInformationInner inner) { + return new CapabilityInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsInner.java new file mode 100644 index 0000000000000..87c1961e1be33 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/LocationsInner.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Locations getCapability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/locations/{location}/capability") + Observable> getCapability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilityInformationInner object if successful. + */ + public CapabilityInformationInner getCapability(String location) { + return getCapabilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCapabilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCapabilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilityInformationInner object + */ + public Observable getCapabilityAsync(String location) { + return getCapabilityWithServiceResponseAsync(location).map(new Func1, CapabilityInformationInner>() { + @Override + public CapabilityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilityInformationInner object + */ + public Observable> getCapabilityWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCapability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCapabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCapabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationImpl.java new file mode 100644 index 0000000000000..5599641f0d4b7 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.NameAvailabilityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityInformationImpl extends WrapperImpl implements NameAvailabilityInformation { + private final DataLakeAnalyticsManager manager; + NameAvailabilityInformationImpl(NameAvailabilityInformationInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationInner.java new file mode 100644 index 0000000000000..f1c36050df2ab --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/NameAvailabilityInformationInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Analytics account name availability result information. + */ +public class NameAvailabilityInformationInner { + /** + * The Boolean value of true or false to indicate whether the Data Lake + * Analytics account name is available or not. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason why the Data Lake Analytics account name is not available, if + * nameAvailable is false. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * The message describing why the Data Lake Analytics account name is not + * available, if nameAvailable is false. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the Boolean value of true or false to indicate whether the Data Lake Analytics account name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason why the Data Lake Analytics account name is not available, if nameAvailable is false. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get the message describing why the Data Lake Analytics account name is not available, if nameAvailable is false. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..7821385166e05 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.OperationDisplay; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.OperationOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An available operation for Data Lake Analytics. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display information for the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'user', + * 'system', 'user,system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display information for the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the intended executor of the operation. Possible values include: 'user', 'system', 'user,system'. + * + * @return the origin value + */ + public OperationOrigin origin() { + return this.origin; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..74ccafa6f4c3c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final DataLakeAnalyticsManager manager; + OperationListResultImpl(OperationListResultInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..79347dddaac37 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of available operations for Data Lake Analytics. + */ +public class OperationListResultInner { + /** + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the results of the list operation. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..cdea4e4d831d8 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataLakeAnalyticsManager manager; + + OperationsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..2c4209f9066a9 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.Operations list" }) + @GET("providers/Microsoft.DataLakeAnalytics/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/PageImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..306cacd29b926 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationImpl.java new file mode 100644 index 0000000000000..ae9847e00947c --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.SasTokenInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SasTokenInformationImpl extends WrapperImpl implements SasTokenInformation { + private final DataLakeAnalyticsManager manager; + SasTokenInformationImpl(SasTokenInformationInner inner, DataLakeAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + public String accessToken() { + return this.inner().accessToken(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationInner.java new file mode 100644 index 0000000000000..0db66e7c6411f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/SasTokenInformationInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SAS token information. + */ +public class SasTokenInformationInner { + /** + * The access token for the associated Azure Storage Container. + */ + @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) + private String accessToken; + + /** + * Get the access token for the associated Azure Storage Container. + * + * @return the accessToken value + */ + public String accessToken() { + return this.accessToken; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationImpl.java new file mode 100644 index 0000000000000..bb11f5b78210d --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccountInformation; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class StorageAccountInformationImpl extends IndexableRefreshableWrapperImpl implements StorageAccountInformation { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String storageAccountName; + + StorageAccountInformationImpl(StorageAccountInformationInner inner, DataLakeAnalyticsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.storageAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.getAsync(this.resourceGroupName, this.accountName, this.storageAccountName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String suffix() { + return this.inner().suffix(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationInner.java new file mode 100644 index 0000000000000..3dc34f54f662f --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountInformationInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Azure Storage account information. + */ +@JsonFlatten +public class StorageAccountInformationInner extends SubResource { + /** + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix", access = JsonProperty.Access.WRITE_ONLY) + private String suffix; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the optional suffix for the storage account. + * + * @return the suffix value + */ + public String suffix() { + return this.suffix; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..12559fb43d880 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccountInformation; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AddStorageAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageContainer; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.SasTokenInformation; + +class StorageAccountsImpl extends WrapperImpl implements StorageAccounts { + private final DataLakeAnalyticsManager manager; + + StorageAccountsImpl(DataLakeAnalyticsManager manager) { + super(manager.inner().storageAccounts()); + this.manager = manager; + } + + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + private StorageAccountInformationImpl wrapModel(StorageAccountInformationInner inner) { + return new StorageAccountInformationImpl(inner, manager()); + } + + @Override + public Completable updateAsync(String resourceGroupName, String accountName, String storageAccountName) { + StorageAccountsInner client = this.inner(); + return client.updateAsync(resourceGroupName, accountName, storageAccountName).toCompletable(); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + StorageAccountsInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageAccountInformation call(StorageAccountInformationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String storageAccountName) { + StorageAccountsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, storageAccountName) + .map(new Func1() { + @Override + public StorageAccountInformation call(StorageAccountInformationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String storageAccountName) { + StorageAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, storageAccountName).toCompletable(); + } + + private StorageContainerImpl wrapStorageContainerModel(StorageContainerInner inner) { + return new StorageContainerImpl(inner, manager()); + } + + private Observable getStorageContainerInnerUsingStorageAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "accounts"); + String storageAccountName = IdParsingUtils.getValueFromIdByName(id, "storageAccounts"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + StorageAccountsInner client = this.inner(); + return client.getStorageContainerAsync(resourceGroupName, accountName, storageAccountName, containerName); + } + + @Override + public Completable addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.addAsync(resourceGroupName, accountName, storageAccountName, parameters).toCompletable(); + } + + @Override + public Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + StorageAccountsInner client = this.inner(); + return client.getStorageContainerAsync(resourceGroupName, accountName, storageAccountName, containerName) + .map(new Func1() { + @Override + public StorageContainer call(StorageContainerInner inner) { + return wrapStorageContainerModel(inner); + } + }); + } + + @Override + public Observable listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + StorageAccountsInner client = this.inner(); + return client.listStorageContainersAsync(resourceGroupName, accountName, storageAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageContainer call(StorageContainerInner inner) { + return wrapStorageContainerModel(inner); + } + }); + } + + @Override + public Observable listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + StorageAccountsInner client = this.inner(); + return client.listSasTokensAsync(resourceGroupName, accountName, storageAccountName, containerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SasTokenInformation call(SasTokenInformationInner inner) { + return new SasTokenInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java new file mode 100644 index 0000000000000..b73dacd69209d --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java @@ -0,0 +1,1560 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.AddStorageAccountParameters; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.UpdateStorageAccountParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageAccounts. + */ +public class StorageAccountsInner { + /** The Retrofit service to perform REST calls. */ + private StorageAccountsService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageAccountsInner(Retrofit retrofit, DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = retrofit.create(StorageAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts add" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}") + Observable> add(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Body AddStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Body UpdateStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listStorageContainers" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}/containers") + Observable> listStorageContainers(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts getStorageContainer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}/containers/{containerName}") + Observable> getStorageContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listSasTokens" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/storageAccounts/{storageAccountName}/containers/{containerName}/listSasTokens") + Observable> listSasTokens(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listStorageContainersNext" }) + @GET + Observable> listStorageContainersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageAccounts listSasTokensNext" }) + @GET + Observable> listSasTokensNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInformationInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInformationInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + ServiceResponse> * @param filter The OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void add(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + addWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + return addWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.add(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInformationInner object if successful. + */ + public StorageAccountInformationInner get(String resourceGroupName, String accountName, String storageAccountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInformationInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String storageAccountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1, StorageAccountInformationInner>() { + @Override + public StorageAccountInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInformationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String accountName, String storageAccountName) { + updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateAsync(String resourceGroupName, String accountName, String storageAccountName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateStorageAccountParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. Passing nothing results in no change. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String accountName, String storageAccountName, UpdateStorageAccountParameters parameters) { + updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. Passing nothing results in no change. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String storageAccountName, UpdateStorageAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters), serviceCallback); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. Passing nothing results in no change. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateAsync(String resourceGroupName, String accountName, String storageAccountName, UpdateStorageAccountParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. Passing nothing results in no change. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, UpdateStorageAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String storageAccountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String storageAccountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageContainerInner> object if successful. + */ + public PagedList listStorageContainers(final String resourceGroupName, final String accountName, final String storageAccountName) { + ServiceResponse> response = listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageContainerInner> object + */ + public Observable> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + return listStorageContainersWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageContainerInner> object + */ + public Observable>> listStorageContainersWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + return listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageContainersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + ServiceResponse> * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageContainerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageContainersSinglePageAsync(final String resourceGroupName, final String accountName, final String storageAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listStorageContainers(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageContainersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageContainersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageContainerInner object if successful. + */ + public StorageContainerInner getStorageContainer(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName), serviceCallback); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageContainerInner object + */ + public Observable getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName).map(new Func1, StorageContainerInner>() { + @Override + public StorageContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageContainerInner object + */ + public Observable> getStorageContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getStorageContainer(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStorageContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStorageContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasTokenInformationInner> object if successful. + */ + public PagedList listSasTokens(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + ServiceResponse> response = listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInformationInner> object + */ + public Observable> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + return listSasTokensWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInformationInner> object + */ + public Observable>> listSasTokensWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + return listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSasTokensNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Analytics account. + ServiceResponse> * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + ServiceResponse> * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasTokenInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSasTokensSinglePageAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSasTokens(this.client.subscriptionId(), resourceGroupName, accountName, storageAccountName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSasTokensDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSasTokensDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInformationInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInformationInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageContainerInner> object if successful. + */ + public PagedList listStorageContainersNext(final String nextPageLink) { + ServiceResponse> response = listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listStorageContainersNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStorageContainersNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageContainerInner> object + */ + public Observable> listStorageContainersNextAsync(final String nextPageLink) { + return listStorageContainersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageContainerInner> object + */ + public Observable>> listStorageContainersNextWithServiceResponseAsync(final String nextPageLink) { + return listStorageContainersNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listStorageContainersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageContainerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStorageContainersNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listStorageContainersNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStorageContainersNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStorageContainersNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasTokenInformationInner> object if successful. + */ + public PagedList listSasTokensNext(final String nextPageLink) { + ServiceResponse> response = listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSasTokensNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSasTokensNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInformationInner> object + */ + public Observable> listSasTokensNextAsync(final String nextPageLink) { + return listSasTokensNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasTokenInformationInner> object + */ + public Observable>> listSasTokensNextWithServiceResponseAsync(final String nextPageLink) { + return listSasTokensNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSasTokensNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasTokenInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSasTokensNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSasTokensNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSasTokensNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSasTokensNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerImpl.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerImpl.java new file mode 100644 index 0000000000000..66e515970cb5d --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.StorageContainer; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class StorageContainerImpl extends IndexableRefreshableWrapperImpl implements StorageContainer { + private final DataLakeAnalyticsManager manager; + private String resourceGroupName; + private String accountName; + private String storageAccountName; + private String containerName; + + StorageContainerImpl(StorageContainerInner inner, DataLakeAnalyticsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.storageAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + } + + @Override + public DataLakeAnalyticsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.getStorageContainerAsync(this.resourceGroupName, this.accountName, this.storageAccountName, this.containerName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerInner.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerInner.java new file mode 100644 index 0000000000000..91025f8c4c467 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageContainerInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Azure Storage blob container information. + */ +@JsonFlatten +public class StorageContainerInner extends SubResource { + /** + * The last modified time of the blob container. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the last modified time of the blob container. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/package-info.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/package-info.java new file mode 100644 index 0000000000000..bf300b30460b6 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataLakeAnalyticsAccountManagementClient. + * Creates an Azure Data Lake Analytics account management client. + */ +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation; diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/package-info.java b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/package-info.java new file mode 100644 index 0000000000000..d5a0904d0eca9 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataLakeAnalyticsAccountManagementClient. + * Creates an Azure Data Lake Analytics account management client. + */ +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsTest.java b/datalakeanalytics/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsTest.java new file mode 100644 index 0000000000000..2a4c8c76531eb --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/DataLakeAnalyticsTest.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakeanalytics.v2016_11_01; +import com.microsoft.azure.arm.core.TestBase; +import com.microsoft.azure.management.datalakeanalytics.v2016_11_01.implementation.DataLakeAnalyticsManager; +import com.microsoft.azure.management.resources.implementation.ResourceManager; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.arm.utils.SdkContext; +import org.junit.Test; +import org.junit.Assert; +import com.microsoft.azure.arm.resources.Region; +import com.microsoft.azure.management.resources.ResourceGroup; + +public class DataLakeAnalyticsTest extends TestBase { + protected static ResourceManager resourceManager; + protected static DataLakeAnalyticsManager dataLakeAnalyticsManager; + private static String rgName; + + @Override + protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { + resourceManager = ResourceManager + .authenticate(restClient) + .withSubscription(defaultSubscription); + dataLakeAnalyticsManager = DataLakeAnalyticsManager + .authenticate(restClient, defaultSubscription); + } + + @Override + protected void cleanUpResources() { + resourceManager.resourceGroups().deleteByName(rgName); + } + + @Test + public void firstTest() { + rgName = SdkContext.randomResourceName("rg", 20); + ResourceGroup group = resourceManager.resourceGroups() + .define(rgName) + .withRegion(Region.US_WEST.toString()) + .create(); + Assert.assertNotNull(group); + } +} diff --git a/datalakeanalytics/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json b/datalakeanalytics/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json new file mode 100644 index 0000000000000..2619b603ef876 --- /dev/null +++ b/datalakeanalytics/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json @@ -0,0 +1,143 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg64f0485289a8e?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:52:26 GMT", + "content-length" : "183", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "64bfe462-c74c-47db-b974-bd49f14124a5", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015227Z:64bfe462-c74c-47db-b974-bd49f14124a5", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "64bfe462-c74c-47db-b974-bd49f14124a5", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg64f0485289a8e\",\"name\":\"rg64f0485289a8e\",\"location\":\"westus\",\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg64f0485289a8e?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:52:27 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "9be3ece7-940a-416c-a0ed-3aaf14c0298d", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015227Z:9be3ece7-940a-416c-a0ed-3aaf14c0298d", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "9be3ece7-940a-416c-a0ed-3aaf14c0298d", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:52:27 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11999", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "288ccc06-f3a8-4ccc-9ead-96c8b1240790", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015227Z:288ccc06-f3a8-4ccc-9ead-96c8b1240790", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "288ccc06-f3a8-4ccc-9ead-96c8b1240790", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:52:41 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "1904983b-cbef-4010-8bef-ec13e93070ac", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015242Z:1904983b-cbef-4010-8bef-ec13e93070ac", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "1904983b-cbef-4010-8bef-ec13e93070ac", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:52:57 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "068a6fa8-b16c-4aba-8e8d-f68fdccbd174", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015257Z:068a6fa8-b16c-4aba-8e8d-f68fdccbd174", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "068a6fa8-b16c-4aba-8e8d-f68fdccbd174", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY0RjA0ODUyODlBOEUtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:53:12 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "59df9fef-858e-4b7e-a4e7-f6d7a4706bf2", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T015312Z:59df9fef-858e-4b7e-a4e7-f6d7a4706bf2", + "cache-control" : "no-cache", + "x-ms-request-id" : "59df9fef-858e-4b7e-a4e7-f6d7a4706bf2", + "Body" : "" + } + } ], + "variables" : [ "rg64f0485289a8e" ] +} \ No newline at end of file diff --git a/datalakestore/resource-manager/v2015_10_01_preview/pom.xml b/datalakestore/resource-manager/v2015_10_01_preview/pom.xml new file mode 100644 index 0000000000000..ecace1c1184bd --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.datalakestore.v2015_10_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datalakestore + 1.0.0-beta-2 + jar + Microsoft Azure SDK for DataLakeStore Management + This package contains Microsoft DataLakeStore Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Accounts.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Accounts.java new file mode 100644 index 0000000000000..490fe2cd38653 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Accounts.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.FirewallRule; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new FirewallRule resource. + * @param name resource name. + * @return the first stage of the new FirewallRule definition. + */ + FirewallRule.DefinitionStages.Blank defineFirewallRule(String name); + + /** + * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableKeyVaultAsync(String resourceGroupName, String accountName); + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listFirewallRulesAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName); + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/AzureAsyncOperationResult.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/AzureAsyncOperationResult.java new file mode 100644 index 0000000000000..7e3b97319b9e2 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/AzureAsyncOperationResult.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * the status of the AzureAsuncOperation. Possible values include: + * 'InProgress', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatus status; + + /** + * The error property. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Get the status of the AzureAsuncOperation. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public OperationStatus status() { + return this.status; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccount.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccount.java new file mode 100644 index 0000000000000..b51236a9c94fa --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccount.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation.DataLakeStoreManager; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation.DataLakeStoreAccountInner; + +/** + * Type representing DataLakeStoreAccount. + */ +public interface DataLakeStoreAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the identity value. + */ + EncryptionIdentity identity(); + + /** + * @return the properties value. + */ + DataLakeStoreAccountProperties properties(); + + /** + * The entirety of the DataLakeStoreAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataLakeStoreAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataLakeStoreAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataLakeStoreAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The Key vault encryption identity, if any + * @return the next definition stage + */ + WithCreate withIdentity(EncryptionIdentity identity); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the Data Lake Store account properties + * @return the next definition stage + */ + WithCreate withProperties(DataLakeStoreAccountProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + } + } + /** + * The template for a DataLakeStoreAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + } + + /** + * Grouping of DataLakeStoreAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the datalakestoreaccount update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The Key vault encryption identity, if any + * @return the next update stage + */ + Update withIdentity(EncryptionIdentity identity); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the Data Lake Store account properties + * @return the next update stage + */ + Update withProperties(DataLakeStoreAccountProperties properties); + } + + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountProperties.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountProperties.java new file mode 100644 index 0000000000000..107b8b36146bb --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountProperties.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account properties information. + */ +public class DataLakeStoreAccountProperties { + /** + * the status of the Data Lake Store account while being provisioned. + * Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountStatus provisioningState; + + /** + * the status of the Data Lake Store account after provisioning has + * completed. Possible values include: 'active', 'suspended'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountState state; + + /** + * the account creation time. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The current state of encryption for this Data Lake store account. + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "encryptionState") + private EncryptionState encryptionState; + + /** + * The current state of encryption provisioning for this Data Lake store + * account. Possible values include: 'Creating', 'Succeeded'. + */ + @JsonProperty(value = "encryptionProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionProvisioningState encryptionProvisioningState; + + /** + * The Key vault encryption configuration. + */ + @JsonProperty(value = "encryptionConfig") + private EncryptionConfig encryptionConfig; + + /** + * the account last modified time. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * the gateway host. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** + * the default owner group for all new folders and files created in the + * Data Lake Store account. + */ + @JsonProperty(value = "defaultGroup") + private String defaultGroup; + + /** + * Get the status of the Data Lake Store account while being provisioned. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + * + * @return the provisioningState value + */ + public DataLakeStoreAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the Data Lake Store account after provisioning has completed. Possible values include: 'active', 'suspended'. + * + * @return the state value + */ + public DataLakeStoreAccountState state() { + return this.state; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the current state of encryption for this Data Lake store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the encryptionState value + */ + public EncryptionState encryptionState() { + return this.encryptionState; + } + + /** + * Set the current state of encryption for this Data Lake store account. Possible values include: 'Enabled', 'Disabled'. + * + * @param encryptionState the encryptionState value to set + * @return the DataLakeStoreAccountProperties object itself. + */ + public DataLakeStoreAccountProperties withEncryptionState(EncryptionState encryptionState) { + this.encryptionState = encryptionState; + return this; + } + + /** + * Get the current state of encryption provisioning for this Data Lake store account. Possible values include: 'Creating', 'Succeeded'. + * + * @return the encryptionProvisioningState value + */ + public EncryptionProvisioningState encryptionProvisioningState() { + return this.encryptionProvisioningState; + } + + /** + * Get the Key vault encryption configuration. + * + * @return the encryptionConfig value + */ + public EncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set the Key vault encryption configuration. + * + * @param encryptionConfig the encryptionConfig value to set + * @return the DataLakeStoreAccountProperties object itself. + */ + public DataLakeStoreAccountProperties withEncryptionConfig(EncryptionConfig encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the gateway host. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the gateway host. + * + * @param endpoint the endpoint value to set + * @return the DataLakeStoreAccountProperties object itself. + */ + public DataLakeStoreAccountProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the default owner group for all new folders and files created in the Data Lake Store account. + * + * @return the defaultGroup value + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the default owner group for all new folders and files created in the Data Lake Store account. + * + * @param defaultGroup the defaultGroup value to set + * @return the DataLakeStoreAccountProperties object itself. + */ + public DataLakeStoreAccountProperties withDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountState.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountState.java new file mode 100644 index 0000000000000..3c3cb3b9fa855 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountState. + */ +public enum DataLakeStoreAccountState { + /** Enum value active. */ + ACTIVE("active"), + + /** Enum value suspended. */ + SUSPENDED("suspended"); + + /** The actual serialized value for a DataLakeStoreAccountState instance. */ + private String value; + + DataLakeStoreAccountState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountState fromString(String value) { + DataLakeStoreAccountState[] items = DataLakeStoreAccountState.values(); + for (DataLakeStoreAccountState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountStatus.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountStatus.java new file mode 100644 index 0000000000000..d59ca09f213a2 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/DataLakeStoreAccountStatus.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountStatus. + */ +public enum DataLakeStoreAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a DataLakeStoreAccountStatus instance. */ + private String value; + + DataLakeStoreAccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountStatus fromString(String value) { + DataLakeStoreAccountStatus[] items = DataLakeStoreAccountStatus.values(); + for (DataLakeStoreAccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfig.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfig.java new file mode 100644 index 0000000000000..8ed6e2ea63411 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfig.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EncryptionConfig model. + */ +public class EncryptionConfig { + /** + * The type of encryption configuration being used. Currently the only + * supported types are 'UserManaged' and 'ServiceManaged'. Possible values + * include: 'UserManaged', 'ServiceManaged'. + */ + @JsonProperty(value = "type") + private EncryptionConfigType type; + + /** + * The Key vault information for connecting to user managed encryption + * keys. + */ + @JsonProperty(value = "keyVaultMetaInfo") + private KeyVaultMetaInfo keyVaultMetaInfo; + + /** + * Get the type of encryption configuration being used. Currently the only supported types are 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged'. + * + * @return the type value + */ + public EncryptionConfigType type() { + return this.type; + } + + /** + * Set the type of encryption configuration being used. Currently the only supported types are 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged'. + * + * @param type the type value to set + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withType(EncryptionConfigType type) { + this.type = type; + return this; + } + + /** + * Get the Key vault information for connecting to user managed encryption keys. + * + * @return the keyVaultMetaInfo value + */ + public KeyVaultMetaInfo keyVaultMetaInfo() { + return this.keyVaultMetaInfo; + } + + /** + * Set the Key vault information for connecting to user managed encryption keys. + * + * @param keyVaultMetaInfo the keyVaultMetaInfo value to set + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withKeyVaultMetaInfo(KeyVaultMetaInfo keyVaultMetaInfo) { + this.keyVaultMetaInfo = keyVaultMetaInfo; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfigType.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfigType.java new file mode 100644 index 0000000000000..b8d4f2425f402 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionConfigType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionConfigType. + */ +public enum EncryptionConfigType { + /** Enum value UserManaged. */ + USER_MANAGED("UserManaged"), + + /** Enum value ServiceManaged. */ + SERVICE_MANAGED("ServiceManaged"); + + /** The actual serialized value for a EncryptionConfigType instance. */ + private String value; + + EncryptionConfigType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionConfigType instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionConfigType object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionConfigType fromString(String value) { + EncryptionConfigType[] items = EncryptionConfigType.values(); + for (EncryptionConfigType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentity.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentity.java new file mode 100644 index 0000000000000..2f04040689b11 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentity.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EncryptionIdentity model. + */ +public class EncryptionIdentity { + /** + * The type of encryption being used. Currently the only supported type is + * 'SystemAssigned'. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private EncryptionIdentityType type; + + /** + * The principal identifier associated with the encryption. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /** + * The tenant identifier associated with the encryption. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /** + * Get the type of encryption being used. Currently the only supported type is 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public EncryptionIdentityType type() { + return this.type; + } + + /** + * Set the type of encryption being used. Currently the only supported type is 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withType(EncryptionIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principal identifier associated with the encryption. + * + * @return the principalId value + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenant identifier associated with the encryption. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentityType.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentityType.java new file mode 100644 index 0000000000000..36ee7fe8668f1 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionIdentityType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionIdentityType. + */ +public enum EncryptionIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a EncryptionIdentityType instance. */ + private String value; + + EncryptionIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionIdentityType fromString(String value) { + EncryptionIdentityType[] items = EncryptionIdentityType.values(); + for (EncryptionIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionProvisioningState.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionProvisioningState.java new file mode 100644 index 0000000000000..56324e2087a60 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionProvisioningState. + */ +public enum EncryptionProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a EncryptionProvisioningState instance. */ + private String value; + + EncryptionProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionProvisioningState fromString(String value) { + EncryptionProvisioningState[] items = EncryptionProvisioningState.values(); + for (EncryptionProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionState.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionState.java new file mode 100644 index 0000000000000..0217822e69f1d --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/EncryptionState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionState. + */ +public enum EncryptionState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a EncryptionState instance. */ + private String value; + + EncryptionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionState instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionState object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionState fromString(String value) { + EncryptionState[] items = EncryptionState.values(); + for (EncryptionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Error.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Error.java new file mode 100644 index 0000000000000..c7a125f2160c4 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/Error.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store error information. + */ +public class Error { + /** + * the HTTP status code or error code associated with this error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * the error message to display. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * the target of the error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * the list of error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * the inner exceptions or errors, if any. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private InnerError innerError; + + /** + * Get the HTTP status code or error code associated with this error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message to display. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the list of error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the inner exceptions or errors, if any. + * + * @return the innerError value + */ + public InnerError innerError() { + return this.innerError; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/ErrorDetails.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/ErrorDetails.java new file mode 100644 index 0000000000000..e4e2896f0862e --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/ErrorDetails.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store error details information. + */ +public class ErrorDetails { + /** + * the HTTP status code or error code associated with this error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * the error message localized based on Accept-Language. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * the target of the particular error (for example, the name of the + * property in error). + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the HTTP status code or error code associated with this error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message localized based on Accept-Language. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error (for example, the name of the property in error). + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRule.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRule.java new file mode 100644 index 0000000000000..efe2158d18e4a --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRule.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation.FirewallRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation.DataLakeStoreManager; + +/** + * Type representing FirewallRule. + */ +public interface FirewallRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + FirewallRuleProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FirewallRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of FirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FirewallRule definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the firewallrule definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account + * @param accountName The name of the Data Lake Store account to which to add the firewall rule + * @return the next definition stage + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the firewallrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id the firewall rule's subscription ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the firewallrule definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the firewall rule's regional location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the firewallrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name the firewall rule's name + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the firewallrule definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties of the firewall rule + * @return the next definition stage + */ + WithCreate withProperties(FirewallRuleProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName, DefinitionStages.WithProperties { + } + } + /** + * The template for a FirewallRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId, UpdateStages.WithLocation, UpdateStages.WithName, UpdateStages.WithProperties { + } + + /** + * Grouping of FirewallRule update stages. + */ + interface UpdateStages { + /** + * The stage of the firewallrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id the firewall rule's subscription ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the firewallrule update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the firewall rule's regional location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the firewallrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name the firewall rule's name + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the firewallrule update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties of the firewall rule + * @return the next update stage + */ + Update withProperties(FirewallRuleProperties properties); + } + + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRuleProperties.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRuleProperties.java new file mode 100644 index 0000000000000..5c86589cb0b03 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/FirewallRuleProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store firewall rule properties information. + */ +public class FirewallRuleProperties { + /** + * the start IP address for the firewall rule. + */ + @JsonProperty(value = "startIpAddress") + private String startIpAddress; + + /** + * the end IP address for the firewall rule. + */ + @JsonProperty(value = "endIpAddress") + private String endIpAddress; + + /** + * Get the start IP address for the firewall rule. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. + * + * @param startIpAddress the startIpAddress value to set + * @return the FirewallRuleProperties object itself. + */ + public FirewallRuleProperties withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. + * + * @param endIpAddress the endIpAddress value to set + * @return the FirewallRuleProperties object itself. + */ + public FirewallRuleProperties withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/InnerError.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/InnerError.java new file mode 100644 index 0000000000000..a7fb2e30a9f50 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/InnerError.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store inner error information. + */ +public class InnerError { + /** + * the stack trace for the error. + */ + @JsonProperty(value = "trace", access = JsonProperty.Access.WRITE_ONLY) + private String trace; + + /** + * the context for the error message. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private String context; + + /** + * Get the stack trace for the error. + * + * @return the trace value + */ + public String trace() { + return this.trace; + } + + /** + * Get the context for the error message. + * + * @return the context value + */ + public String context() { + return this.context; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/KeyVaultMetaInfo.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/KeyVaultMetaInfo.java new file mode 100644 index 0000000000000..764760ab76008 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/KeyVaultMetaInfo.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The KeyVaultMetaInfo model. + */ +public class KeyVaultMetaInfo { + /** + * The resource identifier for the user managed Key Vault being used to + * encrypt. + */ + @JsonProperty(value = "keyVaultResourceId") + private String keyVaultResourceId; + + /** + * The name of the user managed encryption key. + */ + @JsonProperty(value = "encryptionKeyName") + private String encryptionKeyName; + + /** + * The version of the user managed encryption key. + */ + @JsonProperty(value = "encryptionKeyVersion") + private String encryptionKeyVersion; + + /** + * Get the resource identifier for the user managed Key Vault being used to encrypt. + * + * @return the keyVaultResourceId value + */ + public String keyVaultResourceId() { + return this.keyVaultResourceId; + } + + /** + * Set the resource identifier for the user managed Key Vault being used to encrypt. + * + * @param keyVaultResourceId the keyVaultResourceId value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withKeyVaultResourceId(String keyVaultResourceId) { + this.keyVaultResourceId = keyVaultResourceId; + return this; + } + + /** + * Get the name of the user managed encryption key. + * + * @return the encryptionKeyName value + */ + public String encryptionKeyName() { + return this.encryptionKeyName; + } + + /** + * Set the name of the user managed encryption key. + * + * @param encryptionKeyName the encryptionKeyName value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withEncryptionKeyName(String encryptionKeyName) { + this.encryptionKeyName = encryptionKeyName; + return this; + } + + /** + * Get the version of the user managed encryption key. + * + * @return the encryptionKeyVersion value + */ + public String encryptionKeyVersion() { + return this.encryptionKeyVersion; + } + + /** + * Set the version of the user managed encryption key. + * + * @param encryptionKeyVersion the encryptionKeyVersion value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withEncryptionKeyVersion(String encryptionKeyVersion) { + this.encryptionKeyVersion = encryptionKeyVersion; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/OperationStatus.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/OperationStatus.java new file mode 100644 index 0000000000000..895bb10852f2e --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/OperationStatus.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationStatus. + */ +public enum OperationStatus { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a OperationStatus instance. */ + private 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. + */ + @JsonCreator + public static OperationStatus fromString(String value) { + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsImpl.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..9adfeca64f21c --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.DataLakeStoreAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.FirewallRule; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(DataLakeStoreManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataLakeStoreAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable enableKeyVaultAsync(String resourceGroupName, String accountName) { + AccountsInner client = this.inner(); + return client.enableKeyVaultAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + protected DataLakeStoreAccountImpl wrapModel(DataLakeStoreAccountInner inner) { + return new DataLakeStoreAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected DataLakeStoreAccountImpl wrapModel(String name) { + return new DataLakeStoreAccountImpl(name, new DataLakeStoreAccountInner(), this.manager()); + } + + @Override + public FirewallRuleImpl defineFirewallRule(String name) { + return wrapFirewallRuleModel(name); + } + + private FirewallRuleImpl wrapFirewallRuleModel(String name) { + return new FirewallRuleImpl(name, this.manager()); + } + + private FirewallRuleImpl wrapFirewallRuleModel(FirewallRuleInner inner) { + return new FirewallRuleImpl(inner, manager()); + } + + private Observable getFirewallRuleInnerUsingAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "accounts"); + String firewallRuleName = IdParsingUtils.getValueFromIdByName(id, "firewallRules"); + AccountsInner client = this.inner(); + return client.getFirewallRuleAsync(resourceGroupName, accountName, firewallRuleName); + } + + @Override + public Observable getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) { + AccountsInner client = this.inner(); + return client.getFirewallRuleAsync(resourceGroupName, accountName, firewallRuleName) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapFirewallRuleModel(inner); + } + }); + } + + @Override + public Observable listFirewallRulesAsync(final String resourceGroupName, final String accountName) { + AccountsInner client = this.inner(); + return client.listFirewallRulesAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapFirewallRuleModel(inner); + } + }); + } + + @Override + public Completable deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) { + AccountsInner client = this.inner(); + return client.deleteFirewallRuleAsync(resourceGroupName, accountName, firewallRuleName).toCompletable(); + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java new file mode 100644 index 0000000000000..d89f4d353db12 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java @@ -0,0 +1,2091 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts deleteFirewallRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + Observable> deleteFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts getFirewallRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> getFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts listFirewallRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules") + Observable> listFirewallRules(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts createOrUpdateFirewallRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{name}") + Observable> createOrUpdateFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body FirewallRuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccountInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts enableKeyVault" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault") + Observable> enableKeyVault(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts listFirewallRulesNext" }) + @GET + Observable> listFirewallRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) { + deleteFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return deleteFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteFirewallRuleWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteFirewallRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner getFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) { + return getFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return getFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> getFirewallRuleWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFirewallRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listFirewallRules(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listFirewallRulesSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listFirewallRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listFirewallRulesAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listFirewallRulesSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listFirewallRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listFirewallRulesAsync(final String resourceGroupName, final String accountName) { + return listFirewallRulesWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listFirewallRulesWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listFirewallRulesSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listFirewallRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + ServiceResponse> * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listFirewallRulesSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listFirewallRules(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listFirewallRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listFirewallRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner createOrUpdateFirewallRule(String resourceGroupName, String accountName, String name, FirewallRuleInner parameters) { + return createOrUpdateFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, name, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateFirewallRuleAsync(String resourceGroupName, String accountName, String name, FirewallRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, name, parameters), serviceCallback); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable createOrUpdateFirewallRuleAsync(String resourceGroupName, String accountName, String name, FirewallRuleInner parameters) { + return createOrUpdateFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, name, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> createOrUpdateFirewallRuleWithServiceResponseAsync(String resourceGroupName, String accountName, String name, FirewallRuleInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdateFirewallRule(resourceGroupName, accountName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateFirewallRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner create(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().body(); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner beginCreate(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner update(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().body(); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner beginUpdate(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, name, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableKeyVault(String resourceGroupName, String accountName) { + enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableKeyVaultAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableKeyVaultAsync(String resourceGroupName, String accountName) { + return enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableKeyVaultWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.enableKeyVault(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableKeyVaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableKeyVaultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + return service.list(this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + ServiceResponse> response = listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listWithServiceResponseAsync(filter, top, skip, expand, select, orderby, count, search, format) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + return listSinglePageAsync(filter, top, skip, expand, select, orderby, count, search, format) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + ServiceResponse> * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + ServiceResponse> * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), filter, top, skip, expand, select, orderby, count, search, format, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listFirewallRulesNext(final String nextPageLink) { + ServiceResponse> response = listFirewallRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listFirewallRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listFirewallRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listFirewallRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listFirewallRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listFirewallRulesNextAsync(final String nextPageLink) { + return listFirewallRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listFirewallRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listFirewallRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listFirewallRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listFirewallRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listFirewallRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listFirewallRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listFirewallRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountImpl.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountImpl.java new file mode 100644 index 0000000000000..e045001a8eea5 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.DataLakeStoreAccount; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.EncryptionIdentity; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.DataLakeStoreAccountProperties; + +class DataLakeStoreAccountImpl extends GroupableResourceCoreImpl implements DataLakeStoreAccount, DataLakeStoreAccount.Definition, DataLakeStoreAccount.Update { + DataLakeStoreAccountImpl(String name, DataLakeStoreAccountInner inner, DataLakeStoreManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public EncryptionIdentity identity() { + return this.inner().identity(); + } + + @Override + public DataLakeStoreAccountProperties properties() { + return this.inner().properties(); + } + + @Override + public DataLakeStoreAccountImpl withIdentity(EncryptionIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public DataLakeStoreAccountImpl withProperties(DataLakeStoreAccountProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountInner.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountInner.java new file mode 100644 index 0000000000000..583f511c9bd20 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.EncryptionIdentity; +import java.util.Map; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.DataLakeStoreAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account information. + */ +public class DataLakeStoreAccountInner extends Resource { + /** + * The Key vault encryption identity, if any. + */ + @JsonProperty(value = "identity") + private EncryptionIdentity identity; + + /** + * the Data Lake Store account properties. + */ + @JsonProperty(value = "properties") + private DataLakeStoreAccountProperties properties; + + /** + * Get the Key vault encryption identity, if any. + * + * @return the identity value + */ + public EncryptionIdentity identity() { + return this.identity; + } + + /** + * Set the Key vault encryption identity, if any. + * + * @param identity the identity value to set + * @return the DataLakeStoreAccountInner object itself. + */ + public DataLakeStoreAccountInner withIdentity(EncryptionIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the Data Lake Store account properties. + * + * @return the properties value + */ + public DataLakeStoreAccountProperties properties() { + return this.properties; + } + + /** + * Set the Data Lake Store account properties. + * + * @param properties the properties value to set + * @return the DataLakeStoreAccountInner object itself. + */ + public DataLakeStoreAccountInner withProperties(DataLakeStoreAccountProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountManagementClientImpl.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountManagementClientImpl.java new file mode 100644 index 0000000000000..b7e83b7cb2c8d --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreAccountManagementClientImpl.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataLakeStoreAccountManagementClientImpl class. + */ +public class DataLakeStoreAccountManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataLakeStoreAccountManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataLakeStoreAccountManagementClient", "2015-10-01-preview"); + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreManager.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreManager.java new file mode 100644 index 0000000000000..67eab654b2b2a --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/DataLakeStoreManager.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.Accounts; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataLakeStore resource management. + */ +public final class DataLakeStoreManager extends ManagerCore { + private Accounts accounts; + /** + * Get a Configurable instance that can be used to create DataLakeStoreManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataLakeStoreManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataLakeStoreManager + */ + public static DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataLakeStoreManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataLakeStoreManager + */ + public static DataLakeStoreManager authenticate(RestClient restClient, String subscriptionId) { + return new DataLakeStoreManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataLakeStore management API entry points that work across subscriptions + */ + DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataLakeStoreManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataLakeStoreManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataLakeStoreAccountManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleImpl.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleImpl.java new file mode 100644 index 0000000000000..57b6d88f6ab5f --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.FirewallRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.FirewallRuleProperties; + +class FirewallRuleImpl extends CreatableUpdatableImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private final DataLakeStoreManager manager; + private String resourceGroupName; + private String accountName; + private String name; + + FirewallRuleImpl(String name, DataLakeStoreManager manager) { + super(name, new FirewallRuleInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + FirewallRuleImpl(FirewallRuleInner inner, DataLakeStoreManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules"); + // + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createOrUpdateFirewallRuleAsync(this.resourceGroupName, this.accountName, this.name, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createOrUpdateFirewallRuleAsync(this.resourceGroupName, this.accountName, this.name, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getFirewallRuleAsync(this.resourceGroupName, this.accountName, this.name); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public FirewallRuleProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FirewallRuleImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public FirewallRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public FirewallRuleImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public FirewallRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public FirewallRuleImpl withProperties(FirewallRuleProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleInner.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleInner.java new file mode 100644 index 0000000000000..42ab0b0b9ef9f --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/FirewallRuleInner.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.microsoft.azure.management.datalakestore.v2015_10_01_preview.FirewallRuleProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store firewall rule information. + */ +public class FirewallRuleInner { + /** + * the firewall rule's name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * the namespace and type of the firewall Rule. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * the firewall rule's subscription ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * the firewall rule's regional location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * the properties of the firewall rule. + */ + @JsonProperty(value = "properties") + private FirewallRuleProperties properties; + + /** + * Get the firewall rule's name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the firewall rule's name. + * + * @param name the name value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace and type of the firewall Rule. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the firewall rule's subscription ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the firewall rule's subscription ID. + * + * @param id the id value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the firewall rule's regional location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the firewall rule's regional location. + * + * @param location the location value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties of the firewall rule. + * + * @return the properties value + */ + public FirewallRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties of the firewall rule. + * + * @param properties the properties value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withProperties(FirewallRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/IdParsingUtils.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..0944110a6ba4c --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/PageImpl.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..c0401d7a11158 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/package-info.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..4b012c7d140e1 --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataLakeStoreAccountManagementClient. + * DataLake Store Client. + */ +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview.implementation; diff --git a/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/package-info.java b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/package-info.java new file mode 100644 index 0000000000000..ce2beaaf11b6d --- /dev/null +++ b/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataLakeStoreAccountManagementClient. + * DataLake Store Client. + */ +package com.microsoft.azure.management.datalakestore.v2015_10_01_preview; diff --git a/datalakestore/resource-manager/v2016_11_01/pom.xml b/datalakestore/resource-manager/v2016_11_01/pom.xml new file mode 100644 index 0000000000000..0559ee0457bb9 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.datalakestore.v2016_11_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-datalakestore + 1.0.0-beta-2 + jar + Microsoft Azure SDK for DataLakeStore Management + This package contains Microsoft DataLakeStore Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Accounts.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Accounts.java new file mode 100644 index 0000000000000..27739695d6e19 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Accounts.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableKeyVaultAsync(String resourceGroupName, String accountName); + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CapabilityInformation.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CapabilityInformation.java new file mode 100644 index 0000000000000..8b0fe242dedf7 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CapabilityInformation.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.CapabilityInformationInner; +import java.util.UUID; + +/** + * Type representing CapabilityInformation. + */ +public interface CapabilityInformation extends HasInner, HasManager { + /** + * @return the accountCount value. + */ + Integer accountCount(); + + /** + * @return the maxAccountCount value. + */ + Integer maxAccountCount(); + + /** + * @return the migrationState value. + */ + Boolean migrationState(); + + /** + * @return the state value. + */ + SubscriptionState state(); + + /** + * @return the subscriptionId value. + */ + UUID subscriptionId(); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CheckNameAvailabilityParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..02ac6b936bfee --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CheckNameAvailabilityParameters.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account name availability check parameters. + */ +public class CheckNameAvailabilityParameters { + /** + * The Data Lake Store name to check availability for. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type. Note: This should not be set by the user, as the + * constant value is Microsoft.DataLakeStore/accounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the Data Lake Store name to check availability for. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.DataLakeStore/accounts"; + } + + /** + * Get the Data Lake Store name to check availability for. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Data Lake Store name to check availability for. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type. Note: This should not be set by the user, as the constant value is Microsoft.DataLakeStore/accounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Note: This should not be set by the user, as the constant value is Microsoft.DataLakeStore/accounts. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateDataLakeStoreAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateDataLakeStoreAccountParameters.java new file mode 100644 index 0000000000000..4f56303216be9 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateDataLakeStoreAccountParameters.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The CreateDataLakeStoreAccountParameters model. + */ +@JsonFlatten +public class CreateDataLakeStoreAccountParameters { + /** + * The resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The Key Vault encryption identity, if any. + */ + @JsonProperty(value = "identity") + private EncryptionIdentity identity; + + /** + * The default owner group for all new folders and files created in the + * Data Lake Store account. + */ + @JsonProperty(value = "properties.defaultGroup") + private String defaultGroup; + + /** + * The Key Vault encryption configuration. + */ + @JsonProperty(value = "properties.encryptionConfig") + private EncryptionConfig encryptionConfig; + + /** + * The current state of encryption for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.encryptionState") + private EncryptionState encryptionState; + + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /** + * The list of virtual network rules associated with this Data Lake Store + * account. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * The current state of the IP address firewall for this Data Lake Store + * account. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The list of trusted identity providers associated with this Data Lake + * Store account. + */ + @JsonProperty(value = "properties.trustedIdProviders") + private List trustedIdProviders; + + /** + * The current state of the trusted identity provider feature for this Data + * Lake Store account. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.trustedIdProviderState") + private TrustedIdProviderState trustedIdProviderState; + + /** + * The commitment tier to use for next month. Possible values include: + * 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', + * 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /** + * Get the resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the resource location. + * + * @param location the location value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the Key Vault encryption identity, if any. + * + * @return the identity value + */ + public EncryptionIdentity identity() { + return this.identity; + } + + /** + * Set the Key Vault encryption identity, if any. + * + * @param identity the identity value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withIdentity(EncryptionIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the default owner group for all new folders and files created in the Data Lake Store account. + * + * @return the defaultGroup value + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the default owner group for all new folders and files created in the Data Lake Store account. + * + * @param defaultGroup the defaultGroup value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + + /** + * Get the Key Vault encryption configuration. + * + * @return the encryptionConfig value + */ + public EncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set the Key Vault encryption configuration. + * + * @param encryptionConfig the encryptionConfig value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withEncryptionConfig(EncryptionConfig encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the current state of encryption for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the encryptionState value + */ + public EncryptionState encryptionState() { + return this.encryptionState; + } + + /** + * Set the current state of encryption for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @param encryptionState the encryptionState value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withEncryptionState(EncryptionState encryptionState) { + this.encryptionState = encryptionState; + return this; + } + + /** + * Get the list of firewall rules associated with this Data Lake Store account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the list of firewall rules associated with this Data Lake Store account. + * + * @param firewallRules the firewallRules value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the list of virtual network rules associated with this Data Lake Store account. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the list of virtual network rules associated with this Data Lake Store account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the current state of the IP address firewall for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the current state of the IP address firewall for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallState the firewallState value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the list of trusted identity providers associated with this Data Lake Store account. + * + * @return the trustedIdProviders value + */ + public List trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * Set the list of trusted identity providers associated with this Data Lake Store account. + * + * @param trustedIdProviders the trustedIdProviders value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withTrustedIdProviders(List trustedIdProviders) { + this.trustedIdProviders = trustedIdProviders; + return this; + } + + /** + * Get the current state of the trusted identity provider feature for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the trustedIdProviderState value + */ + public TrustedIdProviderState trustedIdProviderState() { + return this.trustedIdProviderState; + } + + /** + * Set the current state of the trusted identity provider feature for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @param trustedIdProviderState the trustedIdProviderState value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withTrustedIdProviderState(TrustedIdProviderState trustedIdProviderState) { + this.trustedIdProviderState = trustedIdProviderState; + return this; + } + + /** + * Get the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @param newTier the newTier value to set + * @return the CreateDataLakeStoreAccountParameters object itself. + */ + public CreateDataLakeStoreAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateFirewallRuleWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateFirewallRuleWithAccountParameters.java new file mode 100644 index 0000000000000..298b677b1a903 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateFirewallRuleWithAccountParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new firewall rule while creating a new Data + * Lake Store account. + */ +@JsonFlatten +public class CreateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the unique name of the firewall rule to create. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the firewall rule to create. + * + * @param name the name value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java new file mode 100644 index 0000000000000..e95cc4d6d885e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateFirewallRuleParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new firewall rule. + */ +@JsonFlatten +public class CreateOrUpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateTrustedIdProviderParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateTrustedIdProviderParameters.java new file mode 100644 index 0000000000000..60c84533eeb65 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateTrustedIdProviderParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new trusted identity provider. + */ +@JsonFlatten +public class CreateOrUpdateTrustedIdProviderParameters { + /** + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "properties.idProvider", required = true) + private String idProvider; + + /** + * Get the URL of this trusted identity provider. + * + * @return the idProvider value + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set + * @return the CreateOrUpdateTrustedIdProviderParameters object itself. + */ + public CreateOrUpdateTrustedIdProviderParameters withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateVirtualNetworkRuleParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateVirtualNetworkRuleParameters.java new file mode 100644 index 0000000000000..0a46007cb40cd --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateOrUpdateVirtualNetworkRuleParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new virtual network rule. + */ +@JsonFlatten +public class CreateOrUpdateVirtualNetworkRuleParameters { + /** + * The resource identifier for the subnet. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /** + * Get the resource identifier for the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the resource identifier for the subnet. + * + * @param subnetId the subnetId value to set + * @return the CreateOrUpdateVirtualNetworkRuleParameters object itself. + */ + public CreateOrUpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateTrustedIdProviderWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateTrustedIdProviderWithAccountParameters.java new file mode 100644 index 0000000000000..1ba42d3bc8f4e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateTrustedIdProviderWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new trusted identity provider while creating + * a new Data Lake Store account. + */ +@JsonFlatten +public class CreateTrustedIdProviderWithAccountParameters { + /** + * The unique name of the trusted identity provider to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "properties.idProvider", required = true) + private String idProvider; + + /** + * Get the unique name of the trusted identity provider to create. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the trusted identity provider to create. + * + * @param name the name value to set + * @return the CreateTrustedIdProviderWithAccountParameters object itself. + */ + public CreateTrustedIdProviderWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URL of this trusted identity provider. + * + * @return the idProvider value + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set + * @return the CreateTrustedIdProviderWithAccountParameters object itself. + */ + public CreateTrustedIdProviderWithAccountParameters withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateVirtualNetworkRuleWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateVirtualNetworkRuleWithAccountParameters.java new file mode 100644 index 0000000000000..8fd7dc0b40308 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/CreateVirtualNetworkRuleWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to create a new virtual network rule while creating a + * new Data Lake Store account. + */ +@JsonFlatten +public class CreateVirtualNetworkRuleWithAccountParameters { + /** + * The unique name of the virtual network rule to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource identifier for the subnet. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /** + * Get the unique name of the virtual network rule to create. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the virtual network rule to create. + * + * @param name the name value to set + * @return the CreateVirtualNetworkRuleWithAccountParameters object itself. + */ + public CreateVirtualNetworkRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource identifier for the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the resource identifier for the subnet. + * + * @param subnetId the subnetId value to set + * @return the CreateVirtualNetworkRuleWithAccountParameters object itself. + */ + public CreateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java new file mode 100644 index 0000000000000..77f24d3c05e8e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java @@ -0,0 +1,406 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; +import java.util.List; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreAccountInner; + +/** + * Type representing DataLakeStoreAccount. + */ +public interface DataLakeStoreAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accountId value. + */ + UUID accountId(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the currentTier value. + */ + TierType currentTier(); + + /** + * @return the defaultGroup value. + */ + String defaultGroup(); + + /** + * @return the encryptionConfig value. + */ + EncryptionConfig encryptionConfig(); + + /** + * @return the encryptionProvisioningState value. + */ + EncryptionProvisioningState encryptionProvisioningState(); + + /** + * @return the encryptionState value. + */ + EncryptionState encryptionState(); + + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the firewallAllowAzureIps value. + */ + FirewallAllowAzureIpsState firewallAllowAzureIps(); + + /** + * @return the firewallRules value. + */ + List firewallRules(); + + /** + * @return the firewallState value. + */ + FirewallState firewallState(); + + /** + * @return the identity value. + */ + EncryptionIdentity identity(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the newTier value. + */ + TierType newTier(); + + /** + * @return the provisioningState value. + */ + DataLakeStoreAccountStatus provisioningState(); + + /** + * @return the state value. + */ + DataLakeStoreAccountState state(); + + /** + * @return the trustedIdProviders value. + */ + List trustedIdProviders(); + + /** + * @return the trustedIdProviderState value. + */ + TrustedIdProviderState trustedIdProviderState(); + + /** + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + + /** + * The entirety of the DataLakeStoreAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataLakeStoreAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataLakeStoreAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataLakeStoreAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify DefaultGroup. + */ + interface WithDefaultGroup { + /** + * Specifies defaultGroup. + * @param defaultGroup The default owner group for all new folders and files created in the Data Lake Store account + * @return the next definition stage + */ + WithCreate withDefaultGroup(String defaultGroup); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify EncryptionConfig. + */ + interface WithEncryptionConfig { + /** + * Specifies encryptionConfig. + * @param encryptionConfig The Key Vault encryption configuration + * @return the next definition stage + */ + WithCreate withEncryptionConfig(EncryptionConfig encryptionConfig); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify EncryptionState. + */ + interface WithEncryptionState { + /** + * Specifies encryptionState. + * @param encryptionState The current state of encryption for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withEncryptionState(EncryptionState encryptionState); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify FirewallAllowAzureIps. + */ + interface WithFirewallAllowAzureIps { + /** + * Specifies firewallAllowAzureIps. + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify FirewallRules. + */ + interface WithFirewallRules { + /** + * Specifies firewallRules. + * @param firewallRules The list of firewall rules associated with this Data Lake Store account + * @return the next definition stage + */ + WithCreate withFirewallRulesForCreate(List firewallRules); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify FirewallState. + */ + interface WithFirewallState { + /** + * Specifies firewallState. + * @param firewallState The current state of the IP address firewall for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withFirewallState(FirewallState firewallState); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The Key Vault encryption identity, if any + * @return the next definition stage + */ + WithCreate withIdentity(EncryptionIdentity identity); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify NewTier. + */ + interface WithNewTier { + /** + * Specifies newTier. + * @param newTier The commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * @return the next definition stage + */ + WithCreate withNewTier(TierType newTier); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify TrustedIdProviders. + */ + interface WithTrustedIdProviders { + /** + * Specifies trustedIdProviders. + * @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account + * @return the next definition stage + */ + WithCreate withTrustedIdProvidersForCreate(List trustedIdProviders); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify TrustedIdProviderState. + */ + interface WithTrustedIdProviderState { + /** + * Specifies trustedIdProviderState. + * @param trustedIdProviderState The current state of the trusted identity provider feature for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withTrustedIdProviderState(TrustedIdProviderState trustedIdProviderState); + } + + /** + * The stage of the datalakestoreaccount definition allowing to specify VirtualNetworkRules. + */ + interface WithVirtualNetworkRules { + /** + * Specifies virtualNetworkRules. + * @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account + * @return the next definition stage + */ + WithCreate withVirtualNetworkRulesForCreate(List virtualNetworkRules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDefaultGroup, DefinitionStages.WithEncryptionConfig, DefinitionStages.WithEncryptionState, DefinitionStages.WithFirewallAllowAzureIps, DefinitionStages.WithFirewallRules, DefinitionStages.WithFirewallState, DefinitionStages.WithIdentity, DefinitionStages.WithNewTier, DefinitionStages.WithTrustedIdProviders, DefinitionStages.WithTrustedIdProviderState, DefinitionStages.WithVirtualNetworkRules { + } + } + /** + * The template for a DataLakeStoreAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDefaultGroup, UpdateStages.WithEncryptionConfig, UpdateStages.WithFirewallAllowAzureIps, UpdateStages.WithFirewallRules, UpdateStages.WithFirewallState, UpdateStages.WithNewTier, UpdateStages.WithTrustedIdProviders, UpdateStages.WithTrustedIdProviderState, UpdateStages.WithVirtualNetworkRules { + } + + /** + * Grouping of DataLakeStoreAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the datalakestoreaccount update allowing to specify DefaultGroup. + */ + interface WithDefaultGroup { + /** + * Specifies defaultGroup. + * @param defaultGroup The default owner group for all new folders and files created in the Data Lake Store account + * @return the next update stage + */ + Update withDefaultGroup(String defaultGroup); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify EncryptionConfig. + */ + interface WithEncryptionConfig { + /** + * Specifies encryptionConfig. + * @param encryptionConfig Used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed encryption Key Vault key + * @return the next update stage + */ + Update withEncryptionConfig(UpdateEncryptionConfig encryptionConfig); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify FirewallAllowAzureIps. + */ + interface WithFirewallAllowAzureIps { + /** + * Specifies firewallAllowAzureIps. + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify FirewallRules. + */ + interface WithFirewallRules { + /** + * Specifies firewallRules. + * @param firewallRules The list of firewall rules associated with this Data Lake Store account + * @return the next update stage + */ + Update withFirewallRulesForUpdate(List firewallRules); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify FirewallState. + */ + interface WithFirewallState { + /** + * Specifies firewallState. + * @param firewallState The current state of the IP address firewall for this Data Lake Store account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withFirewallState(FirewallState firewallState); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify NewTier. + */ + interface WithNewTier { + /** + * Specifies newTier. + * @param newTier The commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * @return the next update stage + */ + Update withNewTier(TierType newTier); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify TrustedIdProviders. + */ + interface WithTrustedIdProviders { + /** + * Specifies trustedIdProviders. + * @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account + * @return the next update stage + */ + Update withTrustedIdProvidersForUpdate(List trustedIdProviders); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify TrustedIdProviderState. + */ + interface WithTrustedIdProviderState { + /** + * Specifies trustedIdProviderState. + * @param trustedIdProviderState The current state of the trusted identity provider feature for this Data Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will just be ignored until this feature is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withTrustedIdProviderState(TrustedIdProviderState trustedIdProviderState); + } + + /** + * The stage of the datalakestoreaccount update allowing to specify VirtualNetworkRules. + */ + interface WithVirtualNetworkRules { + /** + * Specifies virtualNetworkRules. + * @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account + * @return the next update stage + */ + Update withVirtualNetworkRulesForUpdate(List virtualNetworkRules); + } + + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountState.java new file mode 100644 index 0000000000000..54e3b76b89baa --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountState. + */ +public enum DataLakeStoreAccountState { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Suspended. */ + SUSPENDED("Suspended"); + + /** The actual serialized value for a DataLakeStoreAccountState instance. */ + private String value; + + DataLakeStoreAccountState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountState fromString(String value) { + DataLakeStoreAccountState[] items = DataLakeStoreAccountState.values(); + for (DataLakeStoreAccountState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountStatus.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountStatus.java new file mode 100644 index 0000000000000..59a426b9afbff --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccountStatus.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountStatus. + */ +public enum DataLakeStoreAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"), + + /** Enum value Undeleting. */ + UNDELETING("Undeleting"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a DataLakeStoreAccountStatus instance. */ + private String value; + + DataLakeStoreAccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountStatus fromString(String value) { + DataLakeStoreAccountStatus[] items = DataLakeStoreAccountStatus.values(); + for (DataLakeStoreAccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfig.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfig.java new file mode 100644 index 0000000000000..caae16b10cb89 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfig.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption configuration for the account. + */ +public class EncryptionConfig { + /** + * The type of encryption configuration being used. Currently the only + * supported types are 'UserManaged' and 'ServiceManaged'. Possible values + * include: 'UserManaged', 'ServiceManaged'. + */ + @JsonProperty(value = "type", required = true) + private EncryptionConfigType type; + + /** + * The Key Vault information for connecting to user managed encryption + * keys. + */ + @JsonProperty(value = "keyVaultMetaInfo") + private KeyVaultMetaInfo keyVaultMetaInfo; + + /** + * Get the type of encryption configuration being used. Currently the only supported types are 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged'. + * + * @return the type value + */ + public EncryptionConfigType type() { + return this.type; + } + + /** + * Set the type of encryption configuration being used. Currently the only supported types are 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged'. + * + * @param type the type value to set + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withType(EncryptionConfigType type) { + this.type = type; + return this; + } + + /** + * Get the Key Vault information for connecting to user managed encryption keys. + * + * @return the keyVaultMetaInfo value + */ + public KeyVaultMetaInfo keyVaultMetaInfo() { + return this.keyVaultMetaInfo; + } + + /** + * Set the Key Vault information for connecting to user managed encryption keys. + * + * @param keyVaultMetaInfo the keyVaultMetaInfo value to set + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withKeyVaultMetaInfo(KeyVaultMetaInfo keyVaultMetaInfo) { + this.keyVaultMetaInfo = keyVaultMetaInfo; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfigType.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfigType.java new file mode 100644 index 0000000000000..898899e541e06 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionConfigType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionConfigType. + */ +public enum EncryptionConfigType { + /** Enum value UserManaged. */ + USER_MANAGED("UserManaged"), + + /** Enum value ServiceManaged. */ + SERVICE_MANAGED("ServiceManaged"); + + /** The actual serialized value for a EncryptionConfigType instance. */ + private String value; + + EncryptionConfigType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionConfigType instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionConfigType object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionConfigType fromString(String value) { + EncryptionConfigType[] items = EncryptionConfigType.values(); + for (EncryptionConfigType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionIdentity.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionIdentity.java new file mode 100644 index 0000000000000..d413c65ac81ea --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionIdentity.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption identity properties. + */ +public class EncryptionIdentity { + /** + * The type of encryption being used. Currently the only supported type is + * 'SystemAssigned'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The principal identifier associated with the encryption. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /** + * The tenant identifier associated with the encryption. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /** + * Creates an instance of EncryptionIdentity class. + */ + public EncryptionIdentity() { + type = "SystemAssigned"; + } + + /** + * Get the type of encryption being used. Currently the only supported type is 'SystemAssigned'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of encryption being used. Currently the only supported type is 'SystemAssigned'. + * + * @param type the type value to set + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withType(String type) { + this.type = type; + return this; + } + + /** + * Get the principal identifier associated with the encryption. + * + * @return the principalId value + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenant identifier associated with the encryption. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionProvisioningState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionProvisioningState.java new file mode 100644 index 0000000000000..e48eb634848e9 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionProvisioningState. + */ +public enum EncryptionProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a EncryptionProvisioningState instance. */ + private String value; + + EncryptionProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionProvisioningState fromString(String value) { + EncryptionProvisioningState[] items = EncryptionProvisioningState.values(); + for (EncryptionProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionState.java new file mode 100644 index 0000000000000..b8371634c1047 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/EncryptionState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionState. + */ +public enum EncryptionState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a EncryptionState instance. */ + private String value; + + EncryptionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionState instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionState object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionState fromString(String value) { + EncryptionState[] items = EncryptionState.values(); + for (EncryptionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallAllowAzureIpsState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallAllowAzureIpsState.java new file mode 100644 index 0000000000000..3a5b934008615 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallAllowAzureIpsState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FirewallAllowAzureIpsState. + */ +public enum FirewallAllowAzureIpsState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallAllowAzureIpsState instance. */ + private String value; + + FirewallAllowAzureIpsState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallAllowAzureIpsState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallAllowAzureIpsState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallAllowAzureIpsState fromString(String value) { + FirewallAllowAzureIpsState[] items = FirewallAllowAzureIpsState.values(); + for (FirewallAllowAzureIpsState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRule.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRule.java new file mode 100644 index 0000000000000..f0eadb3496a01 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRule.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.FirewallRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; + +/** + * Type representing FirewallRule. + */ +public interface FirewallRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FirewallRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithEndIpAddress, DefinitionStages.WithStartIpAddress, DefinitionStages.WithCreate { + } + + /** + * Grouping of FirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FirewallRule definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the firewallrule definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group + * @param accountName The name of the Data Lake Store account + * @return the next definition stage + */ + WithEndIpAddress withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the firewallrule definition allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next definition stage + */ + WithStartIpAddress withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule definition allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next definition stage + */ + WithCreate withStartIpAddress(String startIpAddress); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a FirewallRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEndIpAddress, UpdateStages.WithStartIpAddress { + } + + /** + * Grouping of FirewallRule update stages. + */ + interface UpdateStages { + /** + * The stage of the firewallrule update allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next update stage + */ + Update withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule update allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol + * @return the next update stage + */ + Update withStartIpAddress(String startIpAddress); + } + + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRules.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRules.java new file mode 100644 index 0000000000000..3fe46455b3a7e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.FirewallRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FirewallRules. + */ +public interface FirewallRules extends SupportsCreating, HasInner { + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallState.java new file mode 100644 index 0000000000000..118ec64825aa9 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/FirewallState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FirewallState. + */ +public enum FirewallState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallState instance. */ + private String value; + + FirewallState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallState fromString(String value) { + FirewallState[] items = FirewallState.values(); + for (FirewallState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/KeyVaultMetaInfo.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/KeyVaultMetaInfo.java new file mode 100644 index 0000000000000..2784af43301bb --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/KeyVaultMetaInfo.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata information used by account encryption. + */ +public class KeyVaultMetaInfo { + /** + * The resource identifier for the user managed Key Vault being used to + * encrypt. + */ + @JsonProperty(value = "keyVaultResourceId", required = true) + private String keyVaultResourceId; + + /** + * The name of the user managed encryption key. + */ + @JsonProperty(value = "encryptionKeyName", required = true) + private String encryptionKeyName; + + /** + * The version of the user managed encryption key. + */ + @JsonProperty(value = "encryptionKeyVersion", required = true) + private String encryptionKeyVersion; + + /** + * Get the resource identifier for the user managed Key Vault being used to encrypt. + * + * @return the keyVaultResourceId value + */ + public String keyVaultResourceId() { + return this.keyVaultResourceId; + } + + /** + * Set the resource identifier for the user managed Key Vault being used to encrypt. + * + * @param keyVaultResourceId the keyVaultResourceId value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withKeyVaultResourceId(String keyVaultResourceId) { + this.keyVaultResourceId = keyVaultResourceId; + return this; + } + + /** + * Get the name of the user managed encryption key. + * + * @return the encryptionKeyName value + */ + public String encryptionKeyName() { + return this.encryptionKeyName; + } + + /** + * Set the name of the user managed encryption key. + * + * @param encryptionKeyName the encryptionKeyName value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withEncryptionKeyName(String encryptionKeyName) { + this.encryptionKeyName = encryptionKeyName; + return this; + } + + /** + * Get the version of the user managed encryption key. + * + * @return the encryptionKeyVersion value + */ + public String encryptionKeyVersion() { + return this.encryptionKeyVersion; + } + + /** + * Set the version of the user managed encryption key. + * + * @param encryptionKeyVersion the encryptionKeyVersion value to set + * @return the KeyVaultMetaInfo object itself. + */ + public KeyVaultMetaInfo withEncryptionKeyVersion(String encryptionKeyVersion) { + this.encryptionKeyVersion = encryptionKeyVersion; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java new file mode 100644 index 0000000000000..ca6174e16063c --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCapabilityAsync(String location); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/NameAvailabilityInformation.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/NameAvailabilityInformation.java new file mode 100644 index 0000000000000..c45028c9afd61 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/NameAvailabilityInformation.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.NameAvailabilityInformationInner; + +/** + * Type representing NameAvailabilityInformation. + */ +public interface NameAvailabilityInformation extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationDisplay.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationDisplay.java new file mode 100644 index 0000000000000..f03b063fce551 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a particular operation. + */ +public class OperationDisplay { + /** + * The resource provider of the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The resource type of the operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * A friendly name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * A friendly description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the resource provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get a friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get a friendly description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationListResult.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationListResult.java new file mode 100644 index 0000000000000..f03c3bfd9e432 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationOrigin.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationOrigin.java new file mode 100644 index 0000000000000..2984277be36f9 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/OperationOrigin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationOrigin. + */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** Static value user,system for OperationOrigin. */ + public static final OperationOrigin USERSYSTEM = fromString("user,system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * @param name a name to look for + * @return the corresponding OperationOrigin + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** + * @return known OperationOrigin values + */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Operations.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Operations.java new file mode 100644 index 0000000000000..8f0792546af11 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Data Lake Store REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/SubscriptionState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/SubscriptionState.java new file mode 100644 index 0000000000000..bdfcce79c0bfc --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/SubscriptionState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SubscriptionState. + */ +public final class SubscriptionState extends ExpandableStringEnum { + /** Static value Registered for SubscriptionState. */ + public static final SubscriptionState REGISTERED = fromString("Registered"); + + /** Static value Suspended for SubscriptionState. */ + public static final SubscriptionState SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for SubscriptionState. */ + public static final SubscriptionState DELETED = fromString("Deleted"); + + /** Static value Unregistered for SubscriptionState. */ + public static final SubscriptionState UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for SubscriptionState. */ + public static final SubscriptionState WARNED = fromString("Warned"); + + /** + * Creates or finds a SubscriptionState from its string representation. + * @param name a name to look for + * @return the corresponding SubscriptionState + */ + @JsonCreator + public static SubscriptionState fromString(String name) { + return fromString(name, SubscriptionState.class); + } + + /** + * @return known SubscriptionState values + */ + public static Collection values() { + return values(SubscriptionState.class); + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TierType.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TierType.java new file mode 100644 index 0000000000000..288d444aa2ace --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TierType.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TierType. + */ +public enum TierType { + /** Enum value Consumption. */ + CONSUMPTION("Consumption"), + + /** Enum value Commitment_1TB. */ + COMMITMENT_1TB("Commitment_1TB"), + + /** Enum value Commitment_10TB. */ + COMMITMENT_10TB("Commitment_10TB"), + + /** Enum value Commitment_100TB. */ + COMMITMENT_100TB("Commitment_100TB"), + + /** Enum value Commitment_500TB. */ + COMMITMENT_500TB("Commitment_500TB"), + + /** Enum value Commitment_1PB. */ + COMMITMENT_1PB("Commitment_1PB"), + + /** Enum value Commitment_5PB. */ + COMMITMENT_5PB("Commitment_5PB"); + + /** The actual serialized value for a TierType instance. */ + private String value; + + TierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TierType instance. + * + * @param value the serialized value to parse. + * @return the parsed TierType object, or null if unable to parse. + */ + @JsonCreator + public static TierType fromString(String value) { + TierType[] items = TierType.values(); + for (TierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProvider.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProvider.java new file mode 100644 index 0000000000000..4b0990a6a8c00 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProvider.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.TrustedIdProviderInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; + +/** + * Type representing TrustedIdProvider. + */ +public interface TrustedIdProvider extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the idProvider value. + */ + String idProvider(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TrustedIdProvider definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithIdProvider, DefinitionStages.WithCreate { + } + + /** + * Grouping of TrustedIdProvider definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a TrustedIdProvider definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the trustedidprovider definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group + * @param accountName The name of the Data Lake Store account + * @return the next definition stage + */ + WithIdProvider withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the trustedidprovider definition allowing to specify IdProvider. + */ + interface WithIdProvider { + /** + * Specifies idProvider. + * @param idProvider The URL of this trusted identity provider + * @return the next definition stage + */ + WithCreate withIdProvider(String idProvider); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a TrustedIdProvider update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIdProvider { + } + + /** + * Grouping of TrustedIdProvider update stages. + */ + interface UpdateStages { + /** + * The stage of the trustedidprovider update allowing to specify IdProvider. + */ + interface WithIdProvider { + /** + * Specifies idProvider. + * @param idProvider The URL of this trusted identity provider + * @return the next update stage + */ + Update withIdProvider(String idProvider); + } + + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviderState.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviderState.java new file mode 100644 index 0000000000000..8f7eea6646d46 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviderState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrustedIdProviderState. + */ +public enum TrustedIdProviderState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a TrustedIdProviderState instance. */ + private String value; + + TrustedIdProviderState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrustedIdProviderState instance. + * + * @param value the serialized value to parse. + * @return the parsed TrustedIdProviderState object, or null if unable to parse. + */ + @JsonCreator + public static TrustedIdProviderState fromString(String value) { + TrustedIdProviderState[] items = TrustedIdProviderState.values(); + for (TrustedIdProviderState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviders.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviders.java new file mode 100644 index 0000000000000..97d81223ce26a --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/TrustedIdProviders.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.TrustedIdProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TrustedIdProviders. + */ +public interface TrustedIdProviders extends SupportsCreating, HasInner { + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String trustedIdProviderName); + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String trustedIdProviderName); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateDataLakeStoreAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateDataLakeStoreAccountParameters.java new file mode 100644 index 0000000000000..2c625de927049 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateDataLakeStoreAccountParameters.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Data Lake Store account information to update. + */ +@JsonFlatten +public class UpdateDataLakeStoreAccountParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The default owner group for all new folders and files created in the + * Data Lake Store account. + */ + @JsonProperty(value = "properties.defaultGroup") + private String defaultGroup; + + /** + * Used for rotation of user managed Key Vault keys. Can only be used to + * rotate a user managed encryption Key Vault key. + */ + @JsonProperty(value = "properties.encryptionConfig") + private UpdateEncryptionConfig encryptionConfig; + + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /** + * The list of virtual network rules associated with this Data Lake Store + * account. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * The current state of the IP address firewall for this Data Lake Store + * account. Disabling the firewall does not remove existing rules, they + * will just be ignored until the firewall is re-enabled. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The list of trusted identity providers associated with this Data Lake + * Store account. + */ + @JsonProperty(value = "properties.trustedIdProviders") + private List trustedIdProviders; + + /** + * The current state of the trusted identity provider feature for this Data + * Lake Store account. Disabling trusted identity provider functionality + * does not remove the providers, they will just be ignored until this + * feature is re-enabled. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.trustedIdProviderState") + private TrustedIdProviderState trustedIdProviderState; + + /** + * The commitment tier to use for next month. Possible values include: + * 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', + * 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the default owner group for all new folders and files created in the Data Lake Store account. + * + * @return the defaultGroup value + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the default owner group for all new folders and files created in the Data Lake Store account. + * + * @param defaultGroup the defaultGroup value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + + /** + * Get used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed encryption Key Vault key. + * + * @return the encryptionConfig value + */ + public UpdateEncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed encryption Key Vault key. + * + * @param encryptionConfig the encryptionConfig value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withEncryptionConfig(UpdateEncryptionConfig encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the list of firewall rules associated with this Data Lake Store account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the list of firewall rules associated with this Data Lake Store account. + * + * @param firewallRules the firewallRules value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the list of virtual network rules associated with this Data Lake Store account. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the list of virtual network rules associated with this Data Lake Store account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the current state of the IP address firewall for this Data Lake Store account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the current state of the IP address firewall for this Data Lake Store account. Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallState the firewallState value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the list of trusted identity providers associated with this Data Lake Store account. + * + * @return the trustedIdProviders value + */ + public List trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * Set the list of trusted identity providers associated with this Data Lake Store account. + * + * @param trustedIdProviders the trustedIdProviders value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withTrustedIdProviders(List trustedIdProviders) { + this.trustedIdProviders = trustedIdProviders; + return this; + } + + /** + * Get the current state of the trusted identity provider feature for this Data Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will just be ignored until this feature is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the trustedIdProviderState value + */ + public TrustedIdProviderState trustedIdProviderState() { + return this.trustedIdProviderState; + } + + /** + * Set the current state of the trusted identity provider feature for this Data Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will just be ignored until this feature is re-enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param trustedIdProviderState the trustedIdProviderState value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withTrustedIdProviderState(TrustedIdProviderState trustedIdProviderState) { + this.trustedIdProviderState = trustedIdProviderState; + return this; + } + + /** + * Get the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @param newTier the newTier value to set + * @return the UpdateDataLakeStoreAccountParameters object itself. + */ + public UpdateDataLakeStoreAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateEncryptionConfig.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateEncryptionConfig.java new file mode 100644 index 0000000000000..9a779153de101 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateEncryptionConfig.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption configuration used to update a user managed Key Vault key. + */ +public class UpdateEncryptionConfig { + /** + * The updated Key Vault key to use in user managed key rotation. + */ + @JsonProperty(value = "keyVaultMetaInfo") + private UpdateKeyVaultMetaInfo keyVaultMetaInfo; + + /** + * Get the updated Key Vault key to use in user managed key rotation. + * + * @return the keyVaultMetaInfo value + */ + public UpdateKeyVaultMetaInfo keyVaultMetaInfo() { + return this.keyVaultMetaInfo; + } + + /** + * Set the updated Key Vault key to use in user managed key rotation. + * + * @param keyVaultMetaInfo the keyVaultMetaInfo value to set + * @return the UpdateEncryptionConfig object itself. + */ + public UpdateEncryptionConfig withKeyVaultMetaInfo(UpdateKeyVaultMetaInfo keyVaultMetaInfo) { + this.keyVaultMetaInfo = keyVaultMetaInfo; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleParameters.java new file mode 100644 index 0000000000000..85709c6a037b8 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a firewall rule. + */ +@JsonFlatten +public class UpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java new file mode 100644 index 0000000000000..2a18655d28e0e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateFirewallRuleWithAccountParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a firewall rule while updating a Data Lake + * Store account. + */ +@JsonFlatten +public class UpdateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the unique name of the firewall rule to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the firewall rule to update. + * + * @param name the name value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateKeyVaultMetaInfo.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateKeyVaultMetaInfo.java new file mode 100644 index 0000000000000..5546d7ff8567b --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateKeyVaultMetaInfo.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Key Vault update information used for user managed key rotation. + */ +public class UpdateKeyVaultMetaInfo { + /** + * The version of the user managed encryption key to update through a key + * rotation. + */ + @JsonProperty(value = "encryptionKeyVersion") + private String encryptionKeyVersion; + + /** + * Get the version of the user managed encryption key to update through a key rotation. + * + * @return the encryptionKeyVersion value + */ + public String encryptionKeyVersion() { + return this.encryptionKeyVersion; + } + + /** + * Set the version of the user managed encryption key to update through a key rotation. + * + * @param encryptionKeyVersion the encryptionKeyVersion value to set + * @return the UpdateKeyVaultMetaInfo object itself. + */ + public UpdateKeyVaultMetaInfo withEncryptionKeyVersion(String encryptionKeyVersion) { + this.encryptionKeyVersion = encryptionKeyVersion; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderParameters.java new file mode 100644 index 0000000000000..1b64c1e285e71 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a trusted identity provider. + */ +@JsonFlatten +public class UpdateTrustedIdProviderParameters { + /** + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "properties.idProvider") + private String idProvider; + + /** + * Get the URL of this trusted identity provider. + * + * @return the idProvider value + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set + * @return the UpdateTrustedIdProviderParameters object itself. + */ + public UpdateTrustedIdProviderParameters withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderWithAccountParameters.java new file mode 100644 index 0000000000000..03d9f8ed15125 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateTrustedIdProviderWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a trusted identity provider while updating a + * Data Lake Store account. + */ +@JsonFlatten +public class UpdateTrustedIdProviderWithAccountParameters { + /** + * The unique name of the trusted identity provider to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "properties.idProvider") + private String idProvider; + + /** + * Get the unique name of the trusted identity provider to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the trusted identity provider to update. + * + * @param name the name value to set + * @return the UpdateTrustedIdProviderWithAccountParameters object itself. + */ + public UpdateTrustedIdProviderWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URL of this trusted identity provider. + * + * @return the idProvider value + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set + * @return the UpdateTrustedIdProviderWithAccountParameters object itself. + */ + public UpdateTrustedIdProviderWithAccountParameters withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleParameters.java new file mode 100644 index 0000000000000..ad0c60abaa7d5 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a virtual network rule. + */ +@JsonFlatten +public class UpdateVirtualNetworkRuleParameters { + /** + * The resource identifier for the subnet. + */ + @JsonProperty(value = "properties.subnetId") + private String subnetId; + + /** + * Get the resource identifier for the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the resource identifier for the subnet. + * + * @param subnetId the subnetId value to set + * @return the UpdateVirtualNetworkRuleParameters object itself. + */ + public UpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleWithAccountParameters.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleWithAccountParameters.java new file mode 100644 index 0000000000000..943e41cc82482 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UpdateVirtualNetworkRuleWithAccountParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used to update a virtual network rule while updating a Data + * Lake Store account. + */ +@JsonFlatten +public class UpdateVirtualNetworkRuleWithAccountParameters { + /** + * The unique name of the virtual network rule to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource identifier for the subnet. + */ + @JsonProperty(value = "properties.subnetId") + private String subnetId; + + /** + * Get the unique name of the virtual network rule to update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name of the virtual network rule to update. + * + * @param name the name value to set + * @return the UpdateVirtualNetworkRuleWithAccountParameters object itself. + */ + public UpdateVirtualNetworkRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource identifier for the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the resource identifier for the subnet. + * + * @param subnetId the subnetId value to set + * @return the UpdateVirtualNetworkRuleWithAccountParameters object itself. + */ + public UpdateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRule.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRule.java new file mode 100644 index 0000000000000..25d0ced8c74cd --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRule.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.VirtualNetworkRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; + +/** + * Type representing VirtualNetworkRule. + */ +public interface VirtualNetworkRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the subnetId value. + */ + String subnetId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the VirtualNetworkRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkRule definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the Azure resource group + * @param accountName The name of the Data Lake Store account + * @return the next definition stage + */ + WithSubnetId withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + * @param subnetId The resource identifier for the subnet + * @return the next definition stage + */ + WithCreate withSubnetId(String subnetId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a VirtualNetworkRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSubnetId { + } + + /** + * Grouping of VirtualNetworkRule update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkrule update allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + * @param subnetId The resource identifier for the subnet + * @return the next update stage + */ + Update withSubnetId(String subnetId); + } + + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRules.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRules.java new file mode 100644 index 0000000000000..d7c524f30c37a --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/VirtualNetworkRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.VirtualNetworkRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkRules. + */ +public interface VirtualNetworkRules extends SupportsCreating, HasInner { + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName); + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName); + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..974ff93062d1a --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsImpl.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.datalakestore.v2016_11_01.NameAvailabilityInformation; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CheckNameAvailabilityParameters; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(DataLakeStoreManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(DataLakeStoreAccountBasicInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeStoreAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeStoreAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AccountsInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(DataLakeStoreAccountBasicInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeStoreAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + AccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(DataLakeStoreAccountBasicInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public DataLakeStoreAccount call(DataLakeStoreAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DataLakeStoreAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable enableKeyVaultAsync(String resourceGroupName, String accountName) { + AccountsInner client = this.inner(); + return client.enableKeyVaultAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + protected DataLakeStoreAccountImpl wrapModel(DataLakeStoreAccountInner inner) { + return new DataLakeStoreAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected DataLakeStoreAccountImpl wrapModel(String name) { + return new DataLakeStoreAccountImpl(name, new DataLakeStoreAccountInner(), this.manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) { + AccountsInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, parameters) + .map(new Func1() { + @Override + public NameAvailabilityInformation call(NameAvailabilityInformationInner inner) { + return new NameAvailabilityInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java new file mode 100644 index 0000000000000..3df5ba9bdb238 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java @@ -0,0 +1,1608 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateDataLakeStoreAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateDataLakeStoreAccountParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body CreateDataLakeStoreAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body CreateDataLakeStoreAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body UpdateDataLakeStoreAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body UpdateDataLakeStoreAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts enableKeyVault" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault") + Observable> enableKeyVault(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Body CheckNameAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.list(this.client.subscriptionId(), filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listSinglePageAsync(filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listWithServiceResponseAsync(filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listSinglePageAsync(filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skip, select, orderby, count) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param filter OData filter. Optional. + ServiceResponse> * @param top The number of items to return. Optional. + ServiceResponse> * @param skip The number of items to skip over before returning elements. Optional. + ServiceResponse> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + ServiceResponse> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + ServiceResponse> * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, filter, top, skip, select, orderby, count, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner create(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner beginCreate(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner update(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataLakeStoreAccountInner object if successful. + */ + public DataLakeStoreAccountInner beginUpdate(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, DataLakeStoreAccountInner>() { + @Override + public DataLakeStoreAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataLakeStoreAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableKeyVault(String resourceGroupName, String accountName) { + enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableKeyVaultAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableKeyVaultAsync(String resourceGroupName, String accountName) { + return enableKeyVaultWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableKeyVaultWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.enableKeyVault(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableKeyVaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableKeyVaultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityInformationInner object if successful. + */ + public NameAvailabilityInformationInner checkNameAvailability(String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInformationInner object + */ + public Observable checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityInformationInner>() { + @Override + public NameAvailabilityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInformationInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, CheckNameAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), location, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataLakeStoreAccountBasicInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataLakeStoreAccountBasicInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataLakeStoreAccountBasicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationImpl.java new file mode 100644 index 0000000000000..2b6461ac422d4 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.CapabilityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.SubscriptionState; +import java.util.UUID; + +class CapabilityInformationImpl extends WrapperImpl implements CapabilityInformation { + private final DataLakeStoreManager manager; + CapabilityInformationImpl(CapabilityInformationInner inner, DataLakeStoreManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Integer accountCount() { + return this.inner().accountCount(); + } + + @Override + public Integer maxAccountCount() { + return this.inner().maxAccountCount(); + } + + @Override + public Boolean migrationState() { + return this.inner().migrationState(); + } + + @Override + public SubscriptionState state() { + return this.inner().state(); + } + + @Override + public UUID subscriptionId() { + return this.inner().subscriptionId(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationInner.java new file mode 100644 index 0000000000000..5db49e942813d --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/CapabilityInformationInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakestore.v2016_11_01.SubscriptionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subscription-level properties and limits for Data Lake Store. + */ +public class CapabilityInformationInner { + /** + * The subscription credentials that uniquely identifies the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; + + /** + * The subscription state. Possible values include: 'Registered', + * 'Suspended', 'Deleted', 'Unregistered', 'Warned'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SubscriptionState state; + + /** + * The maximum supported number of accounts under this subscription. + */ + @JsonProperty(value = "maxAccountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxAccountCount; + + /** + * The current number of accounts under this subscription. + */ + @JsonProperty(value = "accountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer accountCount; + + /** + * The Boolean value of true or false to indicate the maintenance state. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private Boolean migrationState; + + /** + * Get the subscription credentials that uniquely identifies the subscription. + * + * @return the subscriptionId value + */ + public UUID subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscription state. Possible values include: 'Registered', 'Suspended', 'Deleted', 'Unregistered', 'Warned'. + * + * @return the state value + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Get the maximum supported number of accounts under this subscription. + * + * @return the maxAccountCount value + */ + public Integer maxAccountCount() { + return this.maxAccountCount; + } + + /** + * Get the current number of accounts under this subscription. + * + * @return the accountCount value + */ + public Integer accountCount() { + return this.accountCount; + } + + /** + * Get the Boolean value of true or false to indicate the maintenance state. + * + * @return the migrationState value + */ + public Boolean migrationState() { + return this.migrationState; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountBasicInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountBasicInner.java new file mode 100644 index 0000000000000..aef0650a8fa87 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountBasicInner.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountStatus; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Basic Data Lake Store account information, returned on list calls. + */ +@JsonFlatten +@SkipParentValidation +public class DataLakeStoreAccountBasicInner extends Resource { + /** + * The unique identifier associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /** + * The provisioning status of the Data Lake Store account. Possible values + * include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', + * 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', + * 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountStatus provisioningState; + + /** + * The state of the Data Lake Store account. Possible values include: + * 'Active', 'Suspended'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountState state; + + /** + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the unique identifier associated with this Data Lake Store account. + * + * @return the accountId value + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioning status of the Data Lake Store account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled'. + * + * @return the provisioningState value + */ + public DataLakeStoreAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state of the Data Lake Store account. Possible values include: 'Active', 'Suspended'. + * + * @return the state value + */ + public DataLakeStoreAccountState state() { + return this.state; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the full CName endpoint for this account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java new file mode 100644 index 0000000000000..b8693598d607b --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccount; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateDataLakeStoreAccountParameters; +import java.util.List; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateDataLakeStoreAccountParameters; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TierType; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionConfig; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionProvisioningState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallAllowAzureIpsState; +import java.util.ArrayList; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRule; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionIdentity; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountStatus; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProvider; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviderState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRule; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateFirewallRuleWithAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateTrustedIdProviderWithAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateVirtualNetworkRuleWithAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateEncryptionConfig; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateFirewallRuleWithAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateTrustedIdProviderWithAccountParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateVirtualNetworkRuleWithAccountParameters; +import rx.functions.Func1; + +class DataLakeStoreAccountImpl extends GroupableResourceCoreImpl implements DataLakeStoreAccount, DataLakeStoreAccount.Definition, DataLakeStoreAccount.Update { + private CreateDataLakeStoreAccountParameters createParameter; + private UpdateDataLakeStoreAccountParameters updateParameter; + DataLakeStoreAccountImpl(String name, DataLakeStoreAccountInner inner, DataLakeStoreManager manager) { + super(name, inner, manager); + this.createParameter = new CreateDataLakeStoreAccountParameters(); + this.updateParameter = new UpdateDataLakeStoreAccountParameters(); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public DataLakeStoreAccountInner call(DataLakeStoreAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DataLakeStoreAccountInner call(DataLakeStoreAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateDataLakeStoreAccountParameters(); + this.updateParameter = new UpdateDataLakeStoreAccountParameters(); + } + + @Override + public UUID accountId() { + return this.inner().accountId(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public TierType currentTier() { + return this.inner().currentTier(); + } + + @Override + public String defaultGroup() { + return this.inner().defaultGroup(); + } + + @Override + public EncryptionConfig encryptionConfig() { + return this.inner().encryptionConfig(); + } + + @Override + public EncryptionProvisioningState encryptionProvisioningState() { + return this.inner().encryptionProvisioningState(); + } + + @Override + public EncryptionState encryptionState() { + return this.inner().encryptionState(); + } + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.inner().firewallAllowAzureIps(); + } + + @Override + public List firewallRules() { + List lst = new ArrayList(); + if (this.inner().firewallRules() != null) { + for (FirewallRuleInner inner : this.inner().firewallRules()) { + lst.add( new FirewallRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public FirewallState firewallState() { + return this.inner().firewallState(); + } + + @Override + public EncryptionIdentity identity() { + return this.inner().identity(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public TierType newTier() { + return this.inner().newTier(); + } + + @Override + public DataLakeStoreAccountStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DataLakeStoreAccountState state() { + return this.inner().state(); + } + + @Override + public List trustedIdProviders() { + List lst = new ArrayList(); + if (this.inner().trustedIdProviders() != null) { + for (TrustedIdProviderInner inner : this.inner().trustedIdProviders()) { + lst.add( new TrustedIdProviderImpl(inner, manager())); + } + } + return lst; + } + + @Override + public TrustedIdProviderState trustedIdProviderState() { + return this.inner().trustedIdProviderState(); + } + + @Override + public List virtualNetworkRules() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkRules() != null) { + for (VirtualNetworkRuleInner inner : this.inner().virtualNetworkRules()) { + lst.add( new VirtualNetworkRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public DataLakeStoreAccountImpl withEncryptionConfig(EncryptionConfig encryptionConfig) { + this.createParameter.withEncryptionConfig(encryptionConfig); + return this; + } + + @Override + public DataLakeStoreAccountImpl withEncryptionState(EncryptionState encryptionState) { + this.createParameter.withEncryptionState(encryptionState); + return this; + } + + @Override + public DataLakeStoreAccountImpl withFirewallRulesForCreate(List firewallRules) { + this.createParameter.withFirewallRules(firewallRules); + return this; + } + + @Override + public DataLakeStoreAccountImpl withIdentity(EncryptionIdentity identity) { + this.createParameter.withIdentity(identity); + return this; + } + + @Override + public DataLakeStoreAccountImpl withTrustedIdProvidersForCreate(List trustedIdProviders) { + this.createParameter.withTrustedIdProviders(trustedIdProviders); + return this; + } + + @Override + public DataLakeStoreAccountImpl withVirtualNetworkRulesForCreate(List virtualNetworkRules) { + this.createParameter.withVirtualNetworkRules(virtualNetworkRules); + return this; + } + + @Override + public DataLakeStoreAccountImpl withEncryptionConfig(UpdateEncryptionConfig encryptionConfig) { + this.updateParameter.withEncryptionConfig(encryptionConfig); + return this; + } + + @Override + public DataLakeStoreAccountImpl withFirewallRulesForUpdate(List firewallRules) { + this.updateParameter.withFirewallRules(firewallRules); + return this; + } + + @Override + public DataLakeStoreAccountImpl withTrustedIdProvidersForUpdate(List trustedIdProviders) { + this.updateParameter.withTrustedIdProviders(trustedIdProviders); + return this; + } + + @Override + public DataLakeStoreAccountImpl withVirtualNetworkRulesForUpdate(List virtualNetworkRules) { + this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); + return this; + } + + @Override + public DataLakeStoreAccountImpl withDefaultGroup(String defaultGroup) { + if (isInCreateMode()) { + this.createParameter.withDefaultGroup(defaultGroup); + } else { + this.updateParameter.withDefaultGroup(defaultGroup); + } + return this; + } + + @Override + public DataLakeStoreAccountImpl withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + if (isInCreateMode()) { + this.createParameter.withFirewallAllowAzureIps(firewallAllowAzureIps); + } else { + this.updateParameter.withFirewallAllowAzureIps(firewallAllowAzureIps); + } + return this; + } + + @Override + public DataLakeStoreAccountImpl withFirewallState(FirewallState firewallState) { + if (isInCreateMode()) { + this.createParameter.withFirewallState(firewallState); + } else { + this.updateParameter.withFirewallState(firewallState); + } + return this; + } + + @Override + public DataLakeStoreAccountImpl withNewTier(TierType newTier) { + if (isInCreateMode()) { + this.createParameter.withNewTier(newTier); + } else { + this.updateParameter.withNewTier(newTier); + } + return this; + } + + @Override + public DataLakeStoreAccountImpl withTrustedIdProviderState(TrustedIdProviderState trustedIdProviderState) { + if (isInCreateMode()) { + this.createParameter.withTrustedIdProviderState(trustedIdProviderState); + } else { + this.updateParameter.withTrustedIdProviderState(trustedIdProviderState); + } + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountInner.java new file mode 100644 index 0000000000000..c90d7ac4f60ae --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountInner.java @@ -0,0 +1,338 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionIdentity; +import java.util.UUID; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountStatus; +import com.microsoft.azure.management.datalakestore.v2016_11_01.DataLakeStoreAccountState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionConfig; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.EncryptionProvisioningState; +import java.util.List; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallAllowAzureIpsState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviderState; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TierType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Data Lake Store account information. + */ +@JsonFlatten +@SkipParentValidation +public class DataLakeStoreAccountInner extends Resource { + /** + * The Key Vault encryption identity, if any. + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionIdentity identity; + + /** + * The unique identifier associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /** + * The provisioning status of the Data Lake Store account. Possible values + * include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', + * 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', + * 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountStatus provisioningState; + + /** + * The state of the Data Lake Store account. Possible values include: + * 'Active', 'Suspended'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountState state; + + /** + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * The default owner group for all new folders and files created in the + * Data Lake Store account. + */ + @JsonProperty(value = "properties.defaultGroup", access = JsonProperty.Access.WRITE_ONLY) + private String defaultGroup; + + /** + * The Key Vault encryption configuration. + */ + @JsonProperty(value = "properties.encryptionConfig", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionConfig encryptionConfig; + + /** + * The current state of encryption for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.encryptionState", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionState encryptionState; + + /** + * The current state of encryption provisioning for this Data Lake Store + * account. Possible values include: 'Creating', 'Succeeded'. + */ + @JsonProperty(value = "properties.encryptionProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionProvisioningState encryptionProvisioningState; + + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "properties.firewallRules", access = JsonProperty.Access.WRITE_ONLY) + private List firewallRules; + + /** + * The list of virtual network rules associated with this Data Lake Store + * account. + */ + @JsonProperty(value = "properties.virtualNetworkRules", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworkRules; + + /** + * The current state of the IP address firewall for this Data Lake Store + * account. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallState", access = JsonProperty.Access.WRITE_ONLY) + private FirewallState firewallState; + + /** + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps", access = JsonProperty.Access.WRITE_ONLY) + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /** + * The list of trusted identity providers associated with this Data Lake + * Store account. + */ + @JsonProperty(value = "properties.trustedIdProviders", access = JsonProperty.Access.WRITE_ONLY) + private List trustedIdProviders; + + /** + * The current state of the trusted identity provider feature for this Data + * Lake Store account. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.trustedIdProviderState", access = JsonProperty.Access.WRITE_ONLY) + private TrustedIdProviderState trustedIdProviderState; + + /** + * The commitment tier to use for next month. Possible values include: + * 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', + * 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + */ + @JsonProperty(value = "properties.newTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType newTier; + + /** + * The commitment tier in use for the current month. Possible values + * include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB'. + */ + @JsonProperty(value = "properties.currentTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType currentTier; + + /** + * Get the Key Vault encryption identity, if any. + * + * @return the identity value + */ + public EncryptionIdentity identity() { + return this.identity; + } + + /** + * Get the unique identifier associated with this Data Lake Store account. + * + * @return the accountId value + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioning status of the Data Lake Store account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled'. + * + * @return the provisioningState value + */ + public DataLakeStoreAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state of the Data Lake Store account. Possible values include: 'Active', 'Suspended'. + * + * @return the state value + */ + public DataLakeStoreAccountState state() { + return this.state; + } + + /** + * Get the account creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get the account last modified time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the full CName endpoint for this account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the default owner group for all new folders and files created in the Data Lake Store account. + * + * @return the defaultGroup value + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Get the Key Vault encryption configuration. + * + * @return the encryptionConfig value + */ + public EncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Get the current state of encryption for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the encryptionState value + */ + public EncryptionState encryptionState() { + return this.encryptionState; + } + + /** + * Get the current state of encryption provisioning for this Data Lake Store account. Possible values include: 'Creating', 'Succeeded'. + * + * @return the encryptionProvisioningState value + */ + public EncryptionProvisioningState encryptionProvisioningState() { + return this.encryptionProvisioningState; + } + + /** + * Get the list of firewall rules associated with this Data Lake Store account. + * + * @return the firewallRules value + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Get the list of virtual network rules associated with this Data Lake Store account. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Get the current state of the IP address firewall for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallState value + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Get the current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is disabled, this is not enforced. Possible values include: 'Enabled', 'Disabled'. + * + * @return the firewallAllowAzureIps value + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Get the list of trusted identity providers associated with this Data Lake Store account. + * + * @return the trustedIdProviders value + */ + public List trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * Get the current state of the trusted identity provider feature for this Data Lake Store account. Possible values include: 'Enabled', 'Disabled'. + * + * @return the trustedIdProviderState value + */ + public TrustedIdProviderState trustedIdProviderState() { + return this.trustedIdProviderState; + } + + /** + * Get the commitment tier to use for next month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @return the newTier value + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Get the commitment tier in use for the current month. Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB'. + * + * @return the currentTier value + */ + public TierType currentTier() { + return this.currentTier; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountManagementClientImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountManagementClientImpl.java new file mode 100644 index 0000000000000..edaaf7717c790 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountManagementClientImpl.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataLakeStoreAccountManagementClientImpl class. + */ +public class DataLakeStoreAccountManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataLakeStoreAccountManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The FirewallRulesInner object to access its operations. + */ + private FirewallRulesInner firewallRules; + + /** + * Gets the FirewallRulesInner object to access its operations. + * @return the FirewallRulesInner object. + */ + public FirewallRulesInner firewallRules() { + return this.firewallRules; + } + + /** + * The VirtualNetworkRulesInner object to access its operations. + */ + private VirtualNetworkRulesInner virtualNetworkRules; + + /** + * Gets the VirtualNetworkRulesInner object to access its operations. + * @return the VirtualNetworkRulesInner object. + */ + public VirtualNetworkRulesInner virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * The TrustedIdProvidersInner object to access its operations. + */ + private TrustedIdProvidersInner trustedIdProviders; + + /** + * Gets the TrustedIdProvidersInner object to access its operations. + * @return the TrustedIdProvidersInner object. + */ + public TrustedIdProvidersInner trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataLakeStoreAccountManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-11-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); + this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); + this.trustedIdProviders = new TrustedIdProvidersInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataLakeStoreAccountManagementClient", "2016-11-01"); + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreManager.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreManager.java new file mode 100644 index 0000000000000..1d0479be7af67 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Accounts; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules; +import com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Operations; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Locations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataLakeStore resource management. + */ +public final class DataLakeStoreManager extends ManagerCore { + private Accounts accounts; + private FirewallRules firewallRules; + private VirtualNetworkRules virtualNetworkRules; + private TrustedIdProviders trustedIdProviders; + private Operations operations; + private Locations locations; + /** + * Get a Configurable instance that can be used to create DataLakeStoreManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataLakeStoreManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataLakeStoreManager + */ + public static DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataLakeStoreManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataLakeStoreManager + */ + public static DataLakeStoreManager authenticate(RestClient restClient, String subscriptionId) { + return new DataLakeStoreManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataLakeStoreManager that exposes DataLakeStore management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataLakeStore management API entry points that work across subscriptions + */ + DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * @return Entry point to manage FirewallRules. + */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(this); + } + return this.firewallRules; + } + + /** + * @return Entry point to manage VirtualNetworkRules. + */ + public VirtualNetworkRules virtualNetworkRules() { + if (this.virtualNetworkRules == null) { + this.virtualNetworkRules = new VirtualNetworkRulesImpl(this); + } + return this.virtualNetworkRules; + } + + /** + * @return Entry point to manage TrustedIdProviders. + */ + public TrustedIdProviders trustedIdProviders() { + if (this.trustedIdProviders == null) { + this.trustedIdProviders = new TrustedIdProvidersImpl(this); + } + return this.trustedIdProviders; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataLakeStoreManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataLakeStoreManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataLakeStoreManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataLakeStoreAccountManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java new file mode 100644 index 0000000000000..991d4dade49d5 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateFirewallRuleParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateFirewallRuleParameters; +import rx.functions.Func1; + +class FirewallRuleImpl extends CreatableUpdatableImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private final DataLakeStoreManager manager; + private String resourceGroupName; + private String accountName; + private String firewallRuleName; + private CreateOrUpdateFirewallRuleParameters createParameter; + private UpdateFirewallRuleParameters updateParameter; + + FirewallRuleImpl(String name, DataLakeStoreManager manager) { + super(name, new FirewallRuleInner()); + this.manager = manager; + // Set resource name + this.firewallRuleName = name; + // + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + FirewallRuleImpl(FirewallRuleInner inner, DataLakeStoreManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.firewallRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.firewallRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules"); + // + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.firewallRuleName, this.createParameter) + .map(new Func1() { + @Override + public FirewallRuleInner call(FirewallRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.firewallRuleName, this.updateParameter) + .map(new Func1() { + @Override + public FirewallRuleInner call(FirewallRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.getAsync(this.resourceGroupName, this.accountName, this.firewallRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateOrUpdateFirewallRuleParameters(); + this.updateParameter = new UpdateFirewallRuleParameters(); + } + + @Override + public String endIpAddress() { + return this.inner().endIpAddress(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String startIpAddress() { + return this.inner().startIpAddress(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FirewallRuleImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public FirewallRuleImpl withEndIpAddress(String endIpAddress) { + if (isInCreateMode()) { + this.createParameter.withEndIpAddress(endIpAddress); + } else { + this.updateParameter.withEndIpAddress(endIpAddress); + } + return this; + } + + @Override + public FirewallRuleImpl withStartIpAddress(String startIpAddress) { + if (isInCreateMode()) { + this.createParameter.withStartIpAddress(startIpAddress); + } else { + this.updateParameter.withStartIpAddress(startIpAddress); + } + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleInner.java new file mode 100644 index 0000000000000..7377c0653ccb0 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleInner.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Store firewall rule information. + */ +@JsonFlatten +public class FirewallRuleInner extends SubResource { + /** + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String startIpAddress; + + /** + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String endIpAddress; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Get the end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesImpl.java new file mode 100644 index 0000000000000..e8b368d550cb8 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRule; + +class FirewallRulesImpl extends WrapperImpl implements FirewallRules { + private final DataLakeStoreManager manager; + + FirewallRulesImpl(DataLakeStoreManager manager) { + super(manager.inner().firewallRules()); + this.manager = manager; + } + + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public FirewallRuleImpl define(String name) { + return wrapModel(name); + } + + private FirewallRuleImpl wrapModel(FirewallRuleInner inner) { + return new FirewallRuleImpl(inner, manager()); + } + + private FirewallRuleImpl wrapModel(String name) { + return new FirewallRuleImpl(name, this.manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + FirewallRulesInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, firewallRuleName) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, firewallRuleName).toCompletable(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java new file mode 100644 index 0000000000000..55dd3da93827f --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateFirewallRuleParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateFirewallRuleParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in FirewallRules. + */ +public class FirewallRulesInner { + /** The Retrofit service to perform REST calls. */ + private FirewallRulesService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FirewallRulesInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(FirewallRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FirewallRules to be + * used by Retrofit to perform actually REST calls. + */ + interface FirewallRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Body CreateOrUpdateFirewallRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Body UpdateFirewallRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.FirewallRules listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner createOrUpdate(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateFirewallRuleParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FirewallRuleInner object if successful. + */ + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName), serviceCallback); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FirewallRuleInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FirewallRuleInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/IdParsingUtils.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..744694bf7936b --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..7aef8cec80817 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CapabilityInformation; + +class LocationsImpl extends WrapperImpl implements Locations { + private final DataLakeStoreManager manager; + + LocationsImpl(DataLakeStoreManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable getCapabilityAsync(String location) { + LocationsInner client = this.inner(); + return client.getCapabilityAsync(location) + .map(new Func1() { + @Override + public CapabilityInformation call(CapabilityInformationInner inner) { + return new CapabilityInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java new file mode 100644 index 0000000000000..48af59f32df3f --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Locations getCapability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/capability") + Observable> getCapability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilityInformationInner object if successful. + */ + public CapabilityInformationInner getCapability(String location) { + return getCapabilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param location The resource location without whitespace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCapabilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCapabilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilityInformationInner object + */ + public Observable getCapabilityAsync(String location) { + return getCapabilityWithServiceResponseAsync(location).map(new Func1, CapabilityInformationInner>() { + @Override + public CapabilityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilityInformationInner object + */ + public Observable> getCapabilityWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCapability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCapabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCapabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationImpl.java new file mode 100644 index 0000000000000..14339211b3333 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.NameAvailabilityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityInformationImpl extends WrapperImpl implements NameAvailabilityInformation { + private final DataLakeStoreManager manager; + NameAvailabilityInformationImpl(NameAvailabilityInformationInner inner, DataLakeStoreManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationInner.java new file mode 100644 index 0000000000000..89c71640d866e --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/NameAvailabilityInformationInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account name availability result information. + */ +public class NameAvailabilityInformationInner { + /** + * The Boolean value of true or false to indicate whether the Data Lake + * Store account name is available or not. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason why the Data Lake Store account name is not available, if + * nameAvailable is false. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * The message describing why the Data Lake Store account name is not + * available, if nameAvailable is false. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the Boolean value of true or false to indicate whether the Data Lake Store account name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason why the Data Lake Store account name is not available, if nameAvailable is false. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get the message describing why the Data Lake Store account name is not available, if nameAvailable is false. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..6af6f436fb9ef --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationInner.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.OperationDisplay; +import com.microsoft.azure.management.datalakestore.v2016_11_01.OperationOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An available operation for Data Lake Store. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display information for the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'user', + * 'system', 'user,system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display information for the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information for the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'user', 'system', 'user,system'. + * + * @return the origin value + */ + public OperationOrigin origin() { + return this.origin; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..c2326ebbed5f6 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final DataLakeStoreManager manager; + OperationListResultImpl(OperationListResultInner inner, DataLakeStoreManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..be45eb2007093 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of available operations for Data Lake Store. + */ +public class OperationListResultInner { + /** + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the results of the list operation. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..ef31589d0f0a4 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataLakeStoreManager manager; + + OperationsImpl(DataLakeStoreManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..b7c8ae052d452 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.Operations list" }) + @GET("providers/Microsoft.DataLakeStore/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Data Lake Store REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Data Lake Store REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Data Lake Store REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Data Lake Store REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..b6a5e11d961fb --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java new file mode 100644 index 0000000000000..5564c3efe5d1f --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProvider; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateTrustedIdProviderParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateTrustedIdProviderParameters; +import rx.functions.Func1; + +class TrustedIdProviderImpl extends CreatableUpdatableImpl implements TrustedIdProvider, TrustedIdProvider.Definition, TrustedIdProvider.Update { + private final DataLakeStoreManager manager; + private String resourceGroupName; + private String accountName; + private String trustedIdProviderName; + private CreateOrUpdateTrustedIdProviderParameters createParameter; + private UpdateTrustedIdProviderParameters updateParameter; + + TrustedIdProviderImpl(String name, DataLakeStoreManager manager) { + super(name, new TrustedIdProviderInner()); + this.manager = manager; + // Set resource name + this.trustedIdProviderName = name; + // + this.createParameter = new CreateOrUpdateTrustedIdProviderParameters(); + this.updateParameter = new UpdateTrustedIdProviderParameters(); + } + + TrustedIdProviderImpl(TrustedIdProviderInner inner, DataLakeStoreManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.trustedIdProviderName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.trustedIdProviderName = IdParsingUtils.getValueFromIdByName(inner.id(), "trustedIdProviders"); + // + this.createParameter = new CreateOrUpdateTrustedIdProviderParameters(); + this.updateParameter = new UpdateTrustedIdProviderParameters(); + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TrustedIdProvidersInner client = this.manager().inner().trustedIdProviders(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.trustedIdProviderName, this.createParameter) + .map(new Func1() { + @Override + public TrustedIdProviderInner call(TrustedIdProviderInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TrustedIdProvidersInner client = this.manager().inner().trustedIdProviders(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.trustedIdProviderName, this.updateParameter) + .map(new Func1() { + @Override + public TrustedIdProviderInner call(TrustedIdProviderInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TrustedIdProvidersInner client = this.manager().inner().trustedIdProviders(); + return client.getAsync(this.resourceGroupName, this.accountName, this.trustedIdProviderName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateOrUpdateTrustedIdProviderParameters(); + this.updateParameter = new UpdateTrustedIdProviderParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String idProvider() { + return this.inner().idProvider(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TrustedIdProviderImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TrustedIdProviderImpl withIdProvider(String idProvider) { + if (isInCreateMode()) { + this.createParameter.withIdProvider(idProvider); + } else { + this.updateParameter.withIdProvider(idProvider); + } + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderInner.java new file mode 100644 index 0000000000000..ab48ae178102a --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Store trusted identity provider information. + */ +@JsonFlatten +public class TrustedIdProviderInner extends SubResource { + /** + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "properties.idProvider", access = JsonProperty.Access.WRITE_ONLY) + private String idProvider; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the URL of this trusted identity provider. + * + * @return the idProvider value + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersImpl.java new file mode 100644 index 0000000000000..d856e9ae42b57 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProvider; + +class TrustedIdProvidersImpl extends WrapperImpl implements TrustedIdProviders { + private final DataLakeStoreManager manager; + + TrustedIdProvidersImpl(DataLakeStoreManager manager) { + super(manager.inner().trustedIdProviders()); + this.manager = manager; + } + + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public TrustedIdProviderImpl define(String name) { + return wrapModel(name); + } + + private TrustedIdProviderImpl wrapModel(TrustedIdProviderInner inner) { + return new TrustedIdProviderImpl(inner, manager()); + } + + private TrustedIdProviderImpl wrapModel(String name) { + return new TrustedIdProviderImpl(name, this.manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + TrustedIdProvidersInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public TrustedIdProvider call(TrustedIdProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + TrustedIdProvidersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, trustedIdProviderName) + .map(new Func1() { + @Override + public TrustedIdProvider call(TrustedIdProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + TrustedIdProvidersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, trustedIdProviderName).toCompletable(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java new file mode 100644 index 0000000000000..ee77f8f9e5403 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateTrustedIdProviderParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateTrustedIdProviderParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TrustedIdProviders. + */ +public class TrustedIdProvidersInner { + /** The Retrofit service to perform REST calls. */ + private TrustedIdProvidersService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of TrustedIdProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TrustedIdProvidersInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(TrustedIdProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for TrustedIdProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface TrustedIdProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("trustedIdProviderName") String trustedIdProviderName, @Body CreateOrUpdateTrustedIdProviderParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("trustedIdProviderName") String trustedIdProviderName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("trustedIdProviderName") String trustedIdProviderName, @Body UpdateTrustedIdProviderParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("trustedIdProviderName") String trustedIdProviderName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.TrustedIdProviders listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TrustedIdProviderInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TrustedIdProviderInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TrustedIdProviderInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TrustedIdProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the specified name will be replaced with this new provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrustedIdProviderInner object if successful. + */ + public TrustedIdProviderInner createOrUpdate(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the specified name will be replaced with this new provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the specified name will be replaced with this new provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).map(new Func1, TrustedIdProviderInner>() { + @Override + public TrustedIdProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the specified name will be replaced with this new provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (trustedIdProviderName == null) { + throw new IllegalArgumentException("Parameter trustedIdProviderName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, trustedIdProviderName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrustedIdProviderInner object if successful. + */ + public TrustedIdProviderInner get(String resourceGroupName, String accountName, String trustedIdProviderName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String trustedIdProviderName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).map(new Func1, TrustedIdProviderInner>() { + @Override + public TrustedIdProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (trustedIdProviderName == null) { + throw new IllegalArgumentException("Parameter trustedIdProviderName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, trustedIdProviderName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrustedIdProviderInner object if successful. + */ + public TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).toBlocking().single().body(); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName), serviceCallback); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).map(new Func1, TrustedIdProviderInner>() { + @Override + public TrustedIdProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (trustedIdProviderName == null) { + throw new IllegalArgumentException("Parameter trustedIdProviderName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateTrustedIdProviderParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, trustedIdProviderName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrustedIdProviderInner object if successful. + */ + public TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters), serviceCallback); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).map(new Func1, TrustedIdProviderInner>() { + @Override + public TrustedIdProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified trusted identity provider. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrustedIdProviderInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (trustedIdProviderName == null) { + throw new IllegalArgumentException("Parameter trustedIdProviderName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, trustedIdProviderName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String trustedIdProviderName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).toBlocking().single().body(); + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String trustedIdProviderName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName), serviceCallback); + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (trustedIdProviderName == null) { + throw new IllegalArgumentException("Parameter trustedIdProviderName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, trustedIdProviderName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TrustedIdProviderInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TrustedIdProviderInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TrustedIdProviderInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TrustedIdProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java new file mode 100644 index 0000000000000..ad74fb01bae58 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateVirtualNetworkRuleParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateVirtualNetworkRuleParameters; +import rx.functions.Func1; + +class VirtualNetworkRuleImpl extends CreatableUpdatableImpl implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update { + private final DataLakeStoreManager manager; + private String resourceGroupName; + private String accountName; + private String virtualNetworkRuleName; + private CreateOrUpdateVirtualNetworkRuleParameters createParameter; + private UpdateVirtualNetworkRuleParameters updateParameter; + + VirtualNetworkRuleImpl(String name, DataLakeStoreManager manager) { + super(name, new VirtualNetworkRuleInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = name; + // + this.createParameter = new CreateOrUpdateVirtualNetworkRuleParameters(); + this.updateParameter = new UpdateVirtualNetworkRuleParameters(); + } + + VirtualNetworkRuleImpl(VirtualNetworkRuleInner inner, DataLakeStoreManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.virtualNetworkRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkRules"); + // + this.createParameter = new CreateOrUpdateVirtualNetworkRuleParameters(); + this.updateParameter = new UpdateVirtualNetworkRuleParameters(); + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.virtualNetworkRuleName, this.createParameter) + .map(new Func1() { + @Override + public VirtualNetworkRuleInner call(VirtualNetworkRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.virtualNetworkRuleName, this.updateParameter) + .map(new Func1() { + @Override + public VirtualNetworkRuleInner call(VirtualNetworkRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.getAsync(this.resourceGroupName, this.accountName, this.virtualNetworkRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateOrUpdateVirtualNetworkRuleParameters(); + this.updateParameter = new UpdateVirtualNetworkRuleParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String subnetId() { + return this.inner().subnetId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VirtualNetworkRuleImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public VirtualNetworkRuleImpl withSubnetId(String subnetId) { + if (isInCreateMode()) { + this.createParameter.withSubnetId(subnetId); + } else { + this.updateParameter.withSubnetId(subnetId); + } + return this; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleInner.java new file mode 100644 index 0000000000000..5ade39fa19934 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Data Lake Store virtual network rule information. + */ +@JsonFlatten +public class VirtualNetworkRuleInner extends SubResource { + /** + * The resource identifier for the subnet. + */ + @JsonProperty(value = "properties.subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the resource identifier for the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesImpl.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesImpl.java new file mode 100644 index 0000000000000..005dd774e2211 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRule; + +class VirtualNetworkRulesImpl extends WrapperImpl implements VirtualNetworkRules { + private final DataLakeStoreManager manager; + + VirtualNetworkRulesImpl(DataLakeStoreManager manager) { + super(manager.inner().virtualNetworkRules()); + this.manager = manager; + } + + public DataLakeStoreManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkRuleImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkRuleImpl wrapModel(VirtualNetworkRuleInner inner) { + return new VirtualNetworkRuleImpl(inner, manager()); + } + + private VirtualNetworkRuleImpl wrapModel(String name) { + return new VirtualNetworkRuleImpl(name, this.manager()); + } + + @Override + public Observable listByAccountAsync(final String resourceGroupName, final String accountName) { + VirtualNetworkRulesInner client = this.inner(); + return client.listByAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, virtualNetworkRuleName) + .map(new Func1() { + @Override + public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, virtualNetworkRuleName).toCompletable(); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java new file mode 100644 index 0000000000000..235c24e2f4514 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalakestore.v2016_11_01.CreateOrUpdateVirtualNetworkRuleParameters; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UpdateVirtualNetworkRuleParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkRules. + */ +public class VirtualNetworkRulesInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkRulesService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkRulesInner(Retrofit retrofit, DataLakeStoreAccountManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkRules to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Body CreateOrUpdateVirtualNetworkRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Body UpdateVirtualNetworkRuleParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalakestore.v2016_11_01.VirtualNetworkRules listByAccountNext" }) + @GET + Observable> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkRuleInner> object if successful. + */ + public PagedList listByAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> object + */ + public Observable> listByAccountAsync(final String resourceGroupName, final String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByAccountSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + ServiceResponse> * @param resourceGroupName The name of the Azure resource group. + ServiceResponse> * @param accountName The name of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to create or update. + * @param parameters Parameters supplied to create or update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner createOrUpdate(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to create or update. + * @param parameters Parameters supplied to create or update the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to create or update. + * @param parameters Parameters supplied to create or update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to create or update. + * @param parameters Parameters supplied to create or update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, virtualNetworkRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner get(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, virtualNetworkRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateVirtualNetworkRuleParameters parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, virtualNetworkRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).toBlocking().single().body(); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified virtual network rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, virtualNetworkRuleName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Store account. + * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, virtualNetworkRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkRuleInner> object if successful. + */ + public PagedList listByAccountNext(final String nextPageLink) { + ServiceResponse> response = listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> object + */ + public Observable> listByAccountNextAsync(final String nextPageLink) { + return listByAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> object + */ + public Observable>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/package-info.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/package-info.java new file mode 100644 index 0000000000000..2dd1676004fec --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DataLakeStoreAccountManagementClient. + * Creates an Azure Data Lake Store account management client. + */ +package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; diff --git a/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/package-info.java b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/package-info.java new file mode 100644 index 0000000000000..abbed663ba4a3 --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DataLakeStoreAccountManagementClient. + * Creates an Azure Data Lake Store account management client. + */ +package com.microsoft.azure.management.datalakestore.v2016_11_01; diff --git a/datalakestore/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreTest.java b/datalakestore/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreTest.java new file mode 100644 index 0000000000000..bf2ca5adc265b --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/test/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreTest.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; +import com.microsoft.azure.arm.core.TestBase; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; +import com.microsoft.azure.management.resources.implementation.ResourceManager; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.arm.utils.SdkContext; +import org.junit.Test; +import org.junit.Assert; +import com.microsoft.azure.arm.resources.Region; +import com.microsoft.azure.management.resources.ResourceGroup; + +public class DataLakeStoreTest extends TestBase { + protected static ResourceManager resourceManager; + protected static DataLakeStoreManager dataLakeStoreManager; + private static String rgName; + + @Override + protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { + resourceManager = ResourceManager + .authenticate(restClient) + .withSubscription(defaultSubscription); + dataLakeStoreManager = DataLakeStoreManager + .authenticate(restClient, defaultSubscription); + } + + @Override + protected void cleanUpResources() { + resourceManager.resourceGroups().deleteByName(rgName); + } + + @Test + public void firstTest() { + rgName = SdkContext.randomResourceName("rg", 20); + ResourceGroup group = resourceManager.resourceGroups() + .define(rgName) + .withRegion(Region.US_WEST.toString()) + .create(); + Assert.assertNotNull(group); + } +} \ No newline at end of file diff --git a/datalakestore/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json b/datalakestore/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json new file mode 100644 index 0000000000000..3eab1a73031da --- /dev/null +++ b/datalakestore/resource-manager/v2016_11_01/src/test/resources/session-records/firstTest.json @@ -0,0 +1,143 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg65727771013f9?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:04 GMT", + "content-length" : "183", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "f66d2091-7999-40b2-a491-07d1646a5c5b", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013304Z:f66d2091-7999-40b2-a491-07d1646a5c5b", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "f66d2091-7999-40b2-a491-07d1646a5c5b", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg65727771013f9\",\"name\":\"rg65727771013f9\",\"location\":\"westus\",\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg65727771013f9?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:04 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "8232eb72-03e5-4eed-9283-8c1ef8794072", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013304Z:8232eb72-03e5-4eed-9283-8c1ef8794072", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "8232eb72-03e5-4eed-9283-8c1ef8794072", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:04 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "00636dbb-fc8b-474d-a730-3ff7d91a238f", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013304Z:00636dbb-fc8b-474d-a730-3ff7d91a238f", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "00636dbb-fc8b-474d-a730-3ff7d91a238f", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:19 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "b6abd9cd-6fe3-4535-b843-4b31a7d6a345", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013319Z:b6abd9cd-6fe3-4535-b843-4b31a7d6a345", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "b6abd9cd-6fe3-4535-b843-4b31a7d6a345", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:34 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "228046c9-d151-48d9-a9b1-dfc3a640f4d9", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013334Z:228046c9-d151-48d9-a9b1-dfc3a640f4d9", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "cache-control" : "no-cache", + "x-ms-request-id" : "228046c9-d151-48d9-a9b1-dfc3a640f4d9", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzY1NzI3NzcxMDEzRjktV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.14.0 OS:Windows Server 2016/10.0 MacAddressHash:0371b9e37b1296dd4f18ab8d1d04ef835872ef528a05f8ea79f7b735a5603490 Java:1.8.0_181 (ResourceManagementClient, 2017-05-10)" + }, + "Response" : { + "date" : "Wed, 10 Oct 2018 01:33:49 GMT", + "content-length" : "0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11995", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "15bf35db-7969-49c9-89aa-6a4274c0e166", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20181010T013349Z:15bf35db-7969-49c9-89aa-6a4274c0e166", + "cache-control" : "no-cache", + "x-ms-request-id" : "15bf35db-7969-49c9-89aa-6a4274c0e166", + "Body" : "" + } + } ], + "variables" : [ "rg65727771013f9" ] +} \ No newline at end of file diff --git a/devspaces/resource-manager/v2018_06_01_preview/pom.xml b/devspaces/resource-manager/v2018_06_01_preview/pom.xml index 4d6192cf3f8cb..b30dff5878624 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/pom.xml +++ b/devspaces/resource-manager/v2018_06_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-devspaces diff --git a/dns/resource-manager/v2016_04_01/pom.xml b/dns/resource-manager/v2016_04_01/pom.xml index 8e87480c6d747..52376db2142c1 100644 --- a/dns/resource-manager/v2016_04_01/pom.xml +++ b/dns/resource-manager/v2016_04_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-dns diff --git a/dns/resource-manager/v2017_10_01/pom.xml b/dns/resource-manager/v2017_10_01/pom.xml index 07db53896c967..d0ac6a2bb135d 100644 --- a/dns/resource-manager/v2017_10_01/pom.xml +++ b/dns/resource-manager/v2017_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-network diff --git a/eventgrid/data-plane/pom.xml b/eventgrid/data-plane/pom.xml index ae7a200eb5a24..cf2f3ac203a6c 100755 --- a/eventgrid/data-plane/pom.xml +++ b/eventgrid/data-plane/pom.xml @@ -9,7 +9,7 @@ 4.0.0 com.microsoft.azure azure-eventgrid - 1.1.0 + 1.2.0 jar Microsoft Azure SDK for eventgrid This package contains Microsoft eventgrid SDK. diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java new file mode 100644 index 0000000000000..419b4c514b8fe --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.eventgrid.models.EventGridEvent; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.protocol.SerializerAdapter; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * The type that can be used to de-serialize eventgrid events. + */ +@Beta +public class EventGridSubscriber { + /** + * The default adapter to be used for de-serializing the events. + */ + private final AzureJacksonAdapter defaultSerializerAdapter; + /** + * The map containing user defined mapping of eventType to Java model type. + */ + private Map eventTypeToEventDataMapping; + + /** + * Creates EventGridSubscriber with default de-serializer. + */ + @Beta + public EventGridSubscriber() { + this.defaultSerializerAdapter = new AzureJacksonAdapter(); + this.eventTypeToEventDataMapping = new HashMap<>(); + } + + /** + * Add a custom event mapping. If a mapping with same eventType exists then the old eventDataType is replaced by + * the specified eventDataType. + * + * @param eventType the event type name. + * @param eventDataType type of the Java model that the event type name mapped to. + */ + @Beta + public void putCustomEventMapping(final String eventType, final Type eventDataType) { + if (eventType == null || eventType.isEmpty()) { + throw new IllegalArgumentException("eventType parameter is required and cannot be null or empty"); + } + if (eventDataType == null) { + throw new IllegalArgumentException("eventDataType parameter is required and cannot be null"); + } + this.eventTypeToEventDataMapping.put(canonicalizeEventType(eventType), eventDataType); + } + + /** + * Get type of the Java model that is mapped to the given eventType. + * + * @param eventType the event type name. + * @return type of the Java model if mapping exists, null otherwise. + */ + @Beta + public Type getCustomEventMapping(final String eventType) { + if (!containsCustomEventMappingFor(eventType)) { + return null; + } else { + return this.eventTypeToEventDataMapping.get(canonicalizeEventType(eventType)); + } + } + + /** + * @return get all registered custom event mappings. + */ + @Beta + public Set> getAllCustomEventMappings() { + return Collections.unmodifiableSet(this.eventTypeToEventDataMapping.entrySet()); + } + + /** + * Removes the mapping with the given eventType. + * + * @param eventType the event type name. + * @return true if the mapping exists and removed, false if mapping does not exists. + */ + @Beta + public boolean removeCustomEventMapping(final String eventType) { + if (!containsCustomEventMappingFor(eventType)) { + return false; + } else { + this.eventTypeToEventDataMapping.remove(canonicalizeEventType(eventType)); + return true; + } + } + + /** + * Checks if an event mapping with the given eventType exists. + * + * @param eventType the event type name. + * @return true if the mapping exists, false otherwise. + */ + @Beta + public boolean containsCustomEventMappingFor(final String eventType) { + if (eventType == null || eventType.isEmpty()) { + return false; + } else { + return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType)); + } + } + + /** + * De-serialize the events in the given requested content using default de-serializer. + * + * @param requestContent the request content in string format. + * @return De-serialized events. + * + * @throws IOException + */ + @Beta + public EventGridEvent[] deserializeEventGridEvents(final String requestContent) throws IOException { + return this.deserializeEventGridEvents(requestContent, this.defaultSerializerAdapter); + } + + /** + * De-serialize the events in the given requested content using the provided de-serializer. + * + * @param requestContent the request content as string. + * @param serializerAdapter the de-serializer. + * @return de-serialized events. + * @throws IOException + */ + @Beta + public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter serializerAdapter) throws IOException { + EventGridEvent[] eventGridEvents = serializerAdapter.deserialize(requestContent, EventGridEvent[].class); + for (EventGridEvent receivedEvent : eventGridEvents) { + if (receivedEvent.data() == null) { + continue; + } else { + final String eventType = receivedEvent.eventType(); + final Type eventDataType; + if (SystemEventTypeMappings.containsMappingFor(eventType)) { + eventDataType = SystemEventTypeMappings.getMapping(eventType); + } else if (containsCustomEventMappingFor(eventType)) { + eventDataType = getCustomEventMapping(eventType); + } else { + eventDataType = null; + } + if (eventDataType != null) { + final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data()); + final Object eventData = serializerAdapter.deserialize(eventDataAsString, eventDataType); + setEventData(receivedEvent, eventData); + } + } + } + return eventGridEvents; + } + + private static void setEventData(EventGridEvent event, final Object data) { + // This reflection based way to set the data field needs to be removed once + // we expose a wither in EventGridEvent to set the data. (Check swagger + codegen) + try { + Field dataField = event.getClass().getDeclaredField("data"); + dataField.setAccessible(true); + dataField.set(event, data); + } catch (NoSuchFieldException nsfe) { + throw new RuntimeException(nsfe); + } catch (IllegalAccessException iae) { + throw new RuntimeException(iae); + } + } + + private static String canonicalizeEventType(final String eventType) { + if (eventType == null) { + return null; + } else { + return eventType.toLowerCase(); + } + } +} \ No newline at end of file diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypeMappings.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypeMappings.java new file mode 100644 index 0000000000000..13e5eaaf79b01 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypeMappings.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization; + +import com.microsoft.azure.eventgrid.models.ContainerRegistryImageDeletedEventData; +import com.microsoft.azure.eventgrid.models.ContainerRegistryImagePushedEventData; +import com.microsoft.azure.eventgrid.models.EventHubCaptureFileCreatedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceConnectedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceCreatedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceDeletedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceDisconnectedEventData; +import com.microsoft.azure.eventgrid.models.MediaJobStateChangeEventData; +import com.microsoft.azure.eventgrid.models.ResourceActionCancelData; +import com.microsoft.azure.eventgrid.models.ResourceActionFailureData; +import com.microsoft.azure.eventgrid.models.ResourceActionSuccessData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteCancelData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteFailureData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteSuccessData; +import com.microsoft.azure.eventgrid.models.ResourceWriteCancelData; +import com.microsoft.azure.eventgrid.models.ResourceWriteFailureData; +import com.microsoft.azure.eventgrid.models.ResourceWriteSuccessData; +import com.microsoft.azure.eventgrid.models.ServiceBusActiveMessagesAvailableWithNoListenersEventData; +import com.microsoft.azure.eventgrid.models.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData; +import com.microsoft.azure.eventgrid.models.StorageBlobCreatedEventData; +import com.microsoft.azure.eventgrid.models.StorageBlobDeletedEventData; +import com.microsoft.azure.eventgrid.models.SubscriptionDeletedEventData; +import com.microsoft.azure.eventgrid.models.SubscriptionValidationEventData; +import com.microsoft.azure.management.apigeneration.Beta; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.Map; + +/** + * Mapping of system event type name to corresponding type of the Java model. + */ +@Beta +final class SystemEventTypeMappings { + /** + * The map containing system eventType to Java model type mapping. + */ + private static Map systemEventMappings; + + static { + systemEventMappings = new HashMap<>(); // key: eventType, Value:eventDataType + // + // ContainerRegistry events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.CONTAINER_REGISTRY_IMAGE_PUSHED_EVENT), ContainerRegistryImagePushedEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.CONTAINER_REGISTRY_IMAGE_DELETED_EVENT), ContainerRegistryImageDeletedEventData.class); + // + // Device events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.IOT_HUB_DEVICE_CREATED_EVENT), IotHubDeviceCreatedEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.IOT_HUB_DEVICE_DELETED_EVENT), IotHubDeviceDeletedEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.IOT_HUB_DEVICE_CONNECTED_EVENT), IotHubDeviceConnectedEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.IOT_HUB_DEVICE_DISCONNECTED_EVENT), IotHubDeviceDisconnectedEventData.class); + // + // EventGrid events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.EVENT_GRID_SUBSCRIPTION_VALIDATION_EVENT), SubscriptionValidationEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.EVENT_GRID_SUBSCRIPTION_DELETED_EVENT), SubscriptionDeletedEventData.class); + // + // Event Hub Events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.EVENT_HUB_CAPTURE_FILE_CREATED_EVENT), EventHubCaptureFileCreatedEventData.class); + // + // Media Services events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.MEDIA_JOB_STATE_CHANGE_EVENT), MediaJobStateChangeEventData.class); + // + // Resource Manager (Azure Subscription/Resource Group) events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_WRITE_SUCCESS_EVENT), ResourceWriteSuccessData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_WRITE_FAILURE_EVENT), ResourceWriteFailureData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_WRITE_CANCEL_EVENT), ResourceWriteCancelData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_DELETE_SUCCESS_EVENT), ResourceDeleteSuccessData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_DELETE_FAILURE_EVENT), ResourceDeleteFailureData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_DELETE_CANCEL_EVENT), ResourceDeleteCancelData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_ACTION_SUCCESS_EVENT), ResourceActionSuccessData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_ACTION_FAILURE_EVENT), ResourceActionFailureData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.RESOURCE_ACTION_CANCEL_EVENT), ResourceActionCancelData.class); + // + // ServiceBus events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.SERVICE_BUS_ACTIVE_MESSAGES_AVAILABLE_WITH_NO_LISTENERS_EVENT), ServiceBusActiveMessagesAvailableWithNoListenersEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.SERVICE_BUS_DEADLETTER_MESSAGES_AVAILABLE_WITH_NO_LISTENER_EVENT), ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.class); + // + // Storage events. + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.STORAGE_BLOB_CREATED_EVENT), StorageBlobCreatedEventData.class); + systemEventMappings.put(canonicalizeEventType(SystemEventTypes.STORAGE_BLOB_DELETED_EVENT), StorageBlobDeletedEventData.class); + } + + /** + * Checks if a mapping exists for the given type. + * + * @param eventType the event type. + * @return true if mapping exists, false otherwise. + */ + @Beta + public static boolean containsMappingFor(final String eventType) { + if (eventType == null || eventType.isEmpty()) { + return false; + } else { + return systemEventMappings.containsKey(canonicalizeEventType(eventType)); + } + } + + /** + * Get Java model type for the given event type. + * + * @param eventType the event type. + * @return the Java model type if mapping exists, null otherwise. + */ + @Beta + public static Type getMapping(final String eventType) { + if (!containsMappingFor(eventType)) { + return null; + } else { + return systemEventMappings.get(canonicalizeEventType(eventType)); + } + } + + private static String canonicalizeEventType(final String eventType) { + if (eventType == null) { + return null; + } else { + return eventType.toLowerCase(); + } + } +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypes.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypes.java new file mode 100644 index 0000000000000..49e7a7bd8b962 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/SystemEventTypes.java @@ -0,0 +1,119 @@ +package com.microsoft.azure.eventgrid.customization; + +import com.microsoft.azure.management.apigeneration.Beta; + +/** + * Represents the names of the various event types for the system events published to Azure Event Grid. + */ +@Beta +public class SystemEventTypes { + // Keep this sorted by the name of the service publishing the events. + + // ContainerRegistry events. + /** + * indicate an event of pushing an image to container registry. + */ + public final static String CONTAINER_REGISTRY_IMAGE_PUSHED_EVENT = "Microsoft.ContainerRegistry.ImagePushed"; + /** + * indicate an event of deleting an image to container registry. + */ + public final static String CONTAINER_REGISTRY_IMAGE_DELETED_EVENT = "Microsoft.ContainerRegistry.ImageDeleted"; + + // Device events. + /** + * indicate an event of creating an IoT hub device. + */ + public final static String IOT_HUB_DEVICE_CREATED_EVENT = "Microsoft.Devices.DeviceCreated"; + /** + * indicate an event of deleting an IoT hub device. + */ + public final static String IOT_HUB_DEVICE_DELETED_EVENT = "Microsoft.Devices.DeviceDeleted"; + /** + * indicate an event of connecting an IoT hub device. + */ + public final static String IOT_HUB_DEVICE_CONNECTED_EVENT = "Microsoft.Devices.DeviceConnected"; + /** + * indicate an event of disconnecting an IoT hub device. + */ + public final static String IOT_HUB_DEVICE_DISCONNECTED_EVENT = "Microsoft.Devices.DeviceDisconnected"; + + // EventGrid events. + /** + * indicate an event of validating eventgrid subscription. + */ + public final static String EVENT_GRID_SUBSCRIPTION_VALIDATION_EVENT = "Microsoft.EventGrid.SubscriptionValidationEvent"; + /** + * indicate an event of deleting eventgrid subscription. + */ + public final static String EVENT_GRID_SUBSCRIPTION_DELETED_EVENT = "Microsoft.EventGrid.SubscriptionDeletedEvent"; + + // Event Hub Events. + /** + * indicate an event of creation of capture file in eventhub. + */ + public final static String EVENT_HUB_CAPTURE_FILE_CREATED_EVENT = "Microsoft.EventHub.CaptureFileCreated"; + + // Media Services events. + /** + * indicate an event of change of media service job state. + */ + public final static String MEDIA_JOB_STATE_CHANGE_EVENT = "Microsoft.Media.JobStateChange"; + + // Resource Manager (Azure Subscription/Resource Group) events + /** + * indicate an event of successful write of a resource. + */ + public final static String RESOURCE_WRITE_SUCCESS_EVENT = "Microsoft.Resources.ResourceWriteSuccess"; + /** + * indicate an event of write failure of a resource. + */ + public final static String RESOURCE_WRITE_FAILURE_EVENT = "Microsoft.Resources.ResourceWriteFailure"; + /** + * indicate an event of write cancellation of a resource. + */ + public final static String RESOURCE_WRITE_CANCEL_EVENT = "Microsoft.Resources.ResourceWriteCancel"; + /** + * indicate an event of successful deletion of a resource. + */ + public final static String RESOURCE_DELETE_SUCCESS_EVENT = "Microsoft.Resources.ResourceDeleteSuccess"; + /** + * indicate an event of failure in deleting a resource. + */ + public final static String RESOURCE_DELETE_FAILURE_EVENT = "Microsoft.Resources.ResourceDeleteFailure"; + /** + * indicate an event of cancellation of resource deletion. + */ + public final static String RESOURCE_DELETE_CANCEL_EVENT = "Microsoft.Resources.ResourceDeleteCancel"; + /** + * indicate an event of successful action on a resource. + */ + public final static String RESOURCE_ACTION_SUCCESS_EVENT = "Microsoft.Resources.ResourceActionSuccess"; + /** + * indicate an event of failure in performing an action on a resource. + */ + public final static String RESOURCE_ACTION_FAILURE_EVENT = "Microsoft.Resources.ResourceActionFailure"; + /** + * indicate an event of cancellation of resource action. + */ + public final static String RESOURCE_ACTION_CANCEL_EVENT = "Microsoft.Resources.ResourceActionCancel"; + + // ServiceBus events. + /** + * indicate an event of active messages with no listener for them. + */ + public final static String SERVICE_BUS_ACTIVE_MESSAGES_AVAILABLE_WITH_NO_LISTENERS_EVENT = "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners"; + /** + * indicate an event of deadletter messages with no listener for them. + */ + public final static String SERVICE_BUS_DEADLETTER_MESSAGES_AVAILABLE_WITH_NO_LISTENER_EVENT = "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener"; + + // Storage events. + /** + * indicates an event of blob creation. + */ + public final static String STORAGE_BLOB_CREATED_EVENT = "Microsoft.Storage.BlobCreated"; + /** + * indicates an event of blob deletion. + */ + public final static String STORAGE_BLOB_DELETED_EVENT = "Microsoft.Storage.BlobDeleted"; +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventInfo.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventInfo.java new file mode 100644 index 0000000000000..93a5d34b9cf92 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventInfo.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the device connection state event. + */ +public class DeviceConnectionStateEventInfo { + /** + * Sequence number is string representation of a hexadecimal number. string + * compare can be used to identify the larger number because both in ASCII + * and HEX numbers come after alphabets. If you are converting the string + * to hex, then the number is a 256 bit number. + */ + @JsonProperty(value = "sequenceNumber") + private String sequenceNumber; + + /** + * Get sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. + * + * @return the sequenceNumber value + */ + public String sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeviceConnectionStateEventInfo object itself. + */ + public DeviceConnectionStateEventInfo withSequenceNumber(String sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventProperties.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventProperties.java new file mode 100644 index 0000000000000..9e5d57430beb1 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceConnectionStateEventProperties.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a device connection + * state event (DeviceConnected, DeviceDisconnected). + */ +public class DeviceConnectionStateEventProperties { + /** + * The unique identifier of the device. This case-sensitive string can be + * up to 128 characters long, and supports ASCII 7-bit alphanumeric + * characters plus the following special characters: - : . + % _ &#35; + * * ? ! ( ) , = @ ; $ '. + */ + @JsonProperty(value = "deviceId") + private String deviceId; + + /** + * The unique identifier of the module. This case-sensitive string can be + * up to 128 characters long, and supports ASCII 7-bit alphanumeric + * characters plus the following special characters: - : . + % _ &#35; + * * ? ! ( ) , = @ ; $ '. + */ + @JsonProperty(value = "moduleId") + private String moduleId; + + /** + * Name of the IoT Hub where the device was created or deleted. + */ + @JsonProperty(value = "hubName") + private String hubName; + + /** + * Information about the device connection state event. + */ + @JsonProperty(value = "deviceConnectionStateEventInfo") + private DeviceConnectionStateEventInfo deviceConnectionStateEventInfo; + + /** + * Get the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. + * + * @return the deviceId value + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Set the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. + * + * @param deviceId the deviceId value to set + * @return the DeviceConnectionStateEventProperties object itself. + */ + public DeviceConnectionStateEventProperties withDeviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get the unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. + * + * @return the moduleId value + */ + public String moduleId() { + return this.moduleId; + } + + /** + * Set the unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. + * + * @param moduleId the moduleId value to set + * @return the DeviceConnectionStateEventProperties object itself. + */ + public DeviceConnectionStateEventProperties withModuleId(String moduleId) { + this.moduleId = moduleId; + return this; + } + + /** + * Get name of the IoT Hub where the device was created or deleted. + * + * @return the hubName value + */ + public String hubName() { + return this.hubName; + } + + /** + * Set name of the IoT Hub where the device was created or deleted. + * + * @param hubName the hubName value to set + * @return the DeviceConnectionStateEventProperties object itself. + */ + public DeviceConnectionStateEventProperties withHubName(String hubName) { + this.hubName = hubName; + return this; + } + + /** + * Get information about the device connection state event. + * + * @return the deviceConnectionStateEventInfo value + */ + public DeviceConnectionStateEventInfo deviceConnectionStateEventInfo() { + return this.deviceConnectionStateEventInfo; + } + + /** + * Set information about the device connection state event. + * + * @param deviceConnectionStateEventInfo the deviceConnectionStateEventInfo value to set + * @return the DeviceConnectionStateEventProperties object itself. + */ + public DeviceConnectionStateEventProperties withDeviceConnectionStateEventInfo(DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) { + this.deviceConnectionStateEventInfo = deviceConnectionStateEventInfo; + return this; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceLifeCycleEventProperties.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceLifeCycleEventProperties.java index 73dc46f7f4d44..afef3326da364 100755 --- a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceLifeCycleEventProperties.java +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceLifeCycleEventProperties.java @@ -18,8 +18,8 @@ public class DeviceLifeCycleEventProperties { /** * The unique identifier of the device. This case-sensitive string can be * up to 128 characters long, and supports ASCII 7-bit alphanumeric - * characters plus the following special characters: - : . + % _ # * ? ! ( - * ) , = @ ; $ '. + * characters plus the following special characters: - : . + % _ &#35; + * * ? ! ( ) , = @ ; $ '. */ @JsonProperty(value = "deviceId") private String deviceId; @@ -31,26 +31,14 @@ public class DeviceLifeCycleEventProperties { private String hubName; /** - * The event type specified for this operation by the IoT Hub. - */ - @JsonProperty(value = "opType") - private String opType; - - /** - * The ISO8601 timestamp of the operation. - */ - @JsonProperty(value = "operationTimestamp") - private String operationTimestamp; - - /** - * Information about the device twin, which is the cloud represenation of + * Information about the device twin, which is the cloud representation of * application device metadata. */ @JsonProperty(value = "twin") private DeviceTwinInfo twin; /** - * Get the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '. + * Get the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. * * @return the deviceId value */ @@ -59,7 +47,7 @@ public String deviceId() { } /** - * Set the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '. + * Set the unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = @ ; $ '. * * @param deviceId the deviceId value to set * @return the DeviceLifeCycleEventProperties object itself. @@ -90,47 +78,7 @@ public DeviceLifeCycleEventProperties withHubName(String hubName) { } /** - * Get the event type specified for this operation by the IoT Hub. - * - * @return the opType value - */ - public String opType() { - return this.opType; - } - - /** - * Set the event type specified for this operation by the IoT Hub. - * - * @param opType the opType value to set - * @return the DeviceLifeCycleEventProperties object itself. - */ - public DeviceLifeCycleEventProperties withOpType(String opType) { - this.opType = opType; - return this; - } - - /** - * Get the ISO8601 timestamp of the operation. - * - * @return the operationTimestamp value - */ - public String operationTimestamp() { - return this.operationTimestamp; - } - - /** - * Set the ISO8601 timestamp of the operation. - * - * @param operationTimestamp the operationTimestamp value to set - * @return the DeviceLifeCycleEventProperties object itself. - */ - public DeviceLifeCycleEventProperties withOperationTimestamp(String operationTimestamp) { - this.operationTimestamp = operationTimestamp; - return this; - } - - /** - * Get information about the device twin, which is the cloud represenation of application device metadata. + * Get information about the device twin, which is the cloud representation of application device metadata. * * @return the twin value */ @@ -139,7 +87,7 @@ public DeviceTwinInfo twin() { } /** - * Set information about the device twin, which is the cloud represenation of application device metadata. + * Set information about the device twin, which is the cloud representation of application device metadata. * * @param twin the twin value to set * @return the DeviceLifeCycleEventProperties object itself. diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceTwinInfo.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceTwinInfo.java index ecf9c20347d78..0446c475ae75b 100755 --- a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceTwinInfo.java +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/DeviceTwinInfo.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Information about the device twin, which is the cloud represenation of + * Information about the device twin, which is the cloud representation of * application device metadata. */ public class DeviceTwinInfo { diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceConnectedEventData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceConnectedEventData.java new file mode 100644 index 0000000000000..64c500c5961aa --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceConnectedEventData.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + + +/** + * Event data for Microsoft.Devices.DeviceConnected event. + */ +public class IotHubDeviceConnectedEventData extends DeviceConnectionStateEventProperties { +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceDisconnectedEventData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceDisconnectedEventData.java new file mode 100644 index 0000000000000..7e070d9835e40 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/IotHubDeviceDisconnectedEventData.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + + +/** + * Event data for Microsoft.Devices.DeviceDisconnected event. + */ +public class IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties { +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/JobState.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/JobState.java new file mode 100644 index 0000000000000..742ccf5187631 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/JobState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** The job was canceled. This is a final state for the job. */ + CANCELED("Canceled"), + + /** The job is in the process of being canceled. This is a transient state for the job. */ + CANCELING("Canceling"), + + /** The job has encountered an error. This is a final state for the job. */ + ERROR("Error"), + + /** The job is finished. This is a final state for the job. */ + FINISHED("Finished"), + + /** The job is processing. This is a transient state for the job. */ + PROCESSING("Processing"), + + /** The job is in a queued state, waiting for resources to become available. This is a transient state. */ + QUEUED("Queued"), + + /** The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. */ + SCHEDULED("Scheduled"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromString(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/MediaJobStateChangeEventData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/MediaJobStateChangeEventData.java new file mode 100644 index 0000000000000..2b65073794cbb --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/MediaJobStateChangeEventData.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a + * Microsoft.Media.JobStateChange event. + */ +public class MediaJobStateChangeEventData { + /** + * The previous state of the Job. Possible values include: 'Canceled', + * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private JobState previousState; + + /** + * The new state of the Job. Possible values include: 'Canceled', + * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * Get the previous state of the Job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the previousState value + */ + public JobState previousState() { + return this.previousState; + } + + /** + * Get the new state of the Job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionCancelData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionCancelData.java new file mode 100644 index 0000000000000..a5448a68f93c5 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionCancelData.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for an + * Microsoft.Resources.ResourceActionCancel event. This is raised when a + * resource action operation is canceled. + */ +public class ResourceActionCancelData { + /** + * The tenant ID of the resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * The subscription ID of the resource. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The resource group of the resource. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * The resource provider performing the operation. + */ + @JsonProperty(value = "resourceProvider") + private String resourceProvider; + + /** + * The URI of the resource in the operation. + */ + @JsonProperty(value = "resourceUri") + private String resourceUri; + + /** + * The operation that was performed. + */ + @JsonProperty(value = "operationName") + private String operationName; + + /** + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The requested authorization for the operation. + */ + @JsonProperty(value = "authorization") + private String authorization; + + /** + * The properties of the claims. + */ + @JsonProperty(value = "claims") + private String claims; + + /** + * An operation ID used for troubleshooting. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * The details of the operation. + */ + @JsonProperty(value = "httpRequest") + private String httpRequest; + + /** + * Get the tenant ID of the resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant ID of the resource. + * + * @param tenantId the tenantId value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subscription ID of the resource. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription ID of the resource. + * + * @param subscriptionId the subscriptionId value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resource group of the resource. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resource group of the resource. + * + * @param resourceGroup the resourceGroup value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the resource provider performing the operation. + * + * @return the resourceProvider value + */ + public String resourceProvider() { + return this.resourceProvider; + } + + /** + * Set the resource provider performing the operation. + * + * @param resourceProvider the resourceProvider value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withResourceProvider(String resourceProvider) { + this.resourceProvider = resourceProvider; + return this; + } + + /** + * Get the URI of the resource in the operation. + * + * @return the resourceUri value + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Set the URI of the resource in the operation. + * + * @param resourceUri the resourceUri value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + /** + * Get the operation that was performed. + * + * @return the operationName value + */ + public String operationName() { + return this.operationName; + } + + /** + * Set the operation that was performed. + * + * @param operationName the operationName value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withOperationName(String operationName) { + this.operationName = operationName; + return this; + } + + /** + * Get the status of the operation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the operation. + * + * @param status the status value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the requested authorization for the operation. + * + * @return the authorization value + */ + public String authorization() { + return this.authorization; + } + + /** + * Set the requested authorization for the operation. + * + * @param authorization the authorization value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withAuthorization(String authorization) { + this.authorization = authorization; + return this; + } + + /** + * Get the properties of the claims. + * + * @return the claims value + */ + public String claims() { + return this.claims; + } + + /** + * Set the properties of the claims. + * + * @param claims the claims value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withClaims(String claims) { + this.claims = claims; + return this; + } + + /** + * Get an operation ID used for troubleshooting. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set an operation ID used for troubleshooting. + * + * @param correlationId the correlationId value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the details of the operation. + * + * @return the httpRequest value + */ + public String httpRequest() { + return this.httpRequest; + } + + /** + * Set the details of the operation. + * + * @param httpRequest the httpRequest value to set + * @return the ResourceActionCancelData object itself. + */ + public ResourceActionCancelData withHttpRequest(String httpRequest) { + this.httpRequest = httpRequest; + return this; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionFailureData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionFailureData.java new file mode 100644 index 0000000000000..e8a03a0497163 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionFailureData.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a + * Microsoft.Resources.ResourceActionFailure event. This is raised when a + * resource action operation fails. + */ +public class ResourceActionFailureData { + /** + * The tenant ID of the resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * The subscription ID of the resource. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The resource group of the resource. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * The resource provider performing the operation. + */ + @JsonProperty(value = "resourceProvider") + private String resourceProvider; + + /** + * The URI of the resource in the operation. + */ + @JsonProperty(value = "resourceUri") + private String resourceUri; + + /** + * The operation that was performed. + */ + @JsonProperty(value = "operationName") + private String operationName; + + /** + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The requested authorization for the operation. + */ + @JsonProperty(value = "authorization") + private String authorization; + + /** + * The properties of the claims. + */ + @JsonProperty(value = "claims") + private String claims; + + /** + * An operation ID used for troubleshooting. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * The details of the operation. + */ + @JsonProperty(value = "httpRequest") + private String httpRequest; + + /** + * Get the tenant ID of the resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant ID of the resource. + * + * @param tenantId the tenantId value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subscription ID of the resource. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription ID of the resource. + * + * @param subscriptionId the subscriptionId value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resource group of the resource. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resource group of the resource. + * + * @param resourceGroup the resourceGroup value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the resource provider performing the operation. + * + * @return the resourceProvider value + */ + public String resourceProvider() { + return this.resourceProvider; + } + + /** + * Set the resource provider performing the operation. + * + * @param resourceProvider the resourceProvider value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withResourceProvider(String resourceProvider) { + this.resourceProvider = resourceProvider; + return this; + } + + /** + * Get the URI of the resource in the operation. + * + * @return the resourceUri value + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Set the URI of the resource in the operation. + * + * @param resourceUri the resourceUri value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + /** + * Get the operation that was performed. + * + * @return the operationName value + */ + public String operationName() { + return this.operationName; + } + + /** + * Set the operation that was performed. + * + * @param operationName the operationName value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withOperationName(String operationName) { + this.operationName = operationName; + return this; + } + + /** + * Get the status of the operation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the operation. + * + * @param status the status value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the requested authorization for the operation. + * + * @return the authorization value + */ + public String authorization() { + return this.authorization; + } + + /** + * Set the requested authorization for the operation. + * + * @param authorization the authorization value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withAuthorization(String authorization) { + this.authorization = authorization; + return this; + } + + /** + * Get the properties of the claims. + * + * @return the claims value + */ + public String claims() { + return this.claims; + } + + /** + * Set the properties of the claims. + * + * @param claims the claims value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withClaims(String claims) { + this.claims = claims; + return this; + } + + /** + * Get an operation ID used for troubleshooting. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set an operation ID used for troubleshooting. + * + * @param correlationId the correlationId value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the details of the operation. + * + * @return the httpRequest value + */ + public String httpRequest() { + return this.httpRequest; + } + + /** + * Set the details of the operation. + * + * @param httpRequest the httpRequest value to set + * @return the ResourceActionFailureData object itself. + */ + public ResourceActionFailureData withHttpRequest(String httpRequest) { + this.httpRequest = httpRequest; + return this; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionSuccessData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionSuccessData.java new file mode 100644 index 0000000000000..d4fdb8c178240 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/ResourceActionSuccessData.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a + * Microsoft.Resources.ResourceActionSuccess event. This is raised when a + * resource action operation succeeds. + */ +public class ResourceActionSuccessData { + /** + * The tenant ID of the resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * The subscription ID of the resource. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The resource group of the resource. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * The resource provider performing the operation. + */ + @JsonProperty(value = "resourceProvider") + private String resourceProvider; + + /** + * The URI of the resource in the operation. + */ + @JsonProperty(value = "resourceUri") + private String resourceUri; + + /** + * The operation that was performed. + */ + @JsonProperty(value = "operationName") + private String operationName; + + /** + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The requested authorization for the operation. + */ + @JsonProperty(value = "authorization") + private String authorization; + + /** + * The properties of the claims. + */ + @JsonProperty(value = "claims") + private String claims; + + /** + * An operation ID used for troubleshooting. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * The details of the operation. + */ + @JsonProperty(value = "httpRequest") + private String httpRequest; + + /** + * Get the tenant ID of the resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant ID of the resource. + * + * @param tenantId the tenantId value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subscription ID of the resource. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription ID of the resource. + * + * @param subscriptionId the subscriptionId value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resource group of the resource. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resource group of the resource. + * + * @param resourceGroup the resourceGroup value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the resource provider performing the operation. + * + * @return the resourceProvider value + */ + public String resourceProvider() { + return this.resourceProvider; + } + + /** + * Set the resource provider performing the operation. + * + * @param resourceProvider the resourceProvider value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withResourceProvider(String resourceProvider) { + this.resourceProvider = resourceProvider; + return this; + } + + /** + * Get the URI of the resource in the operation. + * + * @return the resourceUri value + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Set the URI of the resource in the operation. + * + * @param resourceUri the resourceUri value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + /** + * Get the operation that was performed. + * + * @return the operationName value + */ + public String operationName() { + return this.operationName; + } + + /** + * Set the operation that was performed. + * + * @param operationName the operationName value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withOperationName(String operationName) { + this.operationName = operationName; + return this; + } + + /** + * Get the status of the operation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the operation. + * + * @param status the status value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the requested authorization for the operation. + * + * @return the authorization value + */ + public String authorization() { + return this.authorization; + } + + /** + * Set the requested authorization for the operation. + * + * @param authorization the authorization value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withAuthorization(String authorization) { + this.authorization = authorization; + return this; + } + + /** + * Get the properties of the claims. + * + * @return the claims value + */ + public String claims() { + return this.claims; + } + + /** + * Set the properties of the claims. + * + * @param claims the claims value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withClaims(String claims) { + this.claims = claims; + return this; + } + + /** + * Get an operation ID used for troubleshooting. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set an operation ID used for troubleshooting. + * + * @param correlationId the correlationId value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the details of the operation. + * + * @return the httpRequest value + */ + public String httpRequest() { + return this.httpRequest; + } + + /** + * Set the details of the operation. + * + * @param httpRequest the httpRequest value to set + * @return the ResourceActionSuccessData object itself. + */ + public ResourceActionSuccessData withHttpRequest(String httpRequest) { + this.httpRequest = httpRequest; + return this; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionDeletedEventData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionDeletedEventData.java new file mode 100644 index 0000000000000..212c25afeed91 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionDeletedEventData.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a + * Microsoft.EventGrid.SubscriptionDeletedEvent. + */ +public class SubscriptionDeletedEventData { + /** + * The Azure resource ID of the deleted event subscription. + */ + @JsonProperty(value = "eventSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String eventSubscriptionId; + + /** + * Get the Azure resource ID of the deleted event subscription. + * + * @return the eventSubscriptionId value + */ + public String eventSubscriptionId() { + return this.eventSubscriptionId; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationEventData.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationEventData.java new file mode 100644 index 0000000000000..b7b6af284e4f9 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationEventData.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema of the Data property of an EventGridEvent for a + * Microsoft.EventGrid.SubscriptionValidationEvent. + */ +public class SubscriptionValidationEventData { + /** + * The validation code sent by Azure Event Grid to validate an event + * subscription. To complete the validation handshake, the subscriber must + * either respond with this validation code as part of the validation + * response, or perform a GET request on the validationUrl (available + * starting version 2018-05-01-preview). + */ + @JsonProperty(value = "validationCode", access = JsonProperty.Access.WRITE_ONLY) + private String validationCode; + + /** + * The validation URL sent by Azure Event Grid (available starting version + * 2018-05-01-preview). To complete the validation handshake, the + * subscriber must either respond with the validationCode as part of the + * validation response, or perform a GET request on the validationUrl + * (available starting version 2018-05-01-preview). + */ + @JsonProperty(value = "validationUrl", access = JsonProperty.Access.WRITE_ONLY) + private String validationUrl; + + /** + * Get the validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + * + * @return the validationCode value + */ + public String validationCode() { + return this.validationCode; + } + + /** + * Get the validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + * + * @return the validationUrl value + */ + public String validationUrl() { + return this.validationUrl; + } + +} diff --git a/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationResponse.java b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationResponse.java new file mode 100644 index 0000000000000..e91b1531ba017 --- /dev/null +++ b/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/models/SubscriptionValidationResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.eventgrid.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * To complete an event subscription validation handshake, a subscriber can use + * either the validationCode or the validationUrl received in a + * SubscriptionValidationEvent. When the validationCode is used, the + * SubscriptionValidationResponse can be used to build the response. + */ +public class SubscriptionValidationResponse { + /** + * The validation response sent by the subscriber to Azure Event Grid to + * complete the validation of an event subscription. + */ + @JsonProperty(value = "validationResponse") + private String validationResponse; + + /** + * Get the validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. + * + * @return the validationResponse value + */ + public String validationResponse() { + return this.validationResponse; + } + + /** + * Set the validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. + * + * @param validationResponse the validationResponse value to set + * @return the SubscriptionValidationResponse object itself. + */ + public SubscriptionValidationResponse withValidationResponse(String validationResponse) { + this.validationResponse = validationResponse; + return this; + } + +} diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/CustomizationTests.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/CustomizationTests.java new file mode 100644 index 0000000000000..7ffc235f8a74d --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/CustomizationTests.java @@ -0,0 +1,511 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization; + +import com.microsoft.azure.eventgrid.customization.models.ContosoItemReceivedEventData; +import com.microsoft.azure.eventgrid.customization.models.ContosoItemSentEventData; +import com.microsoft.azure.eventgrid.customization.models.DroneShippingInfo; +import com.microsoft.azure.eventgrid.customization.models.RocketShippingInfo; +import com.microsoft.azure.eventgrid.models.ContainerRegistryImageDeletedEventData; +import com.microsoft.azure.eventgrid.models.ContainerRegistryImagePushedEventData; +import com.microsoft.azure.eventgrid.models.EventGridEvent; +import com.microsoft.azure.eventgrid.models.EventHubCaptureFileCreatedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceConnectedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceCreatedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceDeletedEventData; +import com.microsoft.azure.eventgrid.models.IotHubDeviceDisconnectedEventData; +import com.microsoft.azure.eventgrid.models.JobState; +import com.microsoft.azure.eventgrid.models.MediaJobStateChangeEventData; +import com.microsoft.azure.eventgrid.models.ResourceActionCancelData; +import com.microsoft.azure.eventgrid.models.ResourceActionFailureData; +import com.microsoft.azure.eventgrid.models.ResourceActionSuccessData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteCancelData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteFailureData; +import com.microsoft.azure.eventgrid.models.ResourceDeleteSuccessData; +import com.microsoft.azure.eventgrid.models.ResourceWriteCancelData; +import com.microsoft.azure.eventgrid.models.ResourceWriteFailureData; +import com.microsoft.azure.eventgrid.models.ResourceWriteSuccessData; +import com.microsoft.azure.eventgrid.models.ServiceBusActiveMessagesAvailableWithNoListenersEventData; +import com.microsoft.azure.eventgrid.models.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData; +import com.microsoft.azure.eventgrid.models.StorageBlobCreatedEventData; +import com.microsoft.azure.eventgrid.models.StorageBlobDeletedEventData; +import com.microsoft.azure.eventgrid.models.SubscriptionDeletedEventData; +import com.microsoft.azure.eventgrid.models.SubscriptionValidationEventData; +import org.junit.Assert; +import org.junit.Test; +import sun.misc.IOUtils; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.Map; +import java.util.Set; + +public class CustomizationTests { + + @Test + public void consumeStorageBlobDeletedEventWithExtraProperty() throws IOException { + String jsonData = getTestPayloadFromFile("StorageBlobDeletedEventWithExtraProperty.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof StorageBlobDeletedEventData); + StorageBlobDeletedEventData eventData = (StorageBlobDeletedEventData)events[0].data(); + Assert.assertEquals("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.url()); + } + + @Test + public void ConsumeCustomEvents() throws IOException { + String jsonData = getTestPayloadFromFile("CustomEvents.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemReceived", ContosoItemSentEventData.class); + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemReceived", ContosoItemReceivedEventData.class); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(1, events.length); + Assert.assertTrue(events[0].data() instanceof ContosoItemReceivedEventData); + ContosoItemReceivedEventData eventData = (ContosoItemReceivedEventData) events[0].data(); + Assert.assertEquals("512d38b6-c7b8-40c8-89fe-f46f9e9622b6", eventData.itemSku()); + } + + @Test + public void consumeCustomEventWithArrayData() throws IOException { + String jsonData = getTestPayloadFromFile("CustomEventWithArrayData.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + + ContosoItemReceivedEventData[] arr = { new ContosoItemReceivedEventData() }; + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemReceived", arr.getClass()); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(1, events.length); + Assert.assertTrue(events[0].data() instanceof ContosoItemReceivedEventData[]); + ContosoItemReceivedEventData[] eventData = (ContosoItemReceivedEventData[]) events[0].data(); + Assert.assertEquals("512d38b6-c7b8-40c8-89fe-f46f9e9622b6", (eventData[0]).itemSku()); + } + + @Test + public void consumeCustomEventWithBooleanData() throws IOException { + String jsonData = getTestPayloadFromFile("CustomEventWithBooleanData.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemReceived", Boolean.class); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(1, events.length); + Assert.assertTrue(events[0].data() instanceof Boolean); + Boolean eventData = (Boolean) events[0].data(); + Assert.assertTrue(eventData); + } + + @Test + public void consumeCustomEventWithStringData() throws IOException { + String jsonData = getTestPayloadFromFile("CustomEventWithStringData.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(1, events.length); + Assert.assertTrue(events[0].data() instanceof String); + String eventData = (String) events[0].data(); + Assert.assertEquals("stringdata", eventData); + } + + @Test + public void consumeCustomEventWithPolymorphicData() throws IOException { + String jsonData = getTestPayloadFromFile("CustomEventWithPolymorphicData.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemSent", ContosoItemSentEventData.class); + + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(2, events.length); + Assert.assertTrue(events[0].data() instanceof ContosoItemSentEventData); + Assert.assertTrue(events[1].data() instanceof ContosoItemSentEventData); + ContosoItemSentEventData eventData0 = (ContosoItemSentEventData)events[0].data(); + Assert.assertTrue(eventData0.shippingInfo() instanceof DroneShippingInfo); + ContosoItemSentEventData eventData1 = (ContosoItemSentEventData)events[1].data(); + Assert.assertTrue(eventData1.shippingInfo() instanceof RocketShippingInfo); + } + + @Test + public void testCustomEventMappings() { + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemSent", ContosoItemSentEventData.class); + eventGridSubscriber.putCustomEventMapping("Contoso.Items.ItemReceived", ContosoItemReceivedEventData.class); + + Set> mappings = eventGridSubscriber.getAllCustomEventMappings(); + + Assert.assertEquals(2, mappings.size()); + + Type mapping = eventGridSubscriber.getCustomEventMapping("Contoso.Items.ItemSent"); + Assert.assertNotNull(mapping); + // Ensure lookup is case-insensitive + mapping = eventGridSubscriber.getCustomEventMapping("contoso.Items.Itemsent"); + Assert.assertNotNull(mapping); + + mapping = eventGridSubscriber.getCustomEventMapping("Contoso.Items.NotExists"); + Assert.assertNull(mapping); + + boolean removed = eventGridSubscriber.removeCustomEventMapping("Contoso.Items.ItemReceived"); + Assert.assertTrue(removed); + Assert.assertEquals(1, mappings.size()); + + boolean contains = eventGridSubscriber.containsCustomEventMappingFor("Contoso.Items.ItemSent"); + Assert.assertTrue(contains); + } + + @Test + public void consumeMultipleEventsInSameBatch() throws IOException { + String jsonData = getTestPayloadFromFile("MultipleEventsInSameBatch.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertEquals(4, events.length); + Assert.assertTrue(events[0].data() instanceof StorageBlobCreatedEventData); + Assert.assertTrue(events[1].data() instanceof StorageBlobDeletedEventData); + Assert.assertTrue(events[2].data() instanceof StorageBlobDeletedEventData); + Assert.assertTrue(events[3].data() instanceof ServiceBusDeadletterMessagesAvailableWithNoListenersEventData); + StorageBlobDeletedEventData eventData = (StorageBlobDeletedEventData)events[2].data(); + Assert.assertEquals("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.url()); + } + + // ContainerRegistry events + @Test + public void consumeContainerRegistryImagePushedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ContainerRegistryImagePushedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ContainerRegistryImagePushedEventData); + ContainerRegistryImagePushedEventData eventData = (ContainerRegistryImagePushedEventData)events[0].data(); + Assert.assertEquals("127.0.0.1", eventData.request().addr()); + } + + @Test + public void consumeContainerRegistryImageDeletedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ContainerRegistryImageDeletedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ContainerRegistryImageDeletedEventData); + ContainerRegistryImageDeletedEventData eventData = (ContainerRegistryImageDeletedEventData)events[0].data(); + Assert.assertEquals("testactor", eventData.actor().name()); + } + + // IoTHub Device events + @Test + public void consumeIoTHubDeviceCreatedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("IoTHubDeviceCreatedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof IotHubDeviceCreatedEventData); + IotHubDeviceCreatedEventData eventData = (IotHubDeviceCreatedEventData)events[0].data(); + Assert.assertEquals("enabled", eventData.twin().status()); + } + + @Test + public void consumeIoTHubDeviceDeletedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("IoTHubDeviceDeletedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof IotHubDeviceDeletedEventData); + IotHubDeviceDeletedEventData eventData = (IotHubDeviceDeletedEventData)events[0].data(); + Assert.assertEquals("AAAAAAAAAAE=", eventData.twin().etag()); + } + + @Test + public void consumeIoTHubDeviceConnectedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("IoTHubDeviceConnectedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof IotHubDeviceConnectedEventData); + IotHubDeviceConnectedEventData eventData = (IotHubDeviceConnectedEventData)events[0].data(); + Assert.assertEquals("EGTESTHUB1", eventData.hubName()); + } + + @Test + public void consumeIoTHubDeviceDisconnectedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("IoTHubDeviceDisconnectedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof IotHubDeviceDisconnectedEventData); + IotHubDeviceDisconnectedEventData eventData = (IotHubDeviceDisconnectedEventData)events[0].data(); + Assert.assertEquals("000000000000000001D4132452F67CE200000002000000000000000000000002", eventData.deviceConnectionStateEventInfo().sequenceNumber()); + } + + // EventGrid events + @Test + public void ConsumeEventGridSubscriptionValidationEvent() throws IOException { + String jsonData = getTestPayloadFromFile("EventGridSubscriptionValidationEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof SubscriptionValidationEventData); + SubscriptionValidationEventData eventData = (SubscriptionValidationEventData)events[0].data(); + Assert.assertEquals("512d38b6-c7b8-40c8-89fe-f46f9e9622b6", eventData.validationCode()); + } + + @Test + public void consumeEventGridSubscriptionDeletedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("EventGridSubscriptionDeletedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof SubscriptionDeletedEventData); + SubscriptionDeletedEventData eventData = (SubscriptionDeletedEventData)events[0].data(); + Assert.assertEquals("/subscriptions/id/resourceGroups/rg/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1", eventData.eventSubscriptionId()); + } + + // Event Hub Events + @Test + public void consumeEventHubCaptureFileCreatedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("EventHubCaptureFileCreatedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof EventHubCaptureFileCreatedEventData); + EventHubCaptureFileCreatedEventData eventData = (EventHubCaptureFileCreatedEventData)events[0].data(); + Assert.assertEquals("AzureBlockBlob", eventData.fileType()); + } + + @Test + public void consumeMediaServicesJobStateChangedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("MediaServicesJobStateChangedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof MediaJobStateChangeEventData); + MediaJobStateChangeEventData eventData = (MediaJobStateChangeEventData)events[0].data(); + Assert.assertEquals(JobState.FINISHED, eventData.state()); + } + + // Resource Manager (Azure Subscription/Resource Group) events + @Test + public void consumeResourceWriteFailureEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceWriteFailureEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceWriteFailureData); + ResourceWriteFailureData eventData = (ResourceWriteFailureData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceWriteCancelEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceWriteCancelEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceWriteCancelData); + ResourceWriteCancelData eventData = (ResourceWriteCancelData) events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceDeleteSuccessEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceDeleteSuccessEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceDeleteSuccessData); + ResourceDeleteSuccessData eventData = (ResourceDeleteSuccessData) events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceDeleteFailureEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceDeleteFailureEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceDeleteFailureData); + ResourceDeleteFailureData eventData = (ResourceDeleteFailureData) events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceDeleteCancelEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceDeleteCancelEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceDeleteCancelData); + ResourceDeleteCancelData eventData = (ResourceDeleteCancelData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceActionSuccessEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceActionSuccessEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceActionSuccessData); + ResourceActionSuccessData eventData = (ResourceActionSuccessData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceActionFailureEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceActionFailureEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceActionFailureData); + ResourceActionFailureData eventData = (ResourceActionFailureData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + @Test + public void consumeResourceActionCancelEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceActionCancelEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceActionCancelData); + ResourceActionCancelData eventData = (ResourceActionCancelData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + // ServiceBus events + @Test + public void consumeServiceBusActiveMessagesAvailableWithNoListenersEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ServiceBusActiveMessagesAvailableWithNoListenersEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ServiceBusActiveMessagesAvailableWithNoListenersEventData); + ServiceBusActiveMessagesAvailableWithNoListenersEventData eventData = (ServiceBusActiveMessagesAvailableWithNoListenersEventData) events[0].data(); + Assert.assertEquals("testns1", eventData.namespaceName()); + } + + @Test + public void consumeServiceBusDeadletterMessagesAvailableWithNoListenersEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ServiceBusDeadletterMessagesAvailableWithNoListenersEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ServiceBusDeadletterMessagesAvailableWithNoListenersEventData); + ServiceBusDeadletterMessagesAvailableWithNoListenersEventData eventData = (ServiceBusDeadletterMessagesAvailableWithNoListenersEventData)events[0].data(); + Assert.assertEquals("testns1", eventData.namespaceName()); + } + + // Storage events + @Test + public void consumeStorageBlobCreatedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("StorageBlobCreatedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof StorageBlobCreatedEventData); + StorageBlobCreatedEventData eventData = (StorageBlobCreatedEventData) events[0].data(); + Assert.assertEquals("https://myaccount.blob.core.windows.net/testcontainer/file1.txt", eventData.url()); + } + + @Test + public void consumeStorageBlobDeletedEvent() throws IOException { + String jsonData = getTestPayloadFromFile("StorageBlobDeletedEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof StorageBlobDeletedEventData); + StorageBlobDeletedEventData eventData = (StorageBlobDeletedEventData)events[0].data(); + Assert.assertEquals("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.url()); + } + + // Resource Manager (Azure Subscription/Resource Group) events + @Test + public void consumeResourceWriteSuccessEvent() throws IOException { + String jsonData = getTestPayloadFromFile("ResourceWriteSuccessEvent.json"); + // + EventGridSubscriber eventGridSubscriber = new EventGridSubscriber(); + EventGridEvent[] events = eventGridSubscriber.deserializeEventGridEvents(jsonData); + + Assert.assertNotNull(events); + Assert.assertTrue(events[0].data() instanceof ResourceWriteSuccessData); + ResourceWriteSuccessData eventData = (ResourceWriteSuccessData)events[0].data(); + Assert.assertEquals("72f988bf-86f1-41af-91ab-2d7cd011db47", eventData.tenantId()); + } + + // TODO: When new event types are introduced, add one test here for each event type + + private String getTestPayloadFromFile(String fileName) { + ClassLoader classLoader = getClass().getClassLoader(); + try { + byte[] bytes = IOUtils.readFully(classLoader.getResourceAsStream("customization\\" + fileName), -1, true); + return new String(bytes); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemReceivedEventData.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemReceivedEventData.java new file mode 100644 index 0000000000000..7029fbf145186 --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemReceivedEventData.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContosoItemReceivedEventData { + @JsonProperty(value = "itemSku", access = JsonProperty.Access.WRITE_ONLY) + private String itemSku; + + @JsonProperty(value = "itemUri", access = JsonProperty.Access.WRITE_ONLY) + private String itemUri; + + public String itemSku() { + return this.itemSku; + } + + public String itemUri() { + return this.itemUri; + } +} + diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemSentEventData.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemSentEventData.java new file mode 100644 index 0000000000000..80e8d6995f7ee --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ContosoItemSentEventData.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContosoItemSentEventData { + @JsonProperty(value = "shippingInfo", access = JsonProperty.Access.WRITE_ONLY) + private ShippingInfo shippingInfo; + + /** + * @return the shipping info. + */ + public ShippingInfo shippingInfo() { + return this.shippingInfo; + } +} diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/DroneShippingInfo.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/DroneShippingInfo.java new file mode 100644 index 0000000000000..7bfa721d1dce2 --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/DroneShippingInfo.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "shippingType") +@JsonTypeName("Drone") +public class DroneShippingInfo extends ShippingInfo { + @JsonProperty(value = "droneId", access = JsonProperty.Access.WRITE_ONLY) + private String droneId; + + /** + * @return the drone id. + */ + public String droneId() { + return this.droneId; + } +} diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/RocketShippingInfo.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/RocketShippingInfo.java new file mode 100644 index 0000000000000..9ff4c09994c73 --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/RocketShippingInfo.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "shippingType") +@JsonTypeName("Rocket") +public class RocketShippingInfo extends ShippingInfo { + @JsonProperty(value = "rocketNumber", access = JsonProperty.Access.WRITE_ONLY) + private String rocketNumber; + + /** + * @return the rocket number. + */ + public String rocketNumber() { + return this.rocketNumber; + } +} diff --git a/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ShippingInfo.java b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ShippingInfo.java new file mode 100644 index 0000000000000..c6deb5cd446d6 --- /dev/null +++ b/eventgrid/data-plane/src/test/java/com/microsoft/azure/eventgrid/customization/models/ShippingInfo.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.eventgrid.customization.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "shippingType") +@JsonTypeName("JobOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Drone", value = DroneShippingInfo.class), + @JsonSubTypes.Type(name = "Rocket", value = RocketShippingInfo.class) +}) +public class ShippingInfo { + @JsonProperty(value = "shipmentId", access = JsonProperty.Access.WRITE_ONLY) + private String shipmentId; + + /** + * @return the shipment id. + */ + public String shipmentId() { + return this.shipmentId; + } +} diff --git a/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImageDeletedEvent.json b/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImageDeletedEvent.json new file mode 100644 index 0000000000000..21258c6f216fc --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImageDeletedEvent.json @@ -0,0 +1,39 @@ +[ + { + "id": "56afc886-767b-d359-d59e-0da7877166b2", + "topic": "/SUBSCRIPTIONS/ID/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.ContainerRegistry/test1", + "subject": "test1", + "eventType": "Microsoft.ContainerRegistry.ImageDeleted", + "eventTime": "2018-01-02T19:17:44.4383997Z", + "data": { + "id": "eventID", + "timestamp": "2018-06-20T12:00:33.6125843-07:00", + "action": "testaction", + "target": { + "mediaType": "test", + "size": 20, + "digest": "digest1", + "length": 20, + "repository": "test", + "url": "url1", + "tag": "test" + }, + "request": { + "id": "id", + "addr": "127.0.0.1", + "host": "test", + "method": "method1", + "useragent": "useragent1" + }, + "actor": { + "name": "testactor" + }, + "source": { + "addr": "127.0.0.1", + "instanceID": "id" + } + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImagePushedEvent.json b/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImagePushedEvent.json new file mode 100644 index 0000000000000..6de3420add1d4 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ContainerRegistryImagePushedEvent.json @@ -0,0 +1,39 @@ +[ + { + "id": "56afc886-767b-d359-d59e-0da7877166b2", + "topic": "/SUBSCRIPTIONS/ID/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.ContainerRegistry/test1", + "subject": "test1", + "eventType": "Microsoft.ContainerRegistry.ImagePushed", + "eventTime": "2018-01-02T19:17:44.4383997Z", + "data": { + "id": "eventID", + "timestamp": "2018-06-20T12:00:33.6125843-07:00", + "action": "testaction", + "target": { + "mediaType": "test", + "size": 20, + "digest": "digest1", + "length": 20, + "repository": "test", + "url": "url1", + "tag": "test" + }, + "request": { + "id": "id", + "addr": "127.0.0.1", + "host": "test", + "method": "method1", + "useragent": "useragent1" + }, + "actor": { + "name": "testactor" + }, + "source": { + "addr": "127.0.0.1", + "instanceID": "id" + } + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/CustomEventWithArrayData.json b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithArrayData.json new file mode 100644 index 0000000000000..475c713b4b533 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithArrayData.json @@ -0,0 +1,17 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": [ + { + "itemSku": "512d38b6-c7b8-40c8-89fe-f46f9e9622b6", + "itemUri": "https://rp-eastus2.eventgrid.azure.net:553" + } + ], + "eventType": "Contoso.Items.ItemReceived", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/CustomEventWithBooleanData.json b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithBooleanData.json new file mode 100644 index 0000000000000..aadb734092d7a --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithBooleanData.json @@ -0,0 +1,12 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": true, + "eventType": "Contoso.Items.ItemReceived", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/CustomEventWithPolymorphicData.json b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithPolymorphicData.json new file mode 100644 index 0000000000000..44e593212cba5 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithPolymorphicData.json @@ -0,0 +1,34 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": { + "shippingInfo": { + "shippingType": "Drone", + "droneId": "Drone1", + "shipmentId": "1" + } + }, + "eventType": "Contoso.Items.ItemSent", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + }, + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": { + "shippingInfo": { + "shippingType": "Rocket", + "rocketNumber": 1, + "shipmentId": "1" + } + }, + "eventType": "Contoso.Items.ItemSent", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/CustomEventWithStringData.json b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithStringData.json new file mode 100644 index 0000000000000..36045761e1f44 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/CustomEventWithStringData.json @@ -0,0 +1,12 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": "stringdata", + "eventType": "Contoso.Items.ItemReceived", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/CustomEvents.json b/eventgrid/data-plane/src/test/resources/customization/CustomEvents.json new file mode 100644 index 0000000000000..5999548a30ac1 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/CustomEvents.json @@ -0,0 +1,15 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": { + "itemSku": "512d38b6-c7b8-40c8-89fe-f46f9e9622b6", + "itemUri": "https://rp-eastus2.eventgrid.azure.net:553/eventsubscriptions/estest/validate?id=B2E34264-7D71-453A-B5FB-B62D0FDC85EE&t=2018-04-26T20:30:54.4538837Z&apiVersion=2018-05-01-preview&token=1BNqCxBBSSE9OnNSfZM4%2b5H9zDegKMY6uJ%2fO2DFRkwQ%3d" + }, + "eventType": "Contoso.Items.ItemReceived", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] \ No newline at end of file diff --git a/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionDeletedEvent.json b/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionDeletedEvent.json new file mode 100644 index 0000000000000..c9d01ac0211eb --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionDeletedEvent.json @@ -0,0 +1,14 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": { + "eventSubscriptionId": "/subscriptions/id/resourceGroups/rg/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1" + }, + "eventType": "Microsoft.EventGrid.SubscriptionDeletedEvent", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionValidationEvent.json b/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionValidationEvent.json new file mode 100644 index 0000000000000..de91404d1296d --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/EventGridSubscriptionValidationEvent.json @@ -0,0 +1,15 @@ +[ + { + "id": "2d1781af-3a4c-4d7c-bd0c-e34b19da4e66", + "topic": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "subject": "", + "data": { + "validationCode": "512d38b6-c7b8-40c8-89fe-f46f9e9622b6", + "validationUrl": "https://rp-eastus2.eventgrid.azure.net:553/eventsubscriptions/estest/validate?id=B2E34264-7D71-453A-B5FB-B62D0FDC85EE&t=2018-04-26T20:30:54.4538837Z&apiVersion=2018-05-01-preview&token=1BNqCxBBSSE9OnNSfZM4%2b5H9zDegKMY6uJ%2fO2DFRkwQ%3d" + }, + "eventType": "Microsoft.EventGrid.SubscriptionValidationEvent", + "eventTime": "2018-01-25T22:12:19.4556811Z", + "metadataVersion": "1", + "dataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/EventHubCaptureFileCreatedEvent.json b/eventgrid/data-plane/src/test/resources/customization/EventHubCaptureFileCreatedEvent.json new file mode 100644 index 0000000000000..52b58e9c41f66 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/EventHubCaptureFileCreatedEvent.json @@ -0,0 +1,22 @@ +[ + { + "topic": "/subscriptions/guid/resourcegroups/rgDataMigrationSample/providers/Microsoft.EventHub/namespaces/tfdatamigratens", + "subject": "eventhubs/hubdatamigration", + "eventType": "microsoft.EventHUB.CaptureFileCreated", + "eventTime": "2017-08-31T19:12:46.0498024Z", + "id": "14e87d03-6fbf-4bb2-9a21-92bd1281f247", + "data": { + "fileUrl": "https://tf0831datamigrate.blob.core.windows.net/windturbinecapture/tfdatamigratens/hubdatamigration/1/2017/08/31/19/11/45.avro", + "fileType": "AzureBlockBlob", + "partitionId": "1", + "sizeInBytes": 249168, + "eventCount": 1500, + "firstSequenceNumber": 2400, + "lastSequenceNumber": 3899, + "firstEnqueueTime": "2017-08-31T19:12:14.674Z", + "lastEnqueueTime": "2017-08-31T19:12:44.309Z" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceConnectedEvent.json b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceConnectedEvent.json new file mode 100644 index 0000000000000..a8fefeb6aa0a4 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceConnectedEvent.json @@ -0,0 +1,19 @@ +[ + { + "id": "fbfd8ee1-cf78-74c6-dbcf-e1c58638ccbd", + "topic": "/SUBSCRIPTIONS/BDF55CDD-8DAB-4CF4-9B2F-C21E8A780472/RESOURCEGROUPS/EGTESTRG/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/EGTESTHUB1", + "subject": "devices/48e44e11-1437-4907-83b1-4a8d7e89859e", + "eventType": "Microsoft.Devices.DeviceConnected", + "eventTime": "2018-07-03T23:20:11.6921933+00:00", + "data": { + "deviceConnectionStateEventInfo": { + "sequenceNumber": "000000000000000001D4132452F67CE200000002000000000000000000000001" + }, + "hubName": "EGTESTHUB1", + "deviceId": "48e44e11-1437-4907-83b1-4a8d7e89859e", + "moduleId": "" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] \ No newline at end of file diff --git a/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceCreatedEvent.json b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceCreatedEvent.json new file mode 100644 index 0000000000000..81eb23a9ec8a6 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceCreatedEvent.json @@ -0,0 +1,46 @@ +[ + { + "id": "56afc886-767b-d359-d59e-0da7877166b2", + "topic": "/SUBSCRIPTIONS/ID/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/hub1", + "subject": "devices/LogicAppTestDevice", + "eventType": "Microsoft.Devices.DeviceCreated", + "eventTime": "2018-01-02T19:17:44.4383997Z", + "data": { + "twin": { + "deviceId": "LogicAppTestDevice", + "etag": "AAAAAAAAAAE=", + "status": "enabled", + "statusUpdateTime": "0001-01-01T00:00:00", + "connectionState": "Disconnected", + "lastActivityTime": "0001-01-01T00:00:00", + "cloudToDeviceMessageCount": 0, + "authenticationType": "sas", + "x509Thumbprint": { + "primaryThumbprint": null, + "secondaryThumbprint": null + }, + "version": 2, + "properties": { + "desired": { + "$metadata": { + "$lastUpdated": "2018-01-02T19:17:44.4383997Z" + }, + "$version": 1 + }, + "reported": { + "$metadata": { + "$lastUpdated": "2018-01-02T19:17:44.4383997Z" + }, + "$version": 1 + } + } + }, + "hubName": "egtesthub1", + "deviceId": "LogicAppTestDevice", + "operationTimestamp": "2018-01-02T19:17:44.4383997Z", + "opType": "DeviceCreated" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDeletedEvent.json b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDeletedEvent.json new file mode 100644 index 0000000000000..d96fed94ade56 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDeletedEvent.json @@ -0,0 +1,46 @@ +[ + { + "id": "56afc886-767b-d359-d59e-0da7877166b2", + "topic": "/SUBSCRIPTIONS/id/RESOURCEGROUPS/rg/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/hub1", + "subject": "devices/LogicAppTestDevice", + "eventType": "Microsoft.Devices.DeviceDeleted", + "eventTime": "2018-01-02T19:17:44.4383997Z", + "data": { + "twin": { + "deviceId": "LogicAppTestDevice", + "etag": "AAAAAAAAAAE=", + "status": "enabled", + "statusUpdateTime": "0001-01-01T00:00:00", + "connectionState": "Disconnected", + "lastActivityTime": "0001-01-01T00:00:00", + "cloudToDeviceMessageCount": 0, + "authenticationType": "sas", + "x509Thumbprint": { + "primaryThumbprint": null, + "secondaryThumbprint": null + }, + "version": 2, + "properties": { + "desired": { + "$metadata": { + "$lastUpdated": "2018-01-02T19:17:44.4383997Z" + }, + "$version": 1 + }, + "reported": { + "$metadata": { + "$lastUpdated": "2018-01-02T19:17:44.4383997Z" + }, + "$version": 1 + } + } + }, + "hubName": "egtesthub1", + "deviceId": "LogicAppTestDevice", + "operationTimestamp": "2018-01-02T19:17:44.4383997Z", + "opType": "DeviceCreated" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDisconnectedEvent.json b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDisconnectedEvent.json new file mode 100644 index 0000000000000..cf2dbff4cf8ec --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/IoTHubDeviceDisconnectedEvent.json @@ -0,0 +1,19 @@ +[ + { + "id": "877f0b10-a086-98ec-27b8-6ae2dfbf5f67", + "topic": "/SUBSCRIPTIONS/BDF55CDD-8DAB-4CF4-9B2F-C21E8A780472/RESOURCEGROUPS/EGTESTRG/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/EGTESTHUB1", + "subject": "devices/48e44e11-1437-4907-83b1-4a8d7e89859e", + "eventType": "Microsoft.Devices.DeviceDisconnected", + "eventTime": "2018-07-03T23:20:52.646434+00:00", + "data": { + "deviceConnectionStateEventInfo": { + "sequenceNumber": "000000000000000001D4132452F67CE200000002000000000000000000000002" + }, + "hubName": "EGTESTHUB1", + "deviceId": "48e44e11-1437-4907-83b1-4a8d7e89859e", + "moduleId": "" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/MediaServicesJobStateChangedEvent.json b/eventgrid/data-plane/src/test/resources/customization/MediaServicesJobStateChangedEvent.json new file mode 100644 index 0000000000000..8e0611788e058 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/MediaServicesJobStateChangedEvent.json @@ -0,0 +1,15 @@ +[ + { + "topic": "/subscriptions/{subscription id}/resourceGroups/amsResourceGroup/providers/Microsoft.Media/mediaservices/amsaccount", + "subject": "transforms/VideoAnalyzerTransform/jobs/{job id}", + "eventType": "Microsoft.Media.JobStateChange", + "eventTime": "2018-04-20T21:26:13.8978772", + "id": "", + "data": { + "previousState": "Processing", + "state": "Finished" + }, + "dataVersion": "1.0", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/MultipleEventsInSameBatch.json b/eventgrid/data-plane/src/test/resources/customization/MultipleEventsInSameBatch.json new file mode 100644 index 0000000000000..536bd2e57a9b6 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/MultipleEventsInSameBatch.json @@ -0,0 +1,79 @@ +[ + { + "topic": "/subscriptions/319a9601-1ec0-0000-aebc-8fe82724c81e/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/myaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/file1.txt", + "eventType": "Microsoft.Storage.BlobCreated", + "eventTime": "2017-08-16T01:57:26.005121Z", + "id": "602a88ef-0001-00e6-1233-1646070610ea", + "data": { + "api": "PutBlockList", + "clientRequestId": "799304a4-bbc5-45b6-9849-ec2c66be800a", + "requestId": "602a88ef-0001-00e6-1233-164607000000", + "eTag": "0x8D4E44A24ABE7F1", + "contentType": "text/plain", + "contentLength": 447, + "blobType": "BlockBlob", + "url": "https://myaccount.blob.core.windows.net/testcontainer/file1.txt", + "sequencer": "00000000000000EB000000000000C65A" + }, + "dataVersion": "", + "metadataVersion": "1" + }, + { + "topic": "/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/testfile.txt", + "eventType": "Microsoft.Storage.BlobDeleted", + "eventTime": "2017-11-07T20:09:22.5674003Z", + "id": "4c2359fe-001e-00ba-0e04-58586806d298", + "data": { + "api": "DeleteBlob", + "requestId": "4c2359fe-001e-00ba-0e04-585868000000", + "contentType": "text/plain", + "blobType": "BlockBlob", + "url": "https://example.blob.core.windows.net/testcontainer/testfile.txt", + "sequencer": "0000000000000281000000000002F5CA", + "storageDiagnostics": { + "batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0" + } + }, + "dataVersion": "", + "metadataVersion": "1" + }, + { + "topic": "/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/testfile.txt", + "eventType": "Microsoft.Storage.BlobDeleted", + "eventTime": "2017-11-07T20:09:22.5674003Z", + "id": "4c2359fe-001e-00ba-0e04-58586806d298", + "data": { + "api": "DeleteBlob", + "requestId": "4c2359fe-001e-00ba-0e04-585868000000", + "contentType": "text/plain", + "blobType": "BlockBlob", + "url": "https://example.blob.core.windows.net/testcontainer/testfile.txt", + "sequencer": "0000000000000281000000000002F5CA", + "storageDiagnostics": { + "batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0" + } + }, + "dataVersion": "", + "metadataVersion": "1" + }, + { + "topic": "/subscriptions/id/resourcegroups/rg/providers/Microsoft.ServiceBus/namespaces/testns1", + "subject": "topics/topic1/subscriptions/sub1", + "eventType": "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener", + "eventTime": "2018-02-14T05:12:53.4133526Z", + "id": "dede87b0-3656-419c-acaf-70c95ddc60f5", + "data": { + "namespaceName": "testns1", + "requestUri": "https://testns1.servicebus.windows.net/t1/subscriptions/sub1/messages/head", + "entityType": "subscriber", + "queueName": "queue1", + "topicName": "topic1", + "subscriptionName": "sub1" + }, + "dataVersion": "1", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceActionCancelEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceActionCancelEvent.json new file mode 100644 index 0000000000000..48c4f902a9bcf --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceActionCancelEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceActionCancel", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceActionFailureEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceActionFailureEvent.json new file mode 100644 index 0000000000000..1b7bd2d75f513 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceActionFailureEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceActionFailure", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceActionSuccessEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceActionSuccessEvent.json new file mode 100644 index 0000000000000..ff88ad7960e15 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceActionSuccessEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceActionSuccess", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteCancelEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteCancelEvent.json new file mode 100644 index 0000000000000..90d898be4f84a --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteCancelEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceDeleteCancel", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteFailureEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteFailureEvent.json new file mode 100644 index 0000000000000..6e9f91e58bb9c --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteFailureEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceDeleteFailure", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteSuccessEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteSuccessEvent.json new file mode 100644 index 0000000000000..068c14c4d4abd --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceDeleteSuccessEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceDeleteSuccess", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceWriteCancelEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteCancelEvent.json new file mode 100644 index 0000000000000..6d383f41a1915 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteCancelEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceWriteCancel", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceWriteFailureEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteFailureEvent.json new file mode 100644 index 0000000000000..c8912cc97f0b6 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteFailureEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceWriteFailure", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ResourceWriteSuccessEvent.json b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteSuccessEvent.json new file mode 100644 index 0000000000000..e4dee418fea57 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ResourceWriteSuccessEvent.json @@ -0,0 +1,23 @@ +[ + { + "topic": "/subscriptions/{subscription-id}", + "subject": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "eventType": "Microsoft.Resources.ResourceWriteSuccess", + "eventTime": "2017-08-16T03:54:38.2696833Z", + "id": "25b3b0d0-d79b-44d5-9963-440d4e6a9bba", + "data": { + "authorization": "{azure_resource_manager_authorizations}", + "claims": "{azure_resource_manager_claims}", + "correlationId": "54ef1e39-6a82-44b3-abc1-bdeb6ce4d3c6", + "httpRequest": "{request-operation}", + "resourceProvider": "Microsoft.EventGrid", + "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.EventGrid/eventSubscriptions/LogicAppdd584bdf-8347-49c9-b9a9-d1f980783501", + "operationName": "Microsoft.EventGrid/eventSubscriptions/write", + "status": "Succeeded", + "subscriptionId": "{subscription-id}", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ServiceBusActiveMessagesAvailableWithNoListenersEvent.json b/eventgrid/data-plane/src/test/resources/customization/ServiceBusActiveMessagesAvailableWithNoListenersEvent.json new file mode 100644 index 0000000000000..af12bc4404e3a --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ServiceBusActiveMessagesAvailableWithNoListenersEvent.json @@ -0,0 +1,19 @@ +[ + { + "topic": "/subscriptions/id/resourcegroups/rg/providers/Microsoft.ServiceBus/namespaces/testns1", + "subject": "topics/topic1/subscriptions/sub1", + "eventType": "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners", + "eventTime": "2018-02-14T05:12:53.4133526Z", + "id": "dede87b0-3656-419c-acaf-70c95ddc60f5", + "data": { + "namespaceName": "testns1", + "requestUri": "https: //testns1.servicebus.windows.net/t1/subscriptions/sub1/messages/head", + "entityType": "subscriber", + "queueName": "queue1", + "topicName": "topic1", + "subscriptionName": "sub1" + }, + "dataVersion": "1", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/ServiceBusDeadletterMessagesAvailableWithNoListenersEvent.json b/eventgrid/data-plane/src/test/resources/customization/ServiceBusDeadletterMessagesAvailableWithNoListenersEvent.json new file mode 100644 index 0000000000000..a85f575cdf618 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/ServiceBusDeadletterMessagesAvailableWithNoListenersEvent.json @@ -0,0 +1,19 @@ +[ + { + "topic": "/subscriptions/id/resourcegroups/rg/providers/Microsoft.ServiceBus/namespaces/testns1", + "subject": "topics/topic1/subscriptions/sub1", + "eventType": "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener", + "eventTime": "2018-02-14T05:12:53.4133526Z", + "id": "dede87b0-3656-419c-acaf-70c95ddc60f5", + "data": { + "namespaceName": "testns1", + "requestUri": "https://testns1.servicebus.windows.net/t1/subscriptions/sub1/messages/head", + "entityType": "subscriber", + "queueName": "queue1", + "topicName": "topic1", + "subscriptionName": "sub1" + }, + "dataVersion": "1", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/StorageBlobCreatedEvent.json b/eventgrid/data-plane/src/test/resources/customization/StorageBlobCreatedEvent.json new file mode 100644 index 0000000000000..f051ee38c58d1 --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/StorageBlobCreatedEvent.json @@ -0,0 +1,22 @@ +[ + { + "topic": "/subscriptions/319a9601-1ec0-0000-aebc-8fe82724c81e/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/myaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/file1.txt", + "eventType": "Microsoft.Storage.BlobCreated", + "eventTime": "2017-08-16T01:57:26.005121Z", + "id": "602a88ef-0001-00e6-1233-1646070610ea", + "data": { + "api": "PutBlockList", + "clientRequestId": "799304a4-bbc5-45b6-9849-ec2c66be800a", + "requestId": "602a88ef-0001-00e6-1233-164607000000", + "eTag": "0x8D4E44A24ABE7F1", + "contentType": "text/plain", + "contentLength": 447, + "blobType": "BlockBlob", + "url": "https://myaccount.blob.core.windows.net/testcontainer/file1.txt", + "sequencer": "00000000000000EB000000000000C65A" + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEvent.json b/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEvent.json new file mode 100644 index 0000000000000..d163e0931bbba --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEvent.json @@ -0,0 +1,22 @@ +[ + { + "topic": "/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/testfile.txt", + "eventType": "Microsoft.Storage.BlobDeleted", + "eventTime": "2017-11-07T20:09:22.5674003Z", + "id": "4c2359fe-001e-00ba-0e04-58586806d298", + "data": { + "api": "DeleteBlob", + "requestId": "4c2359fe-001e-00ba-0e04-585868000000", + "contentType": "text/plain", + "blobType": "BlockBlob", + "url": "https://example.blob.core.windows.net/testcontainer/testfile.txt", + "sequencer": "0000000000000281000000000002F5CA", + "storageDiagnostics": { + "batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0" + } + }, + "dataVersion": "", + "metadataVersion": "1" + } +] diff --git a/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEventWithExtraProperty.json b/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEventWithExtraProperty.json new file mode 100644 index 0000000000000..3758afecd568a --- /dev/null +++ b/eventgrid/data-plane/src/test/resources/customization/StorageBlobDeletedEventWithExtraProperty.json @@ -0,0 +1,24 @@ +[ + { + "topic": "/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", + "subject": "/blobServices/default/containers/testcontainer/blobs/testfile.txt", + "eventType": "Microsoft.Storage.BlobDeleted", + "eventTime": "2017-11-07T20:09:22.5674003Z", + "id": "4c2359fe-001e-00ba-0e04-58586806d298", + "data": { + "api": "DeleteBlob", + "requestId": "4c2359fe-001e-00ba-0e04-585868000000", + "contentType": "text/plain", + "blobType": "BlockBlob", + "url": "https://example.blob.core.windows.net/testcontainer/testfile.txt", + "sequencer": "0000000000000281000000000002F5CA", + "brandNewProperty": "0000000000000281000000000002F5CA", + "storageDiagnostics": { + "batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0" + } + }, + "dataVersion": "", + "metadataVersion": "1" + } +] + diff --git a/eventgrid/resource-manager/v2018_01_01/pom.xml b/eventgrid/resource-manager/v2018_01_01/pom.xml index 8f738f582dd41..df7bfd91ce9af 100644 --- a/eventgrid/resource-manager/v2018_01_01/pom.xml +++ b/eventgrid/resource-manager/v2018_01_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid diff --git a/eventgrid/resource-manager/v2018_05_01_preview/pom.xml b/eventgrid/resource-manager/v2018_05_01_preview/pom.xml index 9bbc942508862..01d28d888615c 100644 --- a/eventgrid/resource-manager/v2018_05_01_preview/pom.xml +++ b/eventgrid/resource-manager/v2018_05_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid diff --git a/features/resource-manager/v2015_12_01/pom.xml b/features/resource-manager/v2015_12_01/pom.xml index 852e4925b1cce..0dc1d4e394f7d 100644 --- a/features/resource-manager/v2015_12_01/pom.xml +++ b/features/resource-manager/v2015_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-features diff --git a/gulpfile.js b/gulpfile.js index 4856155e1cc09..e694d68ec919e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -56,7 +56,7 @@ gulp.task('default', function() { const maxParallelism = parseInt(args['parallel'], 10) || os.cpus().length; var specRoot = args['spec-root'] || defaultSpecRoot; var projects = args['projects']; -var autoRestVersion = 'latest'; // default +var autoRestVersion = 'preview'; // default if (args['autorest'] !== undefined) { autoRestVersion = args['autorest']; } @@ -66,7 +66,7 @@ var autoRestExe; gulp.task('codegen', function(cb) { if (autoRestVersion.match(/[0-9]+\.[0-9]+\.[0-9]+.*/) || - autoRestVersion == 'latest') { + autoRestVersion == 'preview') { autoRestExe = 'autorest ---version=' + autoRestVersion; handleInput(projects, cb); } else { @@ -119,7 +119,7 @@ var codegen = function(project, cb) { apiVersion = ''; } - var fconfig; + var fconfig; if (mappings[project].fconfig !== undefined) { fconfig = " --fconfig='" + JSON.stringify(mappings[project].fconfig) + "'" + ' '; } else { @@ -136,7 +136,7 @@ var codegen = function(project, cb) { regenManager + genInterface + apiVersion + - fconfig + + fconfig + autoRestArgs; if (mappings[project].args !== undefined) { @@ -170,7 +170,7 @@ var deleteFolderRecursive = function(folder) { gulp.task('java:build', shell.task('mvn package javadoc:aggregate -DskipTests=true -q')); gulp.task('java:stage', ['java:build'], function(){ - return gulp.src('./target/site/apidocs/**/*').pipe(gulp.dest('./dist')); + return gulp.src('./target/site/apidocs/**/*').pipe(gulp.dest('./dist')); }); /// Top level build entry point @@ -178,7 +178,7 @@ gulp.task('stage', ['java:stage']); gulp.task('publish', ['stage'], function(){ var options = {}; if(process.env.GH_TOKEN){ - options.remoteUrl = 'https://' + process.env.GH_TOKEN + '@github.com/azure/azure-libraries-for-java.git' + options.remoteUrl = 'https://' + process.env.GH_TOKEN + '@github.com/azure/azure-libraries-for-java.git' } return gulp.src('./dist/**/*').pipe(gulpif(!argv.dryrun, ghPages(options))); }); diff --git a/hdinsight/resource-manager/v2015_03_01_preview/pom.xml b/hdinsight/resource-manager/v2015_03_01_preview/pom.xml new file mode 100644 index 0000000000000..1e732c29951dc --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.hdinsight.v2015_03_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-hdinsight + 1.0.0-beta + jar + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft HDInsight Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java new file mode 100644 index 0000000000000..c904037705015 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the application definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group + * @param clusterName The name of the cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the application definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the application definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next definition stage + */ + WithCreate withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the application update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next update stage + */ + Update withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java new file mode 100644 index 0000000000000..30aad4561990c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application SSH endpoint. + */ +public class ApplicationGetEndpoint { + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java new file mode 100644 index 0000000000000..c93c78f1460d1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application HTTP endpoints. + */ +public class ApplicationGetHttpsEndpoint { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the list of access modes for the application. + * + * @return the accessModes value + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the list of access modes for the application. + * + * @param accessModes the accessModes value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java new file mode 100644 index 0000000000000..4766b6dbe0f84 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight cluster application GET response. + */ +public class ApplicationProperties { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /** + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /** + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /** + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /** + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /** + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * The additional properties for application. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /** + * Get the list of roles in the cluster. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the list of install script actions. + * + * @return the installScriptActions value + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the list of install script actions. + * + * @param installScriptActions the installScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the list of uninstall script actions. + * + * @return the uninstallScriptActions value + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the list of application HTTPS endpoints. + * + * @return the httpsEndpoints value + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the list of application SSH endpoints. + * + * @return the sshEndpoints value + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioning state of the application. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the application type. + * + * @return the applicationType value + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the application type. + * + * @param applicationType the applicationType value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the application state. + * + * @return the applicationState value + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the application create date time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplace identifier. + * + * @return the marketplaceIdentifier value + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + + /** + * Get the additional properties for application. + * + * @return the additionalProperties value + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additional properties for application. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java new file mode 100644 index 0000000000000..cd4e43545737b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String applicationName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java new file mode 100644 index 0000000000000..b4114684d7be9 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AsyncOperationState. + */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java new file mode 100644 index 0000000000000..30af6b8ba26f5 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.CapabilitiesResultInner; +import java.util.List; +import java.util.Map; + +/** + * Type representing CapabilitiesResult. + */ +public interface CapabilitiesResult extends HasInner, HasManager { + /** + * @return the features value. + */ + List features(); + + /** + * @return the quota value. + */ + QuotaCapability quota(); + + /** + * @return the regions value. + */ + Map regions(); + + /** + * @return the versions value. + */ + Map versions(); + + /** + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * @return the vmSizes value. + */ + Map vmSizes(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java new file mode 100644 index 0000000000000..eb0d21be238e6 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next definition stage + */ + WithCreate withProperties(ClusterCreateProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProperties { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next update stage + */ + Update withProperties(ClusterCreateProperties properties); + } + + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java new file mode 100644 index 0000000000000..2a0e78442d468 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateCluster request parameters. + */ +public class ClusterCreateParametersExtended { + /** + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /** + * Get the location of the cluster. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the cluster. + * + * @param location the location value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the cluster create parameters. + * + * @return the properties value + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the cluster create parameters. + * + * @param properties the properties value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java new file mode 100644 index 0000000000000..9ca2b6a9d2afd --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster create parameters. + */ +public class ClusterCreateProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storage profile. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storage profile. + * + * @param storageProfile the storageProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java new file mode 100644 index 0000000000000..33fff49e4d75a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster definition. + */ +public class ClusterDefinition { + /** + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /** + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /** + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the link to the blueprint. + * + * @return the blueprint value + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the link to the blueprint. + * + * @param blueprint the blueprint value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the type of cluster. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the type of cluster. + * + * @param kind the kind value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the versions of different services in the cluster. + * + * @return the componentVersion value + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the cluster configurations. + * + * @return the configurations value + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the cluster configurations. + * + * @param configurations the configurations value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java new file mode 100644 index 0000000000000..0326f67f19d4f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of cluster. + */ +public class ClusterGetProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The provisioning state, which only appears in the response. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', + * 'Deleting'. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /** + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /** + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @return the provisioningState value + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @param provisioningState the provisioningState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date on which the cluster was created. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the date on which the cluster was created. + * + * @param createdDate the createdDate value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state of the cluster. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the state of the cluster. + * + * @param clusterState the clusterState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quota information. + * + * @return the quotaInfo value + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quota information. + * + * @param quotaInfo the quotaInfo value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the list of connectivity endpoints. + * + * @return the connectivityEndpoints value + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java new file mode 100644 index 0000000000000..4771a38f1a69e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListPersistedScriptActions operation response. + */ +public class ClusterListPersistedScriptActionsResult { + /** + * The list of Persisted Script Actions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of Persisted Script Actions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Persisted Script Actions. + * + * @param value the value value to set + * @return the ClusterListPersistedScriptActionsResult object itself. + */ + public ClusterListPersistedScriptActionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java new file mode 100644 index 0000000000000..dddb68eb68a8b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list runtime script action detail response. + */ +public class ClusterListRuntimeScriptActionDetailResult { + /** + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of persisted script action details for the cluster. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java new file mode 100644 index 0000000000000..ff83e029de9ef --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) parameters. + */ +public class ClusterMonitoringRequest { + /** + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java new file mode 100644 index 0000000000000..2c32a0b24c6f4 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterMonitoringResponseInner; + +/** + * Type representing ClusterMonitoringResponse. + */ +public interface ClusterMonitoringResponse extends HasInner, HasManager { + /** + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java new file mode 100644 index 0000000000000..0a0e38b051775 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PatchCluster request parameters. + */ +public class ClusterPatchParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java new file mode 100644 index 0000000000000..19d32fc0983b3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resize Cluster request parameters. + */ +public class ClusterResizeParameters { + /** + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the target instance count for the operation. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java new file mode 100644 index 0000000000000..b7bf37ff22595 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resizeAsync(String resourceGroupName, String clusterName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java new file mode 100644 index 0000000000000..3b49a2fa7da14 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the compute profile. + */ +public class ComputeProfile { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the list of roles in the cluster. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles in the cluster. + * + * @param roles the roles value to set + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java new file mode 100644 index 0000000000000..73311cdf5fdfb --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends HasInner { + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable> getAsync(String resourceGroupName, String clusterName, String configurationName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java new file mode 100644 index 0000000000000..027cef539a5ff --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connectivity properties. + */ +public class ConnectivityEndpoint { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol of the endpoint. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol of the endpoint. + * + * @param protocol the protocol value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port to connect to. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the port to connect to. + * + * @param port the port value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java new file mode 100644 index 0000000000000..31b64622a8a52 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data disks groups for the role. + */ +public class DataDisksGroups { + /** + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /** + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /** + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the number of disks per node. + * + * @return the disksPerNode value + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the number of disks per node. + * + * @param disksPerNode the disksPerNode value to set + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get readOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get readOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java new file mode 100644 index 0000000000000..4fe9085467f5b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DirectoryType. + */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java new file mode 100644 index 0000000000000..74b4ce7963de9 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java new file mode 100644 index 0000000000000..6df5999302d6e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java new file mode 100644 index 0000000000000..b24aeb1153007 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error message associated with the cluster creation. + */ +public class Errors { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the Errors object itself. + */ + public Errors withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java new file mode 100644 index 0000000000000..394d93dd00d63 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for the script actions to execute on a running cluster. + */ +public class ExecuteScriptActionParameters { + /** + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the list of run time script actions. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of run time script actions. + * + * @param scriptActions the scriptActions value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java new file mode 100644 index 0000000000000..a8bb1a04bc98d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; + +/** + * Type representing Extension. + */ +public interface Extension extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java new file mode 100644 index 0000000000000..0c9a5754e7793 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends HasInner { + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableMonitoringAsync(String resourceGroupName, String clusterName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java new file mode 100644 index 0000000000000..9477f8027ca06 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HDInsightClusterProvisioningState. + */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java new file mode 100644 index 0000000000000..b62f0ff9c61de --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The hardware profile. + */ +public class HardwareProfile { + /** + * The size of the VM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the size of the VM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the size of the VM. + * + * @param vmSize the vmSize value to set + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java new file mode 100644 index 0000000000000..6b56e20a709bf --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ssh username, password, and ssh public key. + */ +public class LinuxOperatingSystemProfile { + /** + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username. + * + * @param username the username value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password. + * + * @param password the password value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the SSH profile. + * + * @return the sshProfile value + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the SSH profile. + * + * @param sshProfile the sshProfile value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java new file mode 100644 index 0000000000000..e0eb4a3a22381 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the localizable name of a type of usage. + */ +public class LocalizedName { + /** + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the name of the used resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the name of the used resource. + * + * @param value the value value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the used resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the used resource. + * + * @param localizedValue the localizedValue value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java new file mode 100644 index 0000000000000..6fe5d8500dfc1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCapabilitiesAsync(String location); + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String location); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java new file mode 100644 index 0000000000000..7f5c5621820c4 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OSType. + */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java new file mode 100644 index 0000000000000..a3aab4ee02907 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..02795284f5666 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * The service provider: Microsoft.HDInsight. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the service provider: Microsoft.HDInsight. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type: read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type: read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java new file mode 100644 index 0000000000000..873d830bdaa3e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The azure async operation response. + */ +public class OperationResource { + /** + * The async operation state. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private AsyncOperationState status; + + /** + * The operation error information. + */ + @JsonProperty(value = "error") + private Errors error; + + /** + * Get the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public AsyncOperationState status() { + return this.status; + } + + /** + * Set the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the OperationResource object itself. + */ + public OperationResource withStatus(AsyncOperationState status) { + this.status = status; + return this; + } + + /** + * Get the operation error information. + * + * @return the error value + */ + public Errors error() { + return this.error; + } + + /** + * Set the operation error information. + * + * @param error the error value to set + * @return the OperationResource object itself. + */ + public OperationResource withError(Errors error) { + this.error = error; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java new file mode 100644 index 0000000000000..e22be5b83ad6a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java new file mode 100644 index 0000000000000..b5f4f2b78c06a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Linux operation systems profile. + */ +public class OsProfile { + /** + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the Linux OS profile. + * + * @return the linuxOperatingSystemProfile value + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java new file mode 100644 index 0000000000000..617b9f05f32f0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capability. + */ +public class QuotaCapability { + /** + * The list of region quota capabilities. + */ + @JsonProperty(value = "regionalQuotas") + private List regionalQuotas; + + /** + * Get the list of region quota capabilities. + * + * @return the regionalQuotas value + */ + public List regionalQuotas() { + return this.regionalQuotas; + } + + /** + * Set the list of region quota capabilities. + * + * @param regionalQuotas the regionalQuotas value to set + * @return the QuotaCapability object itself. + */ + public QuotaCapability withRegionalQuotas(List regionalQuotas) { + this.regionalQuotas = regionalQuotas; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java new file mode 100644 index 0000000000000..6a8c9f0558089 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota properties for the cluster. + */ +public class QuotaInfo { + /** + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the cores used by the cluster. + * + * @return the coresUsed value + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the cores used by the cluster. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java new file mode 100644 index 0000000000000..24ce926a8128c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capacity. + */ +public class RegionalQuotaCapability { + /** + * The region name. + */ + @JsonProperty(value = "region_name") + private String regionName; + + /** + * The number of cores used in the region. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /** + * The number of courses available in the region. + */ + @JsonProperty(value = "cores_available") + private Long coresAvailable; + + /** + * Get the region name. + * + * @return the regionName value + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the region name. + * + * @param regionName the regionName value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Get the number of cores used in the region. + * + * @return the coresUsed value + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the number of cores used in the region. + * + * @param coresUsed the coresUsed value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the number of courses available in the region. + * + * @return the coresAvailable value + */ + public Long coresAvailable() { + return this.coresAvailable; + } + + /** + * Set the number of courses available in the region. + * + * @param coresAvailable the coresAvailable value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresAvailable(Long coresAvailable) { + this.coresAvailable = coresAvailable; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java new file mode 100644 index 0000000000000..88d0126b8b36b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regions capability. + */ +public class RegionsCapability { + /** + * The list of region capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of region capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of region capabilities. + * + * @param available the available value to set + * @return the RegionsCapability object itself. + */ + public RegionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java new file mode 100644 index 0000000000000..28f0d6ebb5fcb --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a role on the cluster. + */ +public class Role { + /** + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /** + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /** + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /** + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name of the role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the role. + * + * @param name the name value to set + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the instance count of the cluster. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the hardware profile. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the operating system profile. + * + * @return the osProfile value + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the operating system profile. + * + * @param osProfile the osProfile value to set + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtual network profile. + * + * @return the virtualNetworkProfile value + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the data disks groups for the role. + * + * @return the dataDisksGroups value + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the list of script actions on the role. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of script actions on the role. + * + * @param scriptActions the scriptActions value to set + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java new file mode 100644 index 0000000000000..7f48cba55d6f9 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on a running cluster. + */ +public class RuntimeScriptAction { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /** + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script. + * + * @param parameters the parameters value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name of the script action, if any. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java new file mode 100644 index 0000000000000..1ebb47d93dff1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.List; + +/** + * Type representing RuntimeScriptActionDetail. + */ +public interface RuntimeScriptActionDetail extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the parameters value. + */ + String parameters(); + + /** + * @return the roles value. + */ + List roles(); + + /** + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java new file mode 100644 index 0000000000000..47500214d1b6d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The execution summary of a script action. + */ +public class ScriptActionExecutionSummary { + /** + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status of script action execution. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the instance count for a given script action execution status. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java new file mode 100644 index 0000000000000..61c41edfe6087 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The persisted script action for cluster. + */ +public class ScriptActionPersistedGetResponseSpec { + /** + * The name of script action. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * The application name for the script action. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * Get the name of script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of script action. + * + * @param name the name value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name for the script action. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name for the script action. + * + * @param applicationName the applicationName value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java new file mode 100644 index 0000000000000..1c17347a6add1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptActions. + */ +public interface ScriptActions extends HasInner { + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java new file mode 100644 index 0000000000000..43e9d4c92a135 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptExecutionHistorysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptExecutionHistorys. + */ +public interface ScriptExecutionHistorys extends HasInner { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java new file mode 100644 index 0000000000000..529417dc103d1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The security profile which contains Ssh public key for the HDInsight + * cluster. + */ +public class SecurityProfile { + /** + * The directory type. Possible values include: 'ActiveDirectory'. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /** + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /** + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /** + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /** + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /** + * Optional. The Distinguished Names for cluster user groups. + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /** + * Get the directory type. Possible values include: 'ActiveDirectory'. + * + * @return the directoryType value + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directory type. Possible values include: 'ActiveDirectory'. + * + * @param directoryType the directoryType value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the organization's active directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the organization's active directory domain. + * + * @param domain the domain value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @return the organizationalUnitDN value + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domain admin password. + * + * @return the domainUserPassword value + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java new file mode 100644 index 0000000000000..630e034ccdc87 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of SSH public keys. + */ +public class SshProfile { + /** + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the list of SSH public keys. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the list of SSH public keys. + * + * @param publicKeys the publicKeys value to set + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java new file mode 100644 index 0000000000000..4cd02c94237fe --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH public key for the cluster nodes. + */ +public class SshPublicKey { + /** + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificate for SSH. + * + * @return the certificateData value + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificate for SSH. + * + * @param certificateData the certificateData value to set + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java new file mode 100644 index 0000000000000..cbe69089ef5c3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage Account. + */ +public class StorageAccount { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /** + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /** + * The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /** + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get whether or not the storage account is the default storage account. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the fileSystem value + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param fileSystem the fileSystem value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the storage account access key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account access key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java new file mode 100644 index 0000000000000..2bbb3039bcc05 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage profile. + */ +public class StorageProfile { + /** + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the list of storage accounts in the cluster. + * + * @return the storageaccounts value + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java new file mode 100644 index 0000000000000..7dc759818fca7 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Tier. + */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java new file mode 100644 index 0000000000000..dc0f242a2493a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the usage of a particular limited resource. + */ +public class Usage { + /** + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /** + * Get the type of measurement for usage. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the type of measurement for usage. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current usage. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current usage. + * + * @param currentValue the currentValue value to set + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum allowed usage. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the maximum allowed usage. + * + * @param limit the limit value to set + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the details about the localizable name of the used resource. + * + * @return the name value + */ + public LocalizedName name() { + return this.name; + } + + /** + * Set the details about the localizable name of the used resource. + * + * @param name the name value to set + * @return the Usage object itself. + */ + public Usage withName(LocalizedName name) { + this.name = name; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java new file mode 100644 index 0000000000000..41df247f70111 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.UsagesListResultInner; +import java.util.List; + +/** + * Type representing UsagesListResult. + */ +public interface UsagesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java new file mode 100644 index 0000000000000..69ca14ae0810f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version properties. + */ +public class VersionSpec { + /** + * The friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Whether or not the version is the default version. + */ + @JsonProperty(value = "isDefault") + private String isDefault; + + /** + * The component version property. + */ + @JsonProperty(value = "componentVersions") + private Map componentVersions; + + /** + * Get the friendly name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name. + * + * @param friendlyName the friendlyName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name. + * + * @param displayName the displayName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get whether or not the version is the default version. + * + * @return the isDefault value + */ + public String isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the version is the default version. + * + * @param isDefault the isDefault value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withIsDefault(String isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the component version property. + * + * @return the componentVersions value + */ + public Map componentVersions() { + return this.componentVersions; + } + + /** + * Set the component version property. + * + * @param componentVersions the componentVersions value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withComponentVersions(Map componentVersions) { + this.componentVersions = componentVersions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java new file mode 100644 index 0000000000000..7c2cdb4dcba0b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version capability. + */ +public class VersionsCapability { + /** + * The list of version capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of version capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of version capabilities. + * + * @param available the available value to set + * @return the VersionsCapability object itself. + */ + public VersionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java new file mode 100644 index 0000000000000..a0a63a604d88c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network properties. + */ +public class VirtualNetworkProfile { + /** + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the ID of the virtual network. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the virtual network. + * + * @param id the id value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the name of the subnet. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java new file mode 100644 index 0000000000000..b861aad8dab88 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine type compatibility filter. + */ +public class VmSizeCompatibilityFilter { + /** + * The mode for the filter. + */ + @JsonProperty(value = "FilterMode") + private String filterMode; + + /** + * The list of regions. + */ + @JsonProperty(value = "Regions") + private List regions; + + /** + * The list of cluster types available. + */ + @JsonProperty(value = "ClusterFlavors") + private List clusterFlavors; + + /** + * The list of node types. + */ + @JsonProperty(value = "NodeTypes") + private List nodeTypes; + + /** + * The list of cluster versions. + */ + @JsonProperty(value = "ClusterVersions") + private List clusterVersions; + + /** + * The list of virtual machine sizes. + */ + @JsonProperty(value = "vmsizes") + private List vmsizes; + + /** + * Get the mode for the filter. + * + * @return the filterMode value + */ + public String filterMode() { + return this.filterMode; + } + + /** + * Set the mode for the filter. + * + * @param filterMode the filterMode value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withFilterMode(String filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the list of regions. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of regions. + * + * @param regions the regions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the list of cluster types available. + * + * @return the clusterFlavors value + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the list of cluster types available. + * + * @param clusterFlavors the clusterFlavors value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the list of node types. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types. + * + * @param nodeTypes the nodeTypes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the list of cluster versions. + * + * @return the clusterVersions value + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the list of cluster versions. + * + * @param clusterVersions the clusterVersions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the list of virtual machine sizes. + * + * @return the vmsizes value + */ + public List vmsizes() { + return this.vmsizes; + } + + /** + * Set the list of virtual machine sizes. + * + * @param vmsizes the vmsizes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withVmsizes(List vmsizes) { + this.vmsizes = vmsizes; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java new file mode 100644 index 0000000000000..59cd9f7bd761b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine sizes capability. + */ +public class VmSizesCapability { + /** + * The list of virtual machine size capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of virtual machine size capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of virtual machine size capabilities. + * + * @param available the available value to set + * @return the VmSizesCapability object itself. + */ + public VmSizesCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..86c674e3a6775 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String applicationName; + + ApplicationImpl(String name, HDInsightManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + } + + ApplicationImpl(ApplicationInner inner, HDInsightManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java new file mode 100644 index 0000000000000..585317163657c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The HDInsight cluster application. + */ +public class ApplicationInner extends ProxyResource { + /** + * The ETag for the application. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the ETag for the application. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the application. + * + * @param etag the etag value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags for the application. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the application. + * + * @param tags the tags value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the application. + * + * @return the properties value + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties of the application. + * + * @param properties the properties value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..62f0b65973e0a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final HDInsightManager manager; + + ApplicationsImpl(HDInsightManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ApplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, applicationName) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, applicationName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 0000000000000..75518b9e1e1a5 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,774 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java new file mode 100644 index 0000000000000..b2b6e28bc5a46 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; + +class CapabilitiesResultImpl extends WrapperImpl implements CapabilitiesResult { + private final HDInsightManager manager; + CapabilitiesResultImpl(CapabilitiesResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List features() { + return this.inner().features(); + } + + @Override + public QuotaCapability quota() { + return this.inner().quota(); + } + + @Override + public Map regions() { + return this.inner().regions(); + } + + @Override + public Map versions() { + return this.inner().versions(); + } + + @Override + public List vmSizeFilters() { + return this.inner().vmSizeFilters(); + } + + @Override + public Map vmSizes() { + return this.inner().vmSizes(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java new file mode 100644 index 0000000000000..231c4c5fb7a8e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Get Capabilities operation response. + */ +public class CapabilitiesResultInner { + /** + * The version capability. + */ + @JsonProperty(value = "versions") + private Map versions; + + /** + * The virtual machine size compatibilty features. + */ + @JsonProperty(value = "regions") + private Map regions; + + /** + * The virtual machine sizes. + */ + @JsonProperty(value = "vmSizes") + private Map vmSizes; + + /** + * The virtual machine size compatibilty filters. + */ + @JsonProperty(value = "vmSize_filters") + private List vmSizeFilters; + + /** + * The capabilty features. + */ + @JsonProperty(value = "features") + private List features; + + /** + * The quota capability. + */ + @JsonProperty(value = "quota") + private QuotaCapability quota; + + /** + * Get the version capability. + * + * @return the versions value + */ + public Map versions() { + return this.versions; + } + + /** + * Set the version capability. + * + * @param versions the versions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVersions(Map versions) { + this.versions = versions; + return this; + } + + /** + * Get the virtual machine size compatibilty features. + * + * @return the regions value + */ + public Map regions() { + return this.regions; + } + + /** + * Set the virtual machine size compatibilty features. + * + * @param regions the regions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withRegions(Map regions) { + this.regions = regions; + return this; + } + + /** + * Get the virtual machine sizes. + * + * @return the vmSizes value + */ + public Map vmSizes() { + return this.vmSizes; + } + + /** + * Set the virtual machine sizes. + * + * @param vmSizes the vmSizes value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizes(Map vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the virtual machine size compatibilty filters. + * + * @return the vmSizeFilters value + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the virtual machine size compatibilty filters. + * + * @param vmSizeFilters the vmSizeFilters value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the capabilty features. + * + * @return the features value + */ + public List features() { + return this.features; + } + + /** + * Set the capabilty features. + * + * @param features the features value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the quota capability. + * + * @return the quota value + */ + public QuotaCapability quota() { + return this.quota; + } + + /** + * Set the quota capability. + * + * @param quota the quota value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withQuota(QuotaCapability quota) { + this.quota = quota; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..511925987a580 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterCreateParametersExtended createOrUpdateParameter; + ClusterImpl(String name, ClusterInner inner, HDInsightManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ClusterGetProperties properties() { + return this.inner().properties(); + } + + @Override + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java new file mode 100644 index 0000000000000..373c9c9813266 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The HDInsight cluster. + */ +@SkipParentValidation +public class ClusterInner extends Resource { + /** + * The ETag for the resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /** + * Get the ETag for the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the resource. + * + * @param etag the etag value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties of the cluster. + * + * @return the properties value + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties of the cluster. + * + * @param properties the properties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 0000000000000..ef98a3fa94040 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ClusterMonitoringResponseImpl extends WrapperImpl implements ClusterMonitoringResponse { + private final HDInsightManager manager; + ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Boolean clusterMonitoringEnabled() { + return this.inner().clusterMonitoringEnabled(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java new file mode 100644 index 0000000000000..ee8f37c4ec438 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) status response. + */ +public class ClusterMonitoringResponseInner { + /** + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /** + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the clusterMonitoringEnabled value + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..e3684e84d790d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(HDInsightManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + ClustersInner client = this.inner(); + return client.executeScriptActionsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + @Override + public Completable resizeAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.resizeAsync(resourceGroupName, clusterName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java new file mode 100644 index 0000000000000..e75b8f8cb623a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java @@ -0,0 +1,1653 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterPatchParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterResizeParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPatchParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters resize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> resize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> beginResize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters executeScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> executeScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginExecuteScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> beginExecuteScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, tags), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResizeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> executeScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.executeScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExecuteScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginExecuteScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExecuteScriptActionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExecuteScriptActionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..5a518832da809 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.Map; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final HDInsightManager manager; + + ConfigurationsImpl(HDInsightManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Completable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + ConfigurationsInner client = this.inner(); + return client.updateHTTPSettingsAsync(resourceGroupName, clusterName, configurationName, parameters).toCompletable(); + } + + @Override + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, configurationName) + ;} + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 0000000000000..d6cf943c9d95b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,350 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations updateHTTPSettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> updateHTTPSettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations beginUpdateHTTPSettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> beginUpdateHTTPSettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateHTTPSettings(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateHTTPSettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.updateHTTPSettings(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdateHTTPSettings(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateHTTPSettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdateHTTPSettings(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateHTTPSettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateHTTPSettingsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).toBlocking().single().body(); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(String resourceGroupName, String clusterName, String configurationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName), serviceCallback); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java new file mode 100644 index 0000000000000..32c4922c4897e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ExtensionImpl extends WrapperImpl implements Extension { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String extensionName; + + ExtensionImpl(ExtensionInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java new file mode 100644 index 0000000000000..a65fbca54f900 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster monitoring extensions. + */ +public class ExtensionInner { + /** + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the certificate for the cluster monitoring extensions. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..01cf8996226d0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final HDInsightManager manager; + + ExtensionsImpl(HDInsightManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private ExtensionImpl wrapModel(ExtensionInner inner) { + return new ExtensionImpl(inner, manager()); + } + + @Override + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.getMonitoringStatusAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterMonitoringResponse call(ClusterMonitoringResponseInner inner) { + return new ClusterMonitoringResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableMonitoringAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.disableMonitoringAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, extensionName) + .map(new Func1() { + @Override + public Extension call(ExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, extensionName).toCompletable(); + } + + @Override + public Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + ExtensionsInner client = this.inner(); + return client.enableMonitoringAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + ExtensionsInner client = this.inner(); + return client.createAsync(resourceGroupName, clusterName, extensionName, parameters).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 0000000000000..311e8bc8ffbea --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,790 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions enableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> enableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions beginEnableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> beginEnableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions getMonitoringStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> getMonitoringStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions disableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> disableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions beginDisableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> beginDisableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.enableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginEnableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginEnableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginEnableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterMonitoringResponseInner object if successful. + */ + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMonitoringStatusAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterMonitoringResponseInner>() { + @Override + public ClusterMonitoringResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable> getMonitoringStatusWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMonitoringStatus(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMonitoringStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMonitoringStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable disableMonitoringAsync(String resourceGroupName, String clusterName) { + return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> disableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.disableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDisableMonitoring(String resourceGroupName, String clusterName) { + beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDisableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDisableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDisableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDisableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDisableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDisableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInner object if successful. + */ + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, ExtensionInner>() { + @Override + public ExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 0000000000000..5c53e58065c2c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HDInsightManagementClientImpl class. + */ +public class HDInsightManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The HDInsight client API Version. */ + private String apiVersion; + + /** + * Gets The HDInsight client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * The ScriptActionsInner object to access its operations. + */ + private ScriptActionsInner scriptActions; + + /** + * Gets the ScriptActionsInner object to access its operations. + * @return the ScriptActionsInner object. + */ + public ScriptActionsInner scriptActions() { + return this.scriptActions; + } + + /** + * The ScriptExecutionHistorysInner object to access its operations. + */ + private ScriptExecutionHistorysInner scriptExecutionHistorys; + + /** + * Gets the ScriptExecutionHistorysInner object to access its operations. + * @return the ScriptExecutionHistorysInner object. + */ + public ScriptExecutionHistorysInner scriptExecutionHistorys() { + return this.scriptExecutionHistorys; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-03-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.scriptActions = new ScriptActionsInner(restClient().retrofit(), this); + this.scriptExecutionHistorys = new ScriptExecutionHistorysInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HDInsightManagementClient", "2015-03-01-preview"); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java new file mode 100644 index 0000000000000..6f7342f04a445 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HDInsight resource management. + */ +public final class HDInsightManager extends ManagerCore { + private Clusters clusters; + private Applications applications; + private Locations locations; + private Configurations configurations; + private Extensions extensions; + private ScriptActions scriptActions; + private ScriptExecutionHistorys scriptExecutionHistorys; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HDInsightManager.ConfigurableImpl(); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HDInsightManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(RestClient restClient, String subscriptionId) { + return new HDInsightManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HDInsightManager that exposes HDInsight management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HDInsight management API entry points that work across subscriptions + */ + HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * @return Entry point to manage ScriptActions. + */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(this); + } + return this.scriptActions; + } + + /** + * @return Entry point to manage ScriptExecutionHistorys. + */ + public ScriptExecutionHistorys scriptExecutionHistorys() { + if (this.scriptExecutionHistorys == null) { + this.scriptExecutionHistorys = new ScriptExecutionHistorysImpl(this); + } + return this.scriptExecutionHistorys; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HDInsightManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HDInsightManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HDInsightManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..2856ccff2ea38 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..5b4f1e0e8365f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final HDInsightManager manager; + + LocationsImpl(HDInsightManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable getCapabilitiesAsync(String location) { + LocationsInner client = this.inner(); + return client.getCapabilitiesAsync(location) + .map(new Func1() { + @Override + public CapabilitiesResult call(CapabilitiesResultInner inner) { + return new CapabilitiesResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listUsagesAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsagesAsync(location) + .map(new Func1() { + @Override + public UsagesListResult call(UsagesListResultInner inner) { + return new UsagesListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java new file mode 100644 index 0000000000000..e63af68802169 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations getCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities") + Observable> getCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations listUsages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilitiesResultInner object if successful. + */ + public CapabilitiesResultInner getCapabilities(String location) { + return getCapabilitiesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCapabilitiesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCapabilitiesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable getCapabilitiesAsync(String location) { + return getCapabilitiesWithServiceResponseAsync(location).map(new Func1, CapabilitiesResultInner>() { + @Override + public CapabilitiesResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable> getCapabilitiesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCapabilities(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCapabilitiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCapabilitiesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsagesListResultInner object if successful. + */ + public UsagesListResultInner listUsages(String location) { + return listUsagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable listUsagesAsync(String location) { + return listUsagesWithServiceResponseAsync(location).map(new Func1, UsagesListResultInner>() { + @Override + public UsagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listUsages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..947b18f4bea87 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HDInsightManager manager; + OperationImpl(OperationInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..51a4daa9c93a2 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight REST API operation. + */ +public class OperationInner { + /** + * The operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f5b37e168ec3e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HDInsightManager manager; + + OperationsImpl(HDInsightManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..49444335200dd --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations list" }) + @GET("providers/Microsoft.HDInsight/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..e66c3d88145c3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 0000000000000..e641b030b44e9 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; + +class RuntimeScriptActionDetailImpl extends WrapperImpl implements RuntimeScriptActionDetail { + private final HDInsightManager manager; + + RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String debugInformation() { + return this.inner().debugInformation(); + } + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public List executionSummary() { + return this.inner().executionSummary(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String parameters() { + return this.inner().parameters(); + } + + @Override + public List roles() { + return this.inner().roles(); + } + + @Override + public Long scriptExecutionId() { + return this.inner().scriptExecutionId(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java new file mode 100644 index 0000000000000..6a3fe64a029ae --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptAction; + +/** + * The execution details of a script action. + */ +public class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + /** + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /** + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /** + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the execution id of the script action. + * + * @return the scriptExecutionId value + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the start time of script action execution. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the end time of script action execution. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the current execution status of the script action. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the reason why the script action was executed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the summary of script action execution result. + * + * @return the executionSummary value + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the script action execution debug information. + * + * @return the debugInformation value + */ + public String debugInformation() { + return this.debugInformation; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java new file mode 100644 index 0000000000000..cd45286692fa0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on role on the cluster. + */ +public class ScriptActionInner { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withParameters(String parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java new file mode 100644 index 0000000000000..19b74979ea12d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptActionsImpl extends WrapperImpl implements ScriptActions { + private final HDInsightManager manager; + + ScriptActionsImpl(HDInsightManager manager) { + super(manager.inner().scriptActions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + + @Override + public Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + ScriptActionsInner client = this.inner(); + return client.listPersistedScriptsAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + ScriptActionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); + } + + @Override + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptActionsInner client = this.inner(); + return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java new file mode 100644 index 0000000000000..6e0f85951cabe --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java @@ -0,0 +1,498 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptActions. + */ +public class ScriptActionsInner { + /** The Retrofit service to perform REST calls. */ + private ScriptActionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptActionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptActions to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptName") String scriptName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScripts" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + Observable> listPersistedScripts(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions getExecutionDetail" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + Observable> getExecutionDetail(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScriptsNext" }) + @GET + Observable> listPersistedScriptsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String scriptName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).toBlocking().single().body(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String scriptName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName), serviceCallback); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptName == null) { + throw new IllegalArgumentException("Parameter scriptName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, scriptName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScripts(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPersistedScripts(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuntimeScriptActionDetailInner object if successful. + */ + public RuntimeScriptActionDetailInner getExecutionDetail(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, RuntimeScriptActionDetailInner>() { + @Override + public RuntimeScriptActionDetailInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable> getExecutionDetailWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getExecutionDetail(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExecutionDetailDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExecutionDetailDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScriptsNext(final String nextPageLink) { + ServiceResponse> response = listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPersistedScriptsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsNextAsync(final String nextPageLink) { + return listPersistedScriptsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsNextWithServiceResponseAsync(final String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listPersistedScriptsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java new file mode 100644 index 0000000000000..b8850abe9e7cf --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptExecutionHistorysImpl extends WrapperImpl implements ScriptExecutionHistorys { + private final HDInsightManager manager; + + ScriptExecutionHistorysImpl(HDInsightManager manager) { + super(manager.inner().scriptExecutionHistorys()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ScriptExecutionHistorysInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + + @Override + public Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptExecutionHistorysInner client = this.inner(); + return client.promoteAsync(resourceGroupName, clusterName, scriptExecutionId).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java new file mode 100644 index 0000000000000..2c9a861eb927e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptExecutionHistorys. + */ +public class ScriptExecutionHistorysInner { + /** The Retrofit service to perform REST calls. */ + private ScriptExecutionHistorysService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistorysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptExecutionHistorysInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptExecutionHistorysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptExecutionHistorys to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptExecutionHistorysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys promote" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + Observable> promote(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> promoteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.promote(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = promoteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse promoteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java new file mode 100644 index 0000000000000..71aba83915c4e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; + +class UsagesListResultImpl extends WrapperImpl implements UsagesListResult { + private final HDInsightManager manager; + UsagesListResultImpl(UsagesListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java new file mode 100644 index 0000000000000..e602bd55ae961 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional usages for a subscription. + */ +public class UsagesListResultInner { + /** + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of usages. + * + * @param value the value value to set + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..60182e7fdfead --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java new file mode 100644 index 0000000000000..d1cb0bfee0bcf --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; diff --git a/hdinsight/resource-manager/v2018_06_01_preview/pom.xml b/hdinsight/resource-manager/v2018_06_01_preview/pom.xml new file mode 100644 index 0000000000000..7776ba4b47256 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.hdinsight.v2018_06_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-hdinsight + 1.0.0-beta + jar + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft HDInsight Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java new file mode 100644 index 0000000000000..7fc610fc6eb3d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the application definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group + * @param clusterName The name of the cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the application definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the application definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next definition stage + */ + WithCreate withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the application update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next update stage + */ + Update withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.java new file mode 100644 index 0000000000000..a3771c88b9317 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application SSH endpoint. + */ +public class ApplicationGetEndpoint { + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java new file mode 100644 index 0000000000000..e1b695a18cfa9 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application HTTP endpoints. + */ +public class ApplicationGetHttpsEndpoint { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the list of access modes for the application. + * + * @return the accessModes value + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the list of access modes for the application. + * + * @param accessModes the accessModes value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java new file mode 100644 index 0000000000000..d972ff281bc83 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight cluster application GET response. + */ +public class ApplicationProperties { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /** + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /** + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /** + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /** + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /** + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * The additional properties for application. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /** + * Get the list of roles in the cluster. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the list of install script actions. + * + * @return the installScriptActions value + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the list of install script actions. + * + * @param installScriptActions the installScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the list of uninstall script actions. + * + * @return the uninstallScriptActions value + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the list of application HTTPS endpoints. + * + * @return the httpsEndpoints value + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the list of application SSH endpoints. + * + * @return the sshEndpoints value + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioning state of the application. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the application type. + * + * @return the applicationType value + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the application type. + * + * @param applicationType the applicationType value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the application state. + * + * @return the applicationState value + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the application create date time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplace identifier. + * + * @return the marketplaceIdentifier value + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + + /** + * Get the additional properties for application. + * + * @return the additionalProperties value + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additional properties for application. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.java new file mode 100644 index 0000000000000..27fd20f30e8e2 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String applicationName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.java new file mode 100644 index 0000000000000..d15444b92d766 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AsyncOperationState. + */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java new file mode 100644 index 0000000000000..5e864a4aa4580 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next definition stage + */ + WithCreate withProperties(ClusterCreateProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProperties { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next update stage + */ + Update withProperties(ClusterCreateProperties properties); + } + + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java new file mode 100644 index 0000000000000..6306676a11c3d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateCluster request parameters. + */ +public class ClusterCreateParametersExtended { + /** + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /** + * Get the location of the cluster. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the cluster. + * + * @param location the location value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the cluster create parameters. + * + * @return the properties value + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the cluster create parameters. + * + * @param properties the properties value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java new file mode 100644 index 0000000000000..f967ee308913a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster create parameters. + */ +public class ClusterCreateProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storage profile. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storage profile. + * + * @param storageProfile the storageProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java new file mode 100644 index 0000000000000..48f6fae40d26d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster definition. + */ +public class ClusterDefinition { + /** + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /** + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /** + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the link to the blueprint. + * + * @return the blueprint value + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the link to the blueprint. + * + * @param blueprint the blueprint value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the type of cluster. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the type of cluster. + * + * @param kind the kind value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the versions of different services in the cluster. + * + * @return the componentVersion value + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the cluster configurations. + * + * @return the configurations value + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the cluster configurations. + * + * @param configurations the configurations value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java new file mode 100644 index 0000000000000..b525caac90900 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of cluster. + */ +public class ClusterGetProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The provisioning state, which only appears in the response. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', + * 'Deleting'. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /** + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /** + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @return the provisioningState value + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @param provisioningState the provisioningState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date on which the cluster was created. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the date on which the cluster was created. + * + * @param createdDate the createdDate value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state of the cluster. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the state of the cluster. + * + * @param clusterState the clusterState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quota information. + * + * @return the quotaInfo value + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quota information. + * + * @param quotaInfo the quotaInfo value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the list of connectivity endpoints. + * + * @return the connectivityEndpoints value + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java new file mode 100644 index 0000000000000..87ab2bcbb8fb3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListPersistedScriptActions operation response. + */ +public class ClusterListPersistedScriptActionsResult { + /** + * The list of Persisted Script Actions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of Persisted Script Actions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Persisted Script Actions. + * + * @param value the value value to set + * @return the ClusterListPersistedScriptActionsResult object itself. + */ + public ClusterListPersistedScriptActionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.java new file mode 100644 index 0000000000000..cc0c1a0b7b326 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list runtime script action detail response. + */ +public class ClusterListRuntimeScriptActionDetailResult { + /** + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of persisted script action details for the cluster. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.java new file mode 100644 index 0000000000000..77e27b00f9be5 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) parameters. + */ +public class ClusterMonitoringRequest { + /** + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java new file mode 100644 index 0000000000000..c6b15526e837c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClusterMonitoringResponseInner; + +/** + * Type representing ClusterMonitoringResponse. + */ +public interface ClusterMonitoringResponse extends HasInner, HasManager { + /** + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.java new file mode 100644 index 0000000000000..30a8276ae0ba3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PatchCluster request parameters. + */ +public class ClusterPatchParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.java new file mode 100644 index 0000000000000..5efc84f3dac77 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resize Cluster request parameters. + */ +public class ClusterResizeParameters { + /** + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the target instance count for the operation. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java new file mode 100644 index 0000000000000..0fad80b77e2e6 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resizeAsync(String resourceGroupName, String clusterName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.java new file mode 100644 index 0000000000000..ce0cf6674e133 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the compute profile. + */ +public class ComputeProfile { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the list of roles in the cluster. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles in the cluster. + * + * @param roles the roles value to set + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.java new file mode 100644 index 0000000000000..f27abe392cf7d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends HasInner { + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable> getAsync(String resourceGroupName, String clusterName, String configurationName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java new file mode 100644 index 0000000000000..7cb9645591166 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connectivity properties. + */ +public class ConnectivityEndpoint { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol of the endpoint. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol of the endpoint. + * + * @param protocol the protocol value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port to connect to. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the port to connect to. + * + * @param port the port value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java new file mode 100644 index 0000000000000..f975761fdd8c9 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data disks groups for the role. + */ +public class DataDisksGroups { + /** + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /** + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /** + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the number of disks per node. + * + * @return the disksPerNode value + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the number of disks per node. + * + * @param disksPerNode the disksPerNode value to set + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get readOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get readOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.java new file mode 100644 index 0000000000000..0597245dec98a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DirectoryType. + */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.java new file mode 100644 index 0000000000000..2b6507868aa09 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.java new file mode 100644 index 0000000000000..6772ecfd0e0cd --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.java new file mode 100644 index 0000000000000..522a027ccc3d2 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error message associated with the cluster creation. + */ +public class Errors { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the Errors object itself. + */ + public Errors withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java new file mode 100644 index 0000000000000..26bd5a20fbe2d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for the script actions to execute on a running cluster. + */ +public class ExecuteScriptActionParameters { + /** + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the list of run time script actions. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of run time script actions. + * + * @param scriptActions the scriptActions value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java new file mode 100644 index 0000000000000..90af69d8daaab --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; + +/** + * Type representing Extension. + */ +public interface Extension extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java new file mode 100644 index 0000000000000..ec2c5d25793eb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends HasInner { + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableMonitoringAsync(String resourceGroupName, String clusterName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.java new file mode 100644 index 0000000000000..0f507416b60d6 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HDInsightClusterProvisioningState. + */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.java new file mode 100644 index 0000000000000..ceb871e9b1373 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The hardware profile. + */ +public class HardwareProfile { + /** + * The size of the VM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the size of the VM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the size of the VM. + * + * @param vmSize the vmSize value to set + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.java new file mode 100644 index 0000000000000..85b16147dc44f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ssh username, password, and ssh public key. + */ +public class LinuxOperatingSystemProfile { + /** + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username. + * + * @param username the username value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password. + * + * @param password the password value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the SSH profile. + * + * @return the sshProfile value + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the SSH profile. + * + * @param sshProfile the sshProfile value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.java new file mode 100644 index 0000000000000..1d9b8802e35f6 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the localizable name of a type of usage. + */ +public class LocalizedName { + /** + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the name of the used resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the name of the used resource. + * + * @param value the value value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the used resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the used resource. + * + * @param localizedValue the localizedValue value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java new file mode 100644 index 0000000000000..9bd76b3ec75c1 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String location); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.java new file mode 100644 index 0000000000000..f2659f272e9a8 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OSType. + */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java new file mode 100644 index 0000000000000..9ac10da1efcb7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..d6495bbda0051 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * The service provider: Microsoft.HDInsight. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the service provider: Microsoft.HDInsight. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type: read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type: read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java new file mode 100644 index 0000000000000..2dcce02c93854 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The azure async operation response. + */ +public class OperationResource { + /** + * The async operation state. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private AsyncOperationState status; + + /** + * The operation error information. + */ + @JsonProperty(value = "error") + private Errors error; + + /** + * Get the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public AsyncOperationState status() { + return this.status; + } + + /** + * Set the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the OperationResource object itself. + */ + public OperationResource withStatus(AsyncOperationState status) { + this.status = status; + return this; + } + + /** + * Get the operation error information. + * + * @return the error value + */ + public Errors error() { + return this.error; + } + + /** + * Set the operation error information. + * + * @param error the error value to set + * @return the OperationResource object itself. + */ + public OperationResource withError(Errors error) { + this.error = error; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operations.java new file mode 100644 index 0000000000000..ed0e1b039e0ad --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.java new file mode 100644 index 0000000000000..350bb586520fb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Linux operation systems profile. + */ +public class OsProfile { + /** + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the Linux OS profile. + * + * @return the linuxOperatingSystemProfile value + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.java new file mode 100644 index 0000000000000..ad4c2597ce3b9 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota properties for the cluster. + */ +public class QuotaInfo { + /** + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the cores used by the cluster. + * + * @return the coresUsed value + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the cores used by the cluster. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java new file mode 100644 index 0000000000000..069ad311501d2 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a role on the cluster. + */ +public class Role { + /** + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /** + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /** + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /** + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name of the role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the role. + * + * @param name the name value to set + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the instance count of the cluster. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the hardware profile. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the operating system profile. + * + * @return the osProfile value + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the operating system profile. + * + * @param osProfile the osProfile value to set + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtual network profile. + * + * @return the virtualNetworkProfile value + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the data disks groups for the role. + * + * @return the dataDisksGroups value + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the list of script actions on the role. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of script actions on the role. + * + * @param scriptActions the scriptActions value to set + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java new file mode 100644 index 0000000000000..5261fd0ee0dbf --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on a running cluster. + */ +public class RuntimeScriptAction { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /** + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script. + * + * @param parameters the parameters value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name of the script action, if any. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.java new file mode 100644 index 0000000000000..65b7112448a03 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import java.util.List; + +/** + * Type representing RuntimeScriptActionDetail. + */ +public interface RuntimeScriptActionDetail extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the parameters value. + */ + String parameters(); + + /** + * @return the roles value. + */ + List roles(); + + /** + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java new file mode 100644 index 0000000000000..086e42212c573 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The execution summary of a script action. + */ +public class ScriptActionExecutionSummary { + /** + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status of script action execution. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the instance count for a given script action execution status. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.java new file mode 100644 index 0000000000000..6daaf7d88afa7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The persisted script action for cluster. + */ +public class ScriptActionPersistedGetResponseSpec { + /** + * The name of script action. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * The application name for the script action. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * Get the name of script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of script action. + * + * @param name the name value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name for the script action. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name for the script action. + * + * @param applicationName the applicationName value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java new file mode 100644 index 0000000000000..d66041489187d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptActions. + */ +public interface ScriptActions extends HasInner { + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java new file mode 100644 index 0000000000000..019ef20049282 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptExecutionHistorysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptExecutionHistorys. + */ +public interface ScriptExecutionHistorys extends HasInner { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java new file mode 100644 index 0000000000000..c993b8c7357ca --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The security profile which contains Ssh public key for the HDInsight + * cluster. + */ +public class SecurityProfile { + /** + * The directory type. Possible values include: 'ActiveDirectory'. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /** + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /** + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /** + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /** + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /** + * Optional. The Distinguished Names for cluster user groups. + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /** + * Get the directory type. Possible values include: 'ActiveDirectory'. + * + * @return the directoryType value + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directory type. Possible values include: 'ActiveDirectory'. + * + * @param directoryType the directoryType value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the organization's active directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the organization's active directory domain. + * + * @param domain the domain value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @return the organizationalUnitDN value + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domain admin password. + * + * @return the domainUserPassword value + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.java new file mode 100644 index 0000000000000..2f4542e900ad0 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of SSH public keys. + */ +public class SshProfile { + /** + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the list of SSH public keys. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the list of SSH public keys. + * + * @param publicKeys the publicKeys value to set + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.java new file mode 100644 index 0000000000000..d2b63a87cd189 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH public key for the cluster nodes. + */ +public class SshPublicKey { + /** + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificate for SSH. + * + * @return the certificateData value + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificate for SSH. + * + * @param certificateData the certificateData value to set + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java new file mode 100644 index 0000000000000..99ca4fa2ba191 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage Account. + */ +public class StorageAccount { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /** + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /** + * The filesystem, only to be specified for Azure Data Lake Storage type + * Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /** + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get whether or not the storage account is the default storage account. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the filesystem, only to be specified for Azure Data Lake Storage type Gen 2. + * + * @return the fileSystem value + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the filesystem, only to be specified for Azure Data Lake Storage type Gen 2. + * + * @param fileSystem the fileSystem value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the storage account access key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account access key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.java new file mode 100644 index 0000000000000..ffca8a6461d82 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage profile. + */ +public class StorageProfile { + /** + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the list of storage accounts in the cluster. + * + * @return the storageaccounts value + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.java new file mode 100644 index 0000000000000..64667c2b97f35 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Tier. + */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java new file mode 100644 index 0000000000000..40bb0dbec7ff6 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the usage of a particular limited resource. + */ +public class Usage { + /** + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /** + * Get the type of measurement for usage. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the type of measurement for usage. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current usage. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current usage. + * + * @param currentValue the currentValue value to set + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum allowed usage. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the maximum allowed usage. + * + * @param limit the limit value to set + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the details about the localizable name of the used resource. + * + * @return the name value + */ + public LocalizedName name() { + return this.name; + } + + /** + * Set the details about the localizable name of the used resource. + * + * @param name the name value to set + * @return the Usage object itself. + */ + public Usage withName(LocalizedName name) { + this.name = name; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java new file mode 100644 index 0000000000000..e6535a67c6e0d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.UsagesListResultInner; +import java.util.List; + +/** + * Type representing UsagesListResult. + */ +public interface UsagesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.java new file mode 100644 index 0000000000000..02f928a4eff34 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network properties. + */ +public class VirtualNetworkProfile { + /** + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the ID of the virtual network. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the virtual network. + * + * @param id the id value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the name of the subnet. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..b02a8e6697382 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ApplicationProperties; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String applicationName; + + ApplicationImpl(String name, HDInsightManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + } + + ApplicationImpl(ApplicationInner inner, HDInsightManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java new file mode 100644 index 0000000000000..e492ddd3b308a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The HDInsight cluster application. + */ +public class ApplicationInner extends ProxyResource { + /** + * The ETag for the application. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the ETag for the application. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the application. + * + * @param etag the etag value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags for the application. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the application. + * + * @param tags the tags value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the application. + * + * @return the properties value + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties of the application. + * + * @param properties the properties value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..6a1aadd83275b --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final HDInsightManager manager; + + ApplicationsImpl(HDInsightManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ApplicationsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, applicationName) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, applicationName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 0000000000000..5bf8f1ba335c3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,774 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..5e53684da1a00 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterCreateProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterCreateParametersExtended createOrUpdateParameter; + ClusterImpl(String name, ClusterInner inner, HDInsightManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ClusterGetProperties properties() { + return this.inner().properties(); + } + + @Override + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java new file mode 100644 index 0000000000000..0f7ac44c8356d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterGetProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The HDInsight cluster. + */ +@SkipParentValidation +public class ClusterInner extends Resource { + /** + * The ETag for the resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /** + * Get the ETag for the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the resource. + * + * @param etag the etag value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties of the cluster. + * + * @return the properties value + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties of the cluster. + * + * @param properties the properties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 0000000000000..b10558098c4f4 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ClusterMonitoringResponseImpl extends WrapperImpl implements ClusterMonitoringResponse { + private final HDInsightManager manager; + ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Boolean clusterMonitoringEnabled() { + return this.inner().clusterMonitoringEnabled(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java new file mode 100644 index 0000000000000..8245ecb9e2501 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) status response. + */ +public class ClusterMonitoringResponseInner { + /** + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /** + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the clusterMonitoringEnabled value + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..22cb91adc2911 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Cluster; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ExecuteScriptActionParameters; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(HDInsightManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + ClustersInner client = this.inner(); + return client.executeScriptActionsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + @Override + public Completable resizeAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.resizeAsync(resourceGroupName, clusterName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java new file mode 100644 index 0000000000000..250355e95795e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java @@ -0,0 +1,1653 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterPatchParameters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterResizeParameters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ExecuteScriptActionParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPatchParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters resize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> resize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters beginResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> beginResize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters executeScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> executeScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters beginExecuteScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> beginExecuteScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, tags), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResizeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> executeScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.executeScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExecuteScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginExecuteScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExecuteScriptActionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExecuteScriptActionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..971b89020a942 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.Map; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final HDInsightManager manager; + + ConfigurationsImpl(HDInsightManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + ConfigurationsInner client = this.inner(); + return client.updateAsync(resourceGroupName, clusterName, configurationName, parameters).toCompletable(); + } + + @Override + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, configurationName) + ;} + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 0000000000000..3a640c76aa9ee --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,350 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations update" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations beginUpdate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).toBlocking().single().body(); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(String resourceGroupName, String clusterName, String configurationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName), serviceCallback); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.java new file mode 100644 index 0000000000000..481b768290689 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ExtensionImpl extends WrapperImpl implements Extension { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String extensionName; + + ExtensionImpl(ExtensionInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.java new file mode 100644 index 0000000000000..d8dd27791b899 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster monitoring extensions. + */ +public class ExtensionInner { + /** + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the certificate for the cluster monitoring extensions. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..e4a1db3fe5ae7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extension; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringRequest; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final HDInsightManager manager; + + ExtensionsImpl(HDInsightManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private ExtensionImpl wrapModel(ExtensionInner inner) { + return new ExtensionImpl(inner, manager()); + } + + @Override + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.getMonitoringStatusAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterMonitoringResponse call(ClusterMonitoringResponseInner inner) { + return new ClusterMonitoringResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableMonitoringAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.disableMonitoringAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, extensionName) + .map(new Func1() { + @Override + public Extension call(ExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, extensionName).toCompletable(); + } + + @Override + public Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + ExtensionsInner client = this.inner(); + return client.enableMonitoringAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + ExtensionsInner client = this.inner(); + return client.createAsync(resourceGroupName, clusterName, extensionName, parameters).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 0000000000000..c9f8ed736064c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,956 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringRequest; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions enableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> enableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions beginEnableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> beginEnableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions getMonitoringStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> getMonitoringStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions disableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> disableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions beginDisableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> beginDisableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.enableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginEnableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginEnableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginEnableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterMonitoringResponseInner object if successful. + */ + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMonitoringStatusAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterMonitoringResponseInner>() { + @Override + public ClusterMonitoringResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable> getMonitoringStatusWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMonitoringStatus(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMonitoringStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMonitoringStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable disableMonitoringAsync(String resourceGroupName, String clusterName) { + return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> disableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.disableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDisableMonitoring(String resourceGroupName, String clusterName) { + beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDisableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDisableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDisableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDisableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDisableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDisableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().last().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCreate(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInner object if successful. + */ + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, ExtensionInner>() { + @Override + public ExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().last().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String extensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 0000000000000..969d8f76cf069 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HDInsightManagementClientImpl class. + */ +public class HDInsightManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The HDInsight client API Version. */ + private String apiVersion; + + /** + * Gets The HDInsight client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * The ScriptActionsInner object to access its operations. + */ + private ScriptActionsInner scriptActions; + + /** + * Gets the ScriptActionsInner object to access its operations. + * @return the ScriptActionsInner object. + */ + public ScriptActionsInner scriptActions() { + return this.scriptActions; + } + + /** + * The ScriptExecutionHistorysInner object to access its operations. + */ + private ScriptExecutionHistorysInner scriptExecutionHistorys; + + /** + * Gets the ScriptExecutionHistorysInner object to access its operations. + * @return the ScriptExecutionHistorysInner object. + */ + public ScriptExecutionHistorysInner scriptExecutionHistorys() { + return this.scriptExecutionHistorys; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-06-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.scriptActions = new ScriptActionsInner(restClient().retrofit(), this); + this.scriptExecutionHistorys = new ScriptExecutionHistorysInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HDInsightManagementClient", "2018-06-01-preview"); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java new file mode 100644 index 0000000000000..ce22fb29a7680 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HDInsight resource management. + */ +public final class HDInsightManager extends ManagerCore { + private Clusters clusters; + private Applications applications; + private Locations locations; + private Configurations configurations; + private Extensions extensions; + private ScriptActions scriptActions; + private ScriptExecutionHistorys scriptExecutionHistorys; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HDInsightManager.ConfigurableImpl(); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HDInsightManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(RestClient restClient, String subscriptionId) { + return new HDInsightManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HDInsightManager that exposes HDInsight management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HDInsight management API entry points that work across subscriptions + */ + HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * @return Entry point to manage ScriptActions. + */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(this); + } + return this.scriptActions; + } + + /** + * @return Entry point to manage ScriptExecutionHistorys. + */ + public ScriptExecutionHistorys scriptExecutionHistorys() { + if (this.scriptExecutionHistorys == null) { + this.scriptExecutionHistorys = new ScriptExecutionHistorysImpl(this); + } + return this.scriptExecutionHistorys; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HDInsightManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HDInsightManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HDInsightManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/IdParsingUtils.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..d50eda2932c1e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..7dfe32719674c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.UsagesListResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final HDInsightManager manager; + + LocationsImpl(HDInsightManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listUsagesAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsagesAsync(location) + .map(new Func1() { + @Override + public UsagesListResult call(UsagesListResultInner inner) { + return new UsagesListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.java new file mode 100644 index 0000000000000..f3ccae61412ed --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations listUsages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsagesListResultInner object if successful. + */ + public UsagesListResultInner listUsages(String location) { + return listUsagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable listUsagesAsync(String location) { + return listUsagesWithServiceResponseAsync(location).map(new Func1, UsagesListResultInner>() { + @Override + public UsagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listUsages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..1a26cab65fead --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HDInsightManager manager; + OperationImpl(OperationInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..1baadaf05877a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight REST API operation. + */ +public class OperationInner { + /** + * The operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..721dcb81d25ff --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HDInsightManager manager; + + OperationsImpl(HDInsightManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..35baf46abc0f2 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations list" }) + @GET("providers/Microsoft.HDInsight/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/PageImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..7e193ceda3eb3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 0000000000000..8b1a157320227 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActionExecutionSummary; + +class RuntimeScriptActionDetailImpl extends WrapperImpl implements RuntimeScriptActionDetail { + private final HDInsightManager manager; + + RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String debugInformation() { + return this.inner().debugInformation(); + } + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public List executionSummary() { + return this.inner().executionSummary(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String parameters() { + return this.inner().parameters(); + } + + @Override + public List roles() { + return this.inner().roles(); + } + + @Override + public Long scriptExecutionId() { + return this.inner().scriptExecutionId(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java new file mode 100644 index 0000000000000..c66040876e6ac --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptAction; + +/** + * The execution details of a script action. + */ +public class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + /** + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /** + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /** + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the execution id of the script action. + * + * @return the scriptExecutionId value + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the start time of script action execution. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the end time of script action execution. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the current execution status of the script action. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the reason why the script action was executed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the summary of script action execution result. + * + * @return the executionSummary value + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the script action execution debug information. + * + * @return the debugInformation value + */ + public String debugInformation() { + return this.debugInformation; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.java new file mode 100644 index 0000000000000..6ea155237e2e5 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on role on the cluster. + */ +public class ScriptActionInner { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withParameters(String parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java new file mode 100644 index 0000000000000..f5225ef78a4ce --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; + +class ScriptActionsImpl extends WrapperImpl implements ScriptActions { + private final HDInsightManager manager; + + ScriptActionsImpl(HDInsightManager manager) { + super(manager.inner().scriptActions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ScriptActionsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + ScriptActionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); + } + + @Override + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptActionsInner client = this.inner(); + return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java new file mode 100644 index 0000000000000..aa21d81533dc6 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java @@ -0,0 +1,498 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptActions. + */ +public class ScriptActionsInner { + /** The Retrofit service to perform REST calls. */ + private ScriptActionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptActionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptActions to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptName") String scriptName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions getExecutionDetail" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + Observable> getExecutionDetail(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String scriptName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).toBlocking().single().body(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String scriptName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName), serviceCallback); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptName == null) { + throw new IllegalArgumentException("Parameter scriptName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, scriptName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuntimeScriptActionDetailInner object if successful. + */ + public RuntimeScriptActionDetailInner getExecutionDetail(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, RuntimeScriptActionDetailInner>() { + @Override + public RuntimeScriptActionDetailInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable> getExecutionDetailWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getExecutionDetail(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExecutionDetailDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExecutionDetailDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.java new file mode 100644 index 0000000000000..083e2614c281c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; + +class ScriptExecutionHistorysImpl extends WrapperImpl implements ScriptExecutionHistorys { + private final HDInsightManager manager; + + ScriptExecutionHistorysImpl(HDInsightManager manager) { + super(manager.inner().scriptExecutionHistorys()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ScriptExecutionHistorysInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + + @Override + public Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptExecutionHistorysInner client = this.inner(); + return client.promoteAsync(resourceGroupName, clusterName, scriptExecutionId).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java new file mode 100644 index 0000000000000..3f1f93b7e3d77 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptExecutionHistorys. + */ +public class ScriptExecutionHistorysInner { + /** The Retrofit service to perform REST calls. */ + private ScriptExecutionHistorysService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistorysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptExecutionHistorysInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptExecutionHistorysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptExecutionHistorys to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptExecutionHistorysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys promote" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + Observable> promote(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> promoteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.promote(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = promoteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse promoteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java new file mode 100644 index 0000000000000..e00aab78fef84 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.UsagesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Usage; + +class UsagesListResultImpl extends WrapperImpl implements UsagesListResult { + private final HDInsightManager manager; + UsagesListResultImpl(UsagesListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java new file mode 100644 index 0000000000000..19ec943ff35b4 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional usages for a subscription. + */ +public class UsagesListResultInner { + /** + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of usages. + * + * @param value the value value to set + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/package-info.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..4cf8620203ebf --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/package-info.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/package-info.java new file mode 100644 index 0000000000000..47078ef3fd984 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml b/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml index 6854016061bb6..6832715abbc81 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.iotcentral.v2017_07_01_privatepreview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-iotcentral - 1.0.0-beta - jar - Microsoft Azure SDK for IoTCentral Management - This package contains Microsoft IoTCentral Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.iotcentral.v2017_07_01_privatepreview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-iotcentral + 1.0.0-beta + jar + Microsoft Azure SDK for IoTCentral Management + This package contains Microsoft IoTCentral Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java index 65071067ea595..f14a7be9ced65 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.implementation.IoTCentralManager; import com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.implementation.AppInner; diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppPatch.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppPatch.java index 32d38f7879495..1cbb6017addf3 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppPatch.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppPatch.java @@ -51,7 +51,7 @@ public class AppPatch { private String template; /** - * Get the tags value. + * Get instance tags. * * @return the tags value */ @@ -60,7 +60,7 @@ public Map tags() { } /** - * Set the tags value. + * Set instance tags. * * @param tags the tags value to set * @return the AppPatch object itself. @@ -71,7 +71,7 @@ public AppPatch withTags(Map tags) { } /** - * Get the applicationId value. + * Get the ID of the application. * * @return the applicationId value */ @@ -80,7 +80,7 @@ public String applicationId() { } /** - * Get the displayName value. + * Get the display name of the application. * * @return the displayName value */ @@ -89,7 +89,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set the display name of the application. * * @param displayName the displayName value to set * @return the AppPatch object itself. @@ -100,7 +100,7 @@ public AppPatch withDisplayName(String displayName) { } /** - * Get the subdomain value. + * Get the subdomain of the application. * * @return the subdomain value */ @@ -109,7 +109,7 @@ public String subdomain() { } /** - * Set the subdomain value. + * Set the subdomain of the application. * * @param subdomain the subdomain value to set * @return the AppPatch object itself. @@ -120,7 +120,7 @@ public AppPatch withSubdomain(String subdomain) { } /** - * Get the template value. + * Get the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. * * @return the template value */ @@ -129,7 +129,7 @@ public String template() { } /** - * Set the template value. + * Set the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. * * @param template the template value to set * @return the AppPatch object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppSkuInfo.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppSkuInfo.java index b679a099905db..cd642442d4999 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppSkuInfo.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/AppSkuInfo.java @@ -21,7 +21,7 @@ public class AppSkuInfo { private AppSku name; /** - * Get the name value. + * Get the name of the SKU. Possible values include: 'F1', 'S1'. * * @return the name value */ @@ -30,7 +30,7 @@ public AppSku name() { } /** - * Set the name value. + * Set the name of the SKU. Possible values include: 'F1', 'S1'. * * @param name the name value to set * @return the AppSkuInfo object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/ErrorDetails.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/ErrorDetails.java index 158a69f0ef77d..586ea88344d38 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/ErrorDetails.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/ErrorDetails.java @@ -33,7 +33,7 @@ public class ErrorDetails { private String target; /** - * Get the code value. + * Get the error code. * * @return the code value */ @@ -42,7 +42,7 @@ public String code() { } /** - * Get the message value. + * Get the error message. * * @return the message value */ @@ -51,7 +51,7 @@ public String message() { } /** - * Get the target value. + * Get the target of the particular error. * * @return the target value */ diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationDisplay.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationDisplay.java index 96fd6f299bcde..a4e6dde3fa3df 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationDisplay.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationDisplay.java @@ -39,7 +39,7 @@ public class OperationDisplay { private String description; /** - * Get the provider value. + * Get service provider: Microsoft IoT Central. * * @return the provider value */ @@ -48,7 +48,7 @@ public String provider() { } /** - * Get the resource value. + * Get resource Type: IoT Central. * * @return the resource value */ @@ -57,7 +57,7 @@ public String resource() { } /** - * Get the operation value. + * Get name of the operation. * * @return the operation value */ @@ -66,7 +66,7 @@ public String operation() { } /** - * Get the description value. + * Get friendly description for the operation,. * * @return the description value */ diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationInputs.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationInputs.java index fec9e89c642b5..7f92e34667b3a 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationInputs.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/OperationInputs.java @@ -21,7 +21,7 @@ public class OperationInputs { private String name; /** - * Get the name value. + * Get the name of the IoT Central application instance to check. * * @return the name value */ @@ -30,7 +30,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the IoT Central application instance to check. * * @param name the name value to set * @return the OperationInputs object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppInner.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppInner.java index 535766989b119..056a8d6629620 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppInner.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppInner.java @@ -52,7 +52,7 @@ public class AppInner extends Resource { private AppSkuInfo sku; /** - * Get the applicationId value. + * Get the ID of the application. * * @return the applicationId value */ @@ -61,7 +61,7 @@ public String applicationId() { } /** - * Get the displayName value. + * Get the display name of the application. * * @return the displayName value */ @@ -70,7 +70,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set the display name of the application. * * @param displayName the displayName value to set * @return the AppInner object itself. @@ -81,7 +81,7 @@ public AppInner withDisplayName(String displayName) { } /** - * Get the subdomain value. + * Get the subdomain of the application. * * @return the subdomain value */ @@ -90,7 +90,7 @@ public String subdomain() { } /** - * Set the subdomain value. + * Set the subdomain of the application. * * @param subdomain the subdomain value to set * @return the AppInner object itself. @@ -101,7 +101,7 @@ public AppInner withSubdomain(String subdomain) { } /** - * Get the template value. + * Get the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. * * @return the template value */ @@ -110,7 +110,7 @@ public String template() { } /** - * Set the template value. + * Set the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. * * @param template the template value to set * @return the AppInner object itself. @@ -121,7 +121,7 @@ public AppInner withTemplate(String template) { } /** - * Get the sku value. + * Get a valid instance SKU. * * @return the sku value */ @@ -130,7 +130,7 @@ public AppSkuInfo sku() { } /** - * Set the sku value. + * Set a valid instance SKU. * * @param sku the sku value to set * @return the AppInner object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppNameAvailabilityInfoInner.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppNameAvailabilityInfoInner.java index 37072b7f30039..5631971f918bc 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppNameAvailabilityInfoInner.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppNameAvailabilityInfoInner.java @@ -36,7 +36,7 @@ public class AppNameAvailabilityInfoInner { private String message; /** - * Get the nameAvailable value. + * Get the value which indicates whether the provided name is available. * * @return the nameAvailable value */ @@ -45,7 +45,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. * * @return the reason value */ @@ -54,7 +54,7 @@ public AppNameUnavailabilityReason reason() { } /** - * Get the message value. + * Get the detailed reason message. * * @return the message value */ @@ -63,7 +63,7 @@ public String message() { } /** - * Set the message value. + * Set the detailed reason message. * * @param message the message value to set * @return the AppNameAvailabilityInfoInner object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsImpl.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsImpl.java index 3a9d1be9e392f..b50c952c2eb23 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsImpl.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsImpl.java @@ -79,29 +79,10 @@ public PagedList listByResourceGroup(String resourceGroupName) { return this.wrapList(client.listByResourceGroup(resourceGroupName)); } - private Observable> listByResourceGroupNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - AppsInner client = this.inner(); - return client.listByResourceGroupNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listByResourceGroupNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listByResourceGroupAsync(String resourceGroupName) { AppsInner client = this.inner(); return client.listByResourceGroupAsync(resourceGroupName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listByResourceGroupNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { @@ -122,29 +103,10 @@ public PagedList list() { return this.wrapList(client.list()); } - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - AppsInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { AppsInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java index d207c38c3ccd4..2971d20d99fec 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java @@ -26,7 +26,6 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; -import java.util.UUID; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -71,43 +70,43 @@ public AppsInner(Retrofit retrofit, IotCentralClientImpl client) { interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") - Observable> getByResourceGroup(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") - Observable> createOrUpdate(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") - Observable> update(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") - Observable> beginUpdate(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}", method = "DELETE", hasBody = true) - Observable> beginDelete(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/IoTApps") - Observable> list(@Path("subscriptionId") UUID subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps") - Observable> listByResourceGroup(@Path("subscriptionId") UUID subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps checkNameAvailability" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkNameAvailability") - Observable> checkNameAvailability(@Path("subscriptionId") UUID subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OperationInputs operationInputs, @Header("User-Agent") String userAgent); + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OperationInputs operationInputs, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2017_07_01_privatepreview.Apps listNext" }) @GET @@ -181,6 +180,9 @@ public Observable> getByResourceGroupWithServiceRespon if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -268,6 +270,9 @@ public Observable> createOrUpdateWithServiceResponseAs if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (app == null) { throw new IllegalArgumentException("Parameter app is required and cannot be null."); } @@ -342,6 +347,9 @@ public Observable> beginCreateOrUpdateWithServiceRespo if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (app == null) { throw new IllegalArgumentException("Parameter app is required and cannot be null."); } @@ -435,6 +443,9 @@ public Observable> updateWithServiceResponseAsync(Stri if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (appPatch == null) { throw new IllegalArgumentException("Parameter appPatch is required and cannot be null."); } @@ -509,6 +520,9 @@ public Observable> beginUpdateWithServiceResponseAsync if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (appPatch == null) { throw new IllegalArgumentException("Parameter appPatch is required and cannot be null."); } @@ -596,6 +610,9 @@ public Observable> deleteWithServiceResponseAsync(String r if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -661,6 +678,9 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (resourceName == null) { throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -767,6 +787,9 @@ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -879,6 +902,9 @@ public Observable>> listByResourceGroupSinglePage if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -952,6 +978,9 @@ public Observable> checkNameAvaila if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IoTCentralManager.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IoTCentralManager.java index 4ea8f56075972..dda6245b0f5c5 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IoTCentralManager.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IoTCentralManager.java @@ -21,8 +21,6 @@ import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; -import java.util.UUID; - /** * Entry point to Azure IoTCentral resource management. */ @@ -108,6 +106,6 @@ private IoTCentralManager(RestClient restClient, String subscriptionId) { super( restClient, subscriptionId, - new IotCentralClientImpl(restClient).withSubscriptionId(UUID.fromString(subscriptionId))); + new IotCentralClientImpl(restClient).withSubscriptionId(subscriptionId)); } } diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java index 59dc4c957454b..1abd0722bf63e 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java @@ -13,8 +13,6 @@ import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; -import java.util.UUID; - /** * Initializes a new instance of the IotCentralClientImpl class. */ @@ -31,14 +29,14 @@ public AzureClient getAzureClient() { } /** The subscription identifier. */ - private UUID subscriptionId; + private String subscriptionId; /** * Gets The subscription identifier. * * @return the subscriptionId value. */ - public UUID subscriptionId() { + public String subscriptionId() { return this.subscriptionId; } @@ -48,7 +46,7 @@ public UUID subscriptionId() { * @param subscriptionId the subscriptionId value. * @return the service client itself */ - public IotCentralClientImpl withSubscriptionId(UUID subscriptionId) { + public IotCentralClientImpl withSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationInner.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationInner.java index 92efc873a0676..65faca8889ea3 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationInner.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationInner.java @@ -28,7 +28,7 @@ public class OperationInner { private OperationDisplay display; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{read | write | action | delete}. * * @return the name value */ @@ -37,7 +37,7 @@ public String name() { } /** - * Get the display value. + * Get the object that represents the operation. * * @return the display value */ @@ -46,7 +46,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set the object that represents the operation. * * @param display the display value to set * @return the OperationInner object itself. diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsImpl.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsImpl.java index 726aee0a5a296..ffad600a9aa1a 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsImpl.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsImpl.java @@ -28,41 +28,22 @@ public IoTCentralManager manager() { return this.manager; } - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - OperationsInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { OperationsInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public Operation call(OperationInner inner) { return new OperationImpl(inner, manager()); } - }); + }); } } diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsInner.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsInner.java index 7fb4bc3e6baf9..307ff280aae20 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsInner.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/OperationsInner.java @@ -145,6 +145,9 @@ public Observable>> call(ServiceResponse>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -159,7 +162,7 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorDetailsException, IOException { + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorDetailsException.class) diff --git a/iotcentral/resource-manager/v2018_09_01/pom.xml b/iotcentral/resource-manager/v2018_09_01/pom.xml new file mode 100644 index 0000000000000..e16bd3cbd0669 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.iotcentral.v2018_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-iotcentral + 1.0.0-beta + jar + Microsoft Azure SDK for IoTCentral Management + This package contains Microsoft IoTCentral Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java new file mode 100644 index 0000000000000..f51ff4e27af1a --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.IoTCentralManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppInner; + +/** + * Type representing App. + */ +public interface App extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationId value. + */ + String applicationId(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the sku value. + */ + AppSkuInfo sku(); + + /** + * @return the subdomain value. + */ + String subdomain(); + + /** + * @return the template value. + */ + String template(); + + /** + * The entirety of the App definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of App definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a App definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the App definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the app definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(AppSkuInfo sku); + } + + /** + * The stage of the app update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the app update allowing to specify Subdomain. + */ + interface WithSubdomain { + /** + * Specifies subdomain. + */ + WithCreate withSubdomain(String subdomain); + } + + /** + * The stage of the app update allowing to specify Template. + */ + interface WithTemplate { + /** + * Specifies template. + */ + WithCreate withTemplate(String template); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisplayName, DefinitionStages.WithSubdomain, DefinitionStages.WithTemplate { + } + } + /** + * The template for a App update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisplayName, UpdateStages.WithSubdomain, UpdateStages.WithTemplate { + } + + /** + * Grouping of App update stages. + */ + interface UpdateStages { + /** + * The stage of the app {0} allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the app {0} allowing to specify Subdomain. + */ + interface WithSubdomain { + /** + * Specifies subdomain. + */ + Update withSubdomain(String subdomain); + } + + /** + * The stage of the app {0} allowing to specify Template. + */ + interface WithTemplate { + /** + * Specifies template. + */ + Update withTemplate(String template); + } + + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppAvailabilityInfo.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppAvailabilityInfo.java new file mode 100644 index 0000000000000..5c74a2ea3a6b6 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppAvailabilityInfo.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.IoTCentralManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppAvailabilityInfoInner; + +/** + * Type representing AppAvailabilityInfo. + */ +public interface AppAvailabilityInfo extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java new file mode 100644 index 0000000000000..d6cf9fec610a3 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.IoTCentralManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppNameAvailabilityInfoInner; + +/** + * Type representing AppNameAvailabilityInfo. + */ +public interface AppNameAvailabilityInfo extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + AppNameUnavailabilityReason reason(); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java new file mode 100644 index 0000000000000..01ab6c857a615 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AppNameUnavailabilityReason. + */ +public enum AppNameUnavailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a AppNameUnavailabilityReason instance. */ + private String value; + + AppNameUnavailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AppNameUnavailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed AppNameUnavailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static AppNameUnavailabilityReason fromString(String value) { + AppNameUnavailabilityReason[] items = AppNameUnavailabilityReason.values(); + for (AppNameUnavailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java new file mode 100644 index 0000000000000..87cbc43fd52dd --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The description of the IoT Central application. + */ +@JsonFlatten +public class AppPatch { + /** + * Instance tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The ID of the application. + */ + @JsonProperty(value = "properties.applicationId", access = JsonProperty.Access.WRITE_ONLY) + private String applicationId; + + /** + * The display name of the application. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * The subdomain of the application. + */ + @JsonProperty(value = "properties.subdomain") + private String subdomain; + + /** + * The ID of the application template, which is a blueprint that defines + * the characteristics and behaviors of an application. Optional; if not + * specified, defaults to a blank blueprint and allows the application to + * be defined from scratch. + */ + @JsonProperty(value = "properties.template") + private String template; + + /** + * Get instance tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set instance tags. + * + * @param tags the tags value to set + * @return the AppPatch object itself. + */ + public AppPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the ID of the application. + * + * @return the applicationId value + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Get the display name of the application. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the application. + * + * @param displayName the displayName value to set + * @return the AppPatch object itself. + */ + public AppPatch withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the subdomain of the application. + * + * @return the subdomain value + */ + public String subdomain() { + return this.subdomain; + } + + /** + * Set the subdomain of the application. + * + * @param subdomain the subdomain value to set + * @return the AppPatch object itself. + */ + public AppPatch withSubdomain(String subdomain) { + this.subdomain = subdomain; + return this; + } + + /** + * Get the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. + * + * @return the template value + */ + public String template() { + return this.template; + } + + /** + * Set the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. + * + * @param template the template value to set + * @return the AppPatch object itself. + */ + public AppPatch withTemplate(String template) { + this.template = template; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java new file mode 100644 index 0000000000000..7f2f66345bfb9 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AppSku. + */ +public final class AppSku extends ExpandableStringEnum { + /** Static value F1 for AppSku. */ + public static final AppSku F1 = fromString("F1"); + + /** Static value S1 for AppSku. */ + public static final AppSku S1 = fromString("S1"); + + /** + * Creates or finds a AppSku from its string representation. + * @param name a name to look for + * @return the corresponding AppSku + */ + @JsonCreator + public static AppSku fromString(String name) { + return fromString(name, AppSku.class); + } + + /** + * @return known AppSku values + */ + public static Collection values() { + return values(AppSku.class); + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java new file mode 100644 index 0000000000000..44c1c9815f706 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the SKU of the IoT Central application. + */ +public class AppSkuInfo { + /** + * The name of the SKU. Possible values include: 'F1', 'S1'. + */ + @JsonProperty(value = "name", required = true) + private AppSku name; + + /** + * Get the name of the SKU. Possible values include: 'F1', 'S1'. + * + * @return the name value + */ + public AppSku name() { + return this.name; + } + + /** + * Set the name of the SKU. Possible values include: 'F1', 'S1'. + * + * @param name the name value to set + * @return the AppSkuInfo object itself. + */ + public AppSkuInfo withName(AppSku name) { + this.name = name; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java new file mode 100644 index 0000000000000..deec27d18075e --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Apps. + */ +public interface Apps extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check if an IoT Central application name is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(OperationInputs operationInputs); + + /** + * Check if an IoT Central application subdomain is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkSubdomainAvailabilityAsync(OperationInputs operationInputs); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java new file mode 100644 index 0000000000000..708471461f706 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Error details. + */ +@JsonFlatten +public class ErrorDetails { + /** + * The error code. + */ + @JsonProperty(value = "error.code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "error.message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "error.target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * A list of additional details about the error. + */ + @JsonProperty(value = "error.details") + private List details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get a list of additional details about the error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set a list of additional details about the error. + * + * @param details the details value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java new file mode 100644 index 0000000000000..d6d9c28f291af --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorDetails information. + */ +public class ErrorDetailsException extends RestException { + /** + * Initializes a new instance of the ErrorDetailsException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorDetailsException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorDetailsException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorDetailsException(final String message, final Response response, final ErrorDetails body) { + super(message, response, body); + } + + @Override + public ErrorDetails body() { + return (ErrorDetails) super.body(); + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java new file mode 100644 index 0000000000000..a7b6c9d7730af --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of error response. + */ +public class ErrorResponseBody { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * A list of additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get a list of additional details about the error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set a list of additional details about the error. + * + * @param details the details value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java new file mode 100644 index 0000000000000..ae0e3c6414d0e --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input values. + */ +public class NameAvailabilityInputs { + /** + * The name of the IoT Central application instance to check. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of the IoT Central resource to query. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of the IoT Central application instance to check. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the IoT Central application instance to check. + * + * @param name the name value to set + * @return the NameAvailabilityInputs object itself. + */ + public NameAvailabilityInputs withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the IoT Central resource to query. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the IoT Central resource to query. + * + * @param type the type value to set + * @return the NameAvailabilityInputs object itself. + */ + public NameAvailabilityInputs withType(String type) { + this.type = type; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operation.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operation.java new file mode 100644 index 0000000000000..e21f06c57f6b7 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.IoTCentralManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationDisplay.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationDisplay.java new file mode 100644 index 0000000000000..a6dea68ca6850 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft IoT Central. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource Type: IoT Central. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Friendly description for the operation,. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get service provider: Microsoft IoT Central. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource Type: IoT Central. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get friendly description for the operation,. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationInputs.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationInputs.java new file mode 100644 index 0000000000000..5f507aee51985 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/OperationInputs.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input values. + */ +public class OperationInputs { + /** + * The name of the IoT Central application instance to check. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of the IoT Central resource to query. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of the IoT Central application instance to check. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the IoT Central application instance to check. + * + * @param name the name value to set + * @return the OperationInputs object itself. + */ + public OperationInputs withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the IoT Central resource to query. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the IoT Central resource to query. + * + * @param type the type value to set + * @return the OperationInputs object itself. + */ + public OperationInputs withType(String type) { + this.type = type; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operations.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operations.java new file mode 100644 index 0000000000000..1553da6ed8643 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import rx.Observable; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available IoT Central application REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java new file mode 100644 index 0000000000000..ad53cb471be4e --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input values. + */ +public class SubdomainAvailabilityInputs { + /** + * The subdomain of the IoT Central application instance to check. + */ + @JsonProperty(value = "subdomain", required = true) + private String subdomain; + + /** + * The type of the IoT Central resource to query. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the subdomain of the IoT Central application instance to check. + * + * @return the subdomain value + */ + public String subdomain() { + return this.subdomain; + } + + /** + * Set the subdomain of the IoT Central application instance to check. + * + * @param subdomain the subdomain value to set + * @return the SubdomainAvailabilityInputs object itself. + */ + public SubdomainAvailabilityInputs withSubdomain(String subdomain) { + this.subdomain = subdomain; + return this; + } + + /** + * Get the type of the IoT Central resource to query. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the IoT Central resource to query. + * + * @param type the type value to set + * @return the SubdomainAvailabilityInputs object itself. + */ + public SubdomainAvailabilityInputs withType(String type) { + this.type = type; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoImpl.java new file mode 100644 index 0000000000000..525e00b7ec9ff --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AppAvailabilityInfoImpl extends WrapperImpl implements AppAvailabilityInfo { + private final IoTCentralManager manager; + AppAvailabilityInfoImpl(AppAvailabilityInfoInner inner, IoTCentralManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public IoTCentralManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoInner.java new file mode 100644 index 0000000000000..389b61db9ad4c --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppAvailabilityInfoInner.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties indicating whether a given IoT Central application name or + * subdomain is available. + */ +public class AppAvailabilityInfoInner { + /** + * The value which indicates whether the provided name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason for unavailability. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * The detailed reason message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the value which indicates whether the provided name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason for unavailability. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get the detailed reason message. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java new file mode 100644 index 0000000000000..7e5706ebecca3 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.iotcentral.v2018_09_01.App; +import rx.Observable; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppPatch; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppSkuInfo; +import rx.functions.Func1; + +class AppImpl extends GroupableResourceCoreImpl implements App, App.Definition, App.Update { + private AppPatch updateParameter; + AppImpl(String name, AppInner inner, IoTCentralManager manager) { + super(name, inner, manager); + this.updateParameter = new AppPatch(); + } + + @Override + public Observable createResourceAsync() { + AppsInner client = this.manager().inner().apps(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public AppInner call(AppInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AppsInner client = this.manager().inner().apps(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public AppInner call(AppInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AppsInner client = this.manager().inner().apps(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new AppPatch(); + } + + @Override + public String applicationId() { + return this.inner().applicationId(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public AppSkuInfo sku() { + return this.inner().sku(); + } + + @Override + public String subdomain() { + return this.inner().subdomain(); + } + + @Override + public String template() { + return this.inner().template(); + } + + @Override + public AppImpl withSku(AppSkuInfo sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public AppImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.inner().withDisplayName(displayName); + } else { + this.updateParameter.withDisplayName(displayName); + } + return this; + } + + @Override + public AppImpl withSubdomain(String subdomain) { + if (isInCreateMode()) { + this.inner().withSubdomain(subdomain); + } else { + this.updateParameter.withSubdomain(subdomain); + } + return this; + } + + @Override + public AppImpl withTemplate(String template) { + if (isInCreateMode()) { + this.inner().withTemplate(template); + } else { + this.updateParameter.withTemplate(template); + } + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppInner.java new file mode 100644 index 0000000000000..ec7c274b353cf --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppSkuInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The IoT Central application. + */ +@JsonFlatten +public class AppInner extends Resource { + /** + * The ID of the application. + */ + @JsonProperty(value = "properties.applicationId", access = JsonProperty.Access.WRITE_ONLY) + private String applicationId; + + /** + * The display name of the application. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * The subdomain of the application. + */ + @JsonProperty(value = "properties.subdomain") + private String subdomain; + + /** + * The ID of the application template, which is a blueprint that defines + * the characteristics and behaviors of an application. Optional; if not + * specified, defaults to a blank blueprint and allows the application to + * be defined from scratch. + */ + @JsonProperty(value = "properties.template") + private String template; + + /** + * A valid instance SKU. + */ + @JsonProperty(value = "sku", required = true) + private AppSkuInfo sku; + + /** + * Get the ID of the application. + * + * @return the applicationId value + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Get the display name of the application. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the application. + * + * @param displayName the displayName value to set + * @return the AppInner object itself. + */ + public AppInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the subdomain of the application. + * + * @return the subdomain value + */ + public String subdomain() { + return this.subdomain; + } + + /** + * Set the subdomain of the application. + * + * @param subdomain the subdomain value to set + * @return the AppInner object itself. + */ + public AppInner withSubdomain(String subdomain) { + this.subdomain = subdomain; + return this; + } + + /** + * Get the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. + * + * @return the template value + */ + public String template() { + return this.template; + } + + /** + * Set the ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. + * + * @param template the template value to set + * @return the AppInner object itself. + */ + public AppInner withTemplate(String template) { + this.template = template; + return this; + } + + /** + * Get a valid instance SKU. + * + * @return the sku value + */ + public AppSkuInfo sku() { + return this.sku; + } + + /** + * Set a valid instance SKU. + * + * @param sku the sku value to set + * @return the AppInner object itself. + */ + public AppInner withSku(AppSkuInfo sku) { + this.sku = sku; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java new file mode 100644 index 0000000000000..d68656e3d4870 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppNameUnavailabilityReason; + +class AppNameAvailabilityInfoImpl extends WrapperImpl implements AppNameAvailabilityInfo { + private final IoTCentralManager manager; + AppNameAvailabilityInfoImpl(AppNameAvailabilityInfoInner inner, IoTCentralManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public IoTCentralManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public AppNameUnavailabilityReason reason() { + return this.inner().reason(); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java new file mode 100644 index 0000000000000..cac83d5ca21fd --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppNameUnavailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties indicating whether a given IoT Central application name is + * available. + */ +public class AppNameAvailabilityInfoInner { + /** + * The value which indicates whether the provided name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason for unavailability. Possible values include: 'Invalid', + * 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private AppNameUnavailabilityReason reason; + + /** + * The detailed reason message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value which indicates whether the provided name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public AppNameUnavailabilityReason reason() { + return this.reason; + } + + /** + * Get the detailed reason message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the detailed reason message. + * + * @param message the message value to set + * @return the AppNameAvailabilityInfoInner object itself. + */ + public AppNameAvailabilityInfoInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java new file mode 100644 index 0000000000000..537fc693efa61 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.iotcentral.v2018_09_01.Apps; +import com.microsoft.azure.management.iotcentral.v2018_09_01.App; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppAvailabilityInfo; +import com.microsoft.azure.management.iotcentral.v2018_09_01.OperationInputs; + +class AppsImpl extends GroupableResourcesCoreImpl implements Apps { + protected AppsImpl(IoTCentralManager manager) { + super(manager.inner().apps(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AppsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AppsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AppsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AppsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public App call(AppInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AppsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AppsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public App call(AppInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AppImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkNameAvailabilityAsync(OperationInputs operationInputs) { + AppsInner client = this.inner(); + return client.checkNameAvailabilityAsync(operationInputs) + .map(new Func1() { + @Override + public AppAvailabilityInfo call(AppAvailabilityInfoInner inner) { + return new AppAvailabilityInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkSubdomainAvailabilityAsync(OperationInputs operationInputs) { + AppsInner client = this.inner(); + return client.checkSubdomainAvailabilityAsync(operationInputs) + .map(new Func1() { + @Override + public AppAvailabilityInfo call(AppAvailabilityInfoInner inner) { + return new AppAvailabilityInfoImpl(inner, manager()); + } + }); + } + + @Override + protected AppImpl wrapModel(AppInner inner) { + return new AppImpl(inner.name(), inner, manager()); + } + + @Override + protected AppImpl wrapModel(String name) { + return new AppImpl(name, new AppInner(), this.manager()); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java new file mode 100644 index 0000000000000..f551023b24b2a --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java @@ -0,0 +1,1315 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppPatch; +import com.microsoft.azure.management.iotcentral.v2018_09_01.ErrorDetailsException; +import com.microsoft.azure.management.iotcentral.v2018_09_01.OperationInputs; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Apps. + */ +public class AppsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AppsService service; + /** The service client containing this operation class. */ + private IotCentralClientImpl client; + + /** + * Initializes an instance of AppsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AppsInner(Retrofit retrofit, IotCentralClientImpl client) { + this.service = retrofit.create(AppsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Apps to be + * used by Retrofit to perform actually REST calls. + */ + interface AppsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppInner app, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AppPatch appPatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/IoTApps") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body OperationInputs operationInputs, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps checkSubdomainAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkSubdomainAvailability") + Observable> checkSubdomainAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body OperationInputs operationInputs, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppInner object if successful. + */ + public AppInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, AppInner>() { + @Override + public AppInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppInner object if successful. + */ + public AppInner createOrUpdate(String resourceGroupName, String resourceName, AppInner app) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).toBlocking().last().body(); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app), serviceCallback); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).map(new Func1, AppInner>() { + @Override + public AppInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, AppInner app) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (app == null) { + throw new IllegalArgumentException("Parameter app is required and cannot be null."); + } + Validator.validate(app); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), app, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppInner object if successful. + */ + public AppInner beginCreateOrUpdate(String resourceGroupName, String resourceName, AppInner app) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).toBlocking().single().body(); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app), serviceCallback); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).map(new Func1, AppInner>() { + @Override + public AppInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param app The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, AppInner app) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (app == null) { + throw new IllegalArgumentException("Parameter app is required and cannot be null."); + } + Validator.validate(app); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), app, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppInner object if successful. + */ + public AppInner update(String resourceGroupName, String resourceName, AppPatch appPatch) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).toBlocking().last().body(); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch), serviceCallback); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1, AppInner>() { + @Override + public AppInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (appPatch == null) { + throw new IllegalArgumentException("Parameter appPatch is required and cannot be null."); + } + Validator.validate(appPatch); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), appPatch, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppInner object if successful. + */ + public AppInner beginUpdate(String resourceGroupName, String resourceName, AppPatch appPatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).toBlocking().single().body(); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch), serviceCallback); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1, AppInner>() { + @Override + public AppInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (appPatch == null) { + throw new IllegalArgumentException("Parameter appPatch is required and cannot be null."); + } + Validator.validate(appPatch); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), appPatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Check if an IoT Central application name is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppAvailabilityInfoInner object if successful. + */ + public AppAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs) { + return checkNameAvailabilityWithServiceResponseAsync(operationInputs).toBlocking().single().body(); + } + + /** + * Check if an IoT Central application name is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(OperationInputs operationInputs, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(operationInputs), serviceCallback); + } + + /** + * Check if an IoT Central application name is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppAvailabilityInfoInner object + */ + public Observable checkNameAvailabilityAsync(OperationInputs operationInputs) { + return checkNameAvailabilityWithServiceResponseAsync(operationInputs).map(new Func1, AppAvailabilityInfoInner>() { + @Override + public AppAvailabilityInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if an IoT Central application name is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppAvailabilityInfoInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(OperationInputs operationInputs) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (operationInputs == null) { + throw new IllegalArgumentException("Parameter operationInputs is required and cannot be null."); + } + Validator.validate(operationInputs); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), operationInputs, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Check if an IoT Central application subdomain is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppAvailabilityInfoInner object if successful. + */ + public AppAvailabilityInfoInner checkSubdomainAvailability(OperationInputs operationInputs) { + return checkSubdomainAvailabilityWithServiceResponseAsync(operationInputs).toBlocking().single().body(); + } + + /** + * Check if an IoT Central application subdomain is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkSubdomainAvailabilityAsync(OperationInputs operationInputs, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkSubdomainAvailabilityWithServiceResponseAsync(operationInputs), serviceCallback); + } + + /** + * Check if an IoT Central application subdomain is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppAvailabilityInfoInner object + */ + public Observable checkSubdomainAvailabilityAsync(OperationInputs operationInputs) { + return checkSubdomainAvailabilityWithServiceResponseAsync(operationInputs).map(new Func1, AppAvailabilityInfoInner>() { + @Override + public AppAvailabilityInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if an IoT Central application subdomain is available. + * + * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppAvailabilityInfoInner object + */ + public Observable> checkSubdomainAvailabilityWithServiceResponseAsync(OperationInputs operationInputs) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (operationInputs == null) { + throw new IllegalArgumentException("Parameter operationInputs is required and cannot be null."); + } + Validator.validate(operationInputs); + return service.checkSubdomainAvailability(this.client.subscriptionId(), this.client.apiVersion(), operationInputs, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkSubdomainAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkSubdomainAvailabilityDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all IoT Central Applications in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all IoT Central Applications in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the IoT Central Applications in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IdParsingUtils.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..f5d40ca004d73 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IoTCentralManager.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IoTCentralManager.java new file mode 100644 index 0000000000000..5bcff18622a4d --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IoTCentralManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.iotcentral.v2018_09_01.Apps; +import com.microsoft.azure.management.iotcentral.v2018_09_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure IoTCentral resource management. + */ +public final class IoTCentralManager extends ManagerCore { + private Apps apps; + private Operations operations; + /** + * Get a Configurable instance that can be used to create IoTCentralManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new IoTCentralManager.ConfigurableImpl(); + } + /** + * Creates an instance of IoTCentralManager that exposes IoTCentral resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the IoTCentralManager + */ + public static IoTCentralManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new IoTCentralManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of IoTCentralManager that exposes IoTCentral resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the IoTCentralManager + */ + public static IoTCentralManager authenticate(RestClient restClient, String subscriptionId) { + return new IoTCentralManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of IoTCentralManager that exposes IoTCentral management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing IoTCentral management API entry points that work across subscriptions + */ + IoTCentralManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Apps. + */ + public Apps apps() { + if (this.apps == null) { + this.apps = new AppsImpl(this); + } + return this.apps; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public IoTCentralManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return IoTCentralManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private IoTCentralManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new IotCentralClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java new file mode 100644 index 0000000000000..39bad0a45afae --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the IotCentralClientImpl class. + */ +public class IotCentralClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription identifier. */ + private String subscriptionId; + + /** + * Gets The subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public IotCentralClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The version of the API. */ + private String apiVersion; + + /** + * Gets The version of the API. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public IotCentralClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public IotCentralClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public IotCentralClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AppsInner object to access its operations. + */ + private AppsInner apps; + + /** + * Gets the AppsInner object to access its operations. + * @return the AppsInner object. + */ + public AppsInner apps() { + return this.apps; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of IotCentralClient client. + * + * @param credentials the management credentials for Azure + */ + public IotCentralClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of IotCentralClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public IotCentralClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of IotCentralClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public IotCentralClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.apps = new AppsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "IotCentralClient", "2018-09-01"); + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..7b10b69bb85d1 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iotcentral.v2018_09_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final IoTCentralManager manager; + OperationImpl(OperationInner inner, IoTCentralManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public IoTCentralManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..3bbbedc7d9d90 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IoT Central REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{read | write | action | delete}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{read | write | action | delete}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..2e48a99f7e516 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iotcentral.v2018_09_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iotcentral.v2018_09_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final IoTCentralManager manager; + + OperationsImpl(IoTCentralManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public IoTCentralManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..73314fa7689da --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iotcentral.v2018_09_01.ErrorDetailsException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private IotCentralClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, IotCentralClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Operations list" }) + @GET("providers/Microsoft.IoTCentral/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available IoT Central application REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/PageImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..7f90e4b8cab34 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/package-info.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/package-info.java new file mode 100644 index 0000000000000..31223ddacd5fe --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for IotCentralClient. + * Use this API to manage IoT Central Applications in your Azure subscription. + */ +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/package-info.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/package-info.java new file mode 100644 index 0000000000000..7fa09189195c8 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for IotCentralClient. + * Use this API to manage IoT Central Applications in your Azure subscription. + */ +package com.microsoft.azure.management.iotcentral.v2018_09_01; diff --git a/iothub/resource-manager/v2018_04_01/pom.xml b/iothub/resource-manager/v2018_04_01/pom.xml index f1f4e002685dd..cffb1cc0c4af6 100644 --- a/iothub/resource-manager/v2018_04_01/pom.xml +++ b/iothub/resource-manager/v2018_04_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-iothub diff --git a/jetty.xml b/jetty.xml new file mode 100644 index 0000000000000..dad29dc54fd4d --- /dev/null +++ b/jetty.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + 11080 + + + + + + + + + + + + + + + + + 11081 + + + + \ No newline at end of file diff --git a/keyvault/data-plane/.gitignore b/keyvault/data-plane/.gitignore new file mode 100644 index 0000000000000..648fca8a9b3cf --- /dev/null +++ b/keyvault/data-plane/.gitignore @@ -0,0 +1,64 @@ +*.class + +#External libs +extlib/ + +# Auth files +*.auth +*.azureauth + +# Local checkstyle +*.checkstyle + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# Azure Tooling # +node_modules +packages + +# Eclipse # +*.pydevproject +.project +.metadata +bin/** +tmp/** +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +bin/ + +# Other Tooling # +.classpath +.project +**/target/classes/** +**/target/generated-sources/** +**/target/generate-test-sources/** +**/target/maven-status/** +**/target/test-classes/com/** +**/target/surefire-reports/** +**/target/maven-archiver/** +!**/target/test-classes/session-records/** +.idea +*.iml + +# Mac OS # +.DS_Store +.DS_Store? + +# Windows # +Thumbs.db + +# reduced pom files should not be included +dependency-reduced-pom.xml diff --git a/keyvault/data-plane/LICENSE b/keyvault/data-plane/LICENSE new file mode 100644 index 0000000000000..4b1ad51b2f0ef --- /dev/null +++ b/keyvault/data-plane/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/keyvault/data-plane/README.md b/keyvault/data-plane/README.md new file mode 100644 index 0000000000000..d90d0450abdcb --- /dev/null +++ b/keyvault/data-plane/README.md @@ -0,0 +1,129 @@ +[![Build Status](https://travis-ci.org/Azure/azure-keyvault-java.svg?branch=dev)](https://travis-ci.org/Azure/azure-keyvault-java) + +# Microsoft Azure Key Vault SDK for Java + +This is the Microsoft Azure Key Vault client library which allows for the consumption of Key Vault services. Azure Key Vault helps safeguard cryptographic keys and secrets used by cloud applications and services. By using Key Vault, you can encrypt keys and secrets (such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords) using keys protected by hardware security modules (HSMs). For added assurance, you can import or generate keys in HSMs. If you choose to do this, Microsoft processes your keys in FIPS 140-2 Level 2 validated HSMs (hardware and firmware). +Key Vault streamlines the key management process and enables you to maintain control of keys that access and encrypt your data. Developers can create keys for development and testing in minutes, and then seamlessly migrate them to production keys. Security administrators can grant (and revoke) permission to keys, as needed. +For more information refer to [What is Key Vault?](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-whatis) or [Getting Started](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started). + +Documentation for this SDK can be found at [Azure Key Vault Java Documentation](https://docs.microsoft.com/en-us/java/api/overview/azure/keyvault) + +## Sample code +You can find sample code that illustrates key vault usage scenarios [here](https://azure.microsoft.com/en-us/resources/samples/?sort=0&service=key-vault&platform=java). + +
+ + + + + + + + + + + + + + + + +
CategorySamples
Authentication + +
Vault Management + +
Secret Management + +
+ +For more information on using Java with Azure, see [here](https://azure.microsoft.com/en-us/develop/java/) + +## Download + +To get the binaries of this library as distributed by Microsoft, ready for use within your project, you can use Maven. Add the following fragment to you POM's dependencies. + +```xml + + com.microsoft.azure + azure-keyvault-complete + 1.1.2 + +``` + +## Pre-requisites +- A Java Developer Kit (JDK), v 1.7 or later +- Maven + +## Building and Testing + +Clone the repo, then run `mvn compile` from the root directory. + +To run the recorded tests: +1. If you have not already, you need to install the [Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) package. +2. run `mvn jetty:run` to start a jetty server. This starts a service that will block the terminal so you will likely want to open a second terminal to run the actual tests. +3. In your second terminal run `mvn test`. + +## Contributing + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +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 + +# Previous Versions + +| Version | Comments | +| :-------: | :-------- | +| [1.1.1](https://github.com/Azure/azure-keyvault-java/tree/1.1.1) | Version 1.1.1 release | +| [1.1](https://github.com/Azure/azure-keyvault-java/tree/1.1) | Version 1.1 release | +| [1.1-beta-1](https://github.com/Azure/azure-keyvault-java/tree/1.1-beta-1) | Version 1.1.0 **beta** release | +| [1.1-alpha-2](https://github.com/Azure/azure-keyvault-java/tree/v1.1-alpha-2) | Version 1.1.0 **alpha** release | +| [1.0.0](https://github.com/Azure/azure-keyvault-java/tree/v1.0.0) | Version 1.0.0 release | + +# More information +* [Azure Key Vault Java Documentation](https://docs.microsoft.com/en-us/java/api/overview/azure/keyvault) +* [What is Key Vault?](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-whatis) +* [Get started with Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started) +* [Azure Key Vault General Documentation](https://docs.microsoft.com/en-us/azure/key-vault/) +* [Azure Key Vault REST API Reference](https://docs.microsoft.com/en-us/rest/api/keyvault/) +* [Azure Active Directory Documenation](https://docs.microsoft.com/en-us/azure/active-directory/) diff --git a/keyvault/data-plane/REGENERATING.md b/keyvault/data-plane/REGENERATING.md new file mode 100644 index 0000000000000..37b870bbbc342 --- /dev/null +++ b/keyvault/data-plane/REGENERATING.md @@ -0,0 +1,19 @@ +# Regenerating SDK + +The code in the azure-keyvault package is generated via AutoREST. After code generation, there are currently several manual modifications that need to be made for the build to succeed. In the root of the azure-keyvault-java repo, there is a Python script called "regenerate_and_fix_sdk.py" which will automatically regenerate the code and apply the necessary fixes. To regenerate the code using this script: + +- Install AutoREST: https://github.com/Azure/autorest/blob/master/docs/installing-autorest.md +- Open the script in your favorite editor and change "swagger_source_branch" to contain the branch of the Azure REST spec API repo that you'd like the API spec to be sourced from – likely either "master" or "keyvault_preview" + - If there is a tag you'd like to pass to AutoREST – set the "autorest_tag" branch accordingly. +- Using Python 3.6+, run the script from the root of the checked out repository. Verify that no errors appear, and then build/test the SDK. + + + +The changes made by the script post-regeneration are as follows: + +* The generated webkey models will be removed + + +* Any generated model class which has a corresponding custom class in the "models/custom" folder will be changed to inherit from the custom class. +* Any class which utilizes webkey models will have the correct imports from the azure-keyvault-webkey package added +* AutoREST occasionally generates broken parameter declarations in the Javadoc comments - these are repaired. \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-complete/pom.xml b/keyvault/data-plane/azure-keyvault-complete/pom.xml new file mode 100644 index 0000000000000..11fd13065e2eb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-complete/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + com.microsoft.azure + azure-keyvault-complete + 1.1.2 + pom + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + Microsoft Azure Key Vault SDK Complete + This encapsulate all modules of the Microsoft Azure Key Vault SDK. + https://github.com/Azure/azure-keyvault-java + + + UTF-8 + + + + + scm:git:https://github.com/Azure/azure-keyvault-java + scm:git:git@github.com:Azure/azure-keyvault-java.git + HEAD + + + + + microsoft + Microsoft + + + + + + com.microsoft.azure + azure-keyvault + + + com.microsoft.azure + azure-keyvault-core + + + com.microsoft.azure + azure-keyvault-webkey + + + com.microsoft.azure + azure-keyvault-extensions + + + com.microsoft.azure + azure-keyvault-cryptography + + + + diff --git a/keyvault/data-plane/azure-keyvault-core/pom.xml b/keyvault/data-plane/azure-keyvault-core/pom.xml new file mode 100644 index 0000000000000..cee82573a28b9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-core/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + azure-keyvault-core + 1.1.2 + jar + + Microsoft Azure SDK for Key Vault Core + This package contains Microsoft Azure Key Vault Core SDK. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + + + org.apache.commons + commons-lang3 + + + com.google.guava + guava + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.12 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + com.microsoft.schemas._2003._10.serialization + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+
+
+
diff --git a/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java new file mode 100644 index 0000000000000..5eb18bd42677a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKey.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.core; + +import java.io.Closeable; +import java.security.NoSuchAlgorithmException; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.google.common.util.concurrent.ListenableFuture; + + +/** + * Interface for representing cryptographic keys with the Microsoft Azure Key + * Vault libraries. + */ +public interface IKey extends Closeable { + + /** + * The default encryption algorithm for this key, using the representations + * from Json Web Key Algorithms, RFC7513. + * + * @return The default encryption algorithm for this key. + */ + String getDefaultEncryptionAlgorithm(); + + /** + * The default key wrap algorithm for this key, using the representations + * from Json Web Key Algorithms, RFC7513. + * + * @return The default key wrap algorithm for this key. + */ + String getDefaultKeyWrapAlgorithm(); + + /** + * The default signature algorithm for this key, using the representations + * from Json Web Key Algorithms, RFC7513. + * + * @return The default signature algorithm for this key. + */ + String getDefaultSignatureAlgorithm(); + + /** + * The unique key identifier for this key. + * + * @return The key identifier + */ + String getKid(); + + /** + * Decrypts the specified cipher text. Note that not all algorithms require, + * or support, all parameters. + * + * @param ciphertext + * The cipher text to decrypt + * @param iv + * The initialization vector (optional with some algorithms) + * @param authenticationData + * Additional authentication data (optional with some algorithms) + * @param authenticationTag + * The authentication tag from the encrypt operation (optional + * with some algorithms) + * @param algorithm + * The encryption algorithm to use, must be supplied + * @return A ListenableFuture containing the plain text + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm) throws NoSuchAlgorithmException; + + /** + * Encrypts the specified plain text. Note that not all algorithms require, + * or support, all parameters. + * + * @param plaintext + * The plain text to encrypt + * @param iv + * The initialization vector (optional with some algorithms) + * @param authenticationData + * Additional authentication data (optional with some algorithms) + * @param algorithm + * The encryption algorithm to use, defaults to the keys + * DefaultEncryptionAlgorithm + * @return A ListenableFuture containing the cipher text, the authentication + * tag and the algorithm that was used + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture> encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm) throws NoSuchAlgorithmException; + + /** + * Wraps (encrypts) the specified symmetric key material using the specified + * algorithm, or the keys DefaultKeyWrapAlgorithm if none is specified. + * + * @param key + * The symmetric key to wrap + * @param algorithm + * The wrapping algorithm to use, defaults to the keys + * DefaultKeyWrapAlgorithm + * @return ListenableFuture containing the encrypted key and the algorithm + * that was used + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture> wrapKeyAsync(final byte[] key, final String algorithm) throws NoSuchAlgorithmException; + + /** + * Unwraps (decrypts) the specified encryped key material. + * + * @param encryptedKey + * The encrypted key to decrypt + * @param algorithm + * The algorithm to use, must be supplied + * @return A ListenableFuture containing the unwrapped key + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture unwrapKeyAsync(final byte[] encryptedKey, final String algorithm) throws NoSuchAlgorithmException; + + /** + * Signs the specified digest using the specified algorithm, or the keys + * DefaultSignatureAlgorithm if no algorithm is specified. + * + * @param digest + * The digest to sign + * @param algorithm + * The signature algorithm to use + * @return A ListenableFuture containing the signature and the algorithm used. + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture> signAsync(final byte[] digest, final String algorithm) throws NoSuchAlgorithmException; + + /** + * Verifies the supplied signature value using the supplied digest and + * algorithm. + * + * @param digest + * The digest input + * @param signature + * The signature to verify + * @param algorithm + * The algorithm to use, must be provided + * @return A ListenableFuture containing the signature and the algorithm used. + * @throws NoSuchAlgorithmException the algorithm is not valid + */ + ListenableFuture verifyAsync(final byte[] digest, final byte[] signature, final String algorithm) throws NoSuchAlgorithmException; +} diff --git a/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java new file mode 100644 index 0000000000000..635dd80c0287c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/IKeyResolver.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.core; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * Interface for representing key resolving operations with the Microsoft Azure Key + * Vault libraries. + */ +public interface IKeyResolver { + + /** + * Retrieves an IKey implementation for the specified key identifier. + * Implementations should check the format of the kid to ensure that it is + * recognized. Null, rather than an exception, should be returned for + * unrecognized key identifiers to enable chaining of key resolvers. + * + * @param kid + * The key identifier to resolve. + * @return A ListenableFuture containing the resolved IKey + */ + ListenableFuture resolveKeyAsync(String kid); +} diff --git a/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java new file mode 100644 index 0000000000000..b3417f38285d4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-core/src/main/java/com/microsoft/azure/keyvault/core/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains the interface for IKey and IKeyResolver. + */ +package com.microsoft.azure.keyvault.core; diff --git a/keyvault/data-plane/azure-keyvault-cryptography/pom.xml b/keyvault/data-plane/azure-keyvault-cryptography/pom.xml new file mode 100644 index 0000000000000..edcde42ea81d1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + azure-keyvault-cryptography + 1.1.2 + jar + + Microsoft Azure SDK for Key Vault Cryptography + This package contains Microsoft Azure SDK for Key Vault Cryptography. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + true + + + + + + + + com.microsoft.azure + azure-keyvault-webkey + + + com.microsoft.azure + azure-keyvault-core + + + + + com.fasterxml.jackson.core + jackson-databind + + + + + org.apache.commons + commons-lang3 + + + commons-codec + commons-codec + + + com.google.guava + guava + + + + + + junit + junit + test + + + org.bouncycastle + bcprov-jdk15on + test + + + diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Algorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Algorithm.java new file mode 100644 index 0000000000000..e80ccaf5a76b0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Algorithm.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +/** + * Abstract base class for all Algorithm objects. + * + */ +public abstract class Algorithm { + + private final String _name; + + /** + * Constructor. + * + * @param name The name of the algorithm. + */ + protected Algorithm(String name) { + if (Strings.isNullOrWhiteSpace(name)) { + throw new IllegalArgumentException("name"); + } + + _name = name; + } + + /** + * Gets the name of the algorithm. + * + * @return The name of the algorithm. + */ + public String getName() { + return _name; + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AlgorithmResolver.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AlgorithmResolver.java new file mode 100644 index 0000000000000..1ac5c06c52d1a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AlgorithmResolver.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128Cbc; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128CbcHmacSha256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes192Cbc; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes192CbcHmacSha384; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes256Cbc; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes256CbcHmacSha512; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw128; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw192; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es256k; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es384; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es512; +import com.microsoft.azure.keyvault.cryptography.algorithms.Rs256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Rsa15; +import com.microsoft.azure.keyvault.cryptography.algorithms.RsaOaep; + +public class AlgorithmResolver { + + public static final AlgorithmResolver Default = new AlgorithmResolver(); + + static { + Default.put(Aes128CbcHmacSha256.ALGORITHM_NAME, new Aes128CbcHmacSha256()); + Default.put(Aes192CbcHmacSha384.ALGORITHM_NAME, new Aes192CbcHmacSha384()); + Default.put(Aes256CbcHmacSha512.ALGORITHM_NAME, new Aes256CbcHmacSha512()); + + Default.put(Aes128Cbc.ALGORITHM_NAME, new Aes128Cbc()); + Default.put(Aes192Cbc.ALGORITHM_NAME, new Aes192Cbc()); + Default.put(Aes256Cbc.ALGORITHM_NAME, new Aes256Cbc()); + + Default.put(AesKw128.ALGORITHM_NAME, new AesKw128()); + Default.put(AesKw192.ALGORITHM_NAME, new AesKw192()); + Default.put(AesKw256.ALGORITHM_NAME, new AesKw256()); + + Default.put(Rsa15.ALGORITHM_NAME, new Rsa15()); + Default.put(RsaOaep.ALGORITHM_NAME, new RsaOaep()); + + Default.put( Rs256.ALGORITHM_NAME, new Rs256() ); + // Default.put( RsNull.ALGORITHM_NAME, new RsNull() ); + + Default.put(Es256k.ALGORITHM_NAME, new Es256k()); + Default.put(Es256.ALGORITHM_NAME, new Es256()); + Default.put(Es384.ALGORITHM_NAME, new Es384()); + Default.put(Es512.ALGORITHM_NAME, new Es512()); + } + + private final ConcurrentMap _algorithms = new ConcurrentHashMap(); + + /** + * Returns the implementation for an algorithm name. + * + * @param algorithmName The algorithm name. + * @return The implementation for the algorithm or null. + */ + public Algorithm get(String algorithmName) { + return _algorithms.get(algorithmName); + } + + /** + * Add/Update a named algorithm implementation. + * + * @param algorithmName The algorithm name. + * @param provider The implementation of the algorithm. + */ + public void put(String algorithmName, Algorithm provider) { + _algorithms.put(algorithmName, provider); + } + + /** + * Remove a named algorithm implementation. + * + * @param algorithmName The algorithm name + */ + public void remove(String algorithmName) { + _algorithms.remove(algorithmName); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricEncryptionAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricEncryptionAlgorithm.java new file mode 100644 index 0000000000000..b239a41d8530c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricEncryptionAlgorithm.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.NoSuchPaddingException; + +/** + * Abstract base class for all asymmetric encryption algorithms. + * + */ +public abstract class AsymmetricEncryptionAlgorithm extends EncryptionAlgorithm { + + /** + * Constructor. + * + * @param name The name of the algorithm. + */ + protected AsymmetricEncryptionAlgorithm(String name) { + super(name); + } + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption that + * uses the specified {@link java.security.KeyPair} and the default {@link java.security.Provider} provider. + * + * @param keyPair + * The key pair to use. + * @return + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + */ + public abstract ICryptoTransform CreateEncryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption that + * uses the specified {@link java.security.KeyPair} and {@link java.security.Provider}. + * + * @param keyPair + * The key pair to use. + * @param provider + * The provider to use. + * @return + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + */ + public abstract ICryptoTransform CreateEncryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption that + * uses the specified {@link java.security.KeyPair} and the default {@link java.security.Provider} provider. + * + * @param keyPair + * The key pair to use. + * @return + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + */ + public abstract ICryptoTransform CreateDecryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption that + * uses the specified {@link java.security.KeyPair} and {@link java.security.Provider}. + * + * @param keyPair + * The key pair to use. + * @param provider + * The provider to use. + * @return + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + */ + public abstract ICryptoTransform CreateDecryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException; +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricSignatureAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricSignatureAlgorithm.java new file mode 100644 index 0000000000000..ff5e1417ba5c6 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/AsymmetricSignatureAlgorithm.java @@ -0,0 +1,15 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +public abstract class AsymmetricSignatureAlgorithm extends SignatureAlgorithm { + + protected AsymmetricSignatureAlgorithm(String name) { + super(name); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ByteExtensions.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ByteExtensions.java new file mode 100644 index 0000000000000..07aee9a689490 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ByteExtensions.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.util.Arrays; + +public final class ByteExtensions { + + public static byte[] or( byte[] self, byte[] other ) + { + return or( self, other, 0 ); + } + + public static byte[] or( byte[] self, byte[] other, int offset ) + { + if ( self == null ) + throw new IllegalArgumentException( "self" ); + + if ( other == null ) + throw new IllegalArgumentException( "other" ); + + if ( self.length > other.length - offset ) + throw new IllegalArgumentException( "self and other lengths do not match" ); + + byte[] result = new byte[self.length]; + + for ( int i = 0; i < self.length; i++ ) + { + result[i] = (byte)( self[i] | other[offset + i] ); + } + + return result; + } + + public static byte[] xor( byte[] self, byte[] other ) { + return xor( self, other, 0 ); + } + + static byte[] xor( byte[] self, byte[] other, int offset ) + { + if ( self == null ) + throw new IllegalArgumentException( "self" ); + + if ( other == null ) + throw new IllegalArgumentException( "other" ); + + if ( self.length > other.length - offset ) + throw new IllegalArgumentException( "self and other lengths do not match" ); + + byte[] result = new byte[self.length]; + + for ( int i = 0; i < self.length; i++ ) + { + result[i] = (byte)( self[i] ^ other[offset + i] ); + } + + return result; + } + + public static void zero( byte[] self ) + { + if ( self != null ) { + Arrays.fill(self, (byte)0); + } + } + + /** + * Compares two byte arrays in constant time. + * + * @param self + * The first byte array to compare + * @param other + * The second byte array to compare + * @return + * True if the two byte arrays are equal. + */ + public static boolean sequenceEqualConstantTime( byte[] self, byte[] other ) + { + if ( self == null ) + throw new IllegalArgumentException( "self" ); + + if ( other == null ) + throw new IllegalArgumentException( "other" ); + + // Constant time comparison of two byte arrays + long difference = ( self.length & 0xffffffffl ) ^ ( other.length & 0xffffffffl ); + + for ( int i = 0; i < self.length && i < other.length; i++ ) + { + difference |= ( self[i] ^ other[i] ) & 0xffffffffl; + } + + return difference == 0; + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java new file mode 100644 index 0000000000000..fc82ad29025d8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java @@ -0,0 +1,397 @@ +package com.microsoft.azure.keyvault.cryptography; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.security.InvalidAlgorithmParameterException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Provider; +import java.security.Security; +import java.security.interfaces.ECPublicKey; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.EllipticCurve; +import java.security.spec.InvalidKeySpecException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.google.common.collect.ImmutableMap; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.cryptography.algorithms.Ecdsa; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es256k; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es384; +import com.microsoft.azure.keyvault.cryptography.algorithms.Es512; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyCurveName; + + +public class EcKey implements IKey { + + public static final String P256 = "secp256r1"; + public static final String P384 = "secp384r1"; + public static final String P521 = "secp521r1"; + public static final String P256K = "secp256k1"; + public static final Map CURVE_TO_SIGNATURE = ImmutableMap.builder() + .put(JsonWebKeyCurveName.P_256, Es256.ALGORITHM_NAME) + .put(JsonWebKeyCurveName.P_384, Es384.ALGORITHM_NAME) + .put(JsonWebKeyCurveName.P_521, Es512.ALGORITHM_NAME) + .put(JsonWebKeyCurveName.P_256K, Es256k.ALGORITHM_NAME) + .build(); + public static final Map CURVE_TO_SPEC_NAME = ImmutableMap.builder() + .put(JsonWebKeyCurveName.P_256, P256) + .put(JsonWebKeyCurveName.P_384, P384) + .put(JsonWebKeyCurveName.P_521, P521) + .put(JsonWebKeyCurveName.P_256K, P256K) + .build(); + + + private final String _kid; + private final KeyPair _keyPair; + private final Provider _provider; + private final JsonWebKeyCurveName _curve; + + protected final String _signatureAlgorithm; + protected String defaultEncryptionAlgorithm; + + public static JsonWebKeyCurveName getDefaultCurve() { + return JsonWebKeyCurveName.P_256; + } + + /** + * Constructor. + * + * Generates a new EcKey with a P_256 curve and a randomly generated kid. + * + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + */ + public EcKey() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + this(UUID.randomUUID().toString()); + } + + /** + * Constructor. + * + * Generates a new EcKey with a P_256 curve and the given kid. + * + * @param kid + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + */ + public EcKey(String kid) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + this(kid, getDefaultCurve(), Security.getProvider("SunEC")); + } + + /** + * Constructor. + * + * Generates a new EcKey with the given curve and kid. + * @param kid + * @param curve + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + */ + public EcKey(String kid, JsonWebKeyCurveName curve) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + this(kid, curve, Security.getProvider("SunEC")); + } + + /** + * Constructor. + * + * Generates a new EcKey with the given curve and kid. + * @param kid + * @param curve + * @param provider Java security provider + * @throws InvalidAlgorithmParameterException + * @throws NoSuchAlgorithmException + */ + public EcKey(String kid, JsonWebKeyCurveName curve, Provider provider) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { + _kid = kid; + _provider = provider; + _curve = curve; + + _signatureAlgorithm = CURVE_TO_SIGNATURE.get(curve); + if (_signatureAlgorithm == null) { + throw new NoSuchAlgorithmException("Curve not supported."); + } + + final KeyPairGenerator generator = KeyPairGenerator.getInstance("EC", provider); + ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(curve)); + + generator.initialize(gps); + _keyPair = generator.generateKeyPair(); + + } + + /** + * Constructor. + * + * Generates a new EcKey with the given keyPair. + * The keyPair must be an ECKey. + * @param kid + * @param keyPair + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + */ + public EcKey(String kid, KeyPair keyPair) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + this(kid, keyPair, Security.getProvider("SunEC")); + } + + /** + * Constructor. + * + * Generates a new EcKey with the given keyPair. + * The keyPair must be an ECKey. + * @param kid + * @param keyPair + * @param provider Java security provider + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + */ + public EcKey(String kid, KeyPair keyPair, Provider provider) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + + if (Strings.isNullOrWhiteSpace(kid)) { + throw new IllegalArgumentException("Please provide a kid"); + } + + if (keyPair == null) { + throw new IllegalArgumentException("Please provide an ECKey"); + } + + if (keyPair.getPublic() == null || !(keyPair.getPublic() instanceof ECPublicKey)) { + throw new IllegalArgumentException("The keyPair provided is not an ECKey"); + } + + _kid = kid; + _keyPair = keyPair; + _provider = provider; + _curve = getCurveFromKeyPair(keyPair); + _signatureAlgorithm = CURVE_TO_SIGNATURE.get(_curve); + if (_signatureAlgorithm == null) { + throw new IllegalArgumentException("Curve not supported."); + } + } + + /** + * Converts JSON web key to EC key pair, does not include the private key. + * @param jwk + * @return EcKey + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + * @throws InvalidKeySpecException + * @throws NoSuchProviderException + */ + public static EcKey fromJsonWebKey(JsonWebKey jwk) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException, NoSuchProviderException { + return fromJsonWebKey(jwk, false, null); + } + + /** + * Converts JSON web key to EC key pair and include the private key if set to true. + * @param jwk + * @param includePrivateParameters true if the EC key pair should include the private key. False otherwise. + * @return EcKey + * @throws NoSuchAlgorithmException + * @throws InvalidAlgorithmParameterException + * @throws InvalidKeySpecException + * @throws NoSuchProviderException + */ + public static EcKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException, NoSuchProviderException { + return fromJsonWebKey(jwk, includePrivateParameters, null); + } + + /** + * Converts JSON web key to EC key pair and include the private key if set to true. + * @param jwk + * @param includePrivateParameters true if the EC key pair should include the private key. False otherwise. + * @param provider the Java Security Provider + * @return EcKey + */ + public static EcKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) { + try { + if (jwk.kid() != null) { + return new EcKey(jwk.kid(), jwk.toEC(includePrivateParameters, provider)); + } else { + throw new IllegalArgumentException("Json Web Key should have a kid"); + } + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * Converts EcKey to JSON web key. + * @return + */ + public JsonWebKey toJsonWebKey() { + return JsonWebKey.fromEC(_keyPair, _provider); + } + + // Matches the curve of the keyPair to supported curves. + private JsonWebKeyCurveName getCurveFromKeyPair(KeyPair keyPair) { + try { + ECPublicKey key = (ECPublicKey) keyPair.getPublic(); + ECParameterSpec spec = key.getParams(); + EllipticCurve crv = spec.getCurve(); + + List curveList = Arrays.asList(JsonWebKeyCurveName.P_256, JsonWebKeyCurveName.P_384, JsonWebKeyCurveName.P_521, JsonWebKeyCurveName.P_256K); + + for (JsonWebKeyCurveName curve : curveList) { + ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(curve)); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", _provider); + kpg.initialize(gps); + + // Generate dummy keypair to get parameter spec. + KeyPair apair = kpg.generateKeyPair(); + ECPublicKey apub = (ECPublicKey) apair.getPublic(); + ECParameterSpec aspec = apub.getParams(); + EllipticCurve acurve = aspec.getCurve(); + + //Matches the parameter spec + if (acurve.equals(crv)) { + return curve; + } + } + + //Did not find a supported curve. + throw new IllegalArgumentException ("Curve not supported."); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * @return curve of the key + */ + public JsonWebKeyCurveName getCurve() { + return _curve; + } + + /** + * + * @return the underlying keyPair of the key + */ + public KeyPair getKeyPair() { + return _keyPair; + } + + @Override + public void close() throws IOException { + // Intentionally empty + } + + @Override + public String getDefaultEncryptionAlgorithm() { + return null; + } + + @Override + public String getDefaultKeyWrapAlgorithm() { + return null; + } + + @Override + public String getDefaultSignatureAlgorithm() { + return _signatureAlgorithm; + } + + @Override + public String getKid() { + return _kid; + } + + @Override + public ListenableFuture decryptAsync(byte[] ciphertext, byte[] iv, byte[] authenticationData, + byte[] authenticationTag, String algorithm) throws NoSuchAlgorithmException { + throw new UnsupportedOperationException("Decrypt Async is not supported"); + } + + @Override + public ListenableFuture> encryptAsync(byte[] plaintext, byte[] iv, + byte[] authenticationData, String algorithm) throws NoSuchAlgorithmException { + throw new UnsupportedOperationException("Encrypt Async is not supported"); + } + + @Override + public ListenableFuture> wrapKeyAsync(byte[] key, String algorithm) + throws NoSuchAlgorithmException { + throw new UnsupportedOperationException("Wrap key is not supported"); + } + + @Override + public ListenableFuture unwrapKeyAsync(byte[] encryptedKey, String algorithm) + throws NoSuchAlgorithmException { + throw new UnsupportedOperationException("Unwrap key is not supported"); + } + + @Override + public ListenableFuture> signAsync(byte[] digest, String algorithm) throws NoSuchAlgorithmException { + + if (_keyPair.getPrivate() == null) { + throw new UnsupportedOperationException("Sign is not supported without a private key."); + } + + if (digest == null) { + throw new IllegalArgumentException("Please provide a digest to sign."); + } + + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("Please provide a signature algorithm to use."); + } + + // Interpret the requested algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + Ecdsa algo = (Ecdsa) baseAlgorithm; + ISignatureTransform signer = algo.createSignatureTransform(_keyPair, _provider); + + try { + return Futures.immediateFuture(Pair.of(signer.sign(digest), algorithm)); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + } + + @Override + public ListenableFuture verifyAsync(byte[] digest, byte[] signature, String algorithm) throws NoSuchAlgorithmException { + + if (digest == null) { + throw new IllegalArgumentException("Please provide a digest input."); + } + + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("Please provide an algorithm"); + } + + // Interpret the requested algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + Ecdsa algo = (Ecdsa) baseAlgorithm; + + ISignatureTransform signer = algo.createSignatureTransform(_keyPair, _provider); + + try { + return Futures.immediateFuture(signer.verify(digest, signature)); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EncryptionAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EncryptionAlgorithm.java new file mode 100644 index 0000000000000..4d36c332b3beb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EncryptionAlgorithm.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +/** + * Abstract base class for all encryption algorithms. + * + */ +public abstract class EncryptionAlgorithm extends Algorithm { + + /** + * Constructor. + * @param name The name of the algorithm. + */ + protected EncryptionAlgorithm(String name) { + super(name); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/IAuthenticatedCryptoTransform.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/IAuthenticatedCryptoTransform.java new file mode 100644 index 0000000000000..113a14404cf4d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/IAuthenticatedCryptoTransform.java @@ -0,0 +1,12 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +public interface IAuthenticatedCryptoTransform extends ICryptoTransform { + + public byte[] getTag(); +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ICryptoTransform.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ICryptoTransform.java new file mode 100644 index 0000000000000..4787a9d11a0f4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ICryptoTransform.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +import javax.crypto.BadPaddingException; +import javax.crypto.IllegalBlockSizeException; + +/** + * Defines the basic operations of cryptographic transformations. + * + */ +public interface ICryptoTransform { + + /** + * Transforms the specified region of the specified byte array as a single operation. + * + * @param input + * The byte array to be transformed + * @return + * The transformed result. + * @throws IllegalBlockSizeException + * @throws BadPaddingException + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + */ + public byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException; +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ISignatureTransform.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ISignatureTransform.java new file mode 100644 index 0000000000000..484b1448fb513 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/ISignatureTransform.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.security.GeneralSecurityException; + +public interface ISignatureTransform { + + public byte[] sign(final byte[] digest) throws GeneralSecurityException; + + public boolean verify(final byte[] digest, final byte[] signature) throws GeneralSecurityException; +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/KeyWrapAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/KeyWrapAlgorithm.java new file mode 100644 index 0000000000000..e0028d51a5073 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/KeyWrapAlgorithm.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.NoSuchPaddingException; + +/** + * Abstract base class for all key wrap algorithms. + * + */ +public abstract class KeyWrapAlgorithm extends Algorithm { + + /** + * Constructor. + * + * @param name The name of the algorithm. + */ + protected KeyWrapAlgorithm(String name) { + super(name); + } + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption. + * Uses the default AES-KW initialization vector. + * @param key + * The AES key material to be used. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption that + * uses the specified provider for the Java Security API. Uses the default AES-KW initialization vector. + * + * @param key + * The AES key material to be used. + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption + * using the supplied initialization vector. + * @param key + * The AES key material to be used. + * @param iv + * The initialization vector to be used. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The AES key material to be used. + * @param iv + * The initialization vector to be used. + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption. + * Uses the default AES-KW initialization vector. + * @param key + * The AES key material to be used. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption that + * uses the specified provider for the Java Security API. Uses the default AES-KW initialization vector. + * + * @param key + * The AES key material to be used. + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption + * using the supplied initialization vector. + * @param key + * The AES key material to be used. + * @param iv + * The initialization vector to be used. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The AES key material to be used. + * @param iv + * The initialization vector to be used. + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException; +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/RsaKey.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/RsaKey.java new file mode 100644 index 0000000000000..c0ae1b5995e79 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/RsaKey.java @@ -0,0 +1,395 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.io.IOException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.cryptography.algorithms.Rs256; +import com.microsoft.azure.keyvault.cryptography.algorithms.RsaOaep; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + +public class RsaKey implements IKey { + + public static int KeySize1024 = 1024; + public static int KeySize2048 = 2048; + public static int KeySize4096 = 4096; + + public static int getDefaultKeySize() { + return RsaKey.KeySize2048; + } + + private final String _kid; + private final KeyPair _keyPair; + private final Provider _provider; + + /** + * Constructor. + * + * Generates a new RsaKey with a 2048 size keypair and a randomly generated kid. + * @throws NoSuchAlgorithmException + */ + public RsaKey() throws NoSuchAlgorithmException { + this(UUID.randomUUID().toString()); + } + + /** + * Constructor. + * + * Generates a new RsaKey with a 2048 size keypair and the kid given. + * @param kid + * @throws NoSuchAlgorithmException + */ + public RsaKey(String kid) throws NoSuchAlgorithmException { + this(kid, getDefaultKeySize()); + } + + /** + * Constructor. + * + * Generates a new RsaKey with size keySize and the kid given. + * @param kid + * @param keySize + * @throws NoSuchAlgorithmException + */ + public RsaKey(String kid, int keySize) throws NoSuchAlgorithmException { + this(kid, keySize, null); + } + + /** + * Constructor. + * + * Generates a new RsaKey with size keySize and the kid given. The given provider is used for algorithm implementation. + * @param kid + * @param keySize + * @param provider Java security provider. + * @throws NoSuchAlgorithmException + */ + public RsaKey(String kid, int keySize, Provider provider) throws NoSuchAlgorithmException { + + if (Strings.isNullOrWhiteSpace(kid)) { + throw new IllegalArgumentException("kid"); + } + + final KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA", provider); + + generator.initialize(keySize); + + _kid = kid; + _keyPair = generator.generateKeyPair(); + _provider = provider; + } + + /** + * Constructor. + * + * Generates a new RsaKey with the given KeyPair. + * The keyPair must be an RSAKey. + * @param kid + * @param keyPair + */ + public RsaKey(String kid, KeyPair keyPair) { + this(kid, keyPair, null); + } + + /** + * Constructor. + * + * Generates a new RsaKey with given KeyPair. The given provider is used for algorithm implementation. + * The keyPair must be an RSAKey. + * @param kid + * @param keyPair + * @param provider Java security provider + */ + public RsaKey(String kid, KeyPair keyPair, Provider provider) { + + if (Strings.isNullOrWhiteSpace(kid)) { + throw new IllegalArgumentException("Please provide a kid"); + } + + if (keyPair == null) { + throw new IllegalArgumentException("Please provide a KeyPair"); + } + + if (keyPair.getPublic() == null || !(keyPair.getPublic() instanceof RSAPublicKey)) { + throw new IllegalArgumentException("The KeyPair is not an RsaKey"); + } + + _kid = kid; + _keyPair = keyPair; + _provider = provider; + } + + /** + * Converts JSON web key to RsaKey. + * @param jwk + * @return RsaKey + */ + public static RsaKey fromJsonWebKey(JsonWebKey jwk) { + return fromJsonWebKey(jwk, false, null); + } + + /** + * Converts JSON web key to RsaKey and include the private key if set to true. + * @param jwk + * @param includePrivateParameters true if the RSA key pair should include the private key. False otherwise. + * @return RsaKey + */ + public static RsaKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters) { + return fromJsonWebKey(jwk, includePrivateParameters, null); + } + + /** + * Converts JSON web key to RsaKey and include the private key if set to true. + * @param provider the Java security provider. + * @param includePrivateParameters true if the RSA key pair should include the private key. False otherwise. + * @return RsaKey + */ + public static RsaKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) { + if (jwk.kid() != null) { + return new RsaKey(jwk.kid(), jwk.toRSA(includePrivateParameters, provider)); + } else { + throw new IllegalArgumentException("Json Web Key must have a kid"); + } + } + + /** + * Converts RsaKey to JSON web key. + * @return + */ + public JsonWebKey toJsonWebKey() { + return JsonWebKey.fromRSA(_keyPair); + } + + @Override + public String getDefaultEncryptionAlgorithm() { + return RsaOaep.ALGORITHM_NAME; + } + + @Override + public String getDefaultKeyWrapAlgorithm() { + return RsaOaep.ALGORITHM_NAME; + } + + @Override + public String getDefaultSignatureAlgorithm() { + return Rs256.ALGORITHM_NAME; + } + + @Override + public String getKid() { + return _kid; + } + + public KeyPair getKeyPair() { + return _keyPair; + } + + @Override + public ListenableFuture decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm) throws NoSuchAlgorithmException { + + if (ciphertext == null) { + throw new IllegalArgumentException("ciphertext"); + } + + // Interpret the requested algorithm + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform; + ListenableFuture result; + + try { + transform = algo.CreateDecryptor(_keyPair, _provider); + result = Futures.immediateFuture(transform.doFinal(ciphertext)); + } catch (Exception e) { + result = Futures.immediateFailedFuture(e); + } + + return result; + } + + @Override + public ListenableFuture> encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm) throws NoSuchAlgorithmException { + + if (plaintext == null) { + throw new IllegalArgumentException("plaintext"); + } + + // Interpret the requested algorithm + String algorithmName = (Strings.isNullOrWhiteSpace(algorithm) ? getDefaultEncryptionAlgorithm() : algorithm); + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithmName); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithmName); + } + + AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform; + ListenableFuture> result; + + try { + transform = algo.CreateEncryptor(_keyPair, _provider); + result = Futures.immediateFuture(Triple.of(transform.doFinal(plaintext), (byte[]) null, algorithmName)); + } catch (Exception e) { + result = Futures.immediateFailedFuture(e); + } + + return result; + } + + @Override + public ListenableFuture> wrapKeyAsync(final byte[] key, final String algorithm) throws NoSuchAlgorithmException { + + if (key == null) { + throw new IllegalArgumentException("key"); + } + + // Interpret the requested algorithm + String algorithmName = (Strings.isNullOrWhiteSpace(algorithm) ? getDefaultKeyWrapAlgorithm() : algorithm); + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithmName); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithmName); + } + + AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform; + ListenableFuture> result; + + try { + transform = algo.CreateEncryptor(_keyPair, _provider); + result = Futures.immediateFuture(Pair.of(transform.doFinal(key), algorithmName)); + } catch (Exception e) { + result = Futures.immediateFailedFuture(e); + } + + return result; + } + + @Override + public ListenableFuture unwrapKeyAsync(final byte[] encryptedKey, final String algorithm) throws NoSuchAlgorithmException { + + if (encryptedKey == null) { + throw new IllegalArgumentException("encryptedKey "); + } + + // Interpret the requested algorithm + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + // Interpret the requested algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform; + ListenableFuture result; + + try { + transform = algo.CreateDecryptor(_keyPair, _provider); + result = Futures.immediateFuture(transform.doFinal(encryptedKey)); + } catch (Exception e) { + result = Futures.immediateFailedFuture(e); + } + + return result; + } + + @Override + public ListenableFuture> signAsync(final byte[] digest, final String algorithm) throws NoSuchAlgorithmException { + + if (digest == null) { + throw new IllegalArgumentException("encryptedKey "); + } + + // Interpret the requested algorithm + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + // Interpret the requested algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + Rs256 algo = (Rs256)baseAlgorithm; + + ISignatureTransform signer = algo.createSignatureTransform(_keyPair); + + try { + return Futures.immediateFuture(Pair.of(signer.sign(digest), Rs256.ALGORITHM_NAME)); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + } + + @Override + public ListenableFuture verifyAsync(final byte[] digest, final byte[] signature, final String algorithm) throws NoSuchAlgorithmException { + + if (digest == null) { + throw new IllegalArgumentException("encryptedKey "); + } + + // Interpret the requested algorithm + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + // Interpret the requested algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + Rs256 algo = (Rs256)baseAlgorithm; + + ISignatureTransform signer = algo.createSignatureTransform(_keyPair); + + try { + return Futures.immediateFuture(signer.verify(digest, signature)); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + } + + @Override + public void close() throws IOException { + // Intentionally empty + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SignatureAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SignatureAlgorithm.java new file mode 100644 index 0000000000000..53d7459b91363 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SignatureAlgorithm.java @@ -0,0 +1,15 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +public abstract class SignatureAlgorithm extends Algorithm { + + protected SignatureAlgorithm(String name) { + super(name); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Strings.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Strings.java new file mode 100644 index 0000000000000..a1ead94749e65 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/Strings.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +public final class Strings { + + /** + * Determines whether the parameter string is either null or empty. + * + * @param arg The string to be checked. + * @return true if the string is null or empty. + */ + public static boolean isNullOrEmpty(String arg) { + + if (arg == null || arg.length() == 0) { + return true; + } + + return false; + } + + /** + * Determines whether the parameter string is null, empty or whitespace. + * + * @param arg The string to be checked. + * @return true if the string is null, empty or whitespace. + */ + public static boolean isNullOrWhiteSpace(String arg) { + + if (Strings.isNullOrEmpty(arg) || arg.trim().isEmpty()) { + return true; + } + + return false; + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricEncryptionAlgorithm.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricEncryptionAlgorithm.java new file mode 100644 index 0000000000000..b582ced734928 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricEncryptionAlgorithm.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.NoSuchPaddingException; + +/** + * Abstract base class for all symmetric encryption algorithms. + * + */ +public abstract class SymmetricEncryptionAlgorithm extends EncryptionAlgorithm { + + /** + * Constructor. + * + * @param name The name of the algorithm. + */ + protected SymmetricEncryptionAlgorithm(String name) { + super(name); + } + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The key material to be used. + * @param iv + * The initialization vector to be used. + * @param authenticationData + * The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for encryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The key material to be used. + * @param iv + * The initialization vector to be used. + * @param authenticationData + * The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The key material to be used. + * @param iv + * The initialization vector to be used. + * @param authenticationData + * The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @param authenticationTag + * The authentication tag to verify when using authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException; + + /** + * Creates a {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation for decryption + * using the supplied initialization vector and the specific provider for the Java Security API. + * @param key + * The key material to be used. + * @param iv + * The initialization vector to be used. + * @param authenticationData + * The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @param authenticationTag + * The authentication tag to verify when using authenticating encryption algorithms (ignored for non-authenticating algorithms) + * @param provider + * The provider to use. + * @return A {@link com.microsoft.azure.keyvault.cryptography.ICryptoTransform} implementation + * @throws InvalidKeyException + * @throws NoSuchAlgorithmException + * @throws NoSuchPaddingException + * @throws InvalidAlgorithmParameterException + */ + public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException; + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricKey.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricKey.java new file mode 100644 index 0000000000000..c401d77251a88 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/SymmetricKey.java @@ -0,0 +1,389 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography; + +import java.io.IOException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.security.SecureRandom; +import java.util.UUID; + +import org.apache.commons.lang3.NotImplementedException; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128Cbc; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128CbcHmacSha256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes192Cbc; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes192CbcHmacSha384; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes256CbcHmacSha512; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw128; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw192; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw256; +import com.microsoft.azure.keyvault.cryptography.Strings; + +/** + * A simple symmetric key implementation + * + */ +public class SymmetricKey implements IKey { + + private static final SecureRandom Rng = new SecureRandom(); + + public static final int KeySize128 = 128 >> 3; + public static final int KeySize192 = 192 >> 3; + public static final int KeySize256 = 256 >> 3; + public static final int KeySize384 = 384 >> 3; + public static final int KeySize512 = 512 >> 3; + + public static final int DefaultKeySize = KeySize256; + + private final String _kid; + private final byte[] _key; + private final Provider _provider; + + /** + * Creates a SymmetricKey with a random key identifier and + * a random key with DefaultKeySize bits. + */ + public SymmetricKey() { + this(UUID.randomUUID().toString()); + } + + /** + * Creates a SymmetricKey with the specified key identifier and + * a random key with DefaultKeySize bits. + * @param kid + * The key identifier to use. + */ + public SymmetricKey(String kid) { + this(kid, DefaultKeySize); + } + + /** + * Creates a SymmetricKey with the specified key identifier and + * a random key with the specified size. + * @param kid + * The key identifier to use. + * @param keySizeInBytes + * The key size to use in bytes. + */ + public SymmetricKey(String kid, int keySizeInBytes ) { + this(kid, keySizeInBytes, null); + } + + /** + * Creates a SymmetricKey with the specified key identifier and + * a random key with the specified size that uses the specified provider. + * @param kid + * The key identifier to use. + * @param keySizeInBytes + * The key size to use in bytes. + * @param provider + * The provider to use (optional, null for default) + */ + public SymmetricKey(String kid, int keySizeInBytes, Provider provider) { + + if ( Strings.isNullOrWhiteSpace(kid) ) { + throw new IllegalArgumentException("kid"); + } + + if ( keySizeInBytes != KeySize128 && keySizeInBytes != KeySize192 && keySizeInBytes != KeySize256 && keySizeInBytes != KeySize384 && keySizeInBytes != KeySize512 ) { + throw new IllegalArgumentException("The key material must be 128, 192, 256, 384 or 512 bits of data"); + } + + _kid = kid; + _key = new byte[keySizeInBytes]; + _provider = provider; + + // Generate a random key + Rng.nextBytes(_key); + } + + /** + * Creates a SymmetricKey with the specified key identifier and key material. + * @param kid + * The key identifier to use. + * @param keyBytes + * The key material to use. + */ + public SymmetricKey(String kid, byte[] keyBytes) { + this(kid, keyBytes, null); + } + + /** + * Creates a SymmetricKey with the specified key identifier and key material + * that uses the specified Provider. + * @param kid + * The key identifier to use. + * @param keyBytes + * The key material to use. + * @param provider + * The Provider to use (optional, null for default) + */ + public SymmetricKey(String kid, byte[] keyBytes, Provider provider) { + + if ( Strings.isNullOrWhiteSpace(kid) ) { + throw new IllegalArgumentException("kid"); + } + + if ( keyBytes == null ) { + throw new IllegalArgumentException("keyBytes"); + } + + if ( keyBytes.length != KeySize128 && keyBytes.length != KeySize192 && keyBytes.length != KeySize256 && keyBytes.length != KeySize384 && keyBytes.length != KeySize512 ) { + throw new IllegalArgumentException("The key material must be 128, 192, 256, 384 or 512 bits of data"); + } + + _kid = kid; + _key = keyBytes; + _provider = provider; + } + + @Override + public String getDefaultEncryptionAlgorithm() { + + switch (_key.length) { + case KeySize128: + return Aes128Cbc.ALGORITHM_NAME; + + case KeySize192: + return Aes192Cbc.ALGORITHM_NAME; + + case KeySize256: + return Aes128CbcHmacSha256.ALGORITHM_NAME; + + case KeySize384: + return Aes192CbcHmacSha384.ALGORITHM_NAME; + + case KeySize512: + return Aes256CbcHmacSha512.ALGORITHM_NAME; + } + + return null; + } + + @Override + public String getDefaultKeyWrapAlgorithm() { + + switch (_key.length) { + case KeySize128: + return AesKw128.ALGORITHM_NAME; + + case KeySize192: + return AesKw192.ALGORITHM_NAME; + + case KeySize256: + return AesKw256.ALGORITHM_NAME; + + case KeySize384: + // Default to longest allowed key length for wrap + return AesKw256.ALGORITHM_NAME; + + case KeySize512: + // Default to longest allowed key length for wrap + return AesKw256.ALGORITHM_NAME; + } + + return null; + } + + @Override + public String getDefaultSignatureAlgorithm() { + + return null; + } + + @Override + public String getKid() { + + return _kid; + } + + @Override + public ListenableFuture decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm) throws NoSuchAlgorithmException { + + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + if (ciphertext == null) { + throw new IllegalArgumentException("ciphertext"); + } + + if (iv == null) { + throw new IllegalArgumentException("iv"); + } + + // Interpret the algorithm + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof SymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + SymmetricEncryptionAlgorithm algo = (SymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform = null; + + try { + transform = algo.CreateDecryptor(_key, iv, authenticationData, authenticationTag, _provider ); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + byte[] result = null; + + try { + result = transform.doFinal(ciphertext); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + return Futures.immediateFuture(result); + } + + @Override + public ListenableFuture> encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm) throws NoSuchAlgorithmException { + + if (plaintext == null) { + throw new IllegalArgumentException("plaintext"); + } + + if (iv == null) { + throw new IllegalArgumentException("iv"); + } + + // Interpret the algorithm + String algorithmName = (Strings.isNullOrWhiteSpace(algorithm)) ? getDefaultEncryptionAlgorithm() : algorithm; + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithmName); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof SymmetricEncryptionAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + SymmetricEncryptionAlgorithm algo = (SymmetricEncryptionAlgorithm)baseAlgorithm; + + ICryptoTransform transform = null; + + try { + transform = algo.CreateEncryptor(_key, iv, authenticationData, _provider); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + byte[] cipherText = null; + + try { + cipherText = transform.doFinal(plaintext); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + byte[] authenticationTag = null; + + if (transform instanceof IAuthenticatedCryptoTransform) { + + IAuthenticatedCryptoTransform authenticatedTransform = (IAuthenticatedCryptoTransform) transform; + + authenticationTag = authenticatedTransform.getTag().clone(); + } + + return Futures.immediateFuture(Triple.of(cipherText, authenticationTag, algorithm)); + } + + @Override + public ListenableFuture> wrapKeyAsync(final byte[] key, final String algorithm) throws NoSuchAlgorithmException { + + if (key == null || key.length == 0) { + throw new IllegalArgumentException("key"); + } + + // Interpret the algorithm + String algorithmName = (Strings.isNullOrWhiteSpace(algorithm)) ? getDefaultKeyWrapAlgorithm() : algorithm; + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithmName); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof KeyWrapAlgorithm)) { + throw new NoSuchAlgorithmException(algorithmName); + } + + KeyWrapAlgorithm algo = (KeyWrapAlgorithm)baseAlgorithm; + + ICryptoTransform transform = null; + + try { + transform = algo.CreateEncryptor(_key, null, _provider); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + byte[] encrypted = null; + + try { + encrypted = transform.doFinal(key); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + return Futures.immediateFuture(Pair.of(encrypted, algorithmName)); + } + + @Override + public ListenableFuture unwrapKeyAsync(final byte[] encryptedKey, final String algorithm) throws NoSuchAlgorithmException { + + if (Strings.isNullOrWhiteSpace(algorithm)) { + throw new IllegalArgumentException("algorithm"); + } + + if (encryptedKey == null || encryptedKey.length == 0) { + throw new IllegalArgumentException("wrappedKey"); + } + + Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm); + + if (baseAlgorithm == null || !(baseAlgorithm instanceof KeyWrapAlgorithm)) { + throw new NoSuchAlgorithmException(algorithm); + } + + KeyWrapAlgorithm algo = (KeyWrapAlgorithm)baseAlgorithm; + + ICryptoTransform transform = null; + + try { + transform = algo.CreateDecryptor(_key, null, _provider); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + byte[] decrypted = null; + + try { + decrypted = transform.doFinal(encryptedKey); + } catch (Exception e) { + return Futures.immediateFailedFuture(e); + } + + return Futures.immediateFuture(decrypted); + } + + @Override + public ListenableFuture> signAsync(final byte[] digest, final String algorithm) { + return Futures.immediateFailedFuture(new NotImplementedException("signAsync is not currently supported")); + } + + @Override + public ListenableFuture verifyAsync(final byte[] digest, final byte[] signature, final String algorithm) { + return Futures.immediateFailedFuture(new NotImplementedException("verifyAsync is not currently supported")); + } + + @Override + public void close() throws IOException { + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128Cbc.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128Cbc.java new file mode 100644 index 0000000000000..89a10584294dd --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128Cbc.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes128Cbc extends AesCbc { + + private static final int KEY_SIZE = 128; + public static final String ALGORITHM_NAME = "A128CBC"; + + public Aes128Cbc() { + super(ALGORITHM_NAME, KEY_SIZE); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128CbcHmacSha256.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128CbcHmacSha256.java new file mode 100644 index 0000000000000..f473aee20d11b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128CbcHmacSha256.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes128CbcHmacSha256 extends AesCbcHmacSha2 { + + public static final String ALGORITHM_NAME = "A128CBC-HS256"; + + public Aes128CbcHmacSha256() { + super(ALGORITHM_NAME); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192Cbc.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192Cbc.java new file mode 100644 index 0000000000000..fe6f3ff8f1f16 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192Cbc.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes192Cbc extends AesCbc { + + private static final int KEY_SIZE = 192; + public static final String ALGORITHM_NAME = "A192CBC"; + + public Aes192Cbc() { + super(ALGORITHM_NAME, KEY_SIZE); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192CbcHmacSha384.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192CbcHmacSha384.java new file mode 100644 index 0000000000000..ecfc65f49ff69 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes192CbcHmacSha384.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes192CbcHmacSha384 extends AesCbcHmacSha2 { + + public static final String ALGORITHM_NAME = "A192CBC-HS384"; + + public Aes192CbcHmacSha384() { + super(ALGORITHM_NAME); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256Cbc.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256Cbc.java new file mode 100644 index 0000000000000..f198b9012b54c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256Cbc.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes256Cbc extends AesCbc { + + private static final int KEY_SIZE = 256; + public static final String ALGORITHM_NAME = "A256CBC"; + + public Aes256Cbc() { + super(ALGORITHM_NAME, KEY_SIZE); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256CbcHmacSha512.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256CbcHmacSha512.java new file mode 100644 index 0000000000000..61c1aead84b77 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes256CbcHmacSha512.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Aes256CbcHmacSha512 extends AesCbcHmacSha2 { + + public static final String ALGORITHM_NAME = "A256CBC-HS512"; + + public Aes256CbcHmacSha512() { + super(ALGORITHM_NAME); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbc.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbc.java new file mode 100644 index 0000000000000..f2b9d28f67e32 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbc.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; +import com.microsoft.azure.keyvault.cryptography.SymmetricEncryptionAlgorithm; + +public abstract class AesCbc extends SymmetricEncryptionAlgorithm { + + final int keySizeInBytes; + final int keySize; + static class AesCbcDecryptor implements ICryptoTransform { + + private final Cipher _cipher; + + AesCbcDecryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + // Create the cipher using the Provider if specified + if (provider == null) { + _cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + } else { + _cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", provider); + } + + _cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv)); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + return _cipher.doFinal(plaintext); + } + } + + static class AesCbcEncryptor implements ICryptoTransform { + + private final Cipher _cipher; + + AesCbcEncryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + // Create the cipher using the Provider if specified + if (provider == null) { + _cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + } else { + _cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", provider); + } + + _cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv)); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + return _cipher.doFinal(plaintext); + } + } + + protected AesCbc(String name, int size) { + super(name); + keySize = size; + keySizeInBytes = size >> 3; + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null || key.length < keySizeInBytes) { + throw new InvalidKeyException("key must be at least " + keySize + " bits in length"); + } + + return new AesCbcEncryptor(Arrays.copyOfRange(key, 0, keySizeInBytes), iv, null); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null || key.length < keySizeInBytes) { + throw new InvalidKeyException("key must be at least " + keySize + " bits in length"); + } + + return new AesCbcEncryptor(Arrays.copyOfRange(key, 0, keySizeInBytes), iv, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null || key.length < keySizeInBytes) { + throw new InvalidKeyException("key must be at least " + keySize + " bits in length"); + } + + return new AesCbcDecryptor(Arrays.copyOfRange(key, 0, keySizeInBytes), iv, null); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null || key.length < keySizeInBytes) { + throw new InvalidKeyException("key must be at least " + keySize + " bits in length"); + } + + return new AesCbcDecryptor(Arrays.copyOfRange(key, 0, keySizeInBytes), iv, provider); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbcHmacSha2.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbcHmacSha2.java new file mode 100644 index 0000000000000..9ab0a3cd2f1e3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesCbcHmacSha2.java @@ -0,0 +1,279 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.math.BigInteger; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.BadPaddingException; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.Mac; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.lang3.tuple.Triple; + +import com.microsoft.azure.keyvault.cryptography.ByteExtensions; +import com.microsoft.azure.keyvault.cryptography.IAuthenticatedCryptoTransform; +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; +import com.microsoft.azure.keyvault.cryptography.SymmetricEncryptionAlgorithm; + +public abstract class AesCbcHmacSha2 extends SymmetricEncryptionAlgorithm { + + static class AesCbcHmacSha2Decryptor implements IAuthenticatedCryptoTransform { + + final byte[] _aad_length; + final Mac _hmac; + final byte[] _hmac_key; + final ICryptoTransform _inner; + + byte[] _tag; + + AesCbcHmacSha2Decryptor(String name, byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + // Split the key to get the AES key, the HMAC key and the HMAC + // object + Triple parameters = GetAlgorithmParameters(name, key); + + // Save the MAC provider and key + _hmac = parameters.getRight(); + _hmac_key = parameters.getMiddle(); + + // Create the AES provider + _inner = new AesCbc.AesCbcDecryptor(parameters.getLeft(), iv, provider); + + _aad_length = toBigEndian(authenticationData.length * 8); + + // Save the tag + _tag = authenticationTag; + + // Prime the hash. + _hmac.update(authenticationData); + _hmac.update(iv); + } + + @Override + public byte[] getTag() { + return _tag; + } + + @Override + public byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException { + + // Add the cipher text to the running hash + _hmac.update(input); + + // Add the associated_data_length bytes to the hash + byte[] hash = _hmac.doFinal(_aad_length); + + // Compute the new tag + byte[] tag = new byte[_hmac_key.length]; + System.arraycopy(hash, 0, tag, 0, _hmac_key.length); + + // Check the tag before performing the final decrypt + if ( !ByteExtensions.sequenceEqualConstantTime(_tag, tag) ) { + throw new IllegalArgumentException("Data is not authentic"); + } + + return _inner.doFinal(input); + } + } + + static class AesCbcHmacSha2Encryptor implements IAuthenticatedCryptoTransform { + + final byte[] _aad_length; + final Mac _hmac; + final byte[] _hmac_key; + final ICryptoTransform _inner; + + byte[] _tag; + + AesCbcHmacSha2Encryptor(String name, byte[] key, byte[] iv, byte[] authenticationData, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + // Split the key to get the AES key, the HMAC key and the HMAC + // object + Triple parameters = GetAlgorithmParameters(name, key); + + // Save the MAC provider and key + _hmac = parameters.getRight(); + _hmac_key = parameters.getMiddle(); + + // Create the AES encryptor + _inner = new AesCbc.AesCbcEncryptor(parameters.getLeft(), iv, provider); + + _aad_length = toBigEndian(authenticationData.length * 8); + + // Prime the hash. + _hmac.update(authenticationData); + _hmac.update(iv); + } + + @Override + public byte[] getTag() { + return _tag; + } + + // public int TransformBlock( byte[] inputBuffer, int inputOffset, int + // inputCount, byte[] outputBuffer, int outputOffset ) + // { + // // Encrypt the block + // var result = _inner.TransformBlock( inputBuffer, inputOffset, + // inputCount, outputBuffer, outputOffset ); + // + // // Add it to the running hash + // _hmac.TransformBlock( outputBuffer, outputOffset, result, + // outputBuffer, outputOffset ); + // + // return result; + // } + + @Override + public byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException { + + // Encrypt the block + byte[] output = _inner.doFinal(input); + + // Add the cipher text to the running hash + _hmac.update(output); + + // Add the associated_data_length bytes to the hash + byte[] hash = _hmac.doFinal(_aad_length); + + // Compute the tag + _tag = new byte[_hmac_key.length]; + System.arraycopy(hash, 0, _tag, 0, _tag.length); + + return output; + } + } + + protected AesCbcHmacSha2(String name) { + super(name); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + return CreateDecryptor(key, iv, authenticationData, authenticationTag, null); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + if (key == null) { + throw new IllegalArgumentException("No key material"); + } + + if (iv == null) { + throw new IllegalArgumentException("No initialization vector"); + } + + if (authenticationData == null) { + throw new IllegalArgumentException("No authentication data"); + } + + if (authenticationTag == null) { + throw new IllegalArgumentException("No authentication tag"); + } + + // Create the Decryptor + return new AesCbcHmacSha2Decryptor(getName(), key, iv, authenticationData, authenticationTag, provider); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + return CreateEncryptor(key, iv, authenticationData, null); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("No key material"); + } + + if (iv == null) { + throw new IllegalArgumentException("No initialization vector"); + } + + if (authenticationData == null) { + throw new IllegalArgumentException("No authentication data"); + } + + // Create the Encryptor + return new AesCbcHmacSha2Encryptor(getName(), key, iv, authenticationData, provider); + } + + private static Triple GetAlgorithmParameters(String algorithm, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { + + byte[] aes_key; + byte[] hmac_key; + Mac hmac; + + if (algorithm.equalsIgnoreCase(Aes128CbcHmacSha256.ALGORITHM_NAME)) { + if ((key.length << 3) < 256) { + throw new IllegalArgumentException(String.format("%s key length in bits %d < 256", algorithm, key.length << 3)); + } + + hmac_key = new byte[128 >> 3]; + aes_key = new byte[128 >> 3]; + + // The HMAC key precedes the AES key + System.arraycopy(key, 0, hmac_key, 0, 128 >> 3); + System.arraycopy(key, 128 >> 3, aes_key, 0, 128 >> 3); + + hmac = Mac.getInstance("HmacSHA256"); + hmac.init(new SecretKeySpec(hmac_key, "HmacSHA256")); + + } else if (algorithm.equalsIgnoreCase(Aes192CbcHmacSha384.ALGORITHM_NAME)) { + + if ((key.length << 3) < 384) { + throw new IllegalArgumentException(String.format("%s key length in bits %d < 384", algorithm, key.length << 3)); + } + + hmac_key = new byte[192 >> 3]; + aes_key = new byte[192 >> 3]; + + // The HMAC key precedes the AES key + System.arraycopy(key, 0, hmac_key, 0, 192 >> 3); + System.arraycopy(key, 192 >> 3, aes_key, 0, 192 >> 3); + + hmac = Mac.getInstance("HmacSHA384"); + hmac.init(new SecretKeySpec(hmac_key, "HmacSHA384")); + } else if (algorithm.equalsIgnoreCase(Aes256CbcHmacSha512.ALGORITHM_NAME)) { + + if ((key.length << 3) < 512) { + throw new IllegalArgumentException(String.format("%s key length in bits %d < 512", algorithm, key.length << 3)); + } + + hmac_key = new byte[256 >> 3]; + aes_key = new byte[256 >> 3]; + + // The HMAC key precedes the AES key + System.arraycopy(key, 0, hmac_key, 0, 256 >> 3); + System.arraycopy(key, 256 >> 3, aes_key, 0, 256 >> 3); + + hmac = Mac.getInstance("HmacSHA512"); + hmac.init(new SecretKeySpec(hmac_key, "HmacSHA512")); + } else { + throw new IllegalArgumentException(String.format("Unsupported algorithm: %s", algorithm)); + } + + return Triple.of(aes_key, hmac_key, hmac); + } + + static byte[] toBigEndian(long i) { + + byte[] shortRepresentation = BigInteger.valueOf(i).toByteArray(); + byte[] longRepresentation = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }; + + System.arraycopy(shortRepresentation, 0, longRepresentation, longRepresentation.length - shortRepresentation.length, shortRepresentation.length); + + return longRepresentation; + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw.java new file mode 100644 index 0000000000000..6bd7dfc28c639 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; +import com.microsoft.azure.keyvault.cryptography.KeyWrapAlgorithm; + +public abstract class AesKw extends KeyWrapAlgorithm { + + static final byte[] _defaultIv = new byte[] { (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6 }; + static final String _cipherName = "AESWrap"; + + class AesKwDecryptor implements ICryptoTransform { + + final Cipher _cipher; + + AesKwDecryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + if (provider == null) { + _cipher = Cipher.getInstance(_cipherName); + } else { + _cipher = Cipher.getInstance(_cipherName, provider); + } + + // The default provider does not support the specification of IV. This + // is guarded by the CreateEncrypter wrapper method and the iv parameter + // can be ignored when using the default provider + if (provider == null ) { + _cipher.init(Cipher.UNWRAP_MODE, new SecretKeySpec(key, "AES")); + } else { + _cipher.init(Cipher.UNWRAP_MODE, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv)); + } + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException { + + return _cipher.unwrap(plaintext, "AESWrap", Cipher.SECRET_KEY).getEncoded(); + } + + } + + class AesKwEncryptor implements ICryptoTransform { + + final Cipher _cipher; + + AesKwEncryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + if (provider == null) { + _cipher = Cipher.getInstance(_cipherName); + } else { + _cipher = Cipher.getInstance(_cipherName, provider); + } + + // The default provider does not support the specification of IV. This + // is guarded by the CreateEncrypter wrapper method and the iv parameter + // can be ignored when using the default provider + if (provider == null ) { + _cipher.init(Cipher.WRAP_MODE, new SecretKeySpec(key, "AES")); + } else { + _cipher.init(Cipher.WRAP_MODE, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv)); + } + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException { + + return _cipher.wrap(new SecretKeySpec(plaintext, "AES")); + } + + } + + protected AesKw(String name) { + super(name); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + return CreateEncryptor(key, null, null); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + return CreateEncryptor(key, null, provider); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + return CreateEncryptor(key, iv, null); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key"); + } + + if (key.length != 128 >> 3 && key.length != 192 >> 3 && key.length != 256 >> 3) { + throw new IllegalArgumentException("key length must be 128, 192 or 256 bits"); + } + + if (iv != null ) { + // iv length must be 64 bits + if ( iv.length != 8) { + throw new IllegalArgumentException("iv length must be 64 bits"); + } + // iv cannot be specified with the default provider + if (provider == null) { + throw new IllegalArgumentException("user specified iv is not supported with the default provider"); + } + } + + return new AesKwEncryptor(key, iv == null ? _defaultIv : iv, provider); + + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + return CreateDecryptor(key, null, null); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + return CreateDecryptor(key, null, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + return CreateDecryptor(key, iv, null); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key"); + } + + if (key.length != 128 >> 3 && key.length != 192 >> 3 && key.length != 256 >> 3) { + throw new IllegalArgumentException("key length must be 128, 192 or 256 bits"); + } + + + if (iv != null ) { + // iv length must be 64 bits + if ( iv.length != 8) { + throw new IllegalArgumentException("iv length must be 64 bits"); + } + // iv cannot be specified with the default provider + if (provider == null) { + throw new IllegalArgumentException("user specified iv is not supported with the default provider"); + } + } + + return new AesKwDecryptor(key, iv == null ? _defaultIv : iv, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw128.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw128.java new file mode 100644 index 0000000000000..d5696f5998f3f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw128.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.util.Arrays; + +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; + +public final class AesKw128 extends AesKw { + + public static final String ALGORITHM_NAME = "A128KW"; + + static final int KeySizeInBytes = 128 >> 3; + + public AesKw128() { + super(ALGORITHM_NAME); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 128 bits long"); + } + + return super.CreateEncryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 128 bits long"); + } + + return super.CreateDecryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw192.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw192.java new file mode 100644 index 0000000000000..43225d8e080dd --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw192.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.util.Arrays; + +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; + +public final class AesKw192 extends AesKw { + + public static final String ALGORITHM_NAME = "A192KW"; + + static final int KeySizeInBytes = 192 >> 3; + + public AesKw192() { + super(ALGORITHM_NAME); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 192 bits long"); + } + + return super.CreateEncryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 192 bits long"); + } + + return super.CreateDecryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw256.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw256.java new file mode 100644 index 0000000000000..b2b514713c96f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/AesKw256.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.util.Arrays; + +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; + +public final class AesKw256 extends AesKw { + + public static final String ALGORITHM_NAME = "A256KW"; + + static final int KeySizeInBytes = 256 >> 3; + + public AesKw256() { + super(ALGORITHM_NAME); + } + + @Override + public ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 256 bits long"); + } + + return super.CreateEncryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { + + if (key == null) { + throw new IllegalArgumentException("key must not be null"); + } + + if (key.length < KeySizeInBytes) { + throw new IllegalArgumentException("key must be at least 256 bits long"); + } + + return super.CreateDecryptor(Arrays.copyOfRange(key, 0, KeySizeInBytes), iv, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Ecdsa.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Ecdsa.java new file mode 100644 index 0000000000000..a13fa07679979 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Ecdsa.java @@ -0,0 +1,54 @@ +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.GeneralSecurityException; +import java.security.KeyPair; +import java.security.Provider; +import java.security.Signature; + +import com.microsoft.azure.keyvault.cryptography.AsymmetricSignatureAlgorithm; +import com.microsoft.azure.keyvault.cryptography.ISignatureTransform; + +public abstract class Ecdsa extends AsymmetricSignatureAlgorithm { + + protected Ecdsa() { + super("NONEwithEDCSA"); + } + + public ISignatureTransform createSignatureTransform(KeyPair key, Provider provider) { + return new EcdsaSignatureTransform(key, provider); + } + + abstract void checkDigestLength(byte[] digest); + + + class EcdsaSignatureTransform implements ISignatureTransform { + private final String ALGORITHM = "NONEwithECDSA"; + private final KeyPair _keyPair; + + private final Provider _provider; + + public EcdsaSignatureTransform(KeyPair keyPair, Provider provider) { + _keyPair = keyPair; + _provider = provider; + } + + @Override + public byte[] sign(byte[] digest) throws GeneralSecurityException { + checkDigestLength(digest); + Signature signature = Signature.getInstance(ALGORITHM, _provider); + signature.initSign(_keyPair.getPrivate()); + signature.update(digest); + return signature.sign(); + } + + @Override + public boolean verify(byte[] digest, byte[] signature) throws GeneralSecurityException { + Signature verify = Signature.getInstance(ALGORITHM, _provider); + checkDigestLength(digest); + verify.initVerify(_keyPair.getPublic()); + verify.update(digest); + return verify.verify(signature); + } + + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256.java new file mode 100644 index 0000000000000..c9ae074fbb561 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256.java @@ -0,0 +1,12 @@ +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Es256 extends Ecdsa { + public final static String ALGORITHM_NAME = "SHA256withECDSA"; + + @Override + public void checkDigestLength(byte[] digest) { + if (digest.length != 32) { + throw new IllegalArgumentException("Invalid digest length."); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256k.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256k.java new file mode 100644 index 0000000000000..b788979f2b26a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es256k.java @@ -0,0 +1,12 @@ +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Es256k extends Ecdsa { + public final static String ALGORITHM_NAME = "NONEwithECDSA"; + + @Override + public void checkDigestLength(byte[] digest) { + if (digest.length != 32) { + throw new IllegalArgumentException("Invalid digest length."); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es384.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es384.java new file mode 100644 index 0000000000000..7785fdbda61ab --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es384.java @@ -0,0 +1,13 @@ +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Es384 extends Ecdsa { + + public final static String ALGORITHM_NAME = "SHA384withECDSA"; + + @Override + public void checkDigestLength(byte[] digest) { + if (digest.length != 48) { + throw new IllegalArgumentException("Invalid digest length."); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es512.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es512.java new file mode 100644 index 0000000000000..32fdd37699517 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Es512.java @@ -0,0 +1,13 @@ +package com.microsoft.azure.keyvault.cryptography.algorithms; + +public class Es512 extends Ecdsa { + + public final static String ALGORITHM_NAME = "SHA512withECDSA"; + + @Override + public void checkDigestLength(byte[] digest) { + if (digest.length != 64) { + throw new IllegalArgumentException("Invalid digest length."); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rs256.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rs256.java new file mode 100644 index 0000000000000..e443398bf0402 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rs256.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; + +import com.microsoft.azure.keyvault.cryptography.ByteExtensions; +import com.microsoft.azure.keyvault.cryptography.ISignatureTransform; + +/** + * + */ +public class Rs256 extends RsaSignature { + + static final String RsaNone = "RSA/ECB/PKCS1Padding"; + + class Rs256SignatureTransform implements ISignatureTransform { + + private final KeyPair _keyPair; + private final int _emLen; + + Rs256SignatureTransform(KeyPair keyPair) { + _keyPair = keyPair; + + BigInteger modulus = ((RSAPublicKey)_keyPair.getPublic()).getModulus(); + + _emLen = getOctetLength( modulus.bitLength() ); + + } + + @Override + public byte[] sign(byte[] digest) throws NoSuchAlgorithmException { + // Signing isn't just a case of encrypting the digest, there is much more to do. + // For details of the algorithm, see https://tools.ietf.org/html/rfc3447#section-8.2 + + if ( _keyPair.getPrivate() == null ) { + // TODO + } + + // Construct the encoded message + byte[] EM = EMSA_PKCS1_V1_5_ENCODE_HASH(digest, _emLen, "SHA-256"); + + // Convert to integer message + BigInteger s = OS2IP(EM); + + // RSASP1(s) + s = RSASP1((RSAPrivateKey)_keyPair.getPrivate(), s); + + // Convert to octet sequence + return I2OSP(s, _emLen ); + } + + @Override + public boolean verify(byte[] digest, byte[] signature) throws NoSuchAlgorithmException { + + if ( signature.length != _emLen ) { + throw new IllegalArgumentException( "invalid signature length"); + } + + // Convert to integer signature + BigInteger s = OS2IP(signature); + + // Convert integer message + BigInteger m = RSAVP1((RSAPublicKey)_keyPair.getPublic(), s); + + byte[] EM = I2OSP(m, _emLen ); + byte[] EM2 = EMSA_PKCS1_V1_5_ENCODE_HASH(digest, _emLen, "SHA-256"); + + // Use constant time compare + return ByteExtensions.sequenceEqualConstantTime(EM, EM2); + } + + } + + public final static String ALGORITHM_NAME = "RS256"; + + public Rs256() { + super(ALGORITHM_NAME); + } + + @Override + public ISignatureTransform createSignatureTransform(KeyPair keyPair) { + + return new Rs256SignatureTransform(keyPair); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rsa15.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rsa15.java new file mode 100644 index 0000000000000..18ea8d28514fd --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Rsa15.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; + +public final class Rsa15 extends RsaEncryption { + + class Rsa15Decryptor implements ICryptoTransform { + + private final Cipher _cipher; + + Rsa15Decryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + // Create a cipher object using the provider, if specified + if (provider == null) { + _cipher = Cipher.getInstance(RSA15); + } else { + _cipher = Cipher.getInstance(RSA15, provider); + } + + // encrypt the plain text using the public key + _cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate()); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + + return _cipher.doFinal(plaintext); + } + + } + + class Rsa15Encryptor implements ICryptoTransform { + + private final Cipher _cipher; + + Rsa15Encryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + // Create a cipher object using the provider, if specified + if (provider == null) { + _cipher = Cipher.getInstance(RSA15); + } else { + _cipher = Cipher.getInstance(RSA15, provider); + } + + // encrypt the plain text using the public key + _cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + + return _cipher.doFinal(plaintext); + } + + } + + final static String RSA15 = "RSA/ECB/PKCS1Padding"; + + public final static String ALGORITHM_NAME = "RSA1_5"; + + public Rsa15() { + super(ALGORITHM_NAME); + } + + @Override + public ICryptoTransform CreateEncryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return CreateEncryptor(keyPair, null); + } + + @Override + public ICryptoTransform CreateEncryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return new Rsa15Encryptor(keyPair, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return CreateDecryptor(keyPair, null); + } + + @Override + public ICryptoTransform CreateDecryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return new Rsa15Decryptor(keyPair, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaEncryption.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaEncryption.java new file mode 100644 index 0000000000000..83343057aa55a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaEncryption.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import com.microsoft.azure.keyvault.cryptography.AsymmetricEncryptionAlgorithm; + +public abstract class RsaEncryption extends AsymmetricEncryptionAlgorithm { + + protected RsaEncryption(String name) { + super(name); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaOaep.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaOaep.java new file mode 100644 index 0000000000000..38c3e4131231b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaOaep.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; + +public final class RsaOaep extends RsaEncryption { + + class RsaOaepDecryptor implements ICryptoTransform { + + private final Cipher _cipher; + + RsaOaepDecryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + // Create a cipher object using the provider, if specified + if (provider == null) { + _cipher = Cipher.getInstance(RSAOAEP); + } else { + _cipher = Cipher.getInstance(RSAOAEP, provider); + } + + // encrypt the plain text using the public key + _cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate()); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + + return _cipher.doFinal(plaintext); + } + + } + + class RsaOaepEncryptor implements ICryptoTransform { + + private final Cipher _cipher; + + RsaOaepEncryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + // Create a cipher object using the provider, if specified + if (provider == null) { + _cipher = Cipher.getInstance(RSAOAEP); + } else { + _cipher = Cipher.getInstance(RSAOAEP, provider); + } + + // encrypt the plain text using the public key + _cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); + } + + @Override + public byte[] doFinal(byte[] plaintext) throws IllegalBlockSizeException, BadPaddingException { + + return _cipher.doFinal(plaintext); + } + + } + + final static String RSAOAEP = "RSA/ECB/OAEPWithSHA1AndMGF1Padding"; + + public final static String ALGORITHM_NAME = "RSA-OAEP"; + + public RsaOaep() { + super(ALGORITHM_NAME); + } + + @Override + public ICryptoTransform CreateEncryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return CreateEncryptor(keyPair, null); + } + + @Override + public ICryptoTransform CreateEncryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + return new RsaOaepEncryptor(keyPair, provider); + } + + @Override + public ICryptoTransform CreateDecryptor(KeyPair keyPair) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + return CreateDecryptor(keyPair, null); + } + + @Override + public ICryptoTransform CreateDecryptor(KeyPair keyPair, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException { + + return new RsaOaepDecryptor(keyPair, provider); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaSignature.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaSignature.java new file mode 100644 index 0000000000000..2e5a47548be91 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/RsaSignature.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.cryptography.algorithms; + +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.Arrays; + +import com.microsoft.azure.keyvault.cryptography.AsymmetricSignatureAlgorithm; +import com.microsoft.azure.keyvault.cryptography.ISignatureTransform; +import com.microsoft.azure.keyvault.cryptography.Strings; + +public abstract class RsaSignature extends AsymmetricSignatureAlgorithm { + + private static final BigInteger twoFiveSix = new BigInteger("256"); + private static final byte[] sha256Prefix = new byte[] { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, (byte) 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }; + + protected RsaSignature(String name) { + super(name); + } + + protected int getOctetLength(int bits) { + return ( bits % 8 > 0 ) ? bits >> 3 + 1 : bits >> 3; + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-4.2 + */ + protected BigInteger OS2IP(byte[] x) { + + if ( x == null || x.length == 0 ) { + throw new IllegalArgumentException("x"); + } + + return new BigInteger(1,x); + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-4.1 + */ + protected byte[] I2OSP(BigInteger x, int xLen) { + + if ( x == null ) { + throw new IllegalArgumentException("x"); + } + + if ( xLen <= 0 ) { + throw new IllegalArgumentException("xLen"); + } + + if ( x.compareTo( twoFiveSix.pow(xLen) ) == 1 ) { + throw new IllegalArgumentException("integer too large"); + } + + // Even if x is less than 256^xLen, sometiems x.toByteArray() returns 257 bytes with leading zero + byte[] bigEndianBytes = x.toByteArray(); + byte[] bytes; + if (bigEndianBytes.length == 257 && bigEndianBytes[0] == 0) { + bytes = Arrays.copyOfRange(bigEndianBytes, 1, 257); + } else { + bytes = bigEndianBytes; + } + + if ( bytes.length > xLen ) { + throw new IllegalArgumentException("integer too large"); + } + + byte[] result = new byte[xLen]; + + System.arraycopy(bytes, 0, result, xLen - bytes.length, bytes.length); + + return result; + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-5.2.1 + */ + protected BigInteger RSASP1(RSAPrivateKey K, BigInteger m) { + + if ( K == null ) { + throw new IllegalArgumentException("K"); + } + + if ( m == null ) { + throw new IllegalArgumentException("m"); + } + + BigInteger n = K.getModulus(); + BigInteger d = K.getPrivateExponent(); + + if ( m.compareTo(BigInteger.ONE) == -1 || m.compareTo(n) != -1 ) { + throw new IllegalArgumentException("message representative out of range"); + } + + return m.modPow(d, n); + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-5.2.2 + */ + protected BigInteger RSAVP1(RSAPublicKey K, BigInteger s) { + + if ( K == null ) { + throw new IllegalArgumentException("K"); + } + + if ( s == null ) { + throw new IllegalArgumentException("s"); + } + BigInteger n = K.getModulus(); + BigInteger e = K.getPublicExponent(); + + if ( s.compareTo(BigInteger.ONE) == -1 || s.compareTo(n) != -1 ) { + throw new IllegalArgumentException("message representative out of range"); + } + + return s.modPow(e, n); + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-9.2 + */ + protected byte[] EMSA_PKCS1_V1_5_ENCODE(byte[] m, int emLen, String algorithm) throws NoSuchAlgorithmException { + + // Check m + if ( m == null || m.length == 0 ) { + throw new IllegalArgumentException("m"); + } + + MessageDigest messageDigest = null; + + // Check algorithm + if ( Strings.isNullOrWhiteSpace(algorithm) ) { + throw new IllegalArgumentException("algorithm"); + } + + // Only supported algorithms + if ( algorithm.equals("SHA-256") ) { + + // Initialize digest + messageDigest = MessageDigest.getInstance("SHA-256"); + } else { + throw new IllegalArgumentException("algorithm"); + } + + // Hash the message + byte[] digest = messageDigest.digest(m); + + // Construct T, the DER encoded DigestInfo structure + return EMSA_PKCS1_V1_5_ENCODE_HASH(digest, emLen, algorithm); + } + + /* + * See https://tools.ietf.org/html/rfc3447#section-9.2 + */ + protected byte[] EMSA_PKCS1_V1_5_ENCODE_HASH(byte[] h, int emLen, String algorithm) throws NoSuchAlgorithmException { + + // Check m + if ( h == null || h.length == 0 ) { + throw new IllegalArgumentException("m"); + } + + byte[] algorithmPrefix = null; + + // Check algorithm + if ( Strings.isNullOrWhiteSpace(algorithm) ) { + throw new IllegalArgumentException("algorithm"); + } + + // Only supported algorithms + if ( algorithm.equals("SHA-256") ) { + + // Initialize prefix and digest + algorithmPrefix = sha256Prefix; + + if ( h.length != 32 ) { + throw new IllegalArgumentException("h is incorrect length for SHA-256"); + } + } else { + throw new IllegalArgumentException("algorithm"); + } + + + // Construct T, the DER encoded DigestInfo structure + byte[] T = new byte[algorithmPrefix.length + h.length]; + + System.arraycopy(algorithmPrefix, 0, T, 0, algorithmPrefix.length); + System.arraycopy(h, 0, T, algorithmPrefix.length, h.length); + + if ( emLen < T.length + 11 ) { + throw new IllegalArgumentException("intended encoded message length too short"); + } + + // Construct PS + byte[] PS = new byte[emLen - T.length - 3]; + + for ( int i = 0; i < PS.length; i++ ) PS[i] = (byte) 0xff; + + // Construct EM + byte[] EM = new byte[PS.length + T.length + 3]; + + EM[0] = 0x00; EM[1] = 0x01; EM[PS.length + 2] = 0x00; + + System.arraycopy(PS, 0, EM, 2, PS.length); + System.arraycopy(T, 0, EM, PS.length + 3, T.length); + + return EM; + } + + public abstract ISignatureTransform createSignatureTransform(KeyPair keyPair); +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/package-info.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/package-info.java new file mode 100644 index 0000000000000..f3101db3f04c0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains cryptographic functions and implementations. + */ +package com.microsoft.azure.keyvault.cryptography.algorithms; diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/package-info.java b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/package-info.java new file mode 100644 index 0000000000000..5492e8c677615 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains cryptographic functions and implementations + * of RSA and symmetric keys that conform with the IKey interface. + */ +package com.microsoft.azure.keyvault.cryptography; diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcBCProviderTest.java new file mode 100644 index 0000000000000..043b2b54808be --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcBCProviderTest.java @@ -0,0 +1,18 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; + +import org.junit.Before; + +public class AesCbcBCProviderTest extends AesCbcTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaBCProviderTest.java new file mode 100644 index 0000000000000..5c7e07a273474 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaBCProviderTest.java @@ -0,0 +1,17 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; + +import org.junit.Before; + +public class AesCbcHmacShaBCProviderTest extends AesCbcHmacShaTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaTest.java new file mode 100644 index 0000000000000..ef588b4830e9c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcHmacShaTest.java @@ -0,0 +1,267 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; + +import java.security.Provider; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.cryptography.IAuthenticatedCryptoTransform; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128CbcHmacSha256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes192CbcHmacSha384; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes256CbcHmacSha512; + +public class AesCbcHmacShaTest { + + private Provider _provider = null; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + setProvider(null); + } + + @After + public void tearDown() throws Exception { + } + + protected void setProvider(Provider provider) { + _provider = null; + } + + @Test + public void testAes128CbcHmacSha256() { + // Arrange: These values are taken from Appendix B of the JWE specification at + // https://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-40#appendix-B + byte[] K = { (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04, (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x08, (byte)0x09, (byte)0x0a, (byte)0x0b, (byte)0x0c, (byte)0x0d, (byte)0x0e, (byte)0x0f, + (byte)0x10, (byte)0x11, (byte)0x12, (byte)0x13, (byte)0x14, (byte)0x15, (byte)0x16, (byte)0x17, (byte)0x18, (byte)0x19, (byte)0x1a, (byte)0x1b, (byte)0x1c, (byte)0x1d, (byte)0x1e, (byte)0x1f }; + byte[] P = { (byte)0x41, (byte)0x20, (byte)0x63, (byte)0x69, (byte)0x70, (byte)0x68, (byte)0x65, (byte)0x72, (byte)0x20, (byte)0x73, (byte)0x79, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x6d, (byte)0x20, + (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x6e, (byte)0x6f, (byte)0x74, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x72, (byte)0x65, (byte)0x71, (byte)0x75, + (byte)0x69, (byte)0x72, (byte)0x65, (byte)0x64, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x72, (byte)0x65, + (byte)0x74, (byte)0x2c, (byte)0x20, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x69, (byte)0x74, (byte)0x20, (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x62, + (byte)0x65, (byte)0x20, (byte)0x61, (byte)0x62, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x66, (byte)0x61, (byte)0x6c, (byte)0x6c, (byte)0x20, (byte)0x69, + (byte)0x6e, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x68, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x73, (byte)0x20, (byte)0x6f, (byte)0x66, + (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x65, (byte)0x6e, (byte)0x65, (byte)0x6d, (byte)0x79, (byte)0x20, (byte)0x77, (byte)0x69, (byte)0x74, (byte)0x68, (byte)0x6f, + (byte)0x75, (byte)0x74, (byte)0x20, (byte)0x69, (byte)0x6e, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x76, (byte)0x65, (byte)0x6e, (byte)0x69, (byte)0x65, (byte)0x6e, (byte)0x63, (byte)0x65 }; + byte[] IV = { (byte)0x1a, (byte)0xf3, (byte)0x8c, (byte)0x2d, (byte)0xc2, (byte)0xb9, (byte)0x6f, (byte)0xfd, (byte)0xd8, (byte)0x66, (byte)0x94, (byte)0x09, (byte)0x23, (byte)0x41, (byte)0xbc, (byte)0x04 }; + byte[] A = { (byte)0x54, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x70, (byte)0x72, (byte)0x69, (byte)0x6e, (byte)0x63, + (byte)0x69, (byte)0x70, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x6f, (byte)0x66, (byte)0x20, (byte)0x41, (byte)0x75, (byte)0x67, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x20, + (byte)0x4b, (byte)0x65, (byte)0x72, (byte)0x63, (byte)0x6b, (byte)0x68, (byte)0x6f, (byte)0x66, (byte)0x66, (byte)0x73 }; + byte[] E = { (byte)0xc8, (byte)0x0e, (byte)0xdf, (byte)0xa3, (byte)0x2d, (byte)0xdf, (byte)0x39, (byte)0xd5, (byte)0xef, (byte)0x00, (byte)0xc0, (byte)0xb4, (byte)0x68, (byte)0x83, (byte)0x42, (byte)0x79, + (byte)0xa2, (byte)0xe4, (byte)0x6a, (byte)0x1b, (byte)0x80, (byte)0x49, (byte)0xf7, (byte)0x92, (byte)0xf7, (byte)0x6b, (byte)0xfe, (byte)0x54, (byte)0xb9, (byte)0x03, (byte)0xa9, (byte)0xc9, + (byte)0xa9, (byte)0x4a, (byte)0xc9, (byte)0xb4, (byte)0x7a, (byte)0xd2, (byte)0x65, (byte)0x5c, (byte)0x5f, (byte)0x10, (byte)0xf9, (byte)0xae, (byte)0xf7, (byte)0x14, (byte)0x27, (byte)0xe2, + (byte)0xfc, (byte)0x6f, (byte)0x9b, (byte)0x3f, (byte)0x39, (byte)0x9a, (byte)0x22, (byte)0x14, (byte)0x89, (byte)0xf1, (byte)0x63, (byte)0x62, (byte)0xc7, (byte)0x03, (byte)0x23, (byte)0x36, + (byte)0x09, (byte)0xd4, (byte)0x5a, (byte)0xc6, (byte)0x98, (byte)0x64, (byte)0xe3, (byte)0x32, (byte)0x1c, (byte)0xf8, (byte)0x29, (byte)0x35, (byte)0xac, (byte)0x40, (byte)0x96, (byte)0xc8, + (byte)0x6e, (byte)0x13, (byte)0x33, (byte)0x14, (byte)0xc5, (byte)0x40, (byte)0x19, (byte)0xe8, (byte)0xca, (byte)0x79, (byte)0x80, (byte)0xdf, (byte)0xa4, (byte)0xb9, (byte)0xcf, (byte)0x1b, + (byte)0x38, (byte)0x4c, (byte)0x48, (byte)0x6f, (byte)0x3a, (byte)0x54, (byte)0xc5, (byte)0x10, (byte)0x78, (byte)0x15, (byte)0x8e, (byte)0xe5, (byte)0xd7, (byte)0x9d, (byte)0xe5, (byte)0x9f, + (byte)0xbd, (byte)0x34, (byte)0xd8, (byte)0x48, (byte)0xb3, (byte)0xd6, (byte)0x95, (byte)0x50, (byte)0xa6, (byte)0x76, (byte)0x46, (byte)0x34, (byte)0x44, (byte)0x27, (byte)0xad, (byte)0xe5, + (byte)0x4b, (byte)0x88, (byte)0x51, (byte)0xff, (byte)0xb5, (byte)0x98, (byte)0xf7, (byte)0xf8, (byte)0x00, (byte)0x74, (byte)0xb9, (byte)0x47, (byte)0x3c, (byte)0x82, (byte)0xe2, (byte)0xdb }; + byte[] T = { (byte)0x65, (byte)0x2c, (byte)0x3f, (byte)0xa3, (byte)0x6b, (byte)0x0a, (byte)0x7c, (byte)0x5b, (byte)0x32, (byte)0x19, (byte)0xfa, (byte)0xb3, (byte)0xa3, (byte)0x0b, (byte)0xc1, (byte)0xc4 }; + + Aes128CbcHmacSha256 algo = new Aes128CbcHmacSha256(); + + IAuthenticatedCryptoTransform transform = null; + + byte[] encrypted = null; + byte[] tag = null; + + try { + transform = (IAuthenticatedCryptoTransform) algo.CreateEncryptor(K, IV, A, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = transform.doFinal(P); + tag = transform.getTag(); + + assertArrayEquals(E, encrypted); + assertArrayEquals(T, tag); + + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + transform = (IAuthenticatedCryptoTransform)algo.CreateDecryptor(K, IV, A, T, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = transform.doFinal(encrypted); + tag = transform.getTag(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(P, decrypted); + assertArrayEquals(T, tag); + } + + + @Test + public void testAes192CbcHmacSha384() { + // Arrange: These values are taken from Appendix B of the JWE specification at + // https://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-40#appendix-B + byte[] K = { (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04, (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x08, (byte)0x09, (byte)0x0a, (byte)0x0b, (byte)0x0c, (byte)0x0d, (byte)0x0e, (byte)0x0f, + (byte)0x10, (byte)0x11, (byte)0x12, (byte)0x13, (byte)0x14, (byte)0x15, (byte)0x16, (byte)0x17, (byte)0x18, (byte)0x19, (byte)0x1a, (byte)0x1b, (byte)0x1c, (byte)0x1d, (byte)0x1e, (byte)0x1f, + (byte)0x20, (byte)0x21, (byte)0x22, (byte)0x23, (byte)0x24, (byte)0x25, (byte)0x26, (byte)0x27, (byte)0x28, (byte)0x29, (byte)0x2a, (byte)0x2b, (byte)0x2c, (byte)0x2d, (byte)0x2e, (byte)0x2f }; + byte[] P = { (byte)0x41, (byte)0x20, (byte)0x63, (byte)0x69, (byte)0x70, (byte)0x68, (byte)0x65, (byte)0x72, (byte)0x20, (byte)0x73, (byte)0x79, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x6d, (byte)0x20, + (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x6e, (byte)0x6f, (byte)0x74, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x72, (byte)0x65, (byte)0x71, (byte)0x75, + (byte)0x69, (byte)0x72, (byte)0x65, (byte)0x64, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x72, (byte)0x65, + (byte)0x74, (byte)0x2c, (byte)0x20, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x69, (byte)0x74, (byte)0x20, (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x62, + (byte)0x65, (byte)0x20, (byte)0x61, (byte)0x62, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x66, (byte)0x61, (byte)0x6c, (byte)0x6c, (byte)0x20, (byte)0x69, + (byte)0x6e, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x68, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x73, (byte)0x20, (byte)0x6f, (byte)0x66, + (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x65, (byte)0x6e, (byte)0x65, (byte)0x6d, (byte)0x79, (byte)0x20, (byte)0x77, (byte)0x69, (byte)0x74, (byte)0x68, (byte)0x6f, + (byte)0x75, (byte)0x74, (byte)0x20, (byte)0x69, (byte)0x6e, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x76, (byte)0x65, (byte)0x6e, (byte)0x69, (byte)0x65, (byte)0x6e, (byte)0x63, (byte)0x65 }; + byte[] IV = { (byte)0x1a, (byte)0xf3, (byte)0x8c, (byte)0x2d, (byte)0xc2, (byte)0xb9, (byte)0x6f, (byte)0xfd, (byte)0xd8, (byte)0x66, (byte)0x94, (byte)0x09, (byte)0x23, (byte)0x41, (byte)0xbc, (byte)0x04 }; + byte[] A = { (byte)0x54, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x70, (byte)0x72, (byte)0x69, (byte)0x6e, (byte)0x63, + (byte)0x69, (byte)0x70, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x6f, (byte)0x66, (byte)0x20, (byte)0x41, (byte)0x75, (byte)0x67, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x20, + (byte)0x4b, (byte)0x65, (byte)0x72, (byte)0x63, (byte)0x6b, (byte)0x68, (byte)0x6f, (byte)0x66, (byte)0x66, (byte)0x73 }; + byte[] E = { (byte)0xea, (byte)0x65, (byte)0xda, (byte)0x6b, (byte)0x59, (byte)0xe6, (byte)0x1e, (byte)0xdb, (byte)0x41, (byte)0x9b, (byte)0xe6, (byte)0x2d, (byte)0x19, (byte)0x71, (byte)0x2a, (byte)0xe5, + (byte)0xd3, (byte)0x03, (byte)0xee, (byte)0xb5, (byte)0x00, (byte)0x52, (byte)0xd0, (byte)0xdf, (byte)0xd6, (byte)0x69, (byte)0x7f, (byte)0x77, (byte)0x22, (byte)0x4c, (byte)0x8e, (byte)0xdb, + (byte)0x00, (byte)0x0d, (byte)0x27, (byte)0x9b, (byte)0xdc, (byte)0x14, (byte)0xc1, (byte)0x07, (byte)0x26, (byte)0x54, (byte)0xbd, (byte)0x30, (byte)0x94, (byte)0x42, (byte)0x30, (byte)0xc6, + (byte)0x57, (byte)0xbe, (byte)0xd4, (byte)0xca, (byte)0x0c, (byte)0x9f, (byte)0x4a, (byte)0x84, (byte)0x66, (byte)0xf2, (byte)0x2b, (byte)0x22, (byte)0x6d, (byte)0x17, (byte)0x46, (byte)0x21, + (byte)0x4b, (byte)0xf8, (byte)0xcf, (byte)0xc2, (byte)0x40, (byte)0x0a, (byte)0xdd, (byte)0x9f, (byte)0x51, (byte)0x26, (byte)0xe4, (byte)0x79, (byte)0x66, (byte)0x3f, (byte)0xc9, (byte)0x0b, + (byte)0x3b, (byte)0xed, (byte)0x78, (byte)0x7a, (byte)0x2f, (byte)0x0f, (byte)0xfc, (byte)0xbf, (byte)0x39, (byte)0x04, (byte)0xbe, (byte)0x2a, (byte)0x64, (byte)0x1d, (byte)0x5c, (byte)0x21, + (byte)0x05, (byte)0xbf, (byte)0xe5, (byte)0x91, (byte)0xba, (byte)0xe2, (byte)0x3b, (byte)0x1d, (byte)0x74, (byte)0x49, (byte)0xe5, (byte)0x32, (byte)0xee, (byte)0xf6, (byte)0x0a, (byte)0x9a, + (byte)0xc8, (byte)0xbb, (byte)0x6c, (byte)0x6b, (byte)0x01, (byte)0xd3, (byte)0x5d, (byte)0x49, (byte)0x78, (byte)0x7b, (byte)0xcd, (byte)0x57, (byte)0xef, (byte)0x48, (byte)0x49, (byte)0x27, + (byte)0xf2, (byte)0x80, (byte)0xad, (byte)0xc9, (byte)0x1a, (byte)0xc0, (byte)0xc4, (byte)0xe7, (byte)0x9c, (byte)0x7b, (byte)0x11, (byte)0xef, (byte)0xc6, (byte)0x00, (byte)0x54, (byte)0xe3 }; + byte[] T = { (byte)0x84, (byte)0x90, (byte)0xac, (byte)0x0e, (byte)0x58, (byte)0x94, (byte)0x9b, (byte)0xfe, (byte)0x51, (byte)0x87, (byte)0x5d, (byte)0x73, (byte)0x3f, (byte)0x93, (byte)0xac, (byte)0x20, + (byte)0x75, (byte)0x16, (byte)0x80, (byte)0x39, (byte)0xcc, (byte)0xc7, (byte)0x33, (byte)0xd7 }; + + Aes192CbcHmacSha384 algo = new Aes192CbcHmacSha384(); + + IAuthenticatedCryptoTransform transform = null; + + byte[] encrypted = null; + byte[] tag = null; + + try { + transform = (IAuthenticatedCryptoTransform) algo.CreateEncryptor(K, IV, A, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = transform.doFinal(P); + tag = transform.getTag(); + + assertArrayEquals(E, encrypted); + assertArrayEquals(T, tag); + + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + transform = (IAuthenticatedCryptoTransform)algo.CreateDecryptor(K, IV, A, T, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = transform.doFinal(encrypted); + tag = transform.getTag(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(P, decrypted); + assertArrayEquals(T, tag); + } + @Test + public void testAes256CbcHmacSha512() { + // Arrange: These values are taken from Appendix B of the JWE specification at + // https://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-40#appendix-B + byte[] K = { (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04, (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x08, (byte)0x09, (byte)0x0a, (byte)0x0b, (byte)0x0c, (byte)0x0d, (byte)0x0e, (byte)0x0f, + (byte)0x10, (byte)0x11, (byte)0x12, (byte)0x13, (byte)0x14, (byte)0x15, (byte)0x16, (byte)0x17, (byte)0x18, (byte)0x19, (byte)0x1a, (byte)0x1b, (byte)0x1c, (byte)0x1d, (byte)0x1e, (byte)0x1f, + (byte)0x20, (byte)0x21, (byte)0x22, (byte)0x23, (byte)0x24, (byte)0x25, (byte)0x26, (byte)0x27, (byte)0x28, (byte)0x29, (byte)0x2a, (byte)0x2b, (byte)0x2c, (byte)0x2d, (byte)0x2e, (byte)0x2f, + (byte)0x30, (byte)0x31, (byte)0x32, (byte)0x33, (byte)0x34, (byte)0x35, (byte)0x36, (byte)0x37, (byte)0x38, (byte)0x39, (byte)0x3a, (byte)0x3b, (byte)0x3c, (byte)0x3d, (byte)0x3e, (byte)0x3f }; + byte[] P = { (byte)0x41, (byte)0x20, (byte)0x63, (byte)0x69, (byte)0x70, (byte)0x68, (byte)0x65, (byte)0x72, (byte)0x20, (byte)0x73, (byte)0x79, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x6d, (byte)0x20, + (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x6e, (byte)0x6f, (byte)0x74, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x72, (byte)0x65, (byte)0x71, (byte)0x75, + (byte)0x69, (byte)0x72, (byte)0x65, (byte)0x64, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x62, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x72, (byte)0x65, + (byte)0x74, (byte)0x2c, (byte)0x20, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x69, (byte)0x74, (byte)0x20, (byte)0x6d, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x20, (byte)0x62, + (byte)0x65, (byte)0x20, (byte)0x61, (byte)0x62, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x66, (byte)0x61, (byte)0x6c, (byte)0x6c, (byte)0x20, (byte)0x69, + (byte)0x6e, (byte)0x74, (byte)0x6f, (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x68, (byte)0x61, (byte)0x6e, (byte)0x64, (byte)0x73, (byte)0x20, (byte)0x6f, (byte)0x66, + (byte)0x20, (byte)0x74, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x65, (byte)0x6e, (byte)0x65, (byte)0x6d, (byte)0x79, (byte)0x20, (byte)0x77, (byte)0x69, (byte)0x74, (byte)0x68, (byte)0x6f, + (byte)0x75, (byte)0x74, (byte)0x20, (byte)0x69, (byte)0x6e, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x76, (byte)0x65, (byte)0x6e, (byte)0x69, (byte)0x65, (byte)0x6e, (byte)0x63, (byte)0x65 }; + byte[] IV = { (byte)0x1a, (byte)0xf3, (byte)0x8c, (byte)0x2d, (byte)0xc2, (byte)0xb9, (byte)0x6f, (byte)0xfd, (byte)0xd8, (byte)0x66, (byte)0x94, (byte)0x09, (byte)0x23, (byte)0x41, (byte)0xbc, (byte)0x04 }; + byte[] A = { (byte)0x54, (byte)0x68, (byte)0x65, (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x63, (byte)0x6f, (byte)0x6e, (byte)0x64, (byte)0x20, (byte)0x70, (byte)0x72, (byte)0x69, (byte)0x6e, (byte)0x63, + (byte)0x69, (byte)0x70, (byte)0x6c, (byte)0x65, (byte)0x20, (byte)0x6f, (byte)0x66, (byte)0x20, (byte)0x41, (byte)0x75, (byte)0x67, (byte)0x75, (byte)0x73, (byte)0x74, (byte)0x65, (byte)0x20, + (byte)0x4b, (byte)0x65, (byte)0x72, (byte)0x63, (byte)0x6b, (byte)0x68, (byte)0x6f, (byte)0x66, (byte)0x66, (byte)0x73 }; + byte[] E = { (byte)0x4a, (byte)0xff, (byte)0xaa, (byte)0xad, (byte)0xb7, (byte)0x8c, (byte)0x31, (byte)0xc5, (byte)0xda, (byte)0x4b, (byte)0x1b, (byte)0x59, (byte)0x0d, (byte)0x10, (byte)0xff, (byte)0xbd, + (byte)0x3d, (byte)0xd8, (byte)0xd5, (byte)0xd3, (byte)0x02, (byte)0x42, (byte)0x35, (byte)0x26, (byte)0x91, (byte)0x2d, (byte)0xa0, (byte)0x37, (byte)0xec, (byte)0xbc, (byte)0xc7, (byte)0xbd, + (byte)0x82, (byte)0x2c, (byte)0x30, (byte)0x1d, (byte)0xd6, (byte)0x7c, (byte)0x37, (byte)0x3b, (byte)0xcc, (byte)0xb5, (byte)0x84, (byte)0xad, (byte)0x3e, (byte)0x92, (byte)0x79, (byte)0xc2, + (byte)0xe6, (byte)0xd1, (byte)0x2a, (byte)0x13, (byte)0x74, (byte)0xb7, (byte)0x7f, (byte)0x07, (byte)0x75, (byte)0x53, (byte)0xdf, (byte)0x82, (byte)0x94, (byte)0x10, (byte)0x44, (byte)0x6b, + (byte)0x36, (byte)0xeb, (byte)0xd9, (byte)0x70, (byte)0x66, (byte)0x29, (byte)0x6a, (byte)0xe6, (byte)0x42, (byte)0x7e, (byte)0xa7, (byte)0x5c, (byte)0x2e, (byte)0x08, (byte)0x46, (byte)0xa1, + (byte)0x1a, (byte)0x09, (byte)0xcc, (byte)0xf5, (byte)0x37, (byte)0x0d, (byte)0xc8, (byte)0x0b, (byte)0xfe, (byte)0xcb, (byte)0xad, (byte)0x28, (byte)0xc7, (byte)0x3f, (byte)0x09, (byte)0xb3, + (byte)0xa3, (byte)0xb7, (byte)0x5e, (byte)0x66, (byte)0x2a, (byte)0x25, (byte)0x94, (byte)0x41, (byte)0x0a, (byte)0xe4, (byte)0x96, (byte)0xb2, (byte)0xe2, (byte)0xe6, (byte)0x60, (byte)0x9e, + (byte)0x31, (byte)0xe6, (byte)0xe0, (byte)0x2c, (byte)0xc8, (byte)0x37, (byte)0xf0, (byte)0x53, (byte)0xd2, (byte)0x1f, (byte)0x37, (byte)0xff, (byte)0x4f, (byte)0x51, (byte)0x95, (byte)0x0b, + (byte)0xbe, (byte)0x26, (byte)0x38, (byte)0xd0, (byte)0x9d, (byte)0xd7, (byte)0xa4, (byte)0x93, (byte)0x09, (byte)0x30, (byte)0x80, (byte)0x6d, (byte)0x07, (byte)0x03, (byte)0xb1, (byte)0xf6 }; + byte[] T = { (byte)0x4d, (byte)0xd3, (byte)0xb4, (byte)0xc0, (byte)0x88, (byte)0xa7, (byte)0xf4, (byte)0x5c, (byte)0x21, (byte)0x68, (byte)0x39, (byte)0x64, (byte)0x5b, (byte)0x20, (byte)0x12, (byte)0xbf, + (byte)0x2e, (byte)0x62, (byte)0x69, (byte)0xa8, (byte)0xc5, (byte)0x6a, (byte)0x81, (byte)0x6d, (byte)0xbc, (byte)0x1b, (byte)0x26, (byte)0x77, (byte)0x61, (byte)0x95, (byte)0x5b, (byte)0xc5 }; + + Aes256CbcHmacSha512 algo = new Aes256CbcHmacSha512(); + + IAuthenticatedCryptoTransform transform = null; + + byte[] encrypted = null; + byte[] tag = null; + + try { + transform = (IAuthenticatedCryptoTransform) algo.CreateEncryptor(K, IV, A, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = transform.doFinal(P); + tag = transform.getTag(); + + assertArrayEquals(E, encrypted); + assertArrayEquals(T, tag); + + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + transform = (IAuthenticatedCryptoTransform)algo.CreateDecryptor(K, IV, A, T, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = transform.doFinal(encrypted); + tag = transform.getTag(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(P, decrypted); + assertArrayEquals(T, tag); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcTest.java new file mode 100644 index 0000000000000..7b41487ef9888 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesCbcTest.java @@ -0,0 +1,230 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; + +import java.security.Provider; +import java.util.Arrays; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; +import com.microsoft.azure.keyvault.cryptography.algorithms.Aes128Cbc; + +public class AesCbcTest { + + private Provider _provider = null; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + setProvider(null); + } + + @After + public void tearDown() throws Exception { + } + + protected void setProvider(Provider provider) { + _provider = provider; + } + + @Test + public void testAes128CbcOneBlock() { + // Note that AES128CBC as implemented in this library uses PKCS7 padding mode where the test + // vectors from RFC3602 do not use padding. + byte[] CEK = { 0x06, (byte)0xa9, 0x21, 0x40, 0x36, (byte)0xb8, (byte)0xa1, 0x5b, 0x51, 0x2e, 0x03, (byte)0xd5, 0x34, 0x12, 0x00, 0x06 }; + byte[] PLAIN = "Single block msg".getBytes(); + byte[] IV = { 0x3d, (byte)0xaf, (byte)0xba, 0x42, (byte)0x9d, (byte)0x9e, (byte)0xb4, 0x30, (byte)0xb4, 0x22, (byte)0xda, (byte)0x80, 0x2c, (byte)0x9f, (byte)0xac, 0x41 }; + byte[] ED = { (byte)0xe3, 0x53, 0x77, (byte)0x9c, 0x10, 0x79, (byte)0xae, (byte)0xb8, 0x27, 0x08, (byte)0x94, 0x2d, (byte)0xbe, 0x77, 0x18, 0x1a }; + + Aes128Cbc algo = new Aes128Cbc(); + byte[] encrypted = null; + + ICryptoTransform encryptor = null; + try { + encryptor = algo.CreateEncryptor(CEK, IV, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = encryptor.doFinal(PLAIN); + + // Assert: we only compare the first 16 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(encrypted, 0, 16), ED); + } catch (Exception e) { + fail(e.getMessage()); + } + + ICryptoTransform decryptor = null; + try { + decryptor = algo.CreateDecryptor(CEK, IV, null, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(encrypted); + + // Assert: we only compare the first 16 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(decrypted, 0, 16), PLAIN); + } catch (Exception e) { + fail(e.getMessage()); + } + } + + @Test + public void testAes128CbcTwoBlock() { + // Note that AES128CBC as implemented in this library uses PKCS7 padding mode where the test + // vectors do not use padding. + byte[] CEK = { (byte)0xc2, (byte)0x86, 0x69, 0x6d, (byte)0x88, 0x7c, (byte)0x9a, (byte)0xa0, 0x61, 0x1b, (byte)0xbb, 0x3e, 0x20, 0x25, (byte)0xa4, 0x5a }; + byte[] PLAIN = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + byte[] IV = { 0x56, 0x2e, 0x17, (byte)0x99, 0x6d, 0x09, 0x3d, 0x28, (byte)0xdd, (byte)0xb3, (byte)0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }; + byte[] ED = { (byte)0xd2, (byte)0x96, (byte)0xcd, (byte)0x94, (byte)0xc2, (byte)0xcc, (byte)0xcf, (byte)0x8a, 0x3a, (byte)0x86, 0x30, 0x28, (byte)0xb5, (byte)0xe1, (byte)0xdc, 0x0a, 0x75, (byte)0x86, 0x60, 0x2d, 0x25, 0x3c, (byte)0xff, (byte)0xf9, 0x1b, (byte)0x82, 0x66, (byte)0xbe, (byte)0xa6, (byte)0xd6, 0x1a, (byte)0xb1 }; + + Aes128Cbc algo = new Aes128Cbc(); + byte[] encrypted = null; + + ICryptoTransform encryptor = null; + try { + encryptor = algo.CreateEncryptor(CEK, IV, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = encryptor.doFinal(PLAIN); + + // Assert: we only compare the first 32 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(encrypted, 0, 32), ED); + } catch (Exception e) { + fail(e.getMessage()); + } + + ICryptoTransform decryptor = null; + try { + decryptor = algo.CreateDecryptor(CEK, IV, null, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(encrypted); + + // Assert: we only compare the first 32 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(decrypted, 0, 32), PLAIN); + } catch (Exception e) { + fail(e.getMessage()); + } + } + + @Test + public void testAes128CbcOneBlock_ExcessKeyMaterial() { + // Note that AES128CBC as implemented in this library uses PKCS7 padding mode where the test + // vectors from RFC3602 do not use padding. + byte[] CEK = { 0x06, (byte)0xa9, 0x21, 0x40, 0x36, (byte)0xb8, (byte)0xa1, 0x5b, 0x51, 0x2e, 0x03, (byte)0xd5, 0x34, 0x12, 0x00, 0x06, (byte)0xc2, (byte)0x86, 0x69, 0x6d, (byte)0x88, 0x7c, (byte)0x9a, (byte)0xa0, 0x61, 0x1b, (byte)0xbb, 0x3e, 0x20, 0x25, (byte)0xa4, 0x5a }; + byte[] PLAIN = "Single block msg".getBytes(); + byte[] IV = { 0x3d, (byte)0xaf, (byte)0xba, 0x42, (byte)0x9d, (byte)0x9e, (byte)0xb4, 0x30, (byte)0xb4, 0x22, (byte)0xda, (byte)0x80, 0x2c, (byte)0x9f, (byte)0xac, 0x41 }; + byte[] ED = { (byte)0xe3, 0x53, 0x77, (byte)0x9c, 0x10, 0x79, (byte)0xae, (byte)0xb8, 0x27, 0x08, (byte)0x94, 0x2d, (byte)0xbe, 0x77, 0x18, 0x1a }; + + Aes128Cbc algo = new Aes128Cbc(); + byte[] encrypted = null; + + ICryptoTransform encryptor = null; + try { + encryptor = algo.CreateEncryptor(CEK, IV, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = encryptor.doFinal(PLAIN); + + // Assert: we only compare the first 16 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(encrypted, 0, 16),ED); + } catch (Exception e) { + fail(e.getMessage()); + } + + ICryptoTransform decryptor = null; + try { + decryptor = algo.CreateDecryptor(CEK, IV, null, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(encrypted); + + // Assert: we only compare the first 16 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(decrypted, 0, 16), PLAIN); + } catch (Exception e) { + fail(e.getMessage()); + } + } + + @Test + public void testAes128CbcTwoBlock_ExcessKeyMaterial() { + // Note that AES128CBC as implemented in this library uses PKCS7 padding mode where the test + // vectors do not use padding. + byte[] CEK = { (byte)0xc2, (byte)0x86, 0x69, 0x6d, (byte)0x88, 0x7c, (byte)0x9a, (byte)0xa0, 0x61, 0x1b, (byte)0xbb, 0x3e, 0x20, 0x25, (byte)0xa4, 0x5a, (byte)0xc2, (byte)0x86, 0x69, 0x6d, (byte)0x88, 0x7c, (byte)0x9a, (byte)0xa0, 0x61, 0x1b, (byte)0xbb, 0x3e, 0x20, 0x25, (byte)0xa4, 0x5a }; + byte[] PLAIN = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + byte[] IV = { 0x56, 0x2e, 0x17, (byte)0x99, 0x6d, 0x09, 0x3d, 0x28, (byte)0xdd, (byte)0xb3, (byte)0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }; + byte[] ED = { (byte)0xd2, (byte)0x96, (byte)0xcd, (byte)0x94, (byte)0xc2, (byte)0xcc, (byte)0xcf, (byte)0x8a, 0x3a, (byte)0x86, 0x30, 0x28, (byte)0xb5, (byte)0xe1, (byte)0xdc, 0x0a, 0x75, (byte)0x86, 0x60, 0x2d, 0x25, 0x3c, (byte)0xff, (byte)0xf9, 0x1b, (byte)0x82, 0x66, (byte)0xbe, (byte)0xa6, (byte)0xd6, 0x1a, (byte)0xb1 }; + + Aes128Cbc algo = new Aes128Cbc(); + byte[] encrypted = null; + + ICryptoTransform encryptor = null; + try { + encryptor = algo.CreateEncryptor(CEK, IV, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + try { + encrypted = encryptor.doFinal(PLAIN); + + // Assert: we only compare the first 32 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(encrypted, 0, 32), ED); + } catch (Exception e) { + fail(e.getMessage()); + } + + ICryptoTransform decryptor = null; + try { + decryptor = algo.CreateDecryptor(CEK, IV, null, null, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(encrypted); + + // Assert: we only compare the first 32 bytes as this library uses PKCS7 padding + assertArrayEquals(Arrays.copyOfRange(decrypted, 0, 32), PLAIN); + } catch (Exception e) { + fail(e.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwBCProviderTest.java new file mode 100644 index 0000000000000..480db6f2e8966 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwBCProviderTest.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; +import org.junit.Before; + +public class AesKwBCProviderTest extends AesKwTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwTest.java new file mode 100644 index 0000000000000..e79e5569fe71c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/AesKwTest.java @@ -0,0 +1,429 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import javax.crypto.Cipher; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.cryptography.ICryptoTransform; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw128; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw192; +import com.microsoft.azure.keyvault.cryptography.algorithms.AesKw256; + +public class AesKwTest { + + // Always null for the default provider + private Provider _provider = null; + + private static boolean hasUnlimitedCrypto() { + try { + return Cipher.getMaxAllowedKeyLength("RC5") >= 256; + } catch (NoSuchAlgorithmException e) { + return false; + } + } + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + protected void setProvider(Provider provider) { + _provider = provider; + } + + @Test + public void KeyVault_AesKw128() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5 }; + + AesKw kw = new AesKw128(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + @Test + public void KeyVault_AesKw192() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + AesKw kw = new AesKw192(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + } + + @Test + public void KeyVault_AesKw256() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + AesKw kw = new AesKw256(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + } + + @Test + public void KeyVault_AesKw128_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte)0x88, (byte)0x99, (byte)0xAA, (byte)0xBB, (byte)0xCC, (byte)0xDD, (byte)0xEE, (byte)0xFF }; + byte[] EK = { 0x1F, (byte)0xA6, (byte)0x8B, 0x0A, (byte)0x81, 0x12, (byte)0xB4, 0x47, (byte)0xAE, (byte)0xF3, 0x4B, (byte)0xD8, (byte)0xFB, 0x5A, 0x7B, (byte)0x82, (byte)0x9D, 0x3E, (byte)0x86, 0x23, 0x71, (byte)0xD2, (byte)0xCF, (byte)0xE5 }; + + AesKw kw = new AesKw128(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + } catch (Exception e) { + fail(e.getMessage()); + } + + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + @Test + public void KeyVault_AesKw192_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + AesKw kw = new AesKw192(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + } + + @Test + public void KeyVault_AesKw256_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + AesKw kw = new AesKw256(); + + ICryptoTransform encryptor = null; + + try { + encryptor = kw.CreateEncryptor(KEK, _provider); + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] encrypted = null; + + try { + encrypted = encryptor.doFinal(CEK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + + ICryptoTransform decryptor = null; + + try { + decryptor = kw.CreateDecryptor(KEK, _provider); + + if (!unlimited) fail("Expected InvalidKeyException"); + } catch (InvalidKeyException e) { + if (unlimited) fail("InvalidKeyException"); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (unlimited) { + byte[] decrypted = null; + + try { + decrypted = decryptor.doFinal(EK); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyBCProviderTest.java new file mode 100644 index 0000000000000..545c0eb1429c5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyBCProviderTest.java @@ -0,0 +1,16 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; +import org.junit.Before; + +public class ECKeyBCProviderTest extends ECKeyTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyTest.java new file mode 100644 index 0000000000000..748c75f6f159d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/ECKeyTest.java @@ -0,0 +1,324 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.InvalidAlgorithmParameterException; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.Security; +import java.security.interfaces.ECPrivateKey; +import java.security.interfaces.ECPublicKey; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; + +import org.apache.commons.lang3.tuple.Pair; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.ImmutableMap; +import com.microsoft.azure.keyvault.cryptography.EcKey; +import com.microsoft.azure.keyvault.cryptography.test.resources.PemFile; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +public class ECKeyTest { + + private static Provider _provider = null; + + static byte[] CEK; + static KeyFactory FACTORY; + static MessageDigest DIGEST_256; + static MessageDigest DIGEST_384; + static MessageDigest DIGEST_512; + static KeyPairGenerator EC_KEY_GENERATOR; + static Map CURVE_TO_DIGEST; + static List CURVE_LIST; + +// To create keys and signatures used in this class with openssl: +// +// Create key +// openssl ecparam -name {curve_name} -genkey > {key_name}.pem +// openssl pkcs8 -topk8 -nocrypt -in {key_name}.pem -out {key_name}pkcs8.pem +// openssl ec -in {key_name}pkcs8.pem -pubout -out {key_name}pkcs8pub.pem +// +// Sign key +// openssl dgst -{sha_digest} -sign {key_name}pkcs8.pem -out {signature} +// +// Verify key +// openssl dgst -{sha_digest} -verify {key_name}pkcs8pub.pem -signature {signature} + + + protected static void setProvider(Provider provider) { + _provider = provider; + } + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + setProvider(Security.getProvider("SunEC")); + EC_KEY_GENERATOR = KeyPairGenerator.getInstance("EC", _provider); + + Path byte_location = Paths.get("src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/byte_array.bin"); + CEK = Files.readAllBytes(byte_location); + + FACTORY = KeyFactory.getInstance("EC", _provider); + + DIGEST_256 = MessageDigest.getInstance("SHA-256"); + DIGEST_384 = MessageDigest.getInstance("SHA-384"); + DIGEST_512 = MessageDigest.getInstance("SHA-512"); + + CURVE_TO_DIGEST = ImmutableMap.builder() + .put(JsonWebKeyCurveName.P_256, DIGEST_256) + .put(JsonWebKeyCurveName.P_384, DIGEST_384) + .put(JsonWebKeyCurveName.P_521, DIGEST_512) + .put(JsonWebKeyCurveName.P_256K, DIGEST_256) + .build(); + //JsonWebKeyCurveName.SECP256K1) + CURVE_LIST = Arrays.asList(JsonWebKeyCurveName.P_256, JsonWebKeyCurveName.P_384, JsonWebKeyCurveName.P_521, JsonWebKeyCurveName.P_256K); + } + + @Test + public void testCurves() throws Exception { + for (JsonWebKeyCurveName crv : CURVE_LIST) { + EcKey key = new EcKey("keyId", crv); + doSignVerify(key, CURVE_TO_DIGEST.get(crv)); + } + } + + @Test(expected = NoSuchAlgorithmException.class) + public void testUnsupportedCurve() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InstantiationException, IllegalAccessException, ClassNotFoundException { + EcKey key = new EcKey("keyId", new JsonWebKeyCurveName("not an algo")); + } + + @Test + public void testDefaultKey() throws Exception { + EcKey key = new EcKey("keyId"); + doSignVerify(key, DIGEST_256); + } + + @Test + public void testWithKeyPair() throws Exception { + for (JsonWebKeyCurveName crv : CURVE_LIST) { + ECGenParameterSpec gps = new ECGenParameterSpec(EcKey.CURVE_TO_SPEC_NAME.get(crv)); + EC_KEY_GENERATOR.initialize(gps); + KeyPair keyPair = EC_KEY_GENERATOR.generateKeyPair(); + + final String name = "keyid"; + EcKey key = new EcKey(name, keyPair); + assertEquals(name, key.getKid()); + assertEquals(crv, key.getCurve()); + doSignVerify(key, CURVE_TO_DIGEST.get(crv)); + } + } + + @Test(expected = IllegalArgumentException.class) + public void testWithNotCurveKeyPair() throws Exception { + ECGenParameterSpec gps = new ECGenParameterSpec("secp192k1"); + EC_KEY_GENERATOR.initialize(gps); + KeyPair keyPair = EC_KEY_GENERATOR.generateKeyPair(); + + final String name = "keyid"; + EcKey key = new EcKey(name, keyPair); + } + + @Test(expected = UnsupportedOperationException.class) + public void testFromJsonWebKeyPublicOnly() throws Exception { + ECGenParameterSpec gps = new ECGenParameterSpec(EcKey.P256); + EC_KEY_GENERATOR.initialize(gps); + KeyPair keyPair = EC_KEY_GENERATOR.generateKeyPair(); + + ECPublicKey apub = (ECPublicKey) keyPair.getPublic(); + ECPoint point = apub.getW(); + + JsonWebKey jwk = new JsonWebKey() + .withKid("kid") + .withCrv(JsonWebKeyCurveName.P_256) + .withX(point.getAffineX().toByteArray()) + .withY(point.getAffineY().toByteArray()) + .withKty(JsonWebKeyType.EC); + + assertFalse(jwk.hasPrivateKey()); + + EcKey newKey = EcKey.fromJsonWebKey(jwk, false); + assertEquals("kid", newKey.getKid()); + doSignVerify(newKey, DIGEST_256); + } + + @Test + public void testFromJsonWebKey() throws Exception { + ECGenParameterSpec gps = new ECGenParameterSpec(EcKey.P384); + EC_KEY_GENERATOR.initialize(gps); + KeyPair keyPair = EC_KEY_GENERATOR.generateKeyPair(); + + ECPublicKey apub = (ECPublicKey) keyPair.getPublic(); + ECPoint point = apub.getW(); + ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate(); + + JsonWebKey jwk = new JsonWebKey() + .withKid("kid") + .withCrv(JsonWebKeyCurveName.P_384) + .withX(point.getAffineX().toByteArray()) + .withY(point.getAffineY().toByteArray()) + .withD(apriv.getS().toByteArray()) + .withKty(JsonWebKeyType.EC); + + assertTrue(jwk.hasPrivateKey()); + + EcKey newKey = EcKey.fromJsonWebKey(jwk, true); + assertEquals("kid", newKey.getKid()); + doSignVerify(newKey, DIGEST_384); + } + + private static PrivateKey generatePrivateKey(KeyFactory factory, String filename) throws InvalidKeySpecException, FileNotFoundException, IOException { + PemFile pemFile = new PemFile(filename); + byte[] content = pemFile.getPemObject().getContent(); + PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); + return factory.generatePrivate(privKeySpec); + } + + private static PublicKey generatePublicKey(KeyFactory factory, String filename) throws InvalidKeySpecException, FileNotFoundException, IOException { + PemFile pemFile = new PemFile(filename); + byte[] content = pemFile.getPemObject().getContent(); + X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(content); + return factory.generatePublic(pubKeySpec); + } + + private KeyPair getKeyFromFile(String privateKeyPath, String publicKeyPath) throws InvalidKeySpecException, FileNotFoundException, IOException { + PrivateKey priv = generatePrivateKey(FACTORY, privateKeyPath); + PublicKey pub = generatePublicKey(FACTORY, publicKeyPath); + ECPublicKey apub = (ECPublicKey) pub; + ECPrivateKey apriv = (ECPrivateKey) priv; + + KeyPair keyPair = new KeyPair(apub, apriv); + return keyPair; + } + + private void testFromFile(String keyType, MessageDigest digest) throws Exception { + String privateKeyPath = "src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "keynew.pem"; + String publicKeyPath = "src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "keypubnew.pem"; + + EcKey newKey = new EcKey("akey", getKeyFromFile(privateKeyPath, publicKeyPath)); + + Path signatureLocation = Paths.get("src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "sig.der"); + byte[] signature = Files.readAllBytes(signatureLocation); + + doVerify(newKey, digest, signature); + } + + @Test + public void testCreateSECP256K1Key() throws Exception { + ECGenParameterSpec gps = new ECGenParameterSpec("secp256k1"); + Provider myprov = Security.getProvider("BC"); + final KeyPairGenerator generator = KeyPairGenerator.getInstance("EC"); + + generator.initialize(gps); + EcKey key = new EcKey("akey", JsonWebKeyCurveName.P_256K); + } + + @Test + public void testFromP384File() throws Exception { + testFromFile("p384", DIGEST_384); + } + + @Test + public void testFromP521File() throws Exception { + testFromFile("p521", DIGEST_512); + } + + @Test + public void testFromP256File() throws Exception { + testFromFile("p256", DIGEST_256); + } + + @Test + public void testFromSEC256File() throws Exception{ + testFromFile("secp256", DIGEST_256); + } + + @Test + public void testToJsonWebKey() throws Exception { + ECGenParameterSpec gps = new ECGenParameterSpec(EcKey.P521); + EC_KEY_GENERATOR.initialize(gps); + KeyPair keyPair = EC_KEY_GENERATOR.generateKeyPair(); + + ECPublicKey apub = (ECPublicKey) keyPair.getPublic(); + ECPoint point = apub.getW(); + ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate(); + + JsonWebKey jwk = new JsonWebKey() + .withKid("kid") + .withCrv(JsonWebKeyCurveName.P_521) + .withX(point.getAffineX().toByteArray()) + .withY(point.getAffineY().toByteArray()) + .withD(apriv.getS().toByteArray()) + .withKty(JsonWebKeyType.EC); + + EcKey newKey = new EcKey("kid", keyPair); + + JsonWebKey newJwk = newKey.toJsonWebKey(); + //set missing parameters + newJwk.withKid("kid"); + + assertEquals(jwk, newJwk); + } + + //Checks validity of verify by + //Externally signing a byte_array with openssl + //Verifying with SDK + private void doVerify(EcKey key, MessageDigest digest, byte[] preGenSignature) throws IOException, NoSuchAlgorithmException, InterruptedException, ExecutionException { + byte[] hash = digest.digest(CEK); + + //Use sign and verify to test each other. + boolean result = key.verifyAsync(hash, preGenSignature, key.getDefaultSignatureAlgorithm()).get(); + assertTrue(result); + + //Check that key denies invalid digest. + BigInteger bigInt = new BigInteger(hash); + BigInteger shiftInt = bigInt.shiftRight(4); + byte [] shifted = shiftInt.toByteArray(); + boolean incorrectResult = key.verifyAsync(shifted, preGenSignature, key.getDefaultSignatureAlgorithm()).get(); + assertFalse(incorrectResult); + + key.close(); + } + + private void doSignVerify(EcKey key, MessageDigest digest) throws IOException, NoSuchAlgorithmException, InterruptedException, ExecutionException { + + byte[] hash = digest.digest(CEK); + + //Use sign and verify to test each other. + Pair signature = key.signAsync(hash, key.getDefaultSignatureAlgorithm()).get(); + boolean result = key.verifyAsync(hash, signature.getLeft(), key.getDefaultSignatureAlgorithm()).get(); + assertTrue(result); + + //Check that key denies invalid digest. + BigInteger bigInt = new BigInteger(hash); + BigInteger shiftInt = bigInt.shiftRight(4); + byte [] shifted = shiftInt.toByteArray(); + boolean incorrectResult = key.verifyAsync(shifted, signature.getLeft(), key.getDefaultSignatureAlgorithm()).get(); + assertFalse(incorrectResult); + + key.close(); + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyBCProviderTest.java new file mode 100644 index 0000000000000..c9a9c70acaeb3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyBCProviderTest.java @@ -0,0 +1,16 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; +import org.junit.Before; + +public class RsaKeyBCProviderTest extends RsaKeyTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyTest.java new file mode 100644 index 0000000000000..49449105e90c9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/RsaKeyTest.java @@ -0,0 +1,183 @@ +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.*; + +import java.security.MessageDigest; +import java.security.Provider; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.cryptography.RsaKey; +import com.microsoft.azure.keyvault.cryptography.algorithms.Rs256; +import com.microsoft.azure.keyvault.cryptography.algorithms.Rsa15; +import com.microsoft.azure.keyvault.cryptography.algorithms.RsaOaep; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + +public class RsaKeyTest { + + // A Content Encryption Key, or Message. This value is kept consistent with the .NET + // unit test cases to enable cross platform testing. + static final byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte)0x88, (byte)0x99, (byte)0xAA, (byte)0xBB, (byte)0xCC, (byte)0xDD, (byte)0xEE, (byte)0xFF }; + static final String CrossPlatformHash = "qPrtarvzXBKksm5A9v6xnXNtkARcg7n5ox9jjTI+aBE="; + static final String CrossPlatformSignature = "RaNc+8WcWxplS8I7ynJLSoLJKz+dgBvrZhIGH3VFlTTyzu7b9d+lpaV9IKhzCNBsgSysKhgL7EZwVCOTBZ4m6xvKSXqVFXYaBPyBTD7VoKPMYMW6ai5x6xV5XAMaZPfMkff3Deg/RXcc8xQ28FhYuUa8yly01GySY4Hk55anEvb2wBxSy1UGun/0LE1lYH3C3XEgSry4cEkJHDJl1hp+wB4J/noXOqn5ECGU+/4ehBJOyW1gtUH0/gRe8yXnDH0AXepHRyH8iBHLWlKX1r+1/OrMulqOoi82RZzJlTyEz9X+bsQhllqGF6n3hdLS6toH9o7wUtwYNqSx82JuQT6iMg=="; + + private Provider _provider = null; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + protected void setProvider(Provider provider) { + _provider = provider; + } + + @Test + public void testRsa15() throws Exception { + + RsaKey key = getTestRsaKey(); + + // Wrap and Unwrap + Pair wrapped = key.wrapKeyAsync(CEK, Rsa15.ALGORITHM_NAME).get(); + byte[] unwrapped = key.unwrapKeyAsync(wrapped.getLeft(), wrapped.getRight()).get(); + + // Assert + assertEquals(Rsa15.ALGORITHM_NAME, wrapped.getRight()); + assertArrayEquals(CEK, unwrapped); + + // Encrypt and Decrypt + Triple encrypted = key.encryptAsync(CEK, null, null, Rsa15.ALGORITHM_NAME).get(); + byte[] decrypted = key.decryptAsync(encrypted.getLeft(), null, null, null, encrypted.getRight()).get(); + + // Assert + assertEquals(Rsa15.ALGORITHM_NAME, encrypted.getRight()); + assertArrayEquals(CEK, decrypted); + + key.close(); + } + + @Test + public void testRsaOaep() throws Exception { + + RsaKey key = getTestRsaKey(); + + // Wrap and Unwrap + Pair wrapped = key.wrapKeyAsync(CEK, RsaOaep.ALGORITHM_NAME).get(); + byte[] unwrapped = key.unwrapKeyAsync(wrapped.getLeft(), wrapped.getRight()).get(); + + // Assert + assertEquals(RsaOaep.ALGORITHM_NAME, wrapped.getRight()); + assertArrayEquals(CEK, unwrapped); + + // Encrypt and Decrypt + Triple encrypted = key.encryptAsync(CEK, null, null, RsaOaep.ALGORITHM_NAME).get(); + byte[] decrypted = key.decryptAsync(encrypted.getLeft(), null, null, null, encrypted.getRight()).get(); + + // Assert + assertEquals(RsaOaep.ALGORITHM_NAME, encrypted.getRight()); + assertArrayEquals(CEK, decrypted); + + key.close(); + } + + @Test + public void testDefaultAlgorithm() throws Exception { + + RsaKey key = getTestRsaKey(); + + assertEquals(RsaOaep.ALGORITHM_NAME, key.getDefaultEncryptionAlgorithm()); + assertEquals(RsaOaep.ALGORITHM_NAME, key.getDefaultKeyWrapAlgorithm()); + assertEquals(Rs256.ALGORITHM_NAME, key.getDefaultSignatureAlgorithm()); + + // Wrap and Unwrap + Pair wrapped = key.wrapKeyAsync(CEK, key.getDefaultKeyWrapAlgorithm()).get(); + byte[] unwrapped = key.unwrapKeyAsync(wrapped.getLeft(), wrapped.getRight()).get(); + + // Assert + assertEquals(RsaOaep.ALGORITHM_NAME, wrapped.getRight()); + assertArrayEquals(CEK, unwrapped); + + // Encrypt and Decrypt + Triple encrypted = key.encryptAsync(CEK, null, null, key.getDefaultEncryptionAlgorithm()).get(); + byte[] decrypted = key.decryptAsync(encrypted.getLeft(), null, null, null, encrypted.getRight()).get(); + + // Assert + assertEquals(RsaOaep.ALGORITHM_NAME, encrypted.getRight()); + assertArrayEquals(CEK, decrypted); + + key.close(); + } + + @Test + public void testSignVerify() throws Exception { + + RsaKey key = getTestRsaKey(); + + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] hash = digest.digest(CEK); + + byte[] crossPlatformHash = Base64.decodeBase64(CrossPlatformHash); + byte[] crossPlatformSignature = Base64.decodeBase64(CrossPlatformSignature); + + // Check the hash + assertNotNull( hash ); + assertEquals( 32, hash.length ); + assertArrayEquals(hash, crossPlatformHash); + + Pair signature = key.signAsync(hash, "RS256").get(); + boolean result = key.verifyAsync(hash, signature.getLeft(), "RS256").get(); + + // Check the signature + assertTrue(result); + assertArrayEquals(crossPlatformSignature, signature.getLeft()); + + // Now prove we can verify the cross platform signature + result = key.verifyAsync(hash, Base64.decodeBase64(CrossPlatformSignature), "RS256").get(); + + assertTrue(result); + + key.close(); + } + + @Test + public void testToFromJsonWebKey() throws Exception { + RsaKey key = getTestRsaKey(); + JsonWebKey jwk = key.toJsonWebKey(); + jwk.withKid("new kid"); + //setting kid + RsaKey sameKey = RsaKey.fromJsonWebKey(jwk, true, _provider); + JsonWebKey jwkSame = sameKey.toJsonWebKey(); + jwkSame.withKid("new kid"); + assertEquals(jwk, jwkSame); + } + + private RsaKey getTestRsaKey() throws Exception { + String jwkString = "{\"kty\":\"RSA\",\"n\":\"rZ8pnmXkhfmmgNWVVdtNcYy2q0OAcCGIpeFzsN9URqJsiBEiWQfxlUxFTbM4kVWPqjauKt6byvApBGEeMA7Qs8kxwRVP-BD4orXRe9VPgliM92rH0UxQWHmCHUe7G7uUAFPwbiDVhWuFzELxNa6Kljg6Z9DuUKoddmQvlYWj8uSunofCtDi_zzlZKGYTOYJma5IYScHNww1yjLp8-b-Be2UdHbrPkCv6Nuwi6MVIKjPpEeRQgfefRmxDBJQKY3OfydMXZmEwukYXVkUcdIP8XwG2OxnfdRK0oAo0NDebNNVuT89k_3AyZLTr1KbDmx1nnjwa8uB8k-uLtcOC9igbTw\",\"e\":\"AQAB\",\"d\":\"H-z7hy_vVJ9yeZBMtIvt8qpQUK_J51STPwV085otcgud72tPKJXoW2658664ASl9kGwbnLBwb2G3-SEunuGqiNS_PGUB3niob6sFSUMRKsPDsB9HfPoOcCZvwZiWFGRqs6C7vlR1TuJVqRjKJ_ffbf4K51oo6FZPspx7j4AShLAwLUSQ60Ld5QPuxYMYZIMpdVbMVIVHJ26pR4Y18e_0GYmEGnbF5N0HkwqQmfmTiIK5aoGnD3GGgqHeHmWBwh6_WAq90ITLcX_zBeqQUgBSj-Z5v61SroO9Eang36T9mMoYrcPpYwemtAOb4HhQYDj8dCCfbeOcVmvZ9UJKWCX2oQ\",\"dp\":\"HW87UpwPoj3lPI9B9K1hJFeuGgarpakvtHuk1HpZ5hXWFGAJiXoWRV-jvYyjoM2k7RpSxPyuuFFmYHcIxiGFp2ES4HnP0BIhKVa2DyugUxIEcMK53C43Ub4mboJPZTSC3sapKgAmA2ue624sapWmshTPpx9qnUP2Oj3cSMkgMGE\",\"dq\":\"RhwEwb5FYio0GS2tmul8FAYsNH7JDehwI1yUApnTiakhSenFetml4PYyVkKR4csgLZEi3RY6J3R8Tg-36zrZuF7hxhVJn80L5_KETSpfEI3jcrXMVg4SRaMsWLY9Ahxflt2FJgUnHOmWRLmP6_hmaTcxxSACjbyUd_HhwNavD5E\",\"qi\":\"wYPZ4lKIslA1w3FaAzQifnNLABYXXUZ_KAA3a8T8fuxkdE4OP3xIFX7WHhnmBd6uOFiEcGoeq2jNQqDg91rV5661-5muQKcvp4uUsNId5rQw9EZw-kdDcwMtVFTEBfvVuyp83X974xYAHn1Jd8wWohSwrpi1QuH5cQMR5Fm6I1A\",\"p\":\"74Ot7MgxRu4euB31UWnGtrqYPjJmvbjYESS43jfDfo-s62ggV5a39P_YPg6oosgtGHNw0QDxunUOXNu9iriaYPf_imptRk69bKN8Nrl727Y-AaBYdLf1UZuwz8X07FqHAH5ghYpk79djld8QvkUUJLpx6rzcW8BJLTOi46DtzZE\",\"q\":\"uZJu-qenARIt28oj_Jlsk-p_KLnqdczczZfbRDd7XNp6csGLa8R0EyYqUB4xLWELQZsX4tAu9SaAO62tuuEy5wbOAmOVrq2ntoia1mGQSJdoeVq6OqtN300xVnaBc3us0rm8C6-824fEQ1PWXoulXLKcSqBhFT-hQahsYi-kat8\"}"; + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey jwk = null; + + jwk = mapper.readValue(jwkString, JsonWebKey.class); + + return new RsaKey("foo", jwk.toRSA(true, _provider) ); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyBCProviderTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyBCProviderTest.java new file mode 100644 index 0000000000000..2954df416105f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyBCProviderTest.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.microsoft.azure.keyvault.cryptography.test; + +import java.security.Provider; +import org.junit.Before; + +public class SymmetricKeyBCProviderTest extends SymmetricKeyTest { + + @Before + public void setUp() throws Exception { + try { + super.setProvider((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance()); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyTest.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyTest.java new file mode 100644 index 0000000000000..b6d3194cae058 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/SymmetricKeyTest.java @@ -0,0 +1,592 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.microsoft.azure.keyvault.cryptography.test; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.util.concurrent.ExecutionException; + +import javax.crypto.Cipher; + +import org.apache.commons.lang3.tuple.Pair; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.cryptography.SymmetricKey; + +public class SymmetricKeyTest { + + private Provider _provider = null; + + private static boolean hasUnlimitedCrypto() { + try { + return Cipher.getMaxAllowedKeyLength("RC5") >= 256; + } catch (NoSuchAlgorithmException e) { + return false; + } + } + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + setProvider(null); + } + + @After + public void tearDown() throws Exception { + } + + protected void setProvider(Provider provider) { + _provider = provider; + } + + @Test + public void testSymmetricKeyAesKw128() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5 }; + + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A128KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyAesKw192() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A192KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyAesKw256() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A256KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyDefaultAlgorithmAesKw128() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5 }; + + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + String algorithm = null; + + try { + Pair result = key.wrapKeyAsync(CEK, null).get(); + encrypted = result.getLeft(); + algorithm = result.getRight(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertEquals("A128KW", algorithm); + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, algorithm).get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyDefaultAlgorithmAesKw192() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + String algorithm = null; + + try { + Pair result = key.wrapKeyAsync(CEK, null).get(); + + encrypted = result.getLeft(); + algorithm = result.getRight(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertEquals( "A192KW", algorithm); + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, algorithm).get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyDefaultAlgorithmAesKw256() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + String algorithm = null; + + try { + Pair result = key.wrapKeyAsync(CEK, null).get(); + encrypted = result.getLeft(); + algorithm = result.getRight(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertEquals("A256KW", algorithm); + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, algorithm).get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyAesKw128_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte)0x88, (byte)0x99, (byte)0xAA, (byte)0xBB, (byte)0xCC, (byte)0xDD, (byte)0xEE, (byte)0xFF }; + byte[] EK = { 0x1F, (byte)0xA6, (byte)0x8B, 0x0A, (byte)0x81, 0x12, (byte)0xB4, 0x47, (byte)0xAE, (byte)0xF3, 0x4B, (byte)0xD8, (byte)0xFB, 0x5A, 0x7B, (byte)0x82, (byte)0x9D, 0x3E, (byte)0x86, 0x23, 0x71, (byte)0xD2, (byte)0xCF, (byte)0xE5 }; + + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A128KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyAesKw192_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte)0x88, (byte)0x99, (byte)0xAA, (byte)0xBB, (byte)0xCC, (byte)0xDD, (byte)0xEE, (byte)0xFF }; + byte[] EK = { (byte)0x96, 0x77, (byte)0x8B, 0x25, (byte)0xAE, 0x6C, (byte)0xA4, 0x35, (byte)0xF9, 0x2B, 0x5B, (byte)0x97, (byte)0xC0, 0x50, (byte)0xAE, (byte)0xD2, 0x46, (byte)0x8A, (byte)0xB8, (byte)0xA1, 0x7A, (byte)0xD8, 0x4E, 0x5D }; + + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A192KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } + + @Test + public void testSymmetricKeyAesKw256_ExcessKeyMaterial() { + // Arrange + byte[] KEK = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte)0xE8, (byte)0xC3, (byte)0xF9, (byte)0xCE, 0x0F, 0x5B, (byte)0xA2, 0x63, (byte)0xE9, 0x77, 0x79, 0x05, (byte)0x81, (byte)0x8A, 0x2A, (byte)0x93, (byte)0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte)0x8A, (byte)0xE7 }; + + /* + * This test using the default JCE provider depends on whether unlimited security + * is installed or not. In the unlimited case, the full test should pass but in + * the limited case, it should fail with InvalidKeyException. + */ + boolean unlimited = hasUnlimitedCrypto(); + SymmetricKey key = new SymmetricKey("KEK", KEK, _provider); + + byte[] encrypted = null; + + try { + encrypted = key.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + + if (!unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if (unlimited) { + // Assert + assertArrayEquals(EK, encrypted); + + byte[] decrypted = null; + + try { + decrypted = key.unwrapKeyAsync(EK, "A256KW").get(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(CEK, decrypted); + } + + try { + key.close(); + } catch (IOException e) { + fail("Key could not be closed"); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/PemFile.java b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/PemFile.java new file mode 100644 index 0000000000000..1064a943d68a0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/PemFile.java @@ -0,0 +1,27 @@ +package com.microsoft.azure.keyvault.cryptography.test.resources; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.bouncycastle.util.io.pem.PemObject; +import org.bouncycastle.util.io.pem.PemReader; + +public class PemFile { + + private PemObject pemObject; + + public PemFile(String filename) throws FileNotFoundException, IOException { + PemReader pemReader = new PemReader(new InputStreamReader(new FileInputStream(filename))); + try { + this.pemObject = pemReader.readPemObject(); + } finally { + pemReader.close(); + } + } + + public PemObject getPemObject() { + return pemObject; + } +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/SECP256key.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/SECP256key.pem new file mode 100644 index 0000000000000..9422787ad2e2f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/SECP256key.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BgUrgQQACg== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEIIbmPOGbSMPdQoRmd5CTnkMl5EtyAYG9YF0/cC9/QiOsoAcGBSuBBAAK +oUQDQgAEcgWYGgCEzF7O2klfOCQJSrIjKZd1InDMUVwbykw5gvbCaL8m2/hSY13o +X7A1b4PbLn6zK7TAFRqBipA8w2sQ6g== +-----END EC PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/byte_array.bin b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/byte_array.bin new file mode 100644 index 0000000000000..2fdaa8e3b66f3 Binary files /dev/null and b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/byte_array.bin differ diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256key.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256key.pem new file mode 100644 index 0000000000000..0dc7ae15b09c1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256key.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BgUrgQQACg== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEICuTXZmGPyKlnpX/NZjNsfRF3V6np91hIN6JGuq3+ml4oAcGBSuBBAAK +oUQDQgAEB4kcrPPdAiPb0RNPgqik6RbzD4CluCZB/FcqgS8tBOJ3mSjnCNUzlAng +QQWZu0YZzq2n4QZwa9E1FZc5hBH7nA== +-----END EC PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keynew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keynew.pem new file mode 100644 index 0000000000000..fc9d36273a6e9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keynew.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgmDtpx1m8G4Wmwo5+ +CuQx27iupfo5nf4CqsfWmMYxFEehRANCAARIcREG1iUacEdriN3Zim6er9nbgSil +YSYN9tX1+HhLlPr1MXL7nERsSlVSlTptbC+SxGL+2cBcI4dgM7/XPe9Z +-----END PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keypubnew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keypubnew.pem new file mode 100644 index 0000000000000..7e245ae14711b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256keypubnew.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESHERBtYlGnBHa4jd2Ypunq/Z24Eo +pWEmDfbV9fh4S5T69TFy+5xEbEpVUpU6bWwvksRi/tnAXCOHYDO/1z3vWQ== +-----END PUBLIC KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256sig.der b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256sig.der new file mode 100644 index 0000000000000..23f41f2ee364b Binary files /dev/null and b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p256sig.der differ diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keynew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keynew.pem new file mode 100644 index 0000000000000..9ec79bdab30ed --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keynew.pem @@ -0,0 +1,6 @@ +-----BEGIN PRIVATE KEY----- +MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDC0ooKHLcKqHpTI1Cz2 +AjkFh/DXxz9VaHW6tdRYow3eHRpPyjWzdpK9ThCc2vsVvnqhZANiAATy14M2foWP +Tbql4vwUhL1JEh0Oy629FNaggH6oGCNNPdtVOWJfRcPvFWdYIcfOotVGHLIl8WLJ +HnuDUMUbxCJFoWboyPIBzufbiPEvZaAjWjT509d971YJANAwVcYmR4Y= +-----END PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keypubnew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keypubnew.pem new file mode 100644 index 0000000000000..44de436df9154 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384keypubnew.pem @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8teDNn6Fj026peL8FIS9SRIdDsutvRTW +oIB+qBgjTT3bVTliX0XD7xVnWCHHzqLVRhyyJfFiyR57g1DFG8QiRaFm6MjyAc7n +24jxL2WgI1o0+dPXfe9WCQDQMFXGJkeG +-----END PUBLIC KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384sig.der b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384sig.der new file mode 100644 index 0000000000000..44e3fc6b30077 Binary files /dev/null and b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p384sig.der differ diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keynew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keynew.pem new file mode 100644 index 0000000000000..8a95bdd14d969 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keynew.pem @@ -0,0 +1,8 @@ +-----BEGIN PRIVATE KEY----- +MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIAlTlzXR+eSE1CiFBs +s139xS1gP1ESKhGeeeohoa0+s2IDlgwz5CZmIOhfHeDqIMiuvt0Da/SdXa8YEdlr +PfpM9BuhgYkDgYYABAEbJoXHYgVIkmneHp65hog0j3WD7pUaXMwy6HIWCiRU+va9 +1ZN7e8ht4Cor9ME93hiRBFAW1W2unA8AcjIKHhGj1QCq6My/fh4Lur0qgk0DHWj3 +Jlh+hIWAVxLZdkKA2uza01OUN9Ma1VNBoKssZDB7VCGnWUKa6heWDth8hp6X+bLd +LA== +-----END PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keypubnew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keypubnew.pem new file mode 100644 index 0000000000000..da5457b3ff9f9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521keypubnew.pem @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBGyaFx2IFSJJp3h6euYaINI91g+6V +GlzMMuhyFgokVPr2vdWTe3vIbeAqK/TBPd4YkQRQFtVtrpwPAHIyCh4Ro9UAqujM +v34eC7q9KoJNAx1o9yZYfoSFgFcS2XZCgNrs2tNTlDfTGtVTQaCrLGQwe1Qhp1lC +muoXlg7YfIael/my3Sw= +-----END PUBLIC KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521sig.der b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521sig.der new file mode 100644 index 0000000000000..819d2e33ca2ab Binary files /dev/null and b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/p521sig.der differ diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keynew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keynew.pem new file mode 100644 index 0000000000000..3f68ccd6e32c9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keynew.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQghuY84ZtIw91ChGZ3kJOe +QyXkS3IBgb1gXT9wL39CI6yhRANCAARyBZgaAITMXs7aSV84JAlKsiMpl3UicMxR +XBvKTDmC9sJovybb+FJjXehfsDVvg9sufrMrtMAVGoGKkDzDaxDq +-----END PRIVATE KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keypubnew.pem b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keypubnew.pem new file mode 100644 index 0000000000000..4e7cddb688629 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256keypubnew.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEcgWYGgCEzF7O2klfOCQJSrIjKZd1InDM +UVwbykw5gvbCaL8m2/hSY13oX7A1b4PbLn6zK7TAFRqBipA8w2sQ6g== +-----END PUBLIC KEY----- diff --git a/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256sig.der b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256sig.der new file mode 100644 index 0000000000000..2dc90f98c7cfc Binary files /dev/null and b/keyvault/data-plane/azure-keyvault-cryptography/src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/secp256sig.der differ diff --git a/keyvault/data-plane/azure-keyvault-extensions/pom.xml b/keyvault/data-plane/azure-keyvault-extensions/pom.xml new file mode 100644 index 0000000000000..6c3af7a2693f1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/pom.xml @@ -0,0 +1,185 @@ + + + 4.0.0 + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + azure-keyvault-extensions + 1.1.2 + jar + + Microsoft Azure SDK for Key Vault Extensions + This package contains Microsoft Azure Key Vault SDK Extensions. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + + + com.microsoft.azure + azure-keyvault-webkey + + + com.microsoft.azure + azure-keyvault-core + + + com.microsoft.azure + azure-keyvault-cryptography + + + com.microsoft.azure + azure-keyvault + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-mgmt-resources + + + + + com.microsoft.rest + client-runtime + + + + + com.google.guava + guava + + + org.apache.commons + commons-lang3 + + + commons-codec + commons-codec + + + + + + + com.microsoft.azure + azure-mgmt-resources + 1.3.1-SNAPSHOT + test-jar + test + + + com.microsoft.azure + adal4j + test + + + com.microsoft.azure + azure + test + + + + + junit + junit + test + + + org.bouncycastle + bcprov-jdk15on + test + + + org.mockito + mockito-core + 1.10.19 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.12 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+
+
+
diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java new file mode 100644 index 0000000000000..8ce09dde16ae2 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/AggregateKeyResolver.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.extensions; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import com.google.common.util.concurrent.AbstractFuture; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.core.IKeyResolver; + +/** + * The collection of key resolvers that would iterate on a key id to resolve to {@link IKey}. + */ +public class AggregateKeyResolver implements IKeyResolver { + + /** + * Future key class that resolves a key id after the async result is available. + */ + class FutureKey extends AbstractFuture { + + private final String kid; + + private boolean isCancelled = false; + private boolean isDone = false; + private IKey result = null; + + FutureKey(String kid) { + this.kid = kid; + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + + // mark cancelled + isCancelled = true; + + return isCancelled; + } + + @Override + public boolean isCancelled() { + return isCancelled; + } + + @Override + public boolean isDone() { + + // always true + return isDone; + } + + @Override + public IKey get() throws InterruptedException, ExecutionException { + + // throw if cancelled + if (isCancelled) { + throw new InterruptedException(); + } + + synchronized (resolvers) { + for (IKeyResolver resolver : resolvers) { + Future futureKey = resolver.resolveKeyAsync(kid); + + result = futureKey.get(); + + if (result != null) { + break; + } + } + } + + // Mark done + isDone = true; + + return result; + } + + @Override + public IKey get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { + + // throw if cancelled + if (isCancelled) { + throw new InterruptedException(); + } + + synchronized (resolvers) { + for (IKeyResolver resolver : resolvers) { + Future futureKey = resolver.resolveKeyAsync(kid); + + result = futureKey.get(timeout, unit); + + if (result != null) { + break; + } + } + } + + // Mark done + isDone = true; + + return result; + } + } + + private final List resolvers; + + /** + * Constructor. + */ + public AggregateKeyResolver() { + + resolvers = Collections.synchronizedList(new ArrayList()); + } + + /** + * Adds a key resolver to the collection of key resolvers. + * @param resolver the key resolver + */ + public void add(IKeyResolver resolver) { + + synchronized (resolvers) { + resolvers.add(resolver); + } + } + + @Override + public ListenableFuture resolveKeyAsync(String kid) { + return new FutureKey(kid); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java new file mode 100644 index 0000000000000..62bca3fabfdbb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.extensions; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.core.IKeyResolver; + +/** + * The key resolver that caches the key after resolving to {@link IKey}. + */ +public class CachingKeyResolver implements IKeyResolver { + + private final IKeyResolver keyResolver; + private final LoadingCache> cache; + + /** + * Constructor. + * @param capacity the cache size + * @param keyResolver the key resolver + */ + public CachingKeyResolver(int capacity, final IKeyResolver keyResolver) { + this.keyResolver = keyResolver; + cache = CacheBuilder.newBuilder().maximumSize(capacity) + .build(new CacheLoader>() { + + @Override + public ListenableFuture load(String kid) { + return keyResolver.resolveKeyAsync(kid); + } + }); + } + + @Override + public ListenableFuture resolveKeyAsync(String kid) { + KeyIdentifier keyIdentifier = new KeyIdentifier(kid); + if (keyIdentifier.version() == null) { + final ListenableFuture key = keyResolver.resolveKeyAsync(kid); + key.addListener(new Runnable() { + @Override + public void run() { + try { + cache.put(key.get().getKid(), key); + } catch (Exception e) { + // Key caching will occur on first read + } + } + }, + MoreExecutors.directExecutor() + ); + return key; + } else { + return cache.getUnchecked(kid); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java new file mode 100644 index 0000000000000..bfb58a8a7b8a7 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKey.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.keyvault.extensions; + +import java.io.IOException; +import java.security.NoSuchAlgorithmException; + +import com.google.common.util.concurrent.MoreExecutors; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.google.common.base.Function; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.KeyVaultClient; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.cryptography.RsaKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +/** + * The key vault key that performs cryptography operations. + */ +public class KeyVaultKey implements IKey { + + /** + * Transforms the result of decrypt operation to byte array. + */ + class DecryptResultTransform implements Function { + + DecryptResultTransform() { + super(); + } + + @Override + public byte[] apply(KeyOperationResult result) { + return result.result(); + } + } + + /** + * Transforms the result of sign operation to byte array and algorithm pair. + */ + class SignResultTransform implements Function> { + + private final String algorithm; + + SignResultTransform(String algorithm) { + super(); + this.algorithm = algorithm; + } + + @Override + public Pair apply(KeyOperationResult input) { + + return Pair.of(input.result(), algorithm); + } + } + + private final KeyVaultClient client; + private IKey implementation; + + protected KeyVaultKey(KeyVaultClient client, KeyBundle keyBundle) { + + if (client == null) { + throw new IllegalArgumentException("client"); + } + + if (keyBundle == null) { + throw new IllegalArgumentException("keyBundle"); + } + + JsonWebKey key = keyBundle.key(); + + if (key == null) { + throw new IllegalArgumentException("keyBundle must contain a key"); + } + + if (key.kty().equals(JsonWebKeyType.RSA)) { + // The private key is not available for KeyVault keys + implementation = new RsaKey(key.kid(), key.toRSA(false)); + } else if (key.kty().equals(JsonWebKeyType.RSA_HSM)) { + // The private key is not available for KeyVault keys + implementation = new RsaKey(key.kid(), key.toRSA(false)); + } + + if (implementation == null) { + throw new IllegalArgumentException(String.format("The key type %s is not supported", key.kty())); + } + + this.client = client; + } + + @Override + public void close() throws IOException { + if (implementation != null) { + implementation.close(); + } + } + + @Override + public String getDefaultEncryptionAlgorithm() { + if (implementation == null) { + return null; + } + + return implementation.getDefaultEncryptionAlgorithm(); + } + + @Override + public String getDefaultKeyWrapAlgorithm() { + + if (implementation == null) { + return null; + } + + return implementation.getDefaultKeyWrapAlgorithm(); + } + + @Override + public String getDefaultSignatureAlgorithm() { + + if (implementation == null) { + return null; + } + + return implementation.getDefaultSignatureAlgorithm(); + } + + @Override + public String getKid() { + + if (implementation == null) { + return null; + } + + return implementation.getKid(); + } + + @Override + public ListenableFuture decryptAsync(byte[] ciphertext, byte[] iv, byte[] authenticationData, byte[] authenticationTag, String algorithm) { + + if (implementation == null) { + return null; + } + + if (Strings.isNullOrWhiteSpace(algorithm)) { + algorithm = getDefaultEncryptionAlgorithm(); + } + + // Never local + ListenableFuture futureCall = + client.decryptAsync( + implementation.getKid(), + new JsonWebKeyEncryptionAlgorithm(algorithm), + ciphertext, + null); + return Futures.transform(futureCall, new DecryptResultTransform(), MoreExecutors.directExecutor()); + } + + @Override + public ListenableFuture> encryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData, String algorithm) throws NoSuchAlgorithmException { + if (implementation == null) { + return null; + } + + return implementation.encryptAsync(plaintext, iv, authenticationData, algorithm); + } + + @Override + public ListenableFuture> wrapKeyAsync(byte[] plaintext, String algorithm) throws NoSuchAlgorithmException { + if (implementation == null) { + return null; + } + + return implementation.wrapKeyAsync(plaintext, algorithm); + } + + @Override + public ListenableFuture unwrapKeyAsync(byte[] ciphertext, String algorithm) { + if (implementation == null) { + return null; + } + + if (Strings.isNullOrWhiteSpace(algorithm)) { + algorithm = getDefaultKeyWrapAlgorithm(); + } + + // Never local + ListenableFuture futureCall = + client.unwrapKeyAsync( + implementation.getKid(), + new JsonWebKeyEncryptionAlgorithm(algorithm), + ciphertext, + null); + return Futures.transform(futureCall, new DecryptResultTransform(), MoreExecutors.directExecutor()); + } + + @Override + public ListenableFuture> signAsync(byte[] digest, String algorithm) throws NoSuchAlgorithmException { + if (implementation == null) { + return null; + } + + if (Strings.isNullOrWhiteSpace(algorithm)) { + algorithm = getDefaultSignatureAlgorithm(); + } + + // Never local + ListenableFuture futureCall = + client.signAsync( + implementation.getKid(), + new JsonWebKeySignatureAlgorithm(algorithm), + digest, + null); + return Futures.transform(futureCall, new SignResultTransform(algorithm), MoreExecutors.directExecutor()); + } + + @Override + public ListenableFuture verifyAsync(byte[] digest, byte[] signature, String algorithm) throws NoSuchAlgorithmException { + if (implementation == null) { + return null; + } + + return implementation.verifyAsync(digest, signature, algorithm); + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java new file mode 100644 index 0000000000000..3e8cc130cf7d9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/KeyVaultKeyResolver.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.extensions; + +import java.security.Provider; + +import com.google.common.util.concurrent.MoreExecutors; +import org.apache.commons.codec.binary.Base64; + +import com.google.common.base.Function; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.KeyVaultClient; +import com.microsoft.azure.keyvault.SecretIdentifier; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.core.IKeyResolver; +import com.microsoft.azure.keyvault.cryptography.SymmetricKey; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.SecretBundle; + +/** + * The key resolver class that handles resolving key id to type {@link IKey} + * to be used for cryptography operations. + */ +public class KeyVaultKeyResolver implements IKeyResolver { + + static final Base64 BASE64 = new Base64(-1, null, true); + + /** + * Transforms {@link KeyBundle} to {@link IKey}. + */ + class FutureKeyFromKey implements Function { + + protected FutureKeyFromKey() { + super(); + } + + @Override + public IKey apply(KeyBundle keyBundle) { + + if (keyBundle != null) { + return new KeyVaultKey(client, keyBundle); + } + + return null; + } + } + + /** + * Transforms {@link SecretBundle} to {@link IKey}. + */ + class FutureKeyFromSecret implements Function { + + protected FutureKeyFromSecret() { + super(); + } + + @Override + public IKey apply(SecretBundle secretBundle) { + + if (secretBundle != null && secretBundle.contentType().equalsIgnoreCase("application/octet-stream")) { + byte[] keyBytes = BASE64.decode(secretBundle.value()); + + if (keyBytes != null) { + return new SymmetricKey(secretBundle.id(), keyBytes, provider); + } + } + + return null; + } + } + + private final KeyVaultClient client; + private final Provider provider; + + /** + * Constructor. + * @param client the key vault client + */ + public KeyVaultKeyResolver(KeyVaultClient client) { + this.client = client; + this.provider = null; + } + + /** + * Constructor. + * @param client the key vault client + * @param provider the java security provider + */ + public KeyVaultKeyResolver(KeyVaultClient client, Provider provider) { + this.client = client; + this.provider = provider; + } + + private ListenableFuture resolveKeyFromSecretAsync(String kid) { + + ListenableFuture futureCall = client.getSecretAsync(kid, null); + return Futures.transform(futureCall, new FutureKeyFromSecret(), MoreExecutors.directExecutor()); + } + + private ListenableFuture resolveKeyFromKeyAsync(String kid) { + + ListenableFuture futureCall = client.getKeyAsync(kid, null); + return Futures.transform(futureCall, new FutureKeyFromKey(), MoreExecutors.directExecutor()); + } + + @Override + public ListenableFuture resolveKeyAsync(String kid) { + + if (KeyIdentifier.isKeyIdentifier(kid)) { + return resolveKeyFromKeyAsync(kid); + } else if (SecretIdentifier.isSecretIdentifier(kid)) { + return resolveKeyFromSecretAsync(kid); + } + + return Futures.immediateFuture(null); + } + +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java new file mode 100644 index 0000000000000..5d5fe934de6b9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/Strings.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.extensions; + +/** + * String handlers. + */ +public class Strings { + + /** + * Determines whether the parameter string is either null or empty. + * @param arg the string to verify + * @return true if the string is empty or null and false otherwise. + */ + public static boolean isNullOrEmpty(String arg) { + + if (arg == null || arg.length() == 0) { + return true; + } + + return false; + } + + /** + * Determines whether the parameter string is null, empty or whitespace. + * @param arg the string to verify + * @return true if the string is empty, contains only whitespace or is null and false otherwise + */ + public static boolean isNullOrWhiteSpace(String arg) { + + if (Strings.isNullOrEmpty(arg) || arg.trim().isEmpty()) { + return true; + } + + return false; + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html new file mode 100644 index 0000000000000..12edd05fd0bac --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/package.html @@ -0,0 +1,5 @@ + + +This package contains the Azure Key Vault Extension classes. + + diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java new file mode 100644 index 0000000000000..39e15a5941855 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/CachingKeyResolverTest.java @@ -0,0 +1,151 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.microsoft.azure.keyvault.extensions.test; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.UncheckedExecutionException; +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.core.IKeyResolver; +import com.microsoft.azure.keyvault.extensions.CachingKeyResolver; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.util.concurrent.Executor; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +public class CachingKeyResolverTest { + + @SuppressWarnings("unchecked") + final ListenableFuture ikeyAsync = mock(ListenableFuture.class); + final static String keyId = "https://test.vault.azure.net/keys/keyID/version"; + final static String keyId2 = "https://test.vault.azure.net/keys/keyID2/version"; + final static String keyId3 = "https://test.vault.azure.net/keys/keyID3/version"; + final static String newerKeyId3 = "https://test.vault.azure.net/keys/keyID3/version2"; + final static String unversionnedKeyId3 = "https://test.vault.azure.net/keys/keyID3"; + + + /* + * Tests the capacity limit of CachingKeyResolver by adding more keys + * than the cache limit and verifying that least recently used entity is evicted. + */ + @Test + public void KeyVault_CapacityLimitOfCachingKeyResolver() + { + IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); + CachingKeyResolver resolver = new CachingKeyResolver(2, mockedKeyResolver); + + when(mockedKeyResolver.resolveKeyAsync(keyId)).thenReturn(ikeyAsync); + when(mockedKeyResolver.resolveKeyAsync(keyId2)).thenReturn(ikeyAsync); + when(mockedKeyResolver.resolveKeyAsync(keyId3)).thenReturn(ikeyAsync); + + resolver.resolveKeyAsync(keyId); + resolver.resolveKeyAsync(keyId2); + resolver.resolveKeyAsync(keyId3); + + resolver.resolveKeyAsync(keyId2); + resolver.resolveKeyAsync(keyId3); + resolver.resolveKeyAsync(keyId); + resolver.resolveKeyAsync(keyId3); + + verify(mockedKeyResolver, times(1)).resolveKeyAsync(keyId2); + verify(mockedKeyResolver, times(1)).resolveKeyAsync(keyId3); + verify(mockedKeyResolver, times(2)).resolveKeyAsync(keyId); + } + + /* + * Tests the behavior of CachingKeyResolver when resolving key throws + * and validate that the failed entity is not added to the cache. + */ + @Test + public void KeyVault_CachingKeyResolverThrows() + { + IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); + CachingKeyResolver resolver = new CachingKeyResolver(10, mockedKeyResolver); + + // First throw exception and for the second call return a value + when(mockedKeyResolver.resolveKeyAsync(keyId)) + .thenThrow(new RuntimeException("test")) + .thenReturn(ikeyAsync); + + try { + resolver.resolveKeyAsync(keyId); + fail("Should have thrown an exception."); + } + catch (UncheckedExecutionException e) { + assertTrue("RuntimeException is expected.", e.getCause() instanceof RuntimeException); + } + + resolver.resolveKeyAsync(keyId); + resolver.resolveKeyAsync(keyId); + + verify(mockedKeyResolver, times(2)).resolveKeyAsync(keyId); + } + + /* + * Tests that CachingKeyResolver does not cache unversionned keys, + * but does cache the result versionned key + */ + @Test + public void KeyVault_CachingUnversionnedKey() throws Exception { + IKeyResolver mockedKeyResolver = mock(IKeyResolver.class); + CachingKeyResolver resolver = new CachingKeyResolver(2, mockedKeyResolver); + + IKey key = mock(IKey.class); + + when(mockedKeyResolver.resolveKeyAsync(unversionnedKeyId3)).thenReturn(ikeyAsync); + when(ikeyAsync.get()).thenReturn(key); + doAnswer(new Answer() { + @Override + public Object answer(InvocationOnMock invocationOnMock) throws Throwable { + invocationOnMock.getArgumentAt(0, Runnable.class).run(); + return null; + } + }).when(ikeyAsync).addListener(any(Runnable.class), any(Executor.class)); + when(key.getKid()).thenReturn(keyId3); + + /* + * First resolve unversionned key + */ + ListenableFuture result = resolver.resolveKeyAsync(unversionnedKeyId3); + assertEquals(result.get().getKid(), keyId3); + verify(mockedKeyResolver, times(1)).resolveKeyAsync(unversionnedKeyId3); + verify(mockedKeyResolver, times(0)).resolveKeyAsync(keyId3); + + /* + * Second resolve unversionned key, but the result should be a newer key + */ + when(key.getKid()).thenReturn(newerKeyId3); + result = resolver.resolveKeyAsync(unversionnedKeyId3); + assertEquals(result.get().getKid(), newerKeyId3); + verify(mockedKeyResolver, times(2)).resolveKeyAsync(unversionnedKeyId3); + verify(mockedKeyResolver, times(0)).resolveKeyAsync(keyId3); + verify(mockedKeyResolver, times(0)).resolveKeyAsync(newerKeyId3); + + /* + * Check that versionned keys were added to the cache, and do not get resolved again + */ + resolver.resolveKeyAsync(keyId3); + resolver.resolveKeyAsync(newerKeyId3); + verify(mockedKeyResolver, times(0)).resolveKeyAsync(keyId3); + verify(mockedKeyResolver, times(0)).resolveKeyAsync(newerKeyId3); + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java new file mode 100644 index 0000000000000..2e17e5e4bc9cf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultClientIntegrationTestBase.java @@ -0,0 +1,382 @@ +package com.microsoft.azure.keyvault.extensions.test; + +import com.microsoft.aad.adal4j.AuthenticationContext; +import com.microsoft.aad.adal4j.AuthenticationResult; +import com.microsoft.aad.adal4j.ClientCredential; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import com.microsoft.azure.keyvault.KeyVaultClient; +import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyBundle; +import com.microsoft.azure.keyvault.models.DeletedSecretBundle; +import com.microsoft.azure.management.resources.core.AzureTestCredentials; +import com.microsoft.azure.management.resources.core.InterceptorManager; +import com.microsoft.azure.management.resources.core.TestBase; +import com.microsoft.azure.management.resources.fluentcore.utils.ProviderRegistrationInterceptor; +import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.LogLevel; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.interceptors.LoggingInterceptor; +import org.junit.*; +import org.junit.rules.TestName; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +public class KeyVaultClientIntegrationTestBase { + + private static TestBase.TestMode testMode = null; + private PrintStream out; + + protected enum RunCondition { + MOCK_ONLY, LIVE_ONLY, BOTH + } + + protected static KeyVaultClient keyVaultClient; + + protected final static String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; + protected final static String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; + private static final String PLAYBACK_URI_BASE = "http://localhost:"; + protected static String playbackUri = null; + + private final RunCondition runCondition; + + protected KeyVaultClientIntegrationTestBase() { + this(RunCondition.BOTH); + } + + protected KeyVaultClientIntegrationTestBase(RunCondition runCondition) { + this.runCondition = runCondition; + } + + /** + * Primary vault URI, used for keys and secrets tests. + */ + public static String getVaultUri() { + return getLiveVaultUri1(); + } + + /** + * Secondary vault URI, used to verify ability to transparently authenticate + * against a different resource. + */ + public static String getSecondaryVaultUri() { + return getLiveVaultUri2(); + } + + private static String getLiveVaultUri1() { + return getenvOrDefault("keyvault.vaulturi", "https://javasdktestvault.vault.azure.net"); + } + + private static String getLiveVaultUri2() { + return getenvOrDefault("keyvault.vaulturi.alt", "https://javasdktestvault2.vault.azure.net"); + } + + private static String getenvOrDefault(String varName, String defValue) { + String value = System.getenv(varName); + return value != null ? value : defValue; + } + + protected static void compareAttributes(Attributes expectedAttributes, Attributes actualAttribute) { + if (expectedAttributes != null) { + Assert.assertEquals(expectedAttributes.enabled(), actualAttribute.enabled()); + Assert.assertEquals(expectedAttributes.expires(), actualAttribute.expires()); + Assert.assertEquals(expectedAttributes.notBefore(), actualAttribute.notBefore()); + } + } + + private static AuthenticationResult getAccessToken(String authorization, String resource) throws Exception { + + String clientId = System.getenv("arm.clientid"); + + if (clientId == null) { + throw new Exception("Please inform arm.clientid in the environment settings."); + } + + String clientKey = System.getenv("arm.clientkey"); + String username = System.getenv("arm.username"); + String password = System.getenv("arm.password"); + + AuthenticationResult result = null; + ExecutorService service = null; + try { + service = Executors.newFixedThreadPool(1); + AuthenticationContext context = new AuthenticationContext(authorization, false, service); + + Future future = null; + + if (clientKey != null && password == null) { + ClientCredential credentials = new ClientCredential(clientId, clientKey); + future = context.acquireToken(resource, credentials, null); + } + + if (password != null && clientKey == null) { + future = context.acquireToken(resource, clientId, username, password, null); + } + + if (future == null) { + throw new Exception( + "Missing or ambiguous credentials - please inform exactly one of arm.clientkey or arm.password in the environment settings."); + } + + result = future.get(); + } finally { + service.shutdown(); + } + + if (result == null) { + throw new RuntimeException("authentication result was null"); + } + return result; + } + + private static ServiceClientCredentials createTestCredentials() throws Exception { + return new KeyVaultCredentials() { + + @Override + public String doAuthenticate(String authorization, String resource, String scope) { + try { + + if (isRecordMode()) { + AuthenticationResult authResult = getAccessToken(authorization, resource); + return authResult.getAccessToken(); + } else { + return ""; + } + + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + }; + } + + protected void initializeClients(RestClient restClient, String s, String s1) throws IOException { + try { + RestClient restClientWithTimeout = buildRestClient(new RestClient.Builder() + .withBaseUrl("https://{vaultBaseUrl}").withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .withCredentials(createTestCredentials()).withLogLevel(LogLevel.BODY_AND_HEADERS) + .withNetworkInterceptor(interceptorManager.initInterceptor())); + createTestCredentials(); + keyVaultClient = new KeyVaultClient(restClientWithTimeout); + + // keyVaultClient = new KeyVaultClient(restClient); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static String generateRandomResourceName(String prefix, int maxLen) { + return SdkContext.randomResourceName(prefix, maxLen); + } + + + private String shouldCancelTest(boolean isPlaybackMode) { + // Determine whether to run the test based on the condition the test has been + // configured with + switch (this.runCondition) { + case MOCK_ONLY: + return (!isPlaybackMode) ? "Test configured to run only as mocked, not live." : null; + case LIVE_ONLY: + return (isPlaybackMode) ? "Test configured to run only as live, not mocked." : null; + default: + return null; + } + } + + private static void initTestMode() throws IOException { + String azureTestMode = System.getenv("AZURE_TEST_MODE"); + if (azureTestMode != null) { + if (azureTestMode.equalsIgnoreCase("Record")) { + testMode = TestBase.TestMode.RECORD; + } else if (azureTestMode.equalsIgnoreCase("Playback")) { + testMode = TestBase.TestMode.PLAYBACK; + } else { + throw new IOException("Unknown AZURE_TEST_MODE: " + azureTestMode); + } + } else { + // System.out.print("Environment variable 'AZURE_TEST_MODE' has not been set + // yet. Using 'Playback' mode."); + testMode = TestBase.TestMode.PLAYBACK; + } + } + + private static void initPlaybackUri() throws IOException { + if (isPlaybackMode()) { + Properties mavenProps = new Properties(); + InputStream in = TestBase.class.getResourceAsStream("/maven.properties"); + if (in == null) { + throw new IOException( + "The file \"maven.properties\" has not been generated yet. Please execute \"mvn compile\" to generate the file."); + } + mavenProps.load(in); + String port = mavenProps.getProperty("playbackServerPort"); + playbackUri = PLAYBACK_URI_BASE + port; + } else { + playbackUri = PLAYBACK_URI_BASE + "1234"; + } + } + + public static boolean isPlaybackMode() { + if (testMode == null) + try { + initTestMode(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("Can't init test mode."); + } + return testMode == TestBase.TestMode.PLAYBACK; + } + + public static boolean isRecordMode() { + return !isPlaybackMode(); + } + + private static void printThreadInfo(String what) { + long id = Thread.currentThread().getId(); + String name = Thread.currentThread().getName(); + System.out.println(String.format("\n***\n*** [%s:%s] - %s\n***\n", name, id, what)); + } + + @Rule + public TestName testName = new TestName(); + + protected InterceptorManager interceptorManager = null; + + @BeforeClass + public static void beforeClass() throws IOException { + printThreadInfo("beforeclass"); + initTestMode(); + initPlaybackUri(); + } + + @Before + public void beforeMethod() throws Exception { + printThreadInfo(String.format("%s: %s", "beforeTest", testName.getMethodName())); + final String skipMessage = shouldCancelTest(isPlaybackMode()); + Assume.assumeTrue(skipMessage, skipMessage == null); + + interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); + + RestClient restClient; + String defaultSubscription; + ServiceClientCredentials credentials = createTestCredentials(); + + if (isRecordMode()) { + + restClient = buildRestClient(new RestClient.Builder().withBaseUrl("https://{vaultBaseUrl}") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE) + .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) + .withNetworkInterceptor(interceptorManager.initInterceptor()) + .withInterceptor(new ResourceManagerThrottlingInterceptor())); + + interceptorManager.addTextReplacementRule("https://management.azure.com/", playbackUri + "/"); + interceptorManager.addTextReplacementRule("https://graph.windows.net/", playbackUri + "/"); + + keyVaultClient = new KeyVaultClient(restClient); + } else { // is Playback Mode + + restClient = buildRestClient(new RestClient.Builder().withBaseUrl(playbackUri + "/") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE) + .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) + .withNetworkInterceptor(interceptorManager.initInterceptor()) + .withInterceptor(new ResourceManagerThrottlingInterceptor())); + defaultSubscription = ZERO_SUBSCRIPTION; + + out = System.out; + System.setOut(new PrintStream(new OutputStream() { + public void write(int b) { + // DO NOTHING + } + })); + + keyVaultClient = new KeyVaultClient(restClient); + } + + } + + protected static DeletedCertificateBundle pollOnCertificateDeletion(String vaultBaseUrl, String certificateName) + throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 21) { + DeletedCertificateBundle certificateBundle = keyVaultClient.getDeletedCertificate(vaultBaseUrl, + certificateName); + if (certificateBundle == null) { + if (isRecordMode()) { + Thread.sleep(10000); + } + pendingPollCount += 1; + continue; + } else { + return certificateBundle; + } + } + throw new Exception("Deleting certificate delayed"); + } + + protected static DeletedKeyBundle pollOnKeyDeletion(String vaultBaseUrl, String certificateName) throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 21) { + DeletedKeyBundle deletedKeyBundle = keyVaultClient.getDeletedKey(vaultBaseUrl, certificateName); + if (deletedKeyBundle == null) { + if (isRecordMode()) { + Thread.sleep(10000); + } + pendingPollCount += 1; + continue; + } else { + return deletedKeyBundle; + } + } + throw new Exception("Deleting key delayed"); + } + + protected static DeletedSecretBundle pollOnSecretDeletion(String vaultBaseUrl, String secretName) throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 50) { + DeletedSecretBundle deletedSecretBundle = keyVaultClient.getDeletedSecret(vaultBaseUrl, secretName); + if (deletedSecretBundle == null) { + if (isRecordMode()) { + Thread.sleep(10000); + } + pendingPollCount += 1; + continue; + } else { + return deletedSecretBundle; + } + } + throw new Exception("Deleting secret delayed"); + } + + + @After + public void afterMethod() throws IOException { + if (shouldCancelTest(isPlaybackMode()) != null) { + return; + } + + interceptorManager.finalizeInterceptor(); + } + + protected RestClient buildRestClient(RestClient.Builder builder) { + return builder.build(); + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java new file mode 100644 index 0000000000000..767ba16155440 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverBCProviderTest.java @@ -0,0 +1,308 @@ +// +//Copyright © Microsoft Corporation, All Rights Reserved +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +//OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION +//ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A +//PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. +// +//See the Apache License, Version 2.0 for the specific language +//governing permissions and limitations under the License. + +package com.microsoft.azure.keyvault.extensions.test; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; + +import java.security.Provider; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import org.apache.commons.codec.binary.Base64; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.extensions.KeyVaultKeyResolver; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +public class KeyVaultKeyResolverBCProviderTest extends KeyVaultClientIntegrationTestBase { + + private Provider _provider = null; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + try { + _provider = (Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance(); + } catch (ClassNotFoundException ex) { + throw new RuntimeException(ex.getMessage()); + } catch (IllegalAccessException ex) { + throw new RuntimeException(ex.getMessage()); + } catch (InstantiationException ex) { + throw new RuntimeException(ex.getMessage()); + } + } + + @After + public void tearDown() throws Exception { + } + + private static final String KEY_NAME = "JavaExtensionKey"; + private static final String SECRET_NAME = "JavaExtensionSecret"; + + private static final Base64 _base64 = new Base64(-1, null, true); + + @Test + public void KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException + { + String TEST_KEY_NAME = KEY_NAME + "1"; + try { + // Create a key on a vault. + CreateKeyRequest request = new CreateKeyRequest.Builder(getVaultUri(), TEST_KEY_NAME, JsonWebKeyType.RSA).build(); + KeyBundle bundle = keyVaultClient.createKey(request); + + if ( bundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient, _provider ); + + Future baseKeyFuture = resolver.resolveKeyAsync( bundle.keyIdentifier().baseIdentifier() ); + Future versionKeyFuture = resolver.resolveKeyAsync( bundle.keyIdentifier().identifier() ); + + IKey baseKey = baseKeyFuture.get(); + IKey versionKey = versionKeyFuture.get(); + + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + } + finally + { + // Delete the key + keyVaultClient.deleteKey( getVaultUri(), TEST_KEY_NAME ); + pollOnKeyDeletion( getVaultUri(), TEST_KEY_NAME ); + keyVaultClient.purgeDeletedKey( getVaultUri(), TEST_KEY_NAME); + + } + } + } + catch ( Exception ex ) + { + Assert.fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5 }; + + String TEST_SECRET_NAME = SECRET_NAME + "1"; + try { + + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret( request ); + + if ( secretBundle != null ) + { + try { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + finally + { + // Delete the secret + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME ); + + } + } + } + catch ( Exception ex ) { + Assert.fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + String TEST_SECRET_NAME = SECRET_NAME + "2"; + try { + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret( request ); + + if ( secretBundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient, _provider ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + finally + { + // Delete the key + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME); + } + } + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 256bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverBCProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + + String TEST_SECRET_NAME = SECRET_NAME + "3"; + + try { + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret( request ); + + if ( secretBundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient, _provider ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + } catch (Exception e) { + fail(e.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + finally + { + // Delete the key + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME ); + } + } + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java new file mode 100644 index 0000000000000..2df4c05fef714 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/src/test/java/com/microsoft/azure/keyvault/extensions/test/KeyVaultKeyResolverDefaultProviderTest.java @@ -0,0 +1,332 @@ +package com.microsoft.azure.keyvault.extensions.test; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.concurrent.ExecutionException; +import javax.crypto.Cipher; + +import org.apache.commons.codec.binary.Base64; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.microsoft.azure.keyvault.core.IKey; +import com.microsoft.azure.keyvault.extensions.KeyVaultKeyResolver; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +// +//Copyright © Microsoft Corporation, All Rights Reserved +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +//OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION +//ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A +//PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. +// +//See the Apache License, Version 2.0 for the specific language +//governing permissions and limitations under the License. + +public class KeyVaultKeyResolverDefaultProviderTest extends KeyVaultClientIntegrationTestBase { + + private static boolean hasUnlimitedCrypto() { + try { + return Cipher.getMaxAllowedKeyLength("RC5") >= 256; + } catch (NoSuchAlgorithmException e) { + return false; + } + } + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + private static final boolean _unlimited = hasUnlimitedCrypto(); + + + private static final String KEY_NAME = "JavaExtensionKey"; + private static final String SECRET_NAME = "JavaExtensionSecret"; + + private static final Base64 _base64 = new Base64(-1, null, true); + + @Test + public void KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException + { + String TEST_KEY_NAME = KEY_NAME + "1"; + try { + // Create a key on a vault. + CreateKeyRequest request = new CreateKeyRequest.Builder(getVaultUri(), TEST_KEY_NAME, JsonWebKeyType.RSA).build(); + KeyBundle keyBundle = keyVaultClient.createKey(request); + + try + { + // ctor with client + final KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient ); + + IKey baseKey = resolver.resolveKeyAsync( keyBundle.keyIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( keyBundle.keyIdentifier().identifier() ).get(); + + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + } + finally + { + // Delete the key + keyVaultClient.deleteKey( getVaultUri(), TEST_KEY_NAME ); + pollOnKeyDeletion( getVaultUri(), TEST_KEY_NAME ); + keyVaultClient.purgeDeletedKey( getVaultUri(), TEST_KEY_NAME ); + } + } catch(Exception ex) { + fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x1F, (byte) 0xA6, (byte) 0x8B, 0x0A, (byte) 0x81, 0x12, (byte) 0xB4, 0x47, (byte) 0xAE, (byte) 0xF3, 0x4B, (byte) 0xD8, (byte) 0xFB, 0x5A, 0x7B, (byte) 0x82, (byte) 0x9D, 0x3E, (byte) 0x86, 0x23, 0x71, (byte) 0xD2, (byte) 0xCF, (byte) 0xE5 }; + + String TEST_SECRET_NAME = SECRET_NAME + "1"; + + try { + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret(request); + + if ( secretBundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A128KW").get().getLeft(); + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + finally + { + // Delete the key + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME ); + } + } + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 128bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D }; + + String TEST_SECRET_NAME = SECRET_NAME + "2"; + + try { + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret( request ); + + if ( secretBundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + + if (!_unlimited) fail("Expected ExecutionException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!_unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + + if ( _unlimited ) { + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A192KW").get().getLeft(); + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + } + finally + { + // Delete the key + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME ); + } + } + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + } + + /* + * Test resolving a key from a 256bit secret encoded as base64 in a vault using various KeyVaultKeyResolver constructors. + */ + @Test + public void KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverDefaultProviderTest() throws InterruptedException, ExecutionException + { + // Arrange + byte[] keyBytes = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + byte[] CEK = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF }; + byte[] EK = { 0x64, (byte) 0xE8, (byte) 0xC3, (byte) 0xF9, (byte) 0xCE, 0x0F, 0x5B, (byte) 0xA2, 0x63, (byte) 0xE9, 0x77, 0x79, 0x05, (byte) 0x81, (byte) 0x8A, 0x2A, (byte) 0x93, (byte) 0xC8, 0x19, 0x1E, 0x7D, 0x6E, (byte) 0x8A, (byte) 0xE7 }; + + String TEST_SECRET_NAME = SECRET_NAME + "3"; + + try { + SetSecretRequest request = new SetSecretRequest.Builder(getVaultUri(), TEST_SECRET_NAME, _base64.encodeAsString(keyBytes)).withContentType("application/octet-stream").build(); + SecretBundle secretBundle = keyVaultClient.setSecret( request ); + + if ( secretBundle != null ) + { + try + { + // ctor with client + KeyVaultKeyResolver resolver = new KeyVaultKeyResolver( keyVaultClient ); + + IKey baseKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().baseIdentifier() ).get(); + IKey versionKey = resolver.resolveKeyAsync( secretBundle.secretIdentifier().identifier() ).get(); + + // Check for correct key identifiers + Assert.assertEquals( baseKey.getKid(), versionKey.getKid() ); + + // Ensure key operations give the expected results + byte[] encrypted = null; + + try { + encrypted = baseKey.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + + if (!_unlimited) fail("Expected ExecutionException"); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + // In the limited case, the failure should be InvalidKeyException + // In the unlimited case, this should not fail + if (!_unlimited) { + Throwable cause = e.getCause(); + if (cause == null || !(cause instanceof InvalidKeyException)) fail("ExecutionException"); + } else { + fail("ExecutionException"); + } + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + if ( _unlimited ) { + // Assert + assertArrayEquals(EK, encrypted); + + try { + encrypted = versionKey.wrapKeyAsync(CEK, "A256KW").get().getLeft(); + } catch (InterruptedException e) { + fail("InterrupedException"); + } catch (ExecutionException e) { + fail("ExecutionException"); + } catch (NoSuchAlgorithmException e) { + fail("NoSuchAlgorithmException"); + } + + // Assert + assertArrayEquals(EK, encrypted); + } + } + finally + { + // Delete the key + keyVaultClient.deleteSecret( getVaultUri(), TEST_SECRET_NAME ); + pollOnSecretDeletion( getVaultUri(), TEST_SECRET_NAME ); + keyVaultClient.purgeDeletedSecret( getVaultUri(), TEST_SECRET_NAME ); + } + } + } catch ( Exception ex ) { + fail(ex.getMessage()); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key.json new file mode 100644 index 0000000000000..4ec8238186e39 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key.json @@ -0,0 +1,212 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/create?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "67881604-5362-4a60-985e-05c14eb0c784", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/create?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "661", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "73672cfe-a45c-451c-b4d0-6d0ec4e7bc18", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sWFPRfq-Z2JFEF_8HZ9j2CwVKHKhOT-3F9tq-R7nwDfZ965Nx4cAkPeQVRd79MiCFs2WS3ar4sWSd2_w35WLwICC0gH650QtczcXX2I5xYOkWLIbokRtQG1WdS5DVdWlSQUewewfbvlUp1Huh5qVeZoYja_Pgboi8k5QsCZt44R9mKX_1BeANZQnzQlvX7klyihF44D7d2lflWa5RZ1bV0S50hS1acnmBnN7pHNwBwhD-XreCJHHe_LlWZg7GwcErPeHNVMCQrJ3_pMGjQVqC8H_HrU745ZVcbiZJP34bX8lixZrtPEKIoK-WLsJM3m7a83G6jc-EIi26VAoukq5iw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1509124270,\"updated\":1509124270,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "63ec4b4a-16d7-4348-aae9-0239ac709e0d", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "661", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "f37808cf-bd0c-4719-b51b-96f6c94edbe5", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sWFPRfq-Z2JFEF_8HZ9j2CwVKHKhOT-3F9tq-R7nwDfZ965Nx4cAkPeQVRd79MiCFs2WS3ar4sWSd2_w35WLwICC0gH650QtczcXX2I5xYOkWLIbokRtQG1WdS5DVdWlSQUewewfbvlUp1Huh5qVeZoYja_Pgboi8k5QsCZt44R9mKX_1BeANZQnzQlvX7klyihF44D7d2lflWa5RZ1bV0S50hS1acnmBnN7pHNwBwhD-XreCJHHe_LlWZg7GwcErPeHNVMCQrJ3_pMGjQVqC8H_HrU745ZVcbiZJP34bX8lixZrtPEKIoK-WLsJM3m7a83G6jc-EIi26VAoukq5iw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1509124270,\"updated\":1509124270,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "2d1edf82-321d-45b2-810a-50e2f2e2b8dd", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "661", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "adff96dc-ddec-4cca-9364-7837426b7eb2", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sWFPRfq-Z2JFEF_8HZ9j2CwVKHKhOT-3F9tq-R7nwDfZ965Nx4cAkPeQVRd79MiCFs2WS3ar4sWSd2_w35WLwICC0gH650QtczcXX2I5xYOkWLIbokRtQG1WdS5DVdWlSQUewewfbvlUp1Huh5qVeZoYja_Pgboi8k5QsCZt44R9mKX_1BeANZQnzQlvX7klyihF44D7d2lflWa5RZ1bV0S50hS1acnmBnN7pHNwBwhD-XreCJHHe_LlWZg7GwcErPeHNVMCQrJ3_pMGjQVqC8H_HrU745ZVcbiZJP34bX8lixZrtPEKIoK-WLsJM3m7a83G6jc-EIi26VAoukq5iw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1509124270,\"updated\":1509124270,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "d1fc532a-d2c0-4ac8-add0-199d3b59cea0", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:10 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "661", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "ba7ee61b-0773-48e5-a158-c16b8115a397", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey/86cee9e27d734d5692f8c0401575675e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"sWFPRfq-Z2JFEF_8HZ9j2CwVKHKhOT-3F9tq-R7nwDfZ965Nx4cAkPeQVRd79MiCFs2WS3ar4sWSd2_w35WLwICC0gH650QtczcXX2I5xYOkWLIbokRtQG1WdS5DVdWlSQUewewfbvlUp1Huh5qVeZoYja_Pgboi8k5QsCZt44R9mKX_1BeANZQnzQlvX7klyihF44D7d2lflWa5RZ1bV0S50hS1acnmBnN7pHNwBwhD-XreCJHHe_LlWZg7GwcErPeHNVMCQrJ3_pMGjQVqC8H_HrU745ZVcbiZJP34bX8lixZrtPEKIoK-WLsJM3m7a83G6jc-EIi26VAoukq5iw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1509124270,\"updated\":1509124270,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverBCProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverBCProviderTest.json new file mode 100644 index 0000000000000..7411b42e22e3a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverBCProviderTest.json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:25 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b33299d5-0d84-429a-9863-9f71fa653e33", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:26 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3c394856-1f18-486b-8a72-a0e1da379be6", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"j1Yl305qd5uKultZ9jitFjj2NaVvElwBOk2qQGX0YeCncznmfAqk5QgwqwgUhDWKt2Ojutud3n-Ptuw8pJ4zY2je119omDo_7X3R1CBD13vqAhReNFLbZuF-pFXCPR0xRz0tQpX8kQeV4Rq5IxMR6id1XoxX7isjbBZmwSesH7inRqkM3vWSkqZkNF0V02g6YUzDajmudzH1zppPlBLXkymECXQOA_GA2LImAaBk35YSDYgeXbCqtCdkCaV4PsyPEmBTis5xM30KDrTxviVCJltM9fut6s8dJstammi4wHodZe0ZNkBu-cCKvX9DbPAvymdG3NFD5ss-nCMWSWcQUQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529962946,\"updated\":1529962946,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:28 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5954b38a-0273-42bf-9517-e511ccf15578", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"j1Yl305qd5uKultZ9jitFjj2NaVvElwBOk2qQGX0YeCncznmfAqk5QgwqwgUhDWKt2Ojutud3n-Ptuw8pJ4zY2je119omDo_7X3R1CBD13vqAhReNFLbZuF-pFXCPR0xRz0tQpX8kQeV4Rq5IxMR6id1XoxX7isjbBZmwSesH7inRqkM3vWSkqZkNF0V02g6YUzDajmudzH1zppPlBLXkymECXQOA_GA2LImAaBk35YSDYgeXbCqtCdkCaV4PsyPEmBTis5xM30KDrTxviVCJltM9fut6s8dJstammi4wHodZe0ZNkBu-cCKvX9DbPAvymdG3NFD5ss-nCMWSWcQUQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529962946,\"updated\":1529962946,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:30 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0e9d2a1b-1251-403d-8471-87cbb685789c", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"j1Yl305qd5uKultZ9jitFjj2NaVvElwBOk2qQGX0YeCncznmfAqk5QgwqwgUhDWKt2Ojutud3n-Ptuw8pJ4zY2je119omDo_7X3R1CBD13vqAhReNFLbZuF-pFXCPR0xRz0tQpX8kQeV4Rq5IxMR6id1XoxX7isjbBZmwSesH7inRqkM3vWSkqZkNF0V02g6YUzDajmudzH1zppPlBLXkymECXQOA_GA2LImAaBk35YSDYgeXbCqtCdkCaV4PsyPEmBTis5xM30KDrTxviVCJltM9fut6s8dJstammi4wHodZe0ZNkBu-cCKvX9DbPAvymdG3NFD5ss-nCMWSWcQUQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529962946,\"updated\":1529962946,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:31 GMT", + "content-length" : "823", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5e445b91-1dbb-4c2c-9236-7020164618cc", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1529962951,\"scheduledPurgeDate\":1537738951,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"j1Yl305qd5uKultZ9jitFjj2NaVvElwBOk2qQGX0YeCncznmfAqk5QgwqwgUhDWKt2Ojutud3n-Ptuw8pJ4zY2je119omDo_7X3R1CBD13vqAhReNFLbZuF-pFXCPR0xRz0tQpX8kQeV4Rq5IxMR6id1XoxX7isjbBZmwSesH7inRqkM3vWSkqZkNF0V02g6YUzDajmudzH1zppPlBLXkymECXQOA_GA2LImAaBk35YSDYgeXbCqtCdkCaV4PsyPEmBTis5xM30KDrTxviVCJltM9fut6s8dJstammi4wHodZe0ZNkBu-cCKvX9DbPAvymdG3NFD5ss-nCMWSWcQUQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529962946,\"updated\":1529962946,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:33 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e51c8e1d-2212-4e90-9fea-5c6f8b20d9be", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:44 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5078e4f6-465d-4cb9-ad74-4915df6d855c", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:57 GMT", + "content-length" : "823", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4dc4c494-f0b4-4fe1-8917-cd31d45ff7ff", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1529962951,\"scheduledPurgeDate\":1537738951,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/dccd6ba8014a4ae39ac2f122499c6eca\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"j1Yl305qd5uKultZ9jitFjj2NaVvElwBOk2qQGX0YeCncznmfAqk5QgwqwgUhDWKt2Ojutud3n-Ptuw8pJ4zY2je119omDo_7X3R1CBD13vqAhReNFLbZuF-pFXCPR0xRz0tQpX8kQeV4Rq5IxMR6id1XoxX7isjbBZmwSesH7inRqkM3vWSkqZkNF0V02g6YUzDajmudzH1zppPlBLXkymECXQOA_GA2LImAaBk35YSDYgeXbCqtCdkCaV4PsyPEmBTis5xM30KDrTxviVCJltM9fut6s8dJstammi4wHodZe0ZNkBu-cCKvX9DbPAvymdG3NFD5ss-nCMWSWcQUQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529962946,\"updated\":1529962946,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:58 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8ad5c8a9-cf11-4427-818d-efaa3f2bad05", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverDefaultProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverDefaultProviderTest.json new file mode 100644 index 0000000000000..ffc9a930ff709 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Key_KeyVaultKeyResolverDefaultProviderTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:14 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c045ccf2-263b-4be5-bb45-cf61cdf8d191", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:16 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3ab77773-2743-4cd4-b573-aa2acbfd05a1", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"0l9rjWJoKf-BnGB78pt1q_Qt43e2oEM2wE0zG8VqczMsD6H72iL_RcQZUwgIyJAZAinJQ9cUqbwz21C20rACtaPEi99uVv0cYQUnQK66F8frCrPTH_H2B2mLFk4DJs442FW3GcMt5i8kozs-Kc532g-DSTNPdz2of-MDVtF0wG0bk6V1s0Gs6tRd087goZUCre8eYUC_wc1jsivhN4z9teyHqqJQi7-3jO_PBiaBsc3NaitVMuwg797QOjMO84eO3PQnkYeCA6Jb10SThFMgbH5JXtRZOegptyrzYxPRzyah7OfVsiqHsgLMtJ9LnhLpXtc9nSXlaf20II7MP-7SUw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529961736,\"updated\":1529961736,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:18 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "acbca651-c8ab-47e8-bb2f-04d4d2f1eab5", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"0l9rjWJoKf-BnGB78pt1q_Qt43e2oEM2wE0zG8VqczMsD6H72iL_RcQZUwgIyJAZAinJQ9cUqbwz21C20rACtaPEi99uVv0cYQUnQK66F8frCrPTH_H2B2mLFk4DJs442FW3GcMt5i8kozs-Kc532g-DSTNPdz2of-MDVtF0wG0bk6V1s0Gs6tRd087goZUCre8eYUC_wc1jsivhN4z9teyHqqJQi7-3jO_PBiaBsc3NaitVMuwg797QOjMO84eO3PQnkYeCA6Jb10SThFMgbH5JXtRZOegptyrzYxPRzyah7OfVsiqHsgLMtJ9LnhLpXtc9nSXlaf20II7MP-7SUw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529961736,\"updated\":1529961736,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:19 GMT", + "content-length" : "674", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "34697143-5109-4df3-b36e-e8488d0a729f", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"0l9rjWJoKf-BnGB78pt1q_Qt43e2oEM2wE0zG8VqczMsD6H72iL_RcQZUwgIyJAZAinJQ9cUqbwz21C20rACtaPEi99uVv0cYQUnQK66F8frCrPTH_H2B2mLFk4DJs442FW3GcMt5i8kozs-Kc532g-DSTNPdz2of-MDVtF0wG0bk6V1s0Gs6tRd087goZUCre8eYUC_wc1jsivhN4z9teyHqqJQi7-3jO_PBiaBsc3NaitVMuwg797QOjMO84eO3PQnkYeCA6Jb10SThFMgbH5JXtRZOegptyrzYxPRzyah7OfVsiqHsgLMtJ9LnhLpXtc9nSXlaf20II7MP-7SUw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529961736,\"updated\":1529961736,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:19 GMT", + "content-length" : "823", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "85fbccc4-89ce-44e2-b631-fc0742d93f56", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1529961739,\"scheduledPurgeDate\":1537737739,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"0l9rjWJoKf-BnGB78pt1q_Qt43e2oEM2wE0zG8VqczMsD6H72iL_RcQZUwgIyJAZAinJQ9cUqbwz21C20rACtaPEi99uVv0cYQUnQK66F8frCrPTH_H2B2mLFk4DJs442FW3GcMt5i8kozs-Kc532g-DSTNPdz2of-MDVtF0wG0bk6V1s0Gs6tRd087goZUCre8eYUC_wc1jsivhN4z9teyHqqJQi7-3jO_PBiaBsc3NaitVMuwg797QOjMO84eO3PQnkYeCA6Jb10SThFMgbH5JXtRZOegptyrzYxPRzyah7OfVsiqHsgLMtJ9LnhLpXtc9nSXlaf20II7MP-7SUw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529961736,\"updated\":1529961736,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:23 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3e663752-1ab5-4824-bb3c-51c46afb30e2", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: JavaExtensionKey1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:34 GMT", + "content-length" : "823", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3460e39b-9e11-4133-9477-ce4c7e92410f", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1\",\"deletedDate\":1529961739,\"scheduledPurgeDate\":1537737739,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/JavaExtensionKey1/93d42ad97a7842eb8925c5b4dfbea76e\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"0l9rjWJoKf-BnGB78pt1q_Qt43e2oEM2wE0zG8VqczMsD6H72iL_RcQZUwgIyJAZAinJQ9cUqbwz21C20rACtaPEi99uVv0cYQUnQK66F8frCrPTH_H2B2mLFk4DJs442FW3GcMt5i8kozs-Kc532g-DSTNPdz2of-MDVtF0wG0bk6V1s0Gs6tRd087goZUCre8eYUC_wc1jsivhN4z9teyHqqJQi7-3jO_PBiaBsc3NaitVMuwg797QOjMO84eO3PQnkYeCA6Jb10SThFMgbH5JXtRZOegptyrzYxPRzyah7OfVsiqHsgLMtJ9LnhLpXtc9nSXlaf20II7MP-7SUw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529961736,\"updated\":1529961736,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/JavaExtensionKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:35 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4418fde5-e9e7-457a-81af-b33c2acb6c31", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64.json new file mode 100644 index 0000000000000..3f97ae80723aa --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64.json @@ -0,0 +1,212 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:08 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "7cd993cf-216d-42c4-bb36-7278729d55f9", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "290", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "d89cdda4-741f-46a8-ae27-db93aa1d5909", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305\",\"attributes\":{\"enabled\":true,\"created\":1509124269,\"updated\":1509124269,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "3e7ea916-39bf-46b1-8c00-886f309b5e20", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "290", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "f3e1aacd-ce5e-4b1e-8df1-1406a8d61e1d", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305\",\"attributes\":{\"enabled\":true,\"created\":1509124269,\"updated\":1509124269,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "8674d079-9a74-4b5a-9d85-86c887731e29", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "290", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "387f9ad1-c6f0-4c7f-bda0-2a591d9c5004", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305\",\"attributes\":{\"enabled\":true,\"created\":1509124269,\"updated\":1509124269,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "d3544617-f562-43d7-a381-e91e810626db", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:09 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "257", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "19c91fd9-0c20-4bf9-aa82-02252bdb6913", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/73d86a48b2a94f868276007ba620b305\",\"attributes\":{\"enabled\":true,\"created\":1509124269,\"updated\":1509124269,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverBCProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverBCProviderTest.json new file mode 100644 index 0000000000000..bc2d373201e3d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverBCProviderTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:41 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "54df7778-3be6-4420-8ed0-892b94f7f1a4", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:43 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e6e6b826-232a-4f1f-9ced-d766c5f40563", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5\",\"attributes\":{\"enabled\":true,\"created\":1529962903,\"updated\":1529962903,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:44 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9397cc6f-3fd4-4e7e-8ac3-cbd6510fb284", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5\",\"attributes\":{\"enabled\":true,\"created\":1529962903,\"updated\":1529962903,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:45 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "49169fdc-b7f6-4dde-8775-9cff28e9903f", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5\",\"attributes\":{\"enabled\":true,\"created\":1529962903,\"updated\":1529962903,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:47 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6b11c66b-440d-4582-8f3f-36fce9aba79a", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1529962907,\"scheduledPurgeDate\":1537738907,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5\",\"attributes\":{\"enabled\":true,\"created\":1529962903,\"updated\":1529962903,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:41:47 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "27dd6357-1025-4c6f-95f1-3aa5f4382dc2", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:00 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c4842b6d-1abf-440c-8953-d97b5d77ee0e", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1529962907,\"scheduledPurgeDate\":1537738907,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/b1bdfdb663494a2f8a7594d4aca309f5\",\"attributes\":{\"enabled\":true,\"created\":1529962903,\"updated\":1529962903,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:01 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dc6e5859-4d2c-4a67-896b-421e70026551", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverDefaultProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverDefaultProviderTest.json new file mode 100644 index 0000000000000..c21eda2f67ab5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret128Base64_KeyVaultKeyResolverDefaultProviderTest.json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:05 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cb1b7f7f-72ee-4642-bec1-b5c8030f042b", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:08 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8b6bc90f-8930-48e2-96b8-c9a176eed228", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b\",\"attributes\":{\"enabled\":true,\"created\":1529961668,\"updated\":1529961668,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:09 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "71739e44-356f-4d91-8fd9-8082cac85d19", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b\",\"attributes\":{\"enabled\":true,\"created\":1529961668,\"updated\":1529961668,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:11 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5d62591d-66f3-4be9-b5e5-652a410a299e", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODw\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b\",\"attributes\":{\"enabled\":true,\"created\":1529961668,\"updated\":1529961668,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:11 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b59f0561-bb57-4a4a-8ad4-a4e69d598e76", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1529961672,\"scheduledPurgeDate\":1537737672,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b\",\"attributes\":{\"enabled\":true,\"created\":1529961668,\"updated\":1529961668,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:12 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1cfffd8b-acd9-476b-8fcb-e639fbf2b078", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:23 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "73497dde-2cbb-4188-bb39-2258e4c7e8cb", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:34 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5f1232e2-0b99-4ff7-b511-5ea1ee435f7a", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1\",\"deletedDate\":1529961672,\"scheduledPurgeDate\":1537737672,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret1/3660edafb1a04204876ed246a3c4514b\",\"attributes\":{\"enabled\":true,\"created\":1529961668,\"updated\":1529961668,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:37 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "019bf790-a06b-454f-8d4c-ddf2f872e943", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64.json new file mode 100644 index 0000000000000..3998032740d84 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64.json @@ -0,0 +1,212 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "8a2b2e25-e12b-47cb-88d1-93bddfdfb2ef", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "300", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "05a49818-7459-4e4f-8dc0-c15b39aa3ead", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "ce06104c-1b88-43b0-bcc7-5a92e244c82b", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "300", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "1ef7c500-e316-4169-a5e4-d787c3a38c52", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "fdaa3373-8eb8-412c-ba72-def52a428462", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "300", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "a4d06428-6bc2-4573-89bf-a5c477cd0d43", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "32f2e4da-f924-4adb-ac86-f621f0029704", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:08 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "257", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "c7b2e8ab-8bcd-413f-ac30-04fdaec0a052", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/2a5319a6aa9442399660ee6cc582445f\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverBCProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverBCProviderTest.json new file mode 100644 index 0000000000000..e01e72a4754f6 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverBCProviderTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:58 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d4374be8-8f6e-431d-a2f7-43d4a14b21fe", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:59 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d47caae8-b82d-4fd0-9aa3-a8adb80b91e9", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91\",\"attributes\":{\"enabled\":true,\"created\":1529962979,\"updated\":1529962979,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:00 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9ec8c543-5875-4cf7-a7fd-2fe9af5066b2", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91\",\"attributes\":{\"enabled\":true,\"created\":1529962979,\"updated\":1529962979,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:03 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2b0bbedb-6a9f-4dc3-8306-e56019c8f97c", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91\",\"attributes\":{\"enabled\":true,\"created\":1529962979,\"updated\":1529962979,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:04 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4380c7a1-1a69-4987-90c9-2b92567d7f8a", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1529962984,\"scheduledPurgeDate\":1537738984,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91\",\"attributes\":{\"enabled\":true,\"created\":1529962979,\"updated\":1529962979,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:05 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bccc94ad-d3d1-41d3-90b5-3a2af1c299e5", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:20 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "705f16af-2a5b-45e9-96c4-db3dc60016d8", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1529962984,\"scheduledPurgeDate\":1537738984,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/b501f89c350e430a81d4efd59c372c91\",\"attributes\":{\"enabled\":true,\"created\":1529962979,\"updated\":1529962979,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:43:21 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b65c2739-f027-4e75-ac8c-f78f8b7c87c3", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverDefaultProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverDefaultProviderTest.json new file mode 100644 index 0000000000000..e5c6aed12a21b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret192Base64_KeyVaultKeyResolverDefaultProviderTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:36 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "62cb3197-e61c-44fb-87a2-b1fcaa0260ed", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:40 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b5a08ae9-bf3b-46b5-b715-9b20356f7307", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e\",\"attributes\":{\"enabled\":true,\"created\":1529961640,\"updated\":1529961640,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:41 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "291803e2-3257-4d43-a855-ffae71542940", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e\",\"attributes\":{\"enabled\":true,\"created\":1529961640,\"updated\":1529961640,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:46 GMT", + "content-length" : "313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "efde48d1-b1bb-4abb-9eff-2a18105d3dae", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYX\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e\",\"attributes\":{\"enabled\":true,\"created\":1529961640,\"updated\":1529961640,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:48 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4557a962-740d-4221-9ff5-8f0fa90ae5e5", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1529961648,\"scheduledPurgeDate\":1537737648,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e\",\"attributes\":{\"enabled\":true,\"created\":1529961640,\"updated\":1529961640,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:20:50 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d901c334-4cbf-4c39-8706-e7f79ed78e3b", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:03 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b1c9446f-bffa-4028-abe0-e29d6bdadbae", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2\",\"deletedDate\":1529961648,\"scheduledPurgeDate\":1537737648,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret2/034d5deab8164ffc97ca154f0cd9466e\",\"attributes\":{\"enabled\":true,\"created\":1529961640,\"updated\":1529961640,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:04 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c1f5b6ab-e133-4215-956a-2da4f3be09df", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64.json new file mode 100644 index 0000000000000..2c09335ae0471 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64.json @@ -0,0 +1,212 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:06 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "ed9f4eec-eb23-4128-9ccd-bf0c6312c3d0", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:06 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "311", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "428d5d1f-e6fc-485e-b15b-2747466d15ee", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:06 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "fc6c54e3-fe73-4d31-b84e-e0fca26050d9", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:06 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "311", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "2edc5dd1-a1bb-4995-b64e-52b370e0c427", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:06 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "7952e0ca-99de-4839-9248-d307d6b102b5", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "311", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "59a41bdd-badd-4f3c-8cd5-783d92f538c1", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "b7933819-6a71-47ac-bd2d-713c714e965e", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret?api-version=2016-10-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null (KeyVaultClientBase, 2016-10-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Fri, 27 Oct 2017 17:11:07 GMT", + "server" : "Microsoft-IIS/8.5", + "content-length" : "257", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-request-id" : "5f590fab-7878-4b51-ac84-e5f3d72e5a69", + "x-ms-keyvault-service-version" : "1.0.0.826", + "Body" : "{\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret/a741d540b987426c9649ef1bde017488\",\"attributes\":{\"enabled\":true,\"created\":1509124267,\"updated\":1509124267,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverBCProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverBCProviderTest.json new file mode 100644 index 0000000000000..af284b3c04fcf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverBCProviderTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:01 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cc5bd3d4-d3ff-4453-a20e-fa49e582a84b", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:03 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2a72c49e-5d14-4e46-97fc-62dacb0c9c0f", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab\",\"attributes\":{\"enabled\":true,\"created\":1529962923,\"updated\":1529962923,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:06 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2277fd77-1acd-4735-84b8-b6ef097c6ac2", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab\",\"attributes\":{\"enabled\":true,\"created\":1529962923,\"updated\":1529962923,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:07 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d44518f5-ccf1-4e88-9586-4038c1fb1cf4", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab\",\"attributes\":{\"enabled\":true,\"created\":1529962923,\"updated\":1529962923,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:09 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f6e3b359-848e-4cc5-9143-12a6389e9808", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1529962929,\"scheduledPurgeDate\":1537738929,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab\",\"attributes\":{\"enabled\":true,\"created\":1529962923,\"updated\":1529962923,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:10 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b391ff5b-fef8-4053-a422-fdbd2f41f7a9", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:22 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0384cc96-00ef-4404-8de0-04b72ca1b14c", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1529962929,\"scheduledPurgeDate\":1537738929,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/a94886eb8ad64bef8af8e1fcc0d820ab\",\"attributes\":{\"enabled\":true,\"created\":1529962923,\"updated\":1529962923,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:42:24 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4212235d-b2eb-4f99-ae79-703da82c16a3", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverDefaultProviderTest.json b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverDefaultProviderTest.json new file mode 100644 index 0000000000000..449913aab8447 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-extensions/target/test-classes/session-records/KeyVault_KeyVaultKeyResolver_Secret256Base64_KeyVaultKeyResolverDefaultProviderTest.json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:37 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "515fc45a-5154-4def-bd38-7f5e7e225274", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:40 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "fe666844-bbff-4583-aee4-61d597f7e0f7", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be\",\"attributes\":{\"enabled\":true,\"created\":1529961701,\"updated\":1529961701,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:44 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "abd49cc7-f213-4c39-984a-8625ead28a4a", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be\",\"attributes\":{\"enabled\":true,\"created\":1529961701,\"updated\":1529961701,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:46 GMT", + "content-length" : "324", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "53d069d3-6c2f-4fc8-b0e6-fbdbaacbad4b", + "Body" : "{\"value\":\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be\",\"attributes\":{\"enabled\":true,\"created\":1529961701,\"updated\":1529961701,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:47 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d406910f-3266-45f2-9913-aa22d4c0ebc2", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1529961708,\"scheduledPurgeDate\":1537737708,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be\",\"attributes\":{\"enabled\":true,\"created\":1529961701,\"updated\":1529961701,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:48 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "15c519bc-78e5-40a5-bb8e-de82a9e8416d", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:21:59 GMT", + "content-length" : "94", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9575069d-5da9-492f-bbec-d7e66a695f25", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: JavaExtensionSecret3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:11 GMT", + "content-length" : "425", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c3cda06a-f5e3-4ab9-8ac8-7659c73a8c0c", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3\",\"deletedDate\":1529961708,\"scheduledPurgeDate\":1537737708,\"contentType\":\"application/octet-stream\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/JavaExtensionSecret3/ea1deb0012b24eb89a924fe1783751be\",\"attributes\":{\"enabled\":true,\"created\":1529961701,\"updated\":1529961701,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/JavaExtensionSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 21:22:14 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5ea866f5-7130-48ca-b495-8eed855098eb", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-webkey/pom.xml b/keyvault/data-plane/azure-keyvault-webkey/pom.xml new file mode 100644 index 0000000000000..19c30eeed8a05 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/pom.xml @@ -0,0 +1,128 @@ + + + 4.0.0 + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + azure-keyvault-webkey + 1.1.2 + jar + + Microsoft Azure SDK for Key Vault WebKey + This package contains Microsoft Azure Key Vault WebKey library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + + + + + commons-codec + commons-codec + + + com.google.guava + guava + + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.12 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + com.microsoft.schemas._2003._10.serialization; + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+
+
+
diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonDeserializer.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonDeserializer.java new file mode 100644 index 0000000000000..f36de8c23bca5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonDeserializer.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.io.IOException; + +import org.apache.commons.codec.binary.Base64; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; + +/** + * The base64 URL JSON deserializer. + */ +public class Base64UrlJsonDeserializer extends JsonDeserializer { + + static final Base64 BASE64 = new Base64(-1, null, true); + + @Override + public byte[] deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + String text = jp.getText(); + if (text != null) { + return BASE64.decode(text); + } + return null; + } + +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonSerializer.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonSerializer.java new file mode 100644 index 0000000000000..c4b56b7d5a3a9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/Base64UrlJsonSerializer.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.io.IOException; + +import org.apache.commons.codec.binary.Base64; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * The base64 URL JSON serializer. + */ +public class Base64UrlJsonSerializer extends JsonSerializer { + + static final Base64 BASE64 = new Base64(-1, null, true); + + @Override + public void serialize(byte[] value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + String text; + if (value == null) { + text = null; + } else if (value.length == 0) { + text = ""; + } else { + text = BASE64.encodeAsString(value); + } + jgen.writeString(text); + } + +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java new file mode 100644 index 0000000000000..c7d317a070283 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java @@ -0,0 +1,1203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.Security; +import java.security.interfaces.ECPrivateKey; +import java.security.interfaces.ECPublicKey; +import java.security.interfaces.RSAPrivateCrtKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.ECPrivateKeySpec; +import java.security.spec.ECPublicKeySpec; +import java.security.spec.EllipticCurve; +import java.security.spec.RSAPrivateCrtKeySpec; +import java.security.spec.RSAPrivateKeySpec; +import java.security.spec.RSAPublicKeySpec; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableMap; + +/** + * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18. + */ +@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY) +public class JsonWebKey { + + /** + * Key Identifier. + */ + @JsonProperty(value = "kid") + private String kid; + + /** + * JsonWebKey key type (kty). Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct'. + */ + @JsonProperty(value = "kty") + private JsonWebKeyType kty; + + /** + * The keyOps property. + */ + @JsonProperty(value = "key_ops") + private List keyOps; + + /** + * RSA modulus. + */ + @JsonProperty(value = "n") + private byte[] n; + + /** + * RSA public exponent. + */ + @JsonProperty(value = "e") + private byte[] e; + + /** + * RSA private exponent, or the D component of an EC private key. + */ + @JsonProperty(value = "d") + private byte[] d; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "dp") + private byte[] dp; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "dq") + private byte[] dq; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "qi") + private byte[] qi; + + /** + * RSA secret prime. + */ + @JsonProperty(value = "p") + private byte[] p; + + /** + * RSA secret prime, with p & q. + */ + @JsonProperty(value = "q") + private byte[] q; + + /** + * Symmetric key. + */ + @JsonProperty(value = "k") + private byte[] k; + + /** + * HSM Token, used with Bring Your Own Key. + */ + @JsonProperty(value = "key_hsm") + private byte[] t; + + /** + * Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible + * values include: 'P-256', 'P-384', 'P-521', 'SECP256K1'. + */ + @JsonProperty(value = "crv") + private JsonWebKeyCurveName crv; + + /** + * X component of an EC public key. + */ + @JsonProperty(value = "x") + private byte[] x; + + /** + * Y component of an EC public key. + */ + @JsonProperty(value = "y") + private byte[] y; + + /** + * Get the kid value. + * + * @return the kid value + */ + @JsonProperty("kid") + public String kid() { + return this.kid; + } + + /** + * Set the key identifier value. + * + * @param kid + * the kid value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withKid(String kid) { + this.kid = kid; + return this; + } + + /** + * Get the kty value. + * + * @return the kty value + */ + @JsonProperty("kty") + public JsonWebKeyType kty() { + return this.kty; + } + + /** + * Set the key type value. + * + * @param kty + * the key type + * @return the JsonWebKey object itself. + */ + public JsonWebKey withKty(JsonWebKeyType kty) { + this.kty = kty; + return this; + } + + /** + * Get the keyOps value. + * + * @return the keyOps value + */ + @JsonProperty("key_ops") + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps value. + * + * @param keyOps + * the keyOps value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the n value. + * + * @return the n value + */ + @JsonProperty("n") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] n() { + return this.n; + } + + /** + * Set the n value. + * + * @param n + * the n value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withN(byte[] n) { + this.n = n; + return this; + } + + /** + * Get the e value. + * + * @return the e value + */ + @JsonProperty("e") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] e() { + return this.e; + } + + /** + * Set the e value. + * + * @param e + * the e value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withE(byte[] e) { + this.e = e; + return this; + } + + /** + * Get the d value. + * + * @return the d value + */ + @JsonProperty("d") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] d() { + return this.d; + } + + /** + * Set the d value. + * + * @param d + * the d value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withD(byte[] d) { + this.d = d; + return this; + } + + /** + * Get the RSA Private Key Parameter value. + * + * @return the RSA Private Key Parameter value. + */ + @JsonProperty("dp") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] dp() { + return this.dp; + } + + /** + * Set RSA Private Key Parameter value. + * + * @param dp + * the RSA Private Key Parameter value to set. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withDp(byte[] dp) { + this.dp = dp; + return this; + } + + /** + * Get the RSA Private Key Parameter value. + * + * @return the RSA Private Key Parameter value. + */ + @JsonProperty("dq") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] dq() { + return this.dq; + } + + /** + * Set RSA Private Key Parameter value . + * + * @param dq + * the RSA Private Key Parameter value to set. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withDq(byte[] dq) { + this.dq = dq; + return this; + } + + /** + * Get the RSA Private Key Parameter value. + * + * @return the RSA Private Key Parameter value. + */ + @JsonProperty("qi") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] qi() { + return this.qi; + } + + /** + * Set RSA Private Key Parameter value. + * + * @param qi + * the RSA Private Key Parameter value to set. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withQi(byte[] qi) { + this.qi = qi; + return this; + } + + /** + * Get the RSA secret prime value. + * + * @return the RSA secret prime value. + */ + @JsonProperty("p") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] p() { + return this.p; + } + + /** + * Set the RSA secret prime value. + * + * @param p + * the RSA secret prime value. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withP(byte[] p) { + this.p = p; + return this; + } + + /** + * Get RSA secret prime, with p < q value. + * + * @return the RSA secret prime, with p < q value. + */ + @JsonProperty("q") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] q() { + return this.q; + } + + /** + * Set the RSA secret prime, with p < q value. + * + * @param q + * the the RSA secret prime, with p < q value to be set. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withQ(byte[] q) { + this.q = q; + return this; + } + + /** + * Get Symmetric key value. + * + * @return the symmetric key value. + */ + @JsonProperty("k") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] k() { + return this.k; + } + + /** + * Set the Symmetric key value. + * + * @param k + * the symmetric key value to set. + * @return the JsonWebKey object itself. + */ + public JsonWebKey withK(byte[] k) { + this.k = k; + return this; + } + + /** + * Get HSM Token value, used with Bring Your Own Key. + * + * @return HSM Token, used with Bring Your Own Key. + */ + @JsonProperty("key_hsm") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] t() { + return this.t; + } + + /** + * Set HSM Token value, used with Bring Your Own Key. + * + * @param t + * HSM Token value to set, used with Bring Your Own Key + * @return the JsonWebKey object itself. + */ + public JsonWebKey withT(byte[] t) { + this.t = t; + return this; + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + /** + * Get the crv value. + * + * @return the crv value + */ + @JsonProperty("crv") + public JsonWebKeyCurveName crv() { + return this.crv; + } + + /** + * Set the crv value. + * + * @param crv + * the crv value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withCrv(JsonWebKeyCurveName crv) { + this.crv = crv; + return this; + } + + /** + * Get the x value. + * + * @return the x value + */ + @JsonProperty("x") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] x() { + return this.x; + } + + /** + * Set the x value. + * + * @param x + * the x value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withX(byte[] x) { + this.x = x; + return this; + } + + /** + * Get the y value. + * + * @return the y value + */ + @JsonProperty("y") + @JsonSerialize(using = Base64UrlJsonSerializer.class) + @JsonDeserialize(using = Base64UrlJsonDeserializer.class) + public byte[] y() { + return this.y; + } + + /** + * Set the y value. + * + * @param y + * the y value to set + * @return the JsonWebKey object itself. + */ + public JsonWebKey withY(byte[] y) { + this.y = y; + return this; + } + + /** + * Get the RSA public key spec value. + * + * @return the RSA public key spec value + */ + private RSAPublicKeySpec getRSAPublicKeySpec() { + + return new RSAPublicKeySpec(toBigInteger(n), toBigInteger(e)); + } + + /** + * Get the RSA private key spec value. + * + * @return the RSA private key spec value + */ + private RSAPrivateKeySpec getRSAPrivateKeySpec() { + + return new RSAPrivateCrtKeySpec(toBigInteger(n), toBigInteger(e), toBigInteger(d), toBigInteger(p), + toBigInteger(q), toBigInteger(dp), toBigInteger(dq), toBigInteger(qi)); + } + + /** + * Get the RSA public key value. + * + * @param provider + * the Java security provider. + * @return the RSA public key value + */ + private PublicKey getRSAPublicKey(Provider provider) { + + try { + RSAPublicKeySpec publicKeySpec = getRSAPublicKeySpec(); + KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider) + : KeyFactory.getInstance("RSA"); + + return factory.generatePublic(publicKeySpec); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * Get the RSA private key value. + * + * @param provider + * the Java security provider. + * @return the RSA private key value + */ + private PrivateKey getRSAPrivateKey(Provider provider) { + + try { + RSAPrivateKeySpec privateKeySpec = getRSAPrivateKeySpec(); + KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider) + : KeyFactory.getInstance("RSA"); + + return factory.generatePrivate(privateKeySpec); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + private static PublicKey getECPublicKey(ECPoint ecPoint, ECParameterSpec curveSpec, Provider provider) { + // Create public key spec with given point + try { + ECPublicKeySpec pubSpec = new ECPublicKeySpec(ecPoint, curveSpec); + KeyFactory kf = provider != null ? KeyFactory.getInstance("EC", provider) + : KeyFactory.getInstance("EC", "SunEC"); + return (ECPublicKey) kf.generatePublic(pubSpec); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + private static PrivateKey getECPrivateKey(byte[] d, ECParameterSpec curveSpec, Provider provider) { + try { + ECPrivateKeySpec priSpec = new ECPrivateKeySpec(new BigInteger(1, d), curveSpec); + KeyFactory kf = provider != null ? KeyFactory.getInstance("EC", provider) + : KeyFactory.getInstance("EC", "SunEC"); + return (ECPrivateKey) kf.generatePrivate(priSpec); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * Verifies if the key is an RSA key. + */ + private void checkRSACompatible() { + if (!JsonWebKeyType.RSA.equals(kty) && !JsonWebKeyType.RSA_HSM.equals(kty)) { + throw new UnsupportedOperationException("Not an RSA key"); + } + } + + private static byte[] toByteArray(BigInteger n) { + byte[] result = n.toByteArray(); + if (result[0] == 0) { + // The leading zero is used to let the number positive. Since RSA + // parameters are always positive, we remove it. + return Arrays.copyOfRange(result, 1, result.length); + } + return result; + } + + private static BigInteger toBigInteger(byte[] b) { + if (b[0] < 0) { + // RSA parameters are always positive numbers, so if the first byte + // is negative, we need to add a leading zero + // to make the entire BigInteger positive. + byte[] temp = new byte[1 + b.length]; + System.arraycopy(b, 0, temp, 1, b.length); + b = temp; + } + return new BigInteger(b); + } + + /** + * Converts RSA key pair to JSON web key. + * + * @param keyPair + * RSA key pair + * @return the JSON web key, converted from RSA key pair. + */ + public static JsonWebKey fromRSA(KeyPair keyPair) { + + RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) keyPair.getPrivate(); + JsonWebKey key = null; + + if (privateKey != null) { + + key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(privateKey.getModulus())) + .withE(toByteArray(privateKey.getPublicExponent())) + .withD(toByteArray(privateKey.getPrivateExponent())).withP(toByteArray(privateKey.getPrimeP())) + .withQ(toByteArray(privateKey.getPrimeQ())).withDp(toByteArray(privateKey.getPrimeExponentP())) + .withDq(toByteArray(privateKey.getPrimeExponentQ())) + .withQi(toByteArray(privateKey.getCrtCoefficient())); + } else { + + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + + key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(publicKey.getModulus())) + .withE(toByteArray(publicKey.getPublicExponent())).withD(null).withP(null).withQ(null).withDp(null) + .withDq(null).withQi(null); + } + + return key; + } + + /** + * Converts JSON web key to RSA key pair. + * + * @return RSA key pair + */ + public KeyPair toRSA() { + return this.toRSA(false); + } + + /** + * Converts JSON web key to RSA key pair and include the private key if set to + * true. + * + * @param includePrivateParameters + * true if the RSA key pair should include the private key. False + * otherwise. + * @return RSA key pair + */ + public KeyPair toRSA(boolean includePrivateParameters) { + return toRSA(includePrivateParameters, null); + } + + /** + * Converts JSON web key to RSA key pair and include the private key if set to + * true. + * + * @param provider + * the Java security provider. + * @param includePrivateParameters + * true if the RSA key pair should include the private key. False + * otherwise. + * @return RSA key pair + */ + public KeyPair toRSA(boolean includePrivateParameters, Provider provider) { + + // Must be RSA + checkRSACompatible(); + + if (includePrivateParameters) { + return new KeyPair(getRSAPublicKey(provider), getRSAPrivateKey(provider)); + } else { + return new KeyPair(getRSAPublicKey(provider), null); + } + } + + /** + * Converts JSON web key to EC key pair and include the private key if set to + * true. + * + * @return EC key pair + */ + public KeyPair toEC() { + return toEC(false, null); + } + + /** + * Converts JSON web key to EC key pair and include the private key if set to + * true. + * + * @param includePrivateParameters + * true if the EC key pair should include the private key. False + * otherwise. + * @return EC key pair + */ + public KeyPair toEC(boolean includePrivateParameters) { + return toEC(includePrivateParameters, null); + } + + /** + * Converts JSON web key to EC key pair and include the private key if set to + * true. + * + * @param includePrivateParameters + * true if the EC key pair should include the private key. False + * otherwise. + * @param provider + * Java security provider + * @return EC key pair + */ + public KeyPair toEC(boolean includePrivateParameters, Provider provider) { + + if (provider == null) { + // Our default provider for this class + provider = Security.getProvider("SunEC"); + } + + if (!JsonWebKeyType.EC.equals(kty) && !JsonWebKeyType.EC_HSM.equals(kty)) { + throw new IllegalArgumentException("Not an EC key."); + } + + try { + KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", provider); + + ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(crv)); + kpg.initialize(gps); + + // Generate dummy keypair to get parameter spec. + KeyPair apair = kpg.generateKeyPair(); + ECPublicKey apub = (ECPublicKey) apair.getPublic(); + ECParameterSpec aspec = apub.getParams(); + + ECPoint ecPoint = new ECPoint(new BigInteger(1, x), new BigInteger(1, y)); + + KeyPair realKeyPair; + + if (includePrivateParameters) { + realKeyPair = new KeyPair(getECPublicKey(ecPoint, aspec, provider), + getECPrivateKey(d, aspec, provider)); + } else { + realKeyPair = new KeyPair(getECPublicKey(ecPoint, aspec, provider), null); + } + + return realKeyPair; + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * Converts EC key pair to JSON web key. + * + * @param keyPair + * EC key pair + * @param provider + * Java security provider + * @return the JSON web key, converted from EC key pair. + */ + public static JsonWebKey fromEC(KeyPair keyPair, Provider provider) { + + ECPublicKey apub = (ECPublicKey) keyPair.getPublic(); + ECPoint point = apub.getW(); + ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate(); + + if (apriv != null) { + return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider)) + .withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray()) + .withD(apriv.getS().toByteArray()).withKty(JsonWebKeyType.EC); + } else { + return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider)) + .withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray()) + .withKty(JsonWebKeyType.EC); + } + } + + // Matches the curve of the keyPair to supported curves. + private static JsonWebKeyCurveName getCurveFromKeyPair(KeyPair keyPair, Provider provider) { + + try { + ECPublicKey key = (ECPublicKey) keyPair.getPublic(); + ECParameterSpec spec = key.getParams(); + EllipticCurve crv = spec.getCurve(); + + List curveList = Arrays.asList(JsonWebKeyCurveName.P_256, JsonWebKeyCurveName.P_384, + JsonWebKeyCurveName.P_521, JsonWebKeyCurveName.P_256K); + + for (JsonWebKeyCurveName curve : curveList) { + ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(curve)); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", provider); + kpg.initialize(gps); + + // Generate dummy keypair to get parameter spec. + KeyPair apair = kpg.generateKeyPair(); + ECPublicKey apub = (ECPublicKey) apair.getPublic(); + ECParameterSpec aspec = apub.getParams(); + EllipticCurve acurve = aspec.getCurve(); + + // Matches the parameter spec + if (acurve.equals(crv)) { + return curve; + } + } + + // Did not find a supported curve. + throw new NoSuchAlgorithmException("Curve not supported."); + } catch (GeneralSecurityException e) { + throw new IllegalStateException(e); + } + } + + /** + * Converts AES key to JSON web key. + * + * @param secretKey + * AES key + * @return the JSON web key, converted from AES key. + */ + public static JsonWebKey fromAes(SecretKey secretKey) { + if (secretKey == null) { + return null; + } + + return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT); + } + + /** + * Converts JSON web key to AES key. + * + * @return AES key + */ + public SecretKey toAes() { + if (k == null) { + return null; + } + + SecretKey secretKey = new SecretKeySpec(k, "AES"); + return secretKey; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj instanceof JsonWebKey) { + return this.equals((JsonWebKey) obj); + } + return super.equals(obj); + } + + /** + * Indicates whether some other {@link JsonWebKey} is "equal to" this one. + * + * @param jwk + * the other {@link JsonWebKey} to compare with. + * @return true if this {@link JsonWebKey} is the same as the jwk argument; + * false otherwise. + */ + public boolean equals(JsonWebKey jwk) { + if (jwk == null) { + return false; + } + + if (!Objects.equal(kid, jwk.kid)) { + return false; + } + + if (!Objects.equal(kty, jwk.kty)) { + return false; + } + + if (!Objects.equal(keyOps, jwk.keyOps)) { + return false; + } + + if (!Objects.equal(crv, jwk.crv)) { + return false; + } + + if (!Arrays.equals(k, jwk.k)) { + return false; + } + + // Public parameters + if (!Arrays.equals(n, jwk.n)) { + return false; + } + if (!Arrays.equals(e, jwk.e)) { + return false; + } + + // Private parameters + if (!Arrays.equals(d, jwk.d)) { + return false; + } + if (!Arrays.equals(dp, jwk.dp)) { + return false; + } + if (!Arrays.equals(dq, jwk.dq)) { + return false; + } + if (!Arrays.equals(qi, jwk.qi)) { + return false; + } + if (!Arrays.equals(p, jwk.p)) { + return false; + } + if (!Arrays.equals(q, jwk.q)) { + return false; + } + if (!Arrays.equals(x, jwk.x)) { + return false; + } + if (!Arrays.equals(y, jwk.y)) { + return false; + } + + // HSM token + if (!Arrays.equals(t, jwk.t)) { + return false; + } + + return true; + } + + /** + * Verifies whether the {@link JsonWebKey} has private key. + * + * @return true if the {@link JsonWebKey} has private key; false otherwise. + */ + public boolean hasPrivateKey() { + + if (JsonWebKeyType.OCT.equals(kty)) { + return k != null; + } + + else if (JsonWebKeyType.RSA.equals(kty) || JsonWebKeyType.RSA_HSM.equals(kty)) { + return (d != null && dp != null && dq != null && qi != null && p != null && q != null); + } + + else if (JsonWebKeyType.EC.equals(kty) || JsonWebKeyType.EC_HSM.equals(kty)) { + return (d != null); + } + + return false; + } + + /** + * Verifies whether the {@link JsonWebKey} is valid. + * + * @return true if the {@link JsonWebKey} is valid; false otherwise. + */ + @JsonIgnore + public boolean isValid() { + if (kty == null) { + return false; + } + + if (keyOps != null) { + final Set set = new HashSet(JsonWebKeyOperation.ALL_OPERATIONS); + for (int i = 0; i < keyOps.size(); i++) { + if (!set.contains(keyOps.get(i))) { + return false; + } + } + } + + if (JsonWebKeyType.OCT.equals(kty)) { + return isValidOctet(); + } + + else if (JsonWebKeyType.RSA.equals(kty)) { + return isValidRsa(); + } + + else if (JsonWebKeyType.RSA_HSM.equals(kty)) { + return isValidRsaHsm(); + } + + else if (JsonWebKeyType.EC.equals(kty)) { + return isValidEc(); + } + + else if (JsonWebKeyType.EC_HSM.equals(kty)) { + return isValidEcHsm(); + } + + return false; + } + + private boolean isValidOctet() { + if (k != null) { + return true; + } + return false; + } + + private boolean isValidRsa() { + if (n == null || e == null) { + return false; + } + + return hasPrivateKey() || (d == null && dp == null && dq == null && qi == null && p == null && q == null); + } + + private boolean isValidRsaHsm() { + // MAY have public key parameters + if ((n == null && e != null) || (n != null && e == null)) { + return false; + } + + // no private key + if (hasPrivateKey()) { + return false; + } + + // MUST have ( T || ( N && E ) ) + boolean tokenParameters = t != null; + boolean publicParameters = (n != null && e != null); + + if (tokenParameters && publicParameters) { + return false; + } + + return (tokenParameters || publicParameters); + } + + private boolean isValidEc() { + boolean ecPointParameters = (x != null && y != null); + if (!ecPointParameters || crv == null) { + return false; + } + + return hasPrivateKey() || (d == null); + } + + private boolean isValidEcHsm() { + // MAY have public key parameters + boolean ecPointParameters = (x != null && y != null); + if ((ecPointParameters && crv == null) || (!ecPointParameters && crv != null)) { + return false; + } + + // no private key + if (hasPrivateKey()) { + return false; + } + + // MUST have (T || (ecPointParameters && crv)) + boolean publicParameters = (ecPointParameters && crv != null); + boolean tokenParameters = t != null; + + if (tokenParameters && publicParameters) { + return false; + } + + return (tokenParameters || publicParameters); + } + + /** + * Clear key materials. + */ + public void clearMemory() { + zeroArray(k); + k = null; + zeroArray(n); + n = null; + zeroArray(e); + e = null; + zeroArray(d); + d = null; + zeroArray(dp); + dp = null; + zeroArray(dq); + dq = null; + zeroArray(qi); + qi = null; + zeroArray(p); + p = null; + zeroArray(q); + q = null; + zeroArray(t); + t = null; + zeroArray(x); + x = null; + zeroArray(y); + y = null; + } + + private static void zeroArray(byte[] bytes) { + if (bytes != null) { + Arrays.fill(bytes, (byte) 0); + } + } + + @Override + public int hashCode() { + int hashCode = 48313; // setting it to a random prime number + if (kid != null) { + hashCode += kid.hashCode(); + } + + if (JsonWebKeyType.OCT.equals(kty)) { + hashCode += hashCode(k); + } + + else if (JsonWebKeyType.RSA.equals(kty)) { + hashCode += hashCode(n); + } + + else if (JsonWebKeyType.EC.equals(kty)) { + hashCode += hashCode(x); + hashCode += hashCode(y); + hashCode += crv.hashCode(); + } + + else if (JsonWebKeyType.RSA_HSM.equals(kty) || JsonWebKeyType.EC_HSM.equals(kty)) { + hashCode += hashCode(t); + } + + return hashCode; + } + + private static int hashCode(byte[] obj) { + int hashCode = 0; + + if (obj == null || obj.length == 0) { + return 0; + } + + for (int i = 0; i < obj.length; i++) { + hashCode = (hashCode << 3) | (hashCode >> 29) ^ obj[i]; + } + return hashCode; + } + + private static final Map CURVE_TO_SPEC_NAME = ImmutableMap + .builder().put(JsonWebKeyCurveName.P_256, "secp256r1") + .put(JsonWebKeyCurveName.P_384, "secp384r1").put(JsonWebKeyCurveName.P_521, "secp521r1") + .put(JsonWebKeyCurveName.P_256K, "secp256k1").build(); +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyCurveName.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyCurveName.java new file mode 100644 index 0000000000000..b12aa57ece5fa --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyCurveName.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.webkey; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeyCurveName. + */ +public final class JsonWebKeyCurveName { + /** Static value P-256 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256 = new JsonWebKeyCurveName("P-256"); + + /** Static value P-384 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_384 = new JsonWebKeyCurveName("P-384"); + + /** Static value P-521 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_521 = new JsonWebKeyCurveName("P-521"); + + /** Static value SECP256K1 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256K = new JsonWebKeyCurveName("P-256K"); + + private String value; + + /** + * Creates a custom value for JsonWebKeyCurveName. + * @param value the custom value + */ + public JsonWebKeyCurveName(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeyCurveName)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeyCurveName rhs = (JsonWebKeyCurveName) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyEncryptionAlgorithm.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyEncryptionAlgorithm.java new file mode 100644 index 0000000000000..6631fb4a2dac2 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyEncryptionAlgorithm.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeyEncryptionAlgorithm. + */ +public final class JsonWebKeyEncryptionAlgorithm { + + /** Static value RSA-OAEP for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP = new JsonWebKeyEncryptionAlgorithm("RSA-OAEP"); + + /** Static value RSA-OAEP-256 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP_256 = new JsonWebKeyEncryptionAlgorithm("RSA-OAEP-256"); + + /** Static value RSA1_5 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA1_5 = new JsonWebKeyEncryptionAlgorithm("RSA1_5"); + + private String value; + + /** + * Creates a custom value for JsonWebKeyEncryptionAlgorithm. + * + * @param value + * the custom value + */ + public JsonWebKeyEncryptionAlgorithm(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeyEncryptionAlgorithm)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeyEncryptionAlgorithm rhs = (JsonWebKeyEncryptionAlgorithm) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } + + /** + * All the JWK encryption algorithms. + */ + public static final List ALL_ALGORITHMS = Collections + .unmodifiableList(Arrays.asList(RSA_OAEP, RSA1_5, RSA_OAEP_256)); +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyOperation.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyOperation.java new file mode 100644 index 0000000000000..9dbb9d30fce67 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyOperation.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeyOperation. + */ +public final class JsonWebKeyOperation { + /** Static value encrypt for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation ENCRYPT = new JsonWebKeyOperation("encrypt"); + + /** Static value decrypt for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation DECRYPT = new JsonWebKeyOperation("decrypt"); + + /** Static value sign for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation SIGN = new JsonWebKeyOperation("sign"); + + /** Static value verify for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation VERIFY = new JsonWebKeyOperation("verify"); + + /** Static value wrapKey for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation WRAP_KEY = new JsonWebKeyOperation("wrapKey"); + + /** Static value unwrapKey for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation UNWRAP_KEY = new JsonWebKeyOperation("unwrapKey"); + + private String value; + + /** + * Creates a custom value for JsonWebKeyOperation. + * @param value the custom value + */ + public JsonWebKeyOperation(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeyOperation)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeyOperation rhs = (JsonWebKeyOperation) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } + + /** + * All the JWK operations. + */ + public static final List ALL_OPERATIONS = + Collections.unmodifiableList(Arrays.asList(ENCRYPT, DECRYPT, SIGN, VERIFY, WRAP_KEY, UNWRAP_KEY)); +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeySignatureAlgorithm.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeySignatureAlgorithm.java new file mode 100644 index 0000000000000..7075d00a1f975 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeySignatureAlgorithm.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + **/ + +package com.microsoft.azure.keyvault.webkey; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeySignatureAlgorithm. + */ +public final class JsonWebKeySignatureAlgorithm { + + /** Static value PS256 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm PS256 = new JsonWebKeySignatureAlgorithm("PS256"); + + /** Static value PS384 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm PS384 = new JsonWebKeySignatureAlgorithm("PS384"); + + /** Static value PS512 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm PS512 = new JsonWebKeySignatureAlgorithm("PS512"); + + /** Static value RS256 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm RS256 = new JsonWebKeySignatureAlgorithm("RS256"); + + /** Static value RS384 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm RS384 = new JsonWebKeySignatureAlgorithm("RS384"); + + /** Static value RS512 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm RS512 = new JsonWebKeySignatureAlgorithm("RS512"); + + /** Static value RSNULL for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm RSNULL = new JsonWebKeySignatureAlgorithm("RSNULL"); + /** Static value ES256 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm ES256 = new JsonWebKeySignatureAlgorithm("ES256"); + /** Static value ES384 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm ES384 = new JsonWebKeySignatureAlgorithm("ES384"); + /** Static value ES512 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm ES512 = new JsonWebKeySignatureAlgorithm("ES512"); + /** Static value ECDSA256 for JsonWebKeySignatureAlgorithm. */ + public static final JsonWebKeySignatureAlgorithm ES256K = new JsonWebKeySignatureAlgorithm("ES256K"); + + private String value; + + /** + * Creates a custom value for JsonWebKeySignatureAlgorithm. + * + * @param value + * the custom value + */ + public JsonWebKeySignatureAlgorithm(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeySignatureAlgorithm)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeySignatureAlgorithm rhs = (JsonWebKeySignatureAlgorithm) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } + + /** + * All the JWK signature algorithms. + */ + public static final List ALL_ALGORITHMS = Collections.unmodifiableList( + Arrays.asList(RS256, RS384, RS512, RSNULL, PS256, PS384, PS512, ES256, ES384, ES512, ES256K)); +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyType.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyType.java new file mode 100644 index 0000000000000..dc5a7355bcc8f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKeyType.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.webkey; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeyType. + */ +public final class JsonWebKeyType { + /** Static value EC for JsonWebKeyType. */ + public static final JsonWebKeyType EC = new JsonWebKeyType("EC"); + /** Static value EC-HSM for JsonWebKeyType. */ + public static final JsonWebKeyType EC_HSM = new JsonWebKeyType("EC-HSM"); + + /** Static value RSA for JsonWebKeyType. */ + public static final JsonWebKeyType RSA = new JsonWebKeyType("RSA"); + + /** Static value RSA-HSM for JsonWebKeyType. */ + public static final JsonWebKeyType RSA_HSM = new JsonWebKeyType("RSA-HSM"); + + /** Static value oct for JsonWebKeyType. */ + public static final JsonWebKeyType OCT = new JsonWebKeyType("oct"); + + private String value; + + /** + * Creates a custom value for JsonWebKeyType. + * @param value the custom value + */ + public JsonWebKeyType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeyType)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeyType rhs = (JsonWebKeyType) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } + + /** + * All the JWK key types. + */ + public static final List ALL_TYPES = + Collections.unmodifiableList(Arrays.asList(EC, RSA, RSA_HSM, OCT, EC_HSM)); +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/package-info.java b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/package-info.java new file mode 100644 index 0000000000000..6768bb5045206 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the classes for key vault JSON web key. + */ +package com.microsoft.azure.keyvault.webkey; diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/AesValidationTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/AesValidationTests.java new file mode 100644 index 0000000000000..3d1ed2b07c77d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/AesValidationTests.java @@ -0,0 +1,92 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; + +import org.junit.Assert; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; + +public class AesValidationTests { + private static final String TRANSFORMATION = "AES"; + + @Test + public void aesKeyValidation() throws Exception { + KeyGenerator keyGen = KeyGenerator.getInstance(TRANSFORMATION); + keyGen.init(256); + + SecretKey skey = keyGen.generateKey(); + JsonWebKey key = serializeDeserialize(skey); + Assert.assertTrue(key.hasPrivateKey()); + Assert.assertTrue(key.isValid()); + + SecretKey secretKey = key.toAes(); + encryptDecrypt(secretKey); + + // Compare equal JSON web keys + JsonWebKey sameKey = JsonWebKey.fromAes(skey); + Assert.assertEquals(key, key); + Assert.assertEquals(key, sameKey); + Assert.assertEquals(key.hashCode(), sameKey.hashCode()); + } + + @Test + public void invalidKeyOps() throws Exception { + JsonWebKey key = getAes(); + key.withKeyOps(Arrays.asList(JsonWebKeyOperation.ENCRYPT, new JsonWebKeyOperation("foo"))); + Assert.assertFalse(key.isValid()); + } + + @Test + public void octHashCode() throws Exception { + JsonWebKey key = getAes(); + + // Compare hash codes for unequal JWK that would not map to the same hash + Assert.assertNotEquals(key.hashCode(), new JsonWebKey().withK(key.k()).hashCode()); + Assert.assertNotEquals(key.hashCode(), new JsonWebKey().withKty(key.kty()).hashCode()); + + // Compare hash codes for unequal JWK that would map to the same hash + Assert.assertEquals(key.hashCode(), new JsonWebKey().withK(key.k()).withKty(key.kty()).hashCode()); + } + + private static JsonWebKey getAes() throws Exception { + KeyGenerator keyGen = KeyGenerator.getInstance(TRANSFORMATION); + keyGen.init(256); + + SecretKey skey = keyGen.generateKey(); + return JsonWebKey.fromAes(skey); + } + + private static JsonWebKey serializeDeserialize(SecretKey skey) throws Exception { + JsonWebKey webKey = JsonWebKey.fromAes(skey); + String serializedKey = webKey.toString(); + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(serializedKey, JsonWebKey.class); + } + + private static void encryptDecrypt(SecretKey key) throws Exception { + byte[] plaintext = new byte[10]; + new Random().nextBytes(plaintext); + byte[] cipherText = encrypt(key, plaintext); + Assert.assertArrayEquals(decrypt(key, cipherText), plaintext); + } + + private static byte[] encrypt(SecretKey key, byte[] plaintext) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(plaintext); + } + + private static byte[] decrypt(SecretKey key, byte[] ciphertext) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(ciphertext); + } +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/ClearMemoryTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/ClearMemoryTests.java new file mode 100644 index 0000000000000..f28801584059a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/ClearMemoryTests.java @@ -0,0 +1,56 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import java.util.Random; + +import org.junit.Assert; +import org.junit.Test; + +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + +public class ClearMemoryTests { + + @Test + public void clearMemory() + { + JsonWebKey key = new JsonWebKey() + .withD(getRandomByte()) + .withDp(getRandomByte()) + .withDq(getRandomByte()) + .withE(getRandomByte()) + .withK(getRandomByte()) + .withN(getRandomByte()) + .withP(getRandomByte()) + .withQ(getRandomByte()) + .withQi(getRandomByte()) + .withT(getRandomByte()); + key.clearMemory(); + Assert.assertNull(key.d()); + Assert.assertNull(key.dp()); + Assert.assertNull(key.dq()); + Assert.assertNull(key.e()); + Assert.assertNull(key.k()); + Assert.assertNull(key.n()); + Assert.assertNull(key.p()); + Assert.assertNull(key.q()); + Assert.assertNull(key.qi()); + Assert.assertNull(key.t()); + + // Compare it with a newly created JsonWebKey with no properties set. + JsonWebKey key2 = new JsonWebKey(); + Assert.assertTrue(key2.equals(key)); + } + + @Test + public void clearNullMemory() + { + JsonWebKey key = new JsonWebKey(); + key.clearMemory(); + } + + private static byte[] getRandomByte() { + byte[] bytes = new byte[10]; + new Random().nextBytes(bytes); + return bytes; + } + +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcHsmValidationTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcHsmValidationTests.java new file mode 100644 index 0000000000000..0175b2164d696 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcHsmValidationTests.java @@ -0,0 +1,47 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import org.junit.Assert; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + + +public class EcHsmValidationTests { + + String keyWithoutT = "{\"kid\":\"key_id\",\"kty\":\"EC-HSM\",\"key_ops\":null,\"n\":null,\"e\":null,\"d\":null,\"dp\":null,\"dq\":null,\"qi\":null,\"p\":null,\"q\":null,\"k\":null,\"key_hsm\":null,\"crv\":\"P-256\",\"x\":\"KyjF795jLyVIgswKSQInEGYHNBKSKyPgNojEgYlldMI\",\"y\":\"AIl_ca1ZIKbJ5YGdgGr_7HySldI2aWeBaOImZEYIMpVe\"}"; + String keyWithT = "{\"kid\":\"key_id\",\"kty\":\"EC-HSM\",\"key_ops\":null,\"key_hsm\":\"T-TOKEN\"}"; + + @Test + public void ecHsmValidation() throws Exception { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey keyNoT = mapper.readValue(keyWithoutT, JsonWebKey.class); + JsonWebKey keyT = mapper.readValue(keyWithT, JsonWebKey.class); + + Assert.assertTrue(keyNoT.isValid()); + Assert.assertFalse(keyNoT.hasPrivateKey()); + + Assert.assertTrue(keyT.isValid()); + Assert.assertFalse(keyT.hasPrivateKey()); + } + + @Test + public void ecHsmHashCode() throws Exception { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey keyNoT = mapper.readValue(keyWithoutT, JsonWebKey.class); + JsonWebKey keyT = mapper.readValue(keyWithT, JsonWebKey.class); + + Assert.assertNotEquals(keyT.hashCode(), keyNoT.hashCode()); + + // Compare hash codes for unequal JWK that would not map to the same hash + Assert.assertNotEquals(keyT.hashCode(), new JsonWebKey().withKid(keyT.kid()).withT(keyT.t()).hashCode()); + Assert.assertNotEquals(keyT.hashCode(), new JsonWebKey().withKid(keyT.kid()).withKty(keyT.kty()).hashCode()); + Assert.assertNotEquals(keyNoT.hashCode(), new JsonWebKey().hashCode()); + + // Compare hash codes for unequal JWK that would map to the same hash + Assert.assertEquals(keyT.hashCode(), + new JsonWebKey().withKid(keyT.kid()).withKty(keyT.kty()).withT(keyT.t()).hashCode()); + Assert.assertEquals(keyNoT.hashCode(), new JsonWebKey().withKid(keyT.kid()).hashCode()); + } +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcValidationTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcValidationTests.java new file mode 100644 index 0000000000000..a2f341dc1c05b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/EcValidationTests.java @@ -0,0 +1,115 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Security; +import java.security.Signature; +import java.security.SignatureException; +import java.util.Map; +import java.util.Random; + +import org.junit.Assert; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.ImmutableMap; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyCurveName; + + +public class EcValidationTests { + + @Test + public void ecPublicKeyValidation() throws Exception { + + for (String keyStr : keys.values()) { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey key = mapper.readValue(keyStr, JsonWebKey.class); + Assert.assertTrue(key.hasPrivateKey()); + Assert.assertTrue(key.isValid()); + + KeyPair keyPair = key.toEC(); + validateEcKey(keyPair, key); + Assert.assertNull(keyPair.getPrivate()); + + // Compare equal JSON web keys + JsonWebKey sameKey = mapper.readValue(keyStr, JsonWebKey.class); + Assert.assertEquals(key, key); + Assert.assertEquals(key, sameKey); + Assert.assertEquals(key.hashCode(), sameKey.hashCode()); + } + } + + @Test + public void ecPrivateKeyValidation() throws Exception { + for (String keyStr : keys.values()) { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey key = mapper.readValue(keyStr, JsonWebKey.class); + KeyPair keyPairWithPrivate = key.toEC(true); + validateEcKey(keyPairWithPrivate, key); + signVerify(keyPairWithPrivate.getPublic(), keyPairWithPrivate.getPrivate(), key.crv()); + } + } + + private static void validateEcKey(KeyPair keyPair, JsonWebKey key) throws Exception { + JsonWebKey jsonWebKey = JsonWebKey.fromEC(keyPair, Security.getProvider("SunEC")); + boolean includePrivateKey = keyPair.getPrivate() != null; + KeyPair keyPair2 = jsonWebKey.toEC(includePrivateKey); + + Assert.assertTrue(includePrivateKey == jsonWebKey.hasPrivateKey()); + + PublicKey publicKey = keyPair2.getPublic(); + PrivateKey privateKey = keyPair2.getPrivate(); + + if(includePrivateKey) { + + // set the missing properties to compare the keys + jsonWebKey.withKid(new String(key.kid())); + Assert.assertNotNull(privateKey); + Assert.assertEquals(jsonWebKey, key); + Assert.assertEquals(key.hashCode(), jsonWebKey.hashCode()); + signVerify(publicKey, privateKey, jsonWebKey.crv()); + } + } + + private static void signVerify(PublicKey publicKey, PrivateKey privateKey, JsonWebKeyCurveName curve) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException { + Signature signature = Signature.getInstance(CURVE_TO_SIGNATURE.get(curve), Security.getProvider("SunEC")); + signature.initSign(privateKey); + MessageDigest digest = MessageDigest.getInstance(algorithm.get(curve)); + byte[] plaintext = new byte[10]; + new Random().nextBytes(plaintext); + byte[] hash = digest.digest(plaintext); + signature.update(hash); + byte[] signed_hash = signature.sign(); + + signature.initVerify(publicKey); + signature.update(hash); + Assert.assertTrue(signature.verify(signed_hash)); + + } + + static Map algorithm = ImmutableMap.builder() + .put(JsonWebKeyCurveName.P_256, "SHA-256") + .put(JsonWebKeyCurveName.P_384, "SHA-384") + .put(JsonWebKeyCurveName.P_521, "SHA-512") + .put(JsonWebKeyCurveName.P_256K, "SHA-256") + .build(); + + Map keys = ImmutableMap.builder() + .put(256, "{\"kid\":\"key_id\",\"kty\":\"EC\",\"key_ops\":null,\"n\":null,\"e\":null,\"d\":\"AM_iqldq9VSqlf9v3w7lren4pJvZTG81v6_V5ZBLP7ZI\",\"dp\":null,\"dq\":null,\"qi\":null,\"p\":null,\"q\":null,\"k\":null,\"key_hsm\":null,\"crv\":\"P-256\",\"x\":\"KyjF795jLyVIgswKSQInEGYHNBKSKyPgNojEgYlldMI\",\"y\":\"AIl_ca1ZIKbJ5YGdgGr_7HySldI2aWeBaOImZEYIMpVe\"}") + .put(384, "{\"kid\":\"key_id\",\"kty\":\"EC\",\"key_ops\":null,\"n\":null,\"e\":null,\"d\":\"AJEYT00mAfa-_uJ8S9ob0-9uZbPEr56CFebUQW9O-jZQBrtrMSPeqVbjJvTVlzOwbg\",\"dp\":null,\"dq\":null,\"qi\":null,\"p\":null,\"q\":null,\"k\":null,\"key_hsm\":null,\"crv\":\"P-384\",\"x\":\"AKOdkhxTtVkLtaslZIOPQGnsdKRT2xo3Ynk-bnAVvTCf3iGrTpRiMxUmyq_tvzBLEg\",\"y\":\"QoHux2O2XGMh8w7a5sWwskAyCR0g3Lj7kPGuvnDq_bQ_-_VoTvsGMAe9MFexv68I\"}") + .put(521, "{\"kid\":\"key_id\",\"kty\":\"EC\",\"key_ops\":null,\"n\":null,\"e\":null,\"d\":\"AVW7TFJVOJ8jY5PqK0nnKyVYQwhkBEGKt0nhSZTS5io7U32dR7xZle77Gq6SpjrdFVa32jvGWgchlSguV3WKy3sj\",\"dp\":null,\"dq\":null,\"qi\":null,\"p\":null,\"q\":null,\"k\":null,\"key_hsm\":null,\"crv\":\"P-521\",\"x\":\"AIDmImOrJNKOjOGp7wD8Dzi_uz-00E7cs8iN5SwBkzBXktyRrLDFS_SMwVdnIWpLcdJQn5sTGDS121DhjQA2i2dO\",\"y\":\"AWRoeIfIoRoEx8V9ijjwaco3V6vUPUYvKMKxtCPvm8iwhB7pZAI7-mODSfkb3rZo3gxuWoM3G7L66FttUlKSLK4w\"}") + .put(265, "{\"kid\":\"key_id\",\"kty\":\"EC\",\"key_ops\":null,\"n\":null,\"e\":null,\"d\":\"YKv22AkpwBpKUcDodNhKhvI-bRpiWqoN8l0kNCo-Mds\",\"dp\":null,\"dq\":null,\"qi\":null,\"p\":null,\"q\":null,\"k\":null,\"key_hsm\":null,\"crv\":\"P-256K\",\"x\":\"Yw9Sln8gYf_oiFY1anQm0V_WwsRaCIcEccfbhu5hSJo\",\"y\":\"AJq3JT2YldszaohHaS7LkngPWS9y0yAn7HhHb5p0IUDS\"}") + .build(); + + public static final Map CURVE_TO_SIGNATURE = ImmutableMap.builder() + .put(JsonWebKeyCurveName.P_256, "SHA256withECDSA") + .put(JsonWebKeyCurveName.P_384, "SHA384withECDSA") + .put(JsonWebKeyCurveName.P_521, "SHA512withECDSA") + .put(JsonWebKeyCurveName.P_256K, "NONEwithECDSA") + .build(); +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaHsmValidationTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaHsmValidationTests.java new file mode 100644 index 0000000000000..fd960ee23a8c1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaHsmValidationTests.java @@ -0,0 +1,46 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import org.junit.Assert; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + + +public class RsaHsmValidationTests { + + String keyWithoutT = "{\"kid\":\"key_id\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"}"; + String keyWithT = "{\"kid\":\"key_id\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"key_hsm\":\"T-TOKEN\"}"; + + @Test + public void rsaHsmValidation() throws Exception { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey keyNoT = mapper.readValue(keyWithoutT, JsonWebKey.class); + JsonWebKey keyT = mapper.readValue(keyWithT, JsonWebKey.class); + + Assert.assertTrue(keyNoT.isValid()); + Assert.assertFalse(keyNoT.hasPrivateKey()); + + Assert.assertTrue(keyT.isValid()); + Assert.assertFalse(keyT.hasPrivateKey()); + } + + @Test + public void rsaHsmHashCode() throws Exception { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey keyNoT = mapper.readValue(keyWithoutT, JsonWebKey.class); + JsonWebKey keyT = mapper.readValue(keyWithT, JsonWebKey.class); + + Assert.assertNotEquals(keyT.hashCode(), keyNoT.hashCode()); + + // Compare hash codes for unequal JWK that would not map to the same hash + Assert.assertNotEquals(keyT.hashCode(), new JsonWebKey().withKid(keyT.kid()).withT(keyT.t()).hashCode()); + Assert.assertNotEquals(keyT.hashCode(), new JsonWebKey().withKid(keyT.kid()).withKty(keyT.kty()).hashCode()); + Assert.assertNotEquals(keyNoT.hashCode(), new JsonWebKey().hashCode()); + + // Compare hash codes for unequal JWK that would map to the same hash + Assert.assertEquals(keyT.hashCode(), + new JsonWebKey().withKid(keyT.kid()).withKty(keyT.kty()).withT(keyT.t()).hashCode()); + Assert.assertEquals(keyNoT.hashCode(), new JsonWebKey().withKid(keyT.kid()).hashCode()); + } +} diff --git a/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaValidationTests.java b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaValidationTests.java new file mode 100644 index 0000000000000..cb5bcb3de2282 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault-webkey/src/test/java/com/microsoft/azure/keyvault/webkey/test/RsaValidationTests.java @@ -0,0 +1,126 @@ +package com.microsoft.azure.keyvault.webkey.test; + +import java.security.KeyPair; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.util.ArrayList; +import java.util.Map; +import java.util.Random; + +import javax.crypto.Cipher; + +import org.junit.Assert; +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.ImmutableMap; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; + +public class RsaValidationTests { + + private static final String TRANSFORMATION = "RSA/ECB/PKCS1Padding"; + + @Test + public void rsaPublicKeyValidation() throws Exception { + for(String keyStr : keys.values()) + { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey key = mapper.readValue(keyStr, JsonWebKey.class); + Assert.assertTrue(key.hasPrivateKey()); + Assert.assertTrue(key.isValid()); + + KeyPair keyPair = key.toRSA(); + validateRsaKey(keyPair, key); + Assert.assertNull(keyPair.getPrivate()); + + // Compare equal JSON web keys + JsonWebKey sameKey = mapper.readValue(keyStr, JsonWebKey.class); + Assert.assertEquals(key, key); + Assert.assertEquals(key, sameKey); + Assert.assertEquals(key.hashCode(), sameKey.hashCode()); + } + } + + @Test + public void rsaPrivateKeyValidation() throws Exception { + for(String keyStr : keys.values()) + { + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey key = mapper.readValue(keyStr, JsonWebKey.class); + + KeyPair keyPairWithPrivate = key.toRSA(true); + validateRsaKey(keyPairWithPrivate, key); + encryptDecrypt(keyPairWithPrivate.getPublic(), keyPairWithPrivate.getPrivate()); + } + } + + @Test + public void rsaHashCode() throws Exception { + + String keyStr = (String) keys.values().toArray()[0]; + ObjectMapper mapper = new ObjectMapper(); + JsonWebKey key = mapper.readValue(keyStr, JsonWebKey.class); + + // Compare hash codes for unequal JWK that would not map to the same hash + Assert.assertNotEquals(key.hashCode(), new JsonWebKey().withKid(key.kid()).withN(key.n()).hashCode()); + Assert.assertNotEquals(key.hashCode(), new JsonWebKey().withKid(key.kid()).withKty(key.kty()).hashCode()); + Assert.assertNotEquals(key.hashCode(), new JsonWebKey().withKid(key.kid()).withT(key.t()).hashCode()); + + // Compare hash codes for unequal JWK that would map to the same hash + Assert.assertEquals(key.hashCode(), + new JsonWebKey().withN(key.n()).withKty(key.kty()).withKid(key.kid()).hashCode()); + } + + private static void encryptDecrypt(PublicKey publicKey, PrivateKey privateKey) throws Exception { + byte[] plaintext = new byte[10]; + new Random().nextBytes(plaintext); + byte[] cipherText = encrypt(publicKey, plaintext); + if(privateKey != null) { + Assert.assertArrayEquals(decrypt(privateKey, cipherText), plaintext); + } + } + + private static byte[] encrypt(PublicKey key, byte[] plaintext) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(plaintext); + } + + private static byte[] decrypt(PrivateKey key, byte[] ciphertext) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(ciphertext); + } + + private static void validateRsaKey(KeyPair keyPair, JsonWebKey key) throws Exception { + JsonWebKey jsonWebKey = JsonWebKey.fromRSA(keyPair); + boolean includePrivateKey = keyPair.getPrivate() != null; + KeyPair keyPair2 = jsonWebKey.toRSA(includePrivateKey); + + Assert.assertTrue(includePrivateKey == jsonWebKey.hasPrivateKey()); + + PublicKey publicKey = keyPair2.getPublic(); + PrivateKey privateKey = keyPair2.getPrivate(); + + if(includePrivateKey) { + Assert.assertNotNull(privateKey); + + // set the missing properties to compare the keys + jsonWebKey.withKeyOps(new ArrayList(key.keyOps())); + jsonWebKey.withKid(new String(key.kid())); + Assert.assertEquals(jsonWebKey, key); + Assert.assertEquals(key.hashCode(), jsonWebKey.hashCode()); + } + + encryptDecrypt(publicKey, privateKey); + } + + Map keys = ImmutableMap.builder() + .put(512, "{\"kty\":\"RSA\",\"n\":\"uOXIpiH9L0h_byTuP3fcMvKbfS85eTKvxW2skw4oIU2TM3ceFvlDwDK4gKHl4qE4z18bz0qrv9ElstOrT96piQ\",\"e\":\"AQAB\",\"d\":\"And2KMA5uQ1r9MwuvZCODi0D2lcFvz7oBbenyxqmuhTYfdGcuGE9FZg5V6ZcNwBK_eYGZqSwL1Gh2EmzG6AxwQ\",\"dp\":\"CEh8kzQnCRK97NKQeV_wGgWsLYlmgis7Cms85_DIqwE\",\"dq\":\"TAi0G0iE5pvMpiEN2y189hjSRSqE6Unc1lXaE3hcnWE\",\"qi\":\"2HhNqW3QBv1R_iEpu44KVMQs0DdnY5oWp1lH6hgPhXU\",\"p\":\"5BblSoMJmO5Afa-urQFzFpBfACt1175NMUs4tHUYEkE\",\"q\":\"z4Xdf_FU-51wTkW5mFJ6QoDK-GrkMXSdct9hdW26NUk\",\"key_ops\":[\"wrapKey\",\"unwrapKey\",\"encrypt\",\"decrypt\",\"sign\",\"verify\"],\"kid\":\"key_id\"}") + .put(1024, "{\"kty\":\"RSA\",\"n\":\"zicSNMeAUYwp6V6UQlJ8gW04o6O4ZJBIefsLnV6-to1YkzgDu6vDBWb83DcDgB2x63W-ZVK23F4dcJcULu1VM-jX83Sfg0b_ZrugiiXCnZ4iidLNcY5QOS1dSHjfI1eWH6QdLPSIE3sHk-BILrIXqoyIJH-LFxzMu--4bDlej2M\",\"e\":\"AQAB\",\"d\":\"A4h7F2YT6bhG2TXcJ9OiFQj6LFPLmG2gnSnGssiQHDDWXWLB-mvT-9O4CBr2ETJxFvsw0cVV8CqGXQrTaodGxOuCGNmYoczodvlhUBJyMBxAI2or5eZUF9jRiECvigoxNVWKsqWxypvq_X1pMfQbh9ot7F6KOJAEg6wlLTc-fIE\",\"dp\":\"v2JbDaZfi3OCCLMtNMjOxfNsBOPb1IqerGux4IR17fLIzG6JlcyaR4uasILdjE4VufqnppZ6FIlFCZUiyIP0GQ\",\"dq\":\"m6NTbNOxN2qnont_qttyqg6WvOA6zWK55-ZnX8hShmlv0ySgtw1PfOWso3wpRMHAujTOfUSeI14DgOLHLNkKtQ\",\"qi\":\"HOcBZfyxW1dSnghCvdTuKL3jLSww6k_v0jhYET32gyKe8od7uxP7w0dXZ8al4zQ3xGxrip9y7jJi0pjG-Z4uGw\",\"p\":\"6dlyTUBrwxLyLbr0X3yqmNu3VrHSt2zbW8jueZFWXPELlbuQ6EKrHoR39BM8MSjFN5PfZbsBhcqNBkqhitj6xw\",\"q\":\"4a4DOrnZt4423myMKmhgDINvIdNmLCHG0aE8UWcSPKO6RFhzHX46NJSoOuk9gvccMKEXOpcJC6P8b8ypN-OKhQ\",\"key_ops\":[\"wrapKey\",\"unwrapKey\",\"encrypt\",\"decrypt\",\"sign\",\"verify\"],\"kid\":\"key_id\"}") + .put(2048, "{\"kty\":\"RSA\",\"n\":\"rZ8pnmXkhfmmgNWVVdtNcYy2q0OAcCGIpeFzsN9URqJsiBEiWQfxlUxFTbM4kVWPqjauKt6byvApBGEeMA7Qs8kxwRVP-BD4orXRe9VPgliM92rH0UxQWHmCHUe7G7uUAFPwbiDVhWuFzELxNa6Kljg6Z9DuUKoddmQvlYWj8uSunofCtDi_zzlZKGYTOYJma5IYScHNww1yjLp8-b-Be2UdHbrPkCv6Nuwi6MVIKjPpEeRQgfefRmxDBJQKY3OfydMXZmEwukYXVkUcdIP8XwG2OxnfdRK0oAo0NDebNNVuT89k_3AyZLTr1KbDmx1nnjwa8uB8k-uLtcOC9igbTw\",\"e\":\"AQAB\",\"d\":\"H-z7hy_vVJ9yeZBMtIvt8qpQUK_J51STPwV085otcgud72tPKJXoW2658664ASl9kGwbnLBwb2G3-SEunuGqiNS_PGUB3niob6sFSUMRKsPDsB9HfPoOcCZvwZiWFGRqs6C7vlR1TuJVqRjKJ_ffbf4K51oo6FZPspx7j4AShLAwLUSQ60Ld5QPuxYMYZIMpdVbMVIVHJ26pR4Y18e_0GYmEGnbF5N0HkwqQmfmTiIK5aoGnD3GGgqHeHmWBwh6_WAq90ITLcX_zBeqQUgBSj-Z5v61SroO9Eang36T9mMoYrcPpYwemtAOb4HhQYDj8dCCfbeOcVmvZ9UJKWCX2oQ\",\"dp\":\"HW87UpwPoj3lPI9B9K1hJFeuGgarpakvtHuk1HpZ5hXWFGAJiXoWRV-jvYyjoM2k7RpSxPyuuFFmYHcIxiGFp2ES4HnP0BIhKVa2DyugUxIEcMK53C43Ub4mboJPZTSC3sapKgAmA2ue624sapWmshTPpx9qnUP2Oj3cSMkgMGE\",\"dq\":\"RhwEwb5FYio0GS2tmul8FAYsNH7JDehwI1yUApnTiakhSenFetml4PYyVkKR4csgLZEi3RY6J3R8Tg-36zrZuF7hxhVJn80L5_KETSpfEI3jcrXMVg4SRaMsWLY9Ahxflt2FJgUnHOmWRLmP6_hmaTcxxSACjbyUd_HhwNavD5E\",\"qi\":\"wYPZ4lKIslA1w3FaAzQifnNLABYXXUZ_KAA3a8T8fuxkdE4OP3xIFX7WHhnmBd6uOFiEcGoeq2jNQqDg91rV5661-5muQKcvp4uUsNId5rQw9EZw-kdDcwMtVFTEBfvVuyp83X974xYAHn1Jd8wWohSwrpi1QuH5cQMR5Fm6I1A\",\"p\":\"74Ot7MgxRu4euB31UWnGtrqYPjJmvbjYESS43jfDfo-s62ggV5a39P_YPg6oosgtGHNw0QDxunUOXNu9iriaYPf_imptRk69bKN8Nrl727Y-AaBYdLf1UZuwz8X07FqHAH5ghYpk79djld8QvkUUJLpx6rzcW8BJLTOi46DtzZE\",\"q\":\"uZJu-qenARIt28oj_Jlsk-p_KLnqdczczZfbRDd7XNp6csGLa8R0EyYqUB4xLWELQZsX4tAu9SaAO62tuuEy5wbOAmOVrq2ntoia1mGQSJdoeVq6OqtN300xVnaBc3us0rm8C6-824fEQ1PWXoulXLKcSqBhFT-hQahsYi-kat8\",\"key_ops\":[\"wrapKey\",\"unwrapKey\",\"encrypt\",\"decrypt\",\"sign\",\"verify\"],\"kid\":\"key_id\"}") + .put(3072, "{\"kty\":\"RSA\",\"n\":\"03u6K67VN18OzIRZdvCC8F9iOVojF-0kk03JQ7rfwumQMqgxLYOmLkrqLcyJV69XYt32LeEesuwuz_zJbQo9gg4T1pnKJSb-l5xoH1rfnihdc9PyMAH___d_zv3Zg9vdusg668eO1oqS5DtAe517suzwhcMIyCsFNx4aBxCDiPlEwzYISwMQHylt-4d6mbFsqJoGK14WqxTOyv0mLoeeDPs9gmQulGbyjYdZJgqjeRBMuHpXgjs_eMwHuqYmWr-jmbRMzBJpKoAgAJkDxkJzJ7wdf4Bq9HrutVspXqw9ZWh4ImIq65Rm5Mx3JDlUNdlYB0jMyDHpuwAZfr8shACty2d5bvlMnk7aYKngCbX2ZSm6BFInA4mz1eey9Iz8uxnfyEjwaYJCFRDy44P_8aymW4tsLoLYgWnF9NodxcLVbhJjBqsipYiUbvW6PUUB4SVtql4yI3EEcZsFFVAVOnms1sXGXK8vm9V9KU1RSWqF268jMD8s-QHg3a1WmooX6sw5\",\"e\":\"AQAB\",\"d\":\"WKU3m6DcmamcK-jcEUluMTBiHTUlmZ1a4-3Ki7vUmEBLo5gxiOjyatwW_dyKwzjpkbUFQCTpN8ldM-w7SBvvPUkGUsFC5MDMHaO_V0lBi2tTBL6V-T6VXmcRaSOpnaY28liErhkHS_Fo8gbOGCKiW5UKmp7uWu0BciGJemWXJP6LLqJC5qJhixZUFgcrQioHKELrjBkTumFt7tMewokxHDLhjPrONYFTcTSHDzWNYS0OY5NQg_OuvsUTBk8nq4lA2GSQqXyM-B2gbwG6pLSwccwu0x3Fd8qurxg6TSGQAjh69Iyb9ZwiHMsx3XLV95Jmqc0rcEbCzLZUBxX3daGjshw3Yd3pzEXqM8Mz-58p835VPhSMlZB_yvtP72o2QiKybhq1ob5Ygt7hqlqe08K5StN2rzJJoFkwivhfC3_KDX7XSLEK9PzqPaTOkkJu7y7tJgi6aC6Fq-X3fgeLy20LsBKV_SF4Zd323IZ713iGJFJo0f4mDUXfQmU3wrILk40L\",\"dp\":\"V5SlApD1a0ng5XrzEmOV2EVKVLcS7Z2j1WYLVa4BMxSsi8zJal_v8nllEN8ylDTWKCZt6Dg3fcHtOWKYGe7e2fBMwSsKcjPI2aFVHjI18ZMbC1m6eHWK81zlTQ-ZhgiRMXQvsRCX6Qt8PPvqfV4j-YILYfgJbQ_DRYEfJzq9JCQjFwGUiSoZvOBl9jQMM1u4NmOnvodwf8Jk4Oi1DC65U-CjOC7D07eDPNv74Pog6h6x3u7Z9S-ITvP1NX4h0_ot\",\"dq\":\"rg2IrHzp59w8nZbtd4NDk_stRB8xT6T2pxpH3LhNhEbLrmy0sF4Xemm8frlgRWeEn9dUV2nzveorEJF57bZ3cclEqBGtD72y_IRPZTPgDcYhc9l4xKJkJJuA3yWcQ6eHZHjLAZHi9PszYvFiUx1veHU2S_f7aGKjO14n05wb9r-YUmIKt7AVwK94HksflvNIREa867E2OL1lIJiX3azkyMgTnSHvi0bwgdIGp6uPdDwVW_qvvUmlFinDWflgq58\",\"qi\":\"Dw0f0UwU2KN98stNeuk2UVtG-GyKjCxSSYocGBlShsXzxeLn2faLSkkqhUVicW4o2PmedPDpxanDW2Gl7osamaPb25CodPS3JJxeHWrJ6hGBfKqvJnysZ-0zL8wVzwuNLc3VL-jlCudFfGK03MBapA9h3qjAFFhHZRgLH8y64MimARfh2gLldZ0FgNF9zB4yxmVzvpOng4XRJGzSBKdf9QbuL60Tia2rWR7QU2GtbrXlp4KiNZspZuzmBLZPaa82\",\"p\":\"3lnk-l3lG3ahUzPzhInjwTJEDRrAt0YMhpLmO444TNs0MD__RxRQO8EAhLGCuKaNJmKOg-D5-Fup34KBAcFKw1vCh06PNxoIbHmcY1KwrlA3M_47pK74sK532429sM2N0JH9ti4QjtcD85__THeS6I5g8x8xdSH6sm6ubOiUWUQ96fN10pDv-9D7PuoHGEGlndvsRE0GwWmBIjCnIbxXN4kQsE5YXbrY_WTdPXxwTb8F6Cqc2WXIuhZLlSqd8NjD\",\"q\":\"83zNQcd3dTEpO-j6e7hHeKYghVBhIViD6bXDzD3IX--maTnllGMD-xxHNzOURwl_VzwWo1Al_QQSKDMeEnNDXhSU50qbdhdyVDyRXQuR2Fb9hN5SACX-SiPgfs-2buJVZh8JD-VFSI7ou6eMQ9h-uIGnhoxH3vCs7dJgy-mHGPsvqTypaIo3LHGfM21z8h0yqgyYwaanv5UllaustjvRFId_2oWqNtrn6q410s9W5-6Q6xqkrW2m_lUffu7ViRdT\",\"key_ops\":[\"wrapKey\",\"unwrapKey\",\"encrypt\",\"decrypt\",\"sign\",\"verify\"],\"kid\":\"key_id\"}") + .put(4096, "{\"kty\":\"RSA\",\"n\":\"mmpRerSZYY4Xx_s89Qn3NMAmJOW0TXtddwjdTedA2CITP_BQW9Q6K7ZEKcAk5W8KwfvAYEIDkWN0iKtoSiBmTJxgCqpDI2MO1D_JJXFP6Tovbtgj1FJ8Ai90w04wmxoCdS9mFC2tE51qUWO7frJpTGrZqVAB8UMH031c3pUPzWedGRvKwj7J-Awtg_IoByaK-qoyRlwfqm8WpHjg6R6Fn1aJY3Fp62l1F3XGayUgqoJmg0_YzYxKpz9WDqIJo15sbyQEpTG6kRybD8T5O8908JU2d3KPp7GOKDNpai5wdaK50QyvaU3BtvKI35IaK367FSVPEZPEoAGgUBCoLXx8N16XHVgjspSMV6NnjBEoehr4xU3nw4cZ-09yZSXJv5FGKmg4pkJGCHQwUfA3XlWNZSPYIgBByyjpMe6gJt_RDBhkkYGVddkwn4HPlMIk3Gi9wzMLuVcLNVeq5k4Us3YsaXdSPI6LSfoosu7mi8qm2JMYlFzbB9_FaxJWqgHlTRSiXX0XNuHPMJoBHtKwh_7VXxiosim8EvszF_Is1ttF77l5lC198slQ5zsZ2XM90Ln9UV04kAyI1jEegDiW37uVSikt-VKyVKSZg5lgmp16CevLnqD2g_YD6fJMmbU4QmeVELhZeQc7Z_XGH7lM1bSeiAJ0dKlDKDURnA0h2LQfquM\",\"e\":\"AQAB\",\"d\":\"D_CvEz5WzGihW9Y7p1qtV5deWKtoaXc1YXcGIWdLR68nfY-OkWw0dRQOWqD92LwVyDX3g02ilfzw_WAfFp0xnPGnmHJAbAQVy83_MwuiIYQNfCEj0bnnbfJS2LaBngFEBQTXl3hU8ulqcuxwtoDZuIxvMQ3pUBaIqvRjWeGEDW2Hch1vA45ScHYRXMWVYZJBAToAkUgr8f7LFOoa4vXGUCSGxOqNnJejrBWkXfsp3BrfVOmGipwo42BOae71lRUc7HwzXo-Q9YSWcpJK3Y8U60umoRNacQfgkkB8aVGnRP1_YRfbeRYQdpT4PDFrh4Hq83aJKwSuD4vGGNMfXqgIdSWhREajFDN653gDIIrt1BPh-snE9HIr0QWJmGQTlKTFfXMEoHx6mxJgUmzZSdQ9BkfCYyInpevh2piUrdpoAEEBapYyTmEHetutMm6cpPd4EK7-yHf3f1k1Rx-HIkiN-pLPiy6x6sRS-272pRNJUjEyRr7QIxgv2rVmQpFd3HZIsmTA9e5HnEH88pbwzqckWeA8nCpe6vr9uJ5MkIMaZq1Exw2bL8TjezbQdRvFm6eO25ECBE_YRuTm72hWfkn1Aocz5_RrSvW6gjwXpgTB6ScNyDrrmo9Kz8DQA7uvRvwhS48fceGGqEt_02qtj_FY1e8Q-XLVsPz-oafqbrTPI0E\",\"dp\":\"D9PGN8qEoUjBFIDKfuilcKwpU25pLnGsgnlzXxORZYB2T1y_DzHVXoSFkcOcFfn2L-AWFSUQmFlt37ULSoSTi2J5KzeydzXfkz4CauzqyEEyv1Uu_FBM6ZDb14ZkYoS8B_vWx7ow99fopwwObs5LH9vtGmiAJczVTNuwUQd_8uRXsWdoy2Ku8XLmNBaxvpXjzbs3ooKIw450PWB1qk455OrQ0k2dqrbY5VlOjgBEk317yCamGbPy2AgC4EnXnAZ0qJ5gN-mJNbjBCjkS0MImMWphJCrXkKMxl1OURKW_ujb7B5EGXcTmJuFxu8uE6_SxDrhmbCfdrwnfVdQXIGyGsw\",\"dq\":\"xEmqiGWKIuuyMX3wElvw2E_qJfuJ58lyAqQOYrM8ROsk4iaV9yc9G57pHsLRdiCYYrYDoisi96LdJ6kScAcS8j5TAuAdHq2riI0MOd-lZr6I4S_3pnjO3SuHYmCoFagnpIo7QM9-l2ZguDrfCjs7PtQZqMWSg-ncHYrHDsbynhe9GPdes01u4XZ3Y2xoYBDJX2iCXVNKJBUeYwlLd01p4eE1O_UkI8GdxQDMOr0ifOjWa9HtmY13Q8yvWoDtA4UX9Ec83mB3F2RWi4b-0C1pxSifCzeo4VZ0uOZ_aR4ZKfx7npWseE6F-Ue2vPx3qnfZQAkXaqJPsR15ZU0ZtJqAEQ\",\"qi\":\"fzpgNvwBpXBjLkqVkKnGD20kTR1lnMfXKJHk_iGE3UY7FVRSGXiUWpRWo-Gh0Lq8jJVXddX3looqv-v_9uKHja2JkHToWSkJajRznFHvz1pMfs7d3Nr4puumuNxJC1rgktnOIK4eikNxxHJ5Rs6TeQOwWxRbmywMiEeUQAwVvgaaF91g8FmNUE4C2BCpav-1fKkr_ydo1j4AgcSaCcKuywPBvp2Fznf4UcND_1vyZVKhSBbqbu6ql8vb9zEo3E8AKsrn9REji0BnA5kHk1Ps7GiQcMSCdazwBq1kw3DYD5Mt4CuyOdg6Btg-MVDXLLS0Dw0VEvcPhi7ypUlpl0RWcQ\",\"p\":\"uFaIjld13k5EkpQtTJ6zw9Zq5QJwaVBu1RiyXTdji8ysU6rxk07HAsUt049BuKqFv2jdKVDsdL25WkIao93hstdl8Kl_7XQX491_1np1hW-NvapNUYo5UUn-SeT4zseoIu8n-GarEAI00U8Xj2M4pewd82zlCQHTCXZiwbWGF2XMfPqvpYhFtEoMyJUf8z6qCvcZgp-neJJNbLgesspHke8--GwYN-QjrUynkmUGZ14BQdnLsmNLeaWY7A92sLSOFYVK8XnXSzOUld2P5JCgTenS5Na5UpuaY1K8od8rci3TE23Gtma5VhqBiPOFgPXmlkpkBe1uRn84iV5avYQfdw\",\"q\":\"1nHaNzR3mE6cyzPqsqNxT_FDDzMXHCmxW8cO_9GzmFBW6MhNArPEIV9BFAo-NRjDKMYKPin67MlyiLCMN-TWTayeNeuvw_WYwKfI_t9xuyf1nsW-TsNoK4n2d0kwoB5OEH9pAtQKv9rSZl4WULePldJBF4lPBhQb0lmRu-HB_SRskZe8CdDcm-gjwLhoP76gstWN5PNzgrPTpxBC6tHdWD-ZbkzIGWzCjxNHAnJkUAEsy3FVllCtO4pMVXz3zupaVzmDlUQ34weWXqkA-C7QgUPNoCD_M7PTNJKQpnTwlgk1Jvn8v4FDrpmYvv5l8B9swMPtlIi9xADuuEg8gO5i9Q\",\"key_ops\":[\"wrapKey\",\"unwrapKey\",\"encrypt\",\"decrypt\",\"sign\",\"verify\"],\"kid\":\"key_id\"}") + .build(); +} diff --git a/keyvault/data-plane/azure-keyvault/.gitignore b/keyvault/data-plane/azure-keyvault/.gitignore new file mode 100644 index 0000000000000..b83d22266ac8a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/keyvault/data-plane/azure-keyvault/pom.xml b/keyvault/data-plane/azure-keyvault/pom.xml new file mode 100644 index 0000000000000..5d6a418f514d2 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/pom.xml @@ -0,0 +1,262 @@ + + + 4.0.0 + + com.microsoft.azure + azure-keyvault-parent + 1.1.2 + ../pom.xml + + + azure-keyvault + 1.1.2 + jar + + Microsoft Azure SDK for Key Vault + This package contains Microsoft Azure Key Vault SDK. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + playback + + + + + microsoft + Microsoft + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + + + + + + + + com.microsoft.azure + azure-keyvault-cryptography + + + com.microsoft.azure + azure-keyvault-webkey + + + + + com.microsoft.azure + azure-client-runtime + + + + + com.microsoft.rest + client-runtime + + + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + + + commons-codec + commons-codec + + + com.google.guava + guava + + + org.apache.commons + commons-lang3 + + + joda-time + joda-time + 2.1 + + + com.squareup.retrofit2 + retrofit + 2.4.0 + + + com.squareup.okhttp3 + okhttp + 3.10.0 + + + com.squareup.okio + okio + 1.14.0 + + + io.reactivex + rxjava + + + + + + com.microsoft.azure + azure-mgmt-storage + 1.3.0 + test + + + com.microsoft.azure + azure-mgmt-graph-rbac + 1.3.0 + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-mgmt-keyvault + test + + + com.microsoft.azure + azure-keyvault + + + + + com.microsoft.azure + azure-mgmt-resources + 1.3.1-SNAPSHOT + test-jar + test + + + com.microsoft.azure + adal4j + test + + + com.microsoft.azure + azure-storage + 4.4.0 + test + + + + + com.google.code.gson + gson + 2.2.4 + test + + + com.microsoft.azure + azure-client-authentication + [1.1.0,2.0.0) + test + + + junit + junit + test + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.12 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.0 + + + ${basedir}/azure-keyvault/target/azure-keyvault-${project.version}.jar + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + com.microsoft.schemas._2003._10.serialization; + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+
+
+
diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateIdentifier.java new file mode 100644 index 0000000000000..3d89362feb2f8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +/** + * The certificate identifier. + */ +public final class CertificateIdentifier extends ObjectIdentifier { + + /** + * Verify whether the identifier is for certificate. + * @param identifier the certificate identifier + * @return true if the identifier is the certificate identifier. False otherwise. + */ + public static boolean isCertificateIdentifier(String identifier) { + return ObjectIdentifier.isObjectIdentifier("certificates", identifier); + } + + /** + * Constructor. + * @param vault The vault url + * @param name the certificate name + */ + public CertificateIdentifier(String vault, String name) { + this(vault, name, ""); + } + + /** + * Constructor. + * @param vault the vault url + * @param name the certificate name + * @param version the certificate version + */ + public CertificateIdentifier(String vault, String name, String version) { + super(vault, "certificates", name, version); + } + + /** + * Constructor. + * @param identifier the certificate identifier + */ + public CertificateIdentifier(String identifier) { + super("certificates", identifier); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateOperationIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateOperationIdentifier.java new file mode 100644 index 0000000000000..df6144064947b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateOperationIdentifier.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +import java.net.URI; +import java.net.URISyntaxException; + +/** + * The certificate operation identifier. + */ +public final class CertificateOperationIdentifier extends ObjectIdentifier { + + /** + * Verifies whether the identifier belongs to a key vault certificate operation. + * @param identifier the key vault certificate operation identifier. + * @return true if the identifier belongs to a key vault certificate operation. False otherwise. + */ + public static boolean isCertificateOperationIdentifier(String identifier) { + identifier = verifyNonEmpty(identifier, "identifier"); + + URI baseUri; + try { + baseUri = new URI(identifier); + } catch (URISyntaxException e) { + return false; + } + + // Path is of the form "/certificates/[name]/pending" + String[] segments = baseUri.getPath().split("/"); + if (segments.length != 4) { + return false; + } + + if (!(segments[1]).equals("certificates")) { + return false; + } + + if (!(segments[3]).equals("pending")) { + return false; + } + + return true; + } + + /** + * Constructor. + * @param vault the vault url + * @param name the name of certificate + * @param version the certificate version + */ + public CertificateOperationIdentifier(String vault, String name, String version) { + super(vault, "certificates", name, "pending"); + } + + /** + * Constructor. + * @param identifier the key vault certificate operation identifier. + */ + public CertificateOperationIdentifier(String identifier) { + super("certificates", identifier); + if (!version().equals("pending")) { + throw new IllegalArgumentException( + String.format("Invalid CertificateOperationIdentifier: {0}", identifier)); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/IssuerIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/IssuerIdentifier.java new file mode 100644 index 0000000000000..71c88d9d9ee92 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/IssuerIdentifier.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +import java.net.URI; +import java.net.URISyntaxException; +import java.security.InvalidParameterException; + +/** + * The issuer identifier. + */ +public final class IssuerIdentifier extends ObjectIdentifier { + + /** + * Verifies whether the identifier belongs to a key vault issuer. + * @param identifier the key vault issuer identifier. + * @return true if the identifier belongs to a key vault issuer. False otherwise. + */ + public static boolean isIssuerIdentifier(String identifier) { + identifier = verifyNonEmpty(identifier, "identifier"); + + URI baseUri; + try { + baseUri = new URI(identifier); + } catch (URISyntaxException e) { + return false; + } + + String[] segments = baseUri.getPath().split("/"); + if (segments.length != 4 || segments[1] != "certificates" || segments[2] != "issuers") { + return false; + } + + return true; + } + + /** + * Constructor. + * @param vault the vault url. + * @param name the name of issuer. + */ + public IssuerIdentifier(String vault, String name) { + vault = verifyNonEmpty(vault, "vault"); + + name = verifyNonEmpty(name, "name"); + + URI baseUri; + try { + baseUri = new URI(vault); + } catch (URISyntaxException e) { + throw new InvalidParameterException(String.format("Invalid ObjectIdentifier: %s. Not a valid URI", vault)); + } + + this.name = name; + this.version = null; + this.vault = String.format("%s://%s", baseUri.getScheme(), getFullAuthority(baseUri)); + + baseIdentifier = String.format("%s/%s/%s", this.vault, "certificates/issuers", this.name); + identifier = baseIdentifier; + } + + /** + * Constructor. + * @param identifier the key vault issuer identifier. + */ + public IssuerIdentifier(String identifier) { + + identifier = verifyNonEmpty(identifier, "identifier"); + + URI baseUri; + try { + baseUri = new URI(identifier); + } catch (URISyntaxException e) { + throw new InvalidParameterException( + String.format("Invalid ObjectIdentifier: %s. Not a valid URI", identifier)); + } + + // Path is of the form "/collection/name[/version]" + String[] segments = baseUri.getPath().split("/"); + if (segments.length != 4) { + throw new InvalidParameterException(String + .format("Invalid ObjectIdentifier: %s. Bad number of segments: %d", identifier, segments.length)); + } + + if (!segments[1].equals("certificates")) { + throw new InvalidParameterException( + String.format("Invalid ObjectIdentifier: %s. Segment [1] should be '%s', found '%s'", identifier, + "certificates", segments[1])); + } + if (!segments[2].equals("issuers")) { + throw new InvalidParameterException( + String.format("Invalid ObjectIdentifier: %s. Segment [2] should be '%s', found '%s'", identifier, + "issuers", segments[2])); + } + + name = segments[3]; + version = ""; + vault = String.format("%s://%s", baseUri.getScheme(), getFullAuthority(baseUri)); + baseIdentifier = String.format("%s/%s/%s", vault, "certificates/issuers", name); + this.identifier = baseIdentifier; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyIdentifier.java new file mode 100644 index 0000000000000..493f4097df554 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +/** + * The Key Vault key identifier. + */ +public final class KeyIdentifier extends ObjectIdentifier { + + /** + * Verifies whether the identifier belongs to a key vault key. + * @param identifier the key vault key identifier. + * @return true if the identifier belongs to a key vault key. False otherwise. + */ + public static boolean isKeyIdentifier(String identifier) { + return ObjectIdentifier.isObjectIdentifier("keys", identifier); + } + + /** + * Constructor. + * @param vault the vault url. + * @param name the name of key. + */ + public KeyIdentifier(String vault, String name) { + this(vault, name, ""); + } + + /** + * Constructor. + * @param vault the vault url. + * @param name the name of key. + * @param version the key version. + */ + public KeyIdentifier(String vault, String name, String version) { + super(vault, "keys", name, version); + } + + /** + * Constructor. + * @param identifier the key vault key identifier. + */ + public KeyIdentifier(String identifier) { + super("keys", identifier); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClient.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClient.java new file mode 100644 index 0000000000000..58e8bd36ba573 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClient.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +import com.microsoft.azure.keyvault.implementation.KeyVaultClientCustomImpl; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; + +/** + * Class for Key Vault Client. + * + */ +public final class KeyVaultClient extends KeyVaultClientCustomImpl implements KeyVaultClientCustom { + + /** + * Initializes an instance of KeyVaultClient client. + * + * @param credentials the management credentials for Azure + */ + public KeyVaultClient(ServiceClientCredentials credentials) { + super(credentials); + initializeService(); + } + /** + * Initializes an instance of KeyVaultClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public KeyVaultClient(RestClient restClient) { + super(restClient); + initializeService(); + } + + +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientBase.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientBase.java new file mode 100644 index 0000000000000..72f475261b73a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientBase.java @@ -0,0 +1,6124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault; + +import java.util.List; +import java.util.Map; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.models.BackupCertificateResult; +import com.microsoft.azure.keyvault.models.BackupKeyResult; +import com.microsoft.azure.keyvault.models.BackupSecretResult; +import com.microsoft.azure.keyvault.models.BackupStorageResult; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; +import com.microsoft.azure.keyvault.models.DeletedCertificateItem; +import com.microsoft.azure.keyvault.models.DeletedKeyBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyItem; +import com.microsoft.azure.keyvault.models.DeletedSasDefinitionBundle; +import com.microsoft.azure.keyvault.models.DeletedSasDefinitionItem; +import com.microsoft.azure.keyvault.models.DeletedSecretBundle; +import com.microsoft.azure.keyvault.models.DeletedSecretItem; +import com.microsoft.azure.keyvault.models.DeletedStorageAccountItem; +import com.microsoft.azure.keyvault.models.DeletedStorageBundle; +import com.microsoft.azure.keyvault.models.IssuerAttributes; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.models.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.OrganizationDetails; +import com.microsoft.azure.keyvault.models.SasDefinitionAttributes; +import com.microsoft.azure.keyvault.models.SasDefinitionBundle; +import com.microsoft.azure.keyvault.models.SasDefinitionItem; +import com.microsoft.azure.keyvault.models.SasTokenType; +import com.microsoft.azure.keyvault.models.SecretAttributes; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.models.StorageAccountAttributes; +import com.microsoft.azure.keyvault.models.StorageAccountItem; +import com.microsoft.azure.keyvault.models.StorageBundle; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; + +import rx.Observable; + +/** + * The interface for KeyVaultClientBase class. + */ +public interface KeyVaultClientBase { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Client API version.. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + KeyVaultClientBase withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + KeyVaultClientBase withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + KeyVaultClientBase withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, final ServiceCallback serviceCallback); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty); + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve, final ServiceCallback serviceCallback); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, final ServiceCallback serviceCallback); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key); + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags); + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags); + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedKeyBundle object if successful. + */ + DeletedKeyBundle deleteKey(String vaultBaseUrl, String keyName); + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback); + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + Observable deleteKeyAsync(String vaultBaseUrl, String keyName); + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + Observable> deleteKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion); + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags); + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags); + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle getKey(String vaultBaseUrl, String keyName, String keyVersion); + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback); + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion); + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> getKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeyVersions(final String vaultBaseUrl, final String keyName); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback serviceCallback); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName); + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeys(final String vaultBaseUrl); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeysAsync(final String vaultBaseUrl); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl); + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeys(final String vaultBaseUrl, final Integer maxresults); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeysAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupKeyResult object if successful. + */ + BackupKeyResult backupKey(String vaultBaseUrl, String keyName); + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback); + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupKeyResult object + */ + Observable backupKeyAsync(String vaultBaseUrl, String keyName); + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupKeyResult object + */ + Observable> backupKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName); + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup); + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup, final ServiceCallback serviceCallback); + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup); + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> restoreKeyWithServiceResponseAsync(String vaultBaseUrl, byte[] keyBundleBackup); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + KeyOperationResult encrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable> encryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + KeyOperationResult decrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback); + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable> decryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + KeyOperationResult sign(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value); + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback); + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value); + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable> signWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value); + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyVerifyResult object if successful. + */ + KeyVerifyResult verify(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature); + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature, final ServiceCallback serviceCallback); + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyVerifyResult object + */ + Observable verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature); + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyVerifyResult object + */ + Observable> verifyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature); + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback); + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable> wrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + KeyOperationResult unwrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback); + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + Observable> unwrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + PagedList getDeletedKeys(final String vaultBaseUrl); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable> getDeletedKeysAsync(final String vaultBaseUrl); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable>> getDeletedKeysWithServiceResponseAsync(final String vaultBaseUrl); + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + PagedList getDeletedKeys(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable> getDeletedKeysAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable>> getDeletedKeysWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedKeyBundle object if successful. + */ + DeletedKeyBundle getDeletedKey(String vaultBaseUrl, String keyName); + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback); + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + Observable getDeletedKeyAsync(String vaultBaseUrl, String keyName); + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + Observable> getDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName); + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void purgeDeletedKey(String vaultBaseUrl, String keyName); + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture purgeDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable purgeDeletedKeyAsync(String vaultBaseUrl, String keyName); + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> purgeDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName); + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + KeyBundle recoverDeletedKey(String vaultBaseUrl, String keyName); + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback); + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable recoverDeletedKeyAsync(String vaultBaseUrl, String keyName); + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> recoverDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle setSecret(String vaultBaseUrl, String secretName, String value); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, final ServiceCallback serviceCallback); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable setSecretAsync(String vaultBaseUrl, String secretName, String value); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value); + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle setSecret(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes, final ServiceCallback serviceCallback); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes); + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes); + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSecretBundle object if successful. + */ + DeletedSecretBundle deleteSecret(String vaultBaseUrl, String secretName); + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback); + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + Observable deleteSecretAsync(String vaultBaseUrl, String secretName); + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + Observable> deleteSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion); + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags); + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags); + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion); + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback); + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion); + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> getSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecrets(final String vaultBaseUrl); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretsAsync(final String vaultBaseUrl); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl); + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecrets(final String vaultBaseUrl, final Integer maxresults); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecretVersions(final String vaultBaseUrl, final String secretName); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback serviceCallback); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName); + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecretVersions(final String vaultBaseUrl, final String secretName, final Integer maxresults); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + PagedList getDeletedSecrets(final String vaultBaseUrl); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable> getDeletedSecretsAsync(final String vaultBaseUrl); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable>> getDeletedSecretsWithServiceResponseAsync(final String vaultBaseUrl); + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + PagedList getDeletedSecrets(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable> getDeletedSecretsAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable>> getDeletedSecretsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSecretBundle object if successful. + */ + DeletedSecretBundle getDeletedSecret(String vaultBaseUrl, String secretName); + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback); + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + Observable getDeletedSecretAsync(String vaultBaseUrl, String secretName); + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + Observable> getDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName); + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void purgeDeletedSecret(String vaultBaseUrl, String secretName); + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture purgeDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable purgeDeletedSecretAsync(String vaultBaseUrl, String secretName); + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> purgeDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName); + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle recoverDeletedSecret(String vaultBaseUrl, String secretName); + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture recoverDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback); + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable recoverDeletedSecretAsync(String vaultBaseUrl, String secretName); + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> recoverDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName); + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupSecretResult object if successful. + */ + BackupSecretResult backupSecret(String vaultBaseUrl, String secretName); + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture backupSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback); + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupSecretResult object + */ + Observable backupSecretAsync(String vaultBaseUrl, String secretName); + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupSecretResult object + */ + Observable> backupSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName); + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + SecretBundle restoreSecret(String vaultBaseUrl, byte[] secretBundleBackup); + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback serviceCallback); + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup); + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + Observable> restoreSecretWithServiceResponseAsync(String vaultBaseUrl, byte[] secretBundleBackup); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificates(final String vaultBaseUrl); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificatesAsync(final String vaultBaseUrl); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl); + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificates(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending, final ListOperationCallback serviceCallback); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedCertificateBundle object if successful. + */ + DeletedCertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName); + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + Observable deleteCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + Observable> deleteCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts); + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts, final ServiceCallback serviceCallback); + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts); + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable> setCertificateContactsWithServiceResponseAsync(String vaultBaseUrl, Contacts contacts); + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + Contacts getCertificateContacts(String vaultBaseUrl); + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback); + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable getCertificateContactsAsync(String vaultBaseUrl); + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable> getCertificateContactsWithServiceResponseAsync(String vaultBaseUrl); + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + Contacts deleteCertificateContacts(String vaultBaseUrl); + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback); + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable deleteCertificateContactsAsync(String vaultBaseUrl); + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + Observable> deleteCertificateContactsWithServiceResponseAsync(String vaultBaseUrl); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + PagedList getCertificateIssuers(final String vaultBaseUrl); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable> getCertificateIssuersAsync(final String vaultBaseUrl); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl); + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + PagedList getCertificateIssuers(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, final ServiceCallback serviceCallback); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider); + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName); + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes); + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName); + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback); + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable getCertificateIssuerAsync(String vaultBaseUrl, String issuerName); + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> getCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName); + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName); + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback); + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName); + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + Observable> deleteCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + CertificateOperation createCertificate(String vaultBaseUrl, String certificateName); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable createCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + CertificateOperation createCertificate(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, final ServiceCallback serviceCallback); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate); + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback serviceCallback); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName); + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName, final Integer maxresults); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults); + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificatePolicy object if successful. + */ + CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName); + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificatePolicyAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + Observable getCertificatePolicyAsync(String vaultBaseUrl, String certificateName); + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + Observable> getCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificatePolicy object if successful. + */ + CertificatePolicy updateCertificatePolicy(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy); + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, final ServiceCallback serviceCallback); + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + Observable updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy); + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + Observable> updateCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion); + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags); + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion); + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback); + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion); + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> getCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion); + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + CertificateOperation updateCertificateOperation(String vaultBaseUrl, String certificateName, boolean cancellationRequested); + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested, final ServiceCallback serviceCallback); + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested); + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable> updateCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested); + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName); + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable getCertificateOperationAsync(String vaultBaseUrl, String certificateName); + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable> getCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName); + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName); + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + Observable> deleteCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, final ServiceCallback serviceCallback); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates); + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags); + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupCertificateResult object if successful. + */ + BackupCertificateResult backupCertificate(String vaultBaseUrl, String certificateName); + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture backupCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupCertificateResult object + */ + Observable backupCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupCertificateResult object + */ + Observable> backupCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle restoreCertificate(String vaultBaseUrl, byte[] certificateBundleBackup); + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup, final ServiceCallback serviceCallback); + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup); + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> restoreCertificateWithServiceResponseAsync(String vaultBaseUrl, byte[] certificateBundleBackup); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + PagedList getDeletedCertificates(final String vaultBaseUrl); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable> getDeletedCertificatesAsync(final String vaultBaseUrl); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable>> getDeletedCertificatesWithServiceResponseAsync(final String vaultBaseUrl); + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + PagedList getDeletedCertificates(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable> getDeletedCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable>> getDeletedCertificatesWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending); + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedCertificateBundle object if successful. + */ + DeletedCertificateBundle getDeletedCertificate(String vaultBaseUrl, String certificateName); + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + Observable getDeletedCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + Observable> getDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void purgeDeletedCertificate(String vaultBaseUrl, String certificateName); + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture purgeDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable purgeDeletedCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> purgeDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + CertificateBundle recoverDeletedCertificate(String vaultBaseUrl, String certificateName); + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture recoverDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback); + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable recoverDeletedCertificateAsync(String vaultBaseUrl, String certificateName); + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + Observable> recoverDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + PagedList getStorageAccounts(final String vaultBaseUrl); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStorageAccountsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable> getStorageAccountsAsync(final String vaultBaseUrl); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable>> getStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl); + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + PagedList getStorageAccounts(final String vaultBaseUrl, final Integer maxresults); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable> getStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable>> getStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + PagedList getDeletedStorageAccounts(final String vaultBaseUrl); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable> getDeletedStorageAccountsAsync(final String vaultBaseUrl); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable>> getDeletedStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl); + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + PagedList getDeletedStorageAccounts(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable>> getDeletedStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedStorageBundle object if successful. + */ + DeletedStorageBundle getDeletedStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + Observable getDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + Observable> getDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void purgeDeletedStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> purgeDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle recoverDeletedStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> recoverDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupStorageResult object if successful. + */ + BackupStorageResult backupStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStorageResult object + */ + Observable backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStorageResult object + */ + Observable> backupStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle restoreStorageAccount(String vaultBaseUrl, byte[] storageBundleBackup); + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture restoreStorageAccountAsync(String vaultBaseUrl, byte[] storageBundleBackup, final ServiceCallback serviceCallback); + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable restoreStorageAccountAsync(String vaultBaseUrl, byte[] storageBundleBackup); + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> restoreStorageAccountWithServiceResponseAsync(String vaultBaseUrl, byte[] storageBundleBackup); + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedStorageBundle object if successful. + */ + DeletedStorageBundle deleteStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + Observable deleteStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + Observable> deleteStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable getStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> getStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle setStorageAccount(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, final ServiceCallback serviceCallback); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> setStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey); + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle setStorageAccount(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> setStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> updateStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName); + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> updateStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags); + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + StorageBundle regenerateStorageAccountKey(String vaultBaseUrl, String storageAccountName, String keyName); + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture regenerateStorageAccountKeyAsync(String vaultBaseUrl, String storageAccountName, String keyName, final ServiceCallback serviceCallback); + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable regenerateStorageAccountKeyAsync(String vaultBaseUrl, String storageAccountName, String keyName); + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + Observable> regenerateStorageAccountKeyWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String keyName); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + PagedList getSasDefinitions(final String vaultBaseUrl, final String storageAccountName); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final ListOperationCallback serviceCallback); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable>> getSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName); + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + PagedList getSasDefinitions(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable>> getSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + PagedList getDeletedSasDefinitions(final String vaultBaseUrl, final String storageAccountName); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final ListOperationCallback serviceCallback); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName); + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + PagedList getDeletedSasDefinitions(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults); + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSasDefinitionBundle object if successful. + */ + DeletedSasDefinitionBundle getDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback); + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + Observable getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + Observable> getDeletedSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle recoverDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback); + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> recoverDeletedSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSasDefinitionBundle object if successful. + */ + DeletedSasDefinitionBundle deleteSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback); + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + Observable deleteSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + Observable> deleteSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle getSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback); + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable getSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> getSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, final ServiceCallback serviceCallback); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> setSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod); + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> setSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle updateSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> updateSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName); + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + SasDefinitionBundle updateSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags, final ServiceCallback serviceCallback); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + Observable> updateSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeyVersionsNext(final String nextPageLink); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeyVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeyVersionsNextAsync(final String nextPageLink); + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeyVersionsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + PagedList getKeysNext(final String nextPageLink); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable> getKeysNextAsync(final String nextPageLink); + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + Observable>> getKeysNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + PagedList getDeletedKeysNext(final String nextPageLink); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable> getDeletedKeysNextAsync(final String nextPageLink); + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + Observable>> getDeletedKeysNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecretsNext(final String nextPageLink); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretsNextAsync(final String nextPageLink); + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + PagedList getSecretVersionsNext(final String nextPageLink); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSecretVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable> getSecretVersionsNextAsync(final String nextPageLink); + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + Observable>> getSecretVersionsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + PagedList getDeletedSecretsNext(final String nextPageLink); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSecretsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable> getDeletedSecretsNextAsync(final String nextPageLink); + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + Observable>> getDeletedSecretsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificatesNext(final String nextPageLink); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificatesNextAsync(final String nextPageLink); + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificatesNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + PagedList getCertificateIssuersNext(final String nextPageLink); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateIssuersNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable> getCertificateIssuersNextAsync(final String nextPageLink); + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + Observable>> getCertificateIssuersNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificateVersionsNext(final String nextPageLink); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificateVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificateVersionsNextAsync(final String nextPageLink); + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + PagedList getDeletedCertificatesNext(final String nextPageLink); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedCertificatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable> getDeletedCertificatesNextAsync(final String nextPageLink); + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable>> getDeletedCertificatesNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + PagedList getStorageAccountsNext(final String nextPageLink); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStorageAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable> getStorageAccountsNextAsync(final String nextPageLink); + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + Observable>> getStorageAccountsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + PagedList getDeletedStorageAccountsNext(final String nextPageLink); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedStorageAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable> getDeletedStorageAccountsNextAsync(final String nextPageLink); + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + Observable>> getDeletedStorageAccountsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + PagedList getSasDefinitionsNext(final String nextPageLink); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSasDefinitionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable> getSasDefinitionsNextAsync(final String nextPageLink); + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + Observable>> getSasDefinitionsNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + PagedList getDeletedSasDefinitionsNext(final String nextPageLink); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedSasDefinitionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable> getDeletedSasDefinitionsNextAsync(final String nextPageLink); + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + Observable>> getDeletedSasDefinitionsNextWithServiceResponseAsync(final String nextPageLink); + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientCustom.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientCustom.java new file mode 100644 index 0000000000000..f64bf02a90618 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientCustom.java @@ -0,0 +1,1499 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +import java.util.List; +import java.util.Map; + +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.DeletedCertificateItem; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.requests.CreateCertificateRequest; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.ImportCertificateRequest; +import com.microsoft.azure.keyvault.requests.ImportKeyRequest; +import com.microsoft.azure.keyvault.requests.MergeCertificateRequest; +import com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateOperationRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificatePolicyRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateRequest; +import com.microsoft.azure.keyvault.requests.UpdateKeyRequest; +import com.microsoft.azure.keyvault.requests.UpdateSecretRequest; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.protocol.SerializerAdapter; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import rx.Observable; + +/** + * The interface for the Key Vault Client custom class. Maintains some backwards + * compatibility functionalities. + * + */ +public interface KeyVaultClientCustom extends KeyVaultClientBase { + + /** + * @return the Retrofit instance. + */ + Retrofit retrofit(); + + /** + * @return the HTTP client. + */ + OkHttpClient httpClient(); + + /** + * @return the adapter to a Jackson + * {@link com.fasterxml.jackson.databind.ObjectMapper}. + */ + SerializerAdapter serializerAdapter(); + + /** + * Initializes the service. + */ + void initializeService(); + + /** + * @return the {@link RestClient} instance. + */ + RestClient restClient(); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. Authorization: Requires the keys/create permission. + * + * @param createKeyRequest + * the grouped properties for creating a key request + * @return the KeyBundle if successful. + */ + KeyBundle createKey(CreateKeyRequest createKeyRequest); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param keyName + * The name for the new key. The system will generate the version + * name for the new key. + * @param kty + * The type of key to create. For valid key types, see + * JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic + * Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', + * 'RSA-HSM', 'oct' + * @param keySize + * The key size in bytes. For example, 1024 or 2048. + * @param keyOps + * the List<JsonWebKeyOperation> value + * @param keyAttributes + * the KeyAttributes value + * @param tags + * Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @throws KeyVaultErrorException + * thrown if the request is rejected by server + * @throws RuntimeException + * all other wrapped checked exceptions if the request fails to be + * sent + * @return the KeyBundle object if successful. + */ + KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, + List keyOps, KeyAttributes keyAttributes, Map tags); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. Authorization: Requires the keys/create permission. + * + * @param createKeyRequest + * the grouped properties for creating a key request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture createKeyAsync(CreateKeyRequest createKeyRequest, + ServiceCallback serviceCallback); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param keyName + * The name for the new key. The system will generate the version + * name for the new key. + * @param kty + * The type of key to create. For valid key types, see + * JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic + * Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', + * 'RSA-HSM', 'oct' + * @param keySize + * The key size in bytes. For example, 1024 or 2048. + * @param keyOps + * the List<JsonWebKeyOperation> value + * @param keyAttributes + * the KeyAttributes value + * @param tags + * Application specific metadata in the form of key-value pairs. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, + List keyOps, KeyAttributes keyAttributes, Map tags, + final ServiceCallback serviceCallback); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param keyName + * The name for the new key. The system will generate the version + * name for the new key. + * @param kty + * The type of key to create. For valid key types, see + * JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic + * Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', + * 'RSA-HSM', 'oct' + * @param keySize + * The key size in bytes. For example, 1024 or 2048. + * @param keyOps + * the List<JsonWebKeyOperation> value + * @param keyAttributes + * the KeyAttributes value + * @param tags + * Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, + List keyOps, KeyAttributes keyAttributes, Map tags); + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param keyName + * The name for the new key. The system will generate the version + * name for the new key. + * @param kty + * The type of key to create. For valid key types, see + * JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic + * Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', + * 'RSA-HSM', 'oct' + * @param keySize + * The key size in bytes. For example, 1024 or 2048. + * @param keyOps + * the List<JsonWebKeyOperation> value + * @param keyAttributes + * the KeyAttributes value + * @param tags + * Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, + JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, + Map tags); + + /** + * Imports an externally created key, stores it, and returns key parameters and + * attributes to the client. The import key operation may be used to import any + * key type into an Azure Key Vault. If the named key already exists, Azure Key + * Vault creates a new version of the key. Authorization: requires the + * keys/import permission. + * + * @param importKeyRequest + * the grouped properties for importing a key request + * + * @return the KeyBundle if successful. + */ + KeyBundle importKey(ImportKeyRequest importKeyRequest); + + /** + * Imports an externally created key, stores it, and returns key parameters and + * attributes to the client. The import key operation may be used to import any + * key type into an Azure Key Vault. If the named key already exists, Azure Key + * Vault creates a new version of the key. Authorization: requires the + * keys/import permission. + * + * @param importKeyRequest + * the grouped properties for importing a key request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture importKeyAsync(ImportKeyRequest importKeyRequest, + final ServiceCallback serviceCallback); + + /** + * The update key operation changes specified attributes of a stored key and can + * be applied to any key type and key version stored in Azure Key Vault. The + * cryptographic material of a key itself cannot be changed. In order to perform + * this operation, the key must already exist in the Key Vault. Authorization: + * requires the keys/update permission. + * + * @param updateKeyRequest + * the grouped properties for updating a key request + * + * @return the KeyBundle if successful. + */ + KeyBundle updateKey(UpdateKeyRequest updateKeyRequest); + + /** + * The update key operation changes specified attributes of a stored key and can + * be applied to any key type and key version stored in Azure Key Vault. The + * cryptographic material of a key itself cannot be changed. In order to perform + * this operation, the key must already exist in the Key Vault. Authorization: + * requires the keys/update permission. + * + * @param updateKeyRequest + * the grouped properties for updating a key request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateKeyAsync(UpdateKeyRequest updateKeyRequest, + final ServiceCallback serviceCallback); + + /** + * Gets the part of a stored key. The get key operation is applicable to all key + * types. If the requested key is symmetric, then no key material is released in + * the response. Authorization: Requires the keys/get permission. + * + * @param keyIdentifier + * The full key identifier + * + * @return the KeyBundle if successful. + */ + KeyBundle getKey(String keyIdentifier); + + /** + * Gets the part of a stored key. The get key operation is applicable to all key + * types. If the requested key is symmetric, then no key material is released in + * the response. Authorization: Requires the keys/get permission. + * + * @param keyIdentifier + * The full key identifier + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture getKeyAsync(String keyIdentifier, final ServiceCallback serviceCallback); + + /** + * Gets the part of a stored key. The get key operation is applicable to all key + * types. If the requested key is symmetric, then no key material is released in + * the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @return the KeyBundle if successful. + */ + KeyBundle getKey(String vaultBaseUrl, String keyName); + + /** + * Gets the part of a stored key. The get key operation is applicable to all key + * types. If the requested key is symmetric, then no key material is released in + * the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, + final ServiceCallback serviceCallback); + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * + * @return the PagedList<KeyItem> if successful. + */ + PagedList listKeyVersions(final String vaultBaseUrl, final String keyName); + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, + final ListOperationCallback serviceCallback); + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<KeyItem> if successful. + */ + PagedList listKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults); + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, + final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * + * @return the PagedList<KeyItem> if successful. + */ + PagedList listKeys(final String vaultBaseUrl); + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listKeysAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback); + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<KeyItem> if successful. + */ + PagedList listKeys(final String vaultBaseUrl, final Integer maxresults); + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listKeysAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback); + + /** + * Wraps a symmetric key using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be wrapped + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture wrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback); + + /** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be unwrapped + * + * @return the KeyOperationResult if successful. + */ + KeyOperationResult unwrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be unwrapped + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture unwrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback); + + /** + * Wraps a symmetric key using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be wrapped + * + * @return the KeyOperationResult if successful. + */ + KeyOperationResult wrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in a key vault. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be encrypted + * + * @return the KeyOperationResult if successful. + */ + KeyOperationResult encrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in a key vault. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be encrypted + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture encryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback); + + /** + * Decrypts a single block of encrypted data. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be decrypted + * + * @return the KeyOperationResult if successful. + */ + KeyOperationResult decrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value); + + /** + * Decrypts a single block of encrypted data. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be decrypted + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture decryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback); + + /** + * Creates a signature from a digest using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be signed + * + * @return the KeyOperationResult if successful. + */ + KeyOperationResult sign(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value); + + /** + * Creates a signature from a digest using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be signed + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture signAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback); + + /** + * Verifies a signature using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * The signing/verification algorithm. For more information on + * possible algorithm types, see JsonWebKeySignatureAlgorithm. + * @param digest + * The digest used for signing + * @param signature + * The signature to be verified + * + * @return the KeyVerifyResult if successful. + */ + KeyVerifyResult verify(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, + byte[] signature); + + /** + * Verifies a signature using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * The signing/verification algorithm. For more information on + * possible algorithm types, see JsonWebKeySignatureAlgorithm. + * @param digest + * The digest used for signing + * @param signature + * The signature to be verified + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture verifyAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, + byte[] digest, byte[] signature, final ServiceCallback serviceCallback); + + /** + * Sets a secret in the specified vault. + * + * @param setSecretRequest + * the grouped properties for setting a secret request + * + * @return the SecretBundle if successful. + */ + SecretBundle setSecret(SetSecretRequest setSecretRequest); + + /** + * Sets a secret in the specified vault. + * + * @param setSecretRequest + * the grouped properties for setting a secret request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture setSecretAsync(SetSecretRequest setSecretRequest, + final ServiceCallback serviceCallback); + + /** + * Updates the attributes associated with a specified secret in a given key + * vault. + * + * @param updateSecretRequest + * the grouped properties for updating a secret request + * + * @return the SecretBundle if successful. + */ + SecretBundle updateSecret(UpdateSecretRequest updateSecretRequest); + + /** + * Updates the attributes associated with a specified secret in a given key + * vault. + * + * @param updateSecretRequest + * the grouped properties for updating a secret request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateSecretAsync(UpdateSecretRequest updateSecretRequest, + final ServiceCallback serviceCallback); + + /** + * Get a specified secret from a given key vault. + * + * @param secretIdentifier + * The URL for the secret. + * + * @return the SecretBundle if successful. + */ + SecretBundle getSecret(String secretIdentifier); + + /** + * Get a specified secret from a given key vault. + * + * @param secretIdentifier + * The URL for the secret. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSecretAsync(String secretIdentifier, + final ServiceCallback serviceCallback); + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * + * @return the SecretBundle if successful. + */ + SecretBundle getSecret(String vaultBaseUrl, String secretName); + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + + ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, + final ServiceCallback serviceCallback); + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * + * @return the PagedList<SecretItem> if successful. + */ + PagedList listSecrets(final String vaultBaseUrl); + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listSecretsAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback); + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<SecretItem> if successful. + */ + PagedList listSecrets(final String vaultBaseUrl, final Integer maxresults); + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback); + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * + * @return the PagedList<SecretItem> if successful. + */ + PagedList listSecretVersions(final String vaultBaseUrl, final String secretName); + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, + final ListOperationCallback serviceCallback); + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<SecretItem> if successful. + */ + PagedList listSecretVersions(final String vaultBaseUrl, final String secretName, + final Integer maxresults); + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, + final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * List certificates in a specified key vault. The GetCertificates operation + * returns the set of certificates resources in the specified key vault. This + * operation requires the certificates/list permission. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @throws KeyVaultErrorException + * thrown if the request is rejected by server + * @throws RuntimeException + * all other wrapped checked exceptions if the request fails to be + * sent + * @return the PagedList<CertificateItem> object if successful. + */ + PagedList getCertificates(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificates in a specified key vault. The GetCertificates operation + * returns the set of certificates resources in the specified key vault. This + * operation requires the certificates/list permission. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback); + + /** + * List certificates in a specified key vault. The GetCertificates operation + * returns the set of certificates resources in the specified key vault. This + * operation requires the certificates/list permission. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificates in a specified key vault. The GetCertificates operation + * returns the set of certificates resources in the specified key vault. This + * operation requires the certificates/list permission. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + Observable>> getCertificatesWithServiceResponseAsync( + final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * + * @return the PagedList<CertificateItem> if successful. + */ + PagedList listCertificates(final String vaultBaseUrl); + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback); + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<CertificateItem> if successful. + */ + PagedList listCertificates(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback); + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * + * @return the PagedList<CertificateIssuerItem> if successful. + */ + PagedList listCertificateIssuers(final String vaultBaseUrl); + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback); + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<CertificateIssuerItem> if successful. + */ + PagedList listCertificateIssuers(final String vaultBaseUrl, final Integer maxresults); + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, + final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Sets the certificate contacts for the specified vault. + * + * @param setCertificateIssuerRequest + * the grouped properties for setting a certificate issuer request + * + * @return the IssuerBundle if successful. + */ + IssuerBundle setCertificateIssuer(SetCertificateIssuerRequest setCertificateIssuerRequest); + + /** + * Sets the certificate contacts for the specified vault. + * + * @param setCertificateIssuerRequest + * the grouped properties for setting a certificate issuer request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture setCertificateIssuerAsync(SetCertificateIssuerRequest setCertificateIssuerRequest, + final ServiceCallback serviceCallback); + + /** + * Updates the specified certificate issuer. + * + * @param updateCertificateIssuerRequest + * the grouped properties for updating a certificate issuer request + * + * @return the IssuerBundle if successful. + */ + IssuerBundle updateCertificateIssuer(UpdateCertificateIssuerRequest updateCertificateIssuerRequest); + + /** + * Updates the specified certificate issuer. + * + * @param updateCertificateIssuerRequest + * the grouped properties for updating a certificate issuer request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @throws IllegalArgumentException + * thrown if callback is null + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateIssuerAsync( + UpdateCertificateIssuerRequest updateCertificateIssuerRequest, + final ServiceCallback serviceCallback); + + /** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param createCertificateRequest + * the grouped properties for creating a certificate request + * + * @return the CertificateOperation if successful. + */ + CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest); + + /** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param createCertificateRequest + * the grouped properties for creating a certificate request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture createCertificateAsync(CreateCertificateRequest createCertificateRequest, + final ServiceCallback serviceCallback); + + /** + * Imports a certificate into the specified vault. + * + * @param importCertificateRequest + * the grouped properties for importing a certificate request + * + * @return the CertificateBundle if successful. + */ + CertificateBundle importCertificate(ImportCertificateRequest importCertificateRequest); + + /** + * Imports a certificate into the specified vault. + * + * @param importCertificateRequest + * the grouped properties for importing a certificate request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture importCertificateAsync(ImportCertificateRequest importCertificateRequest, + final ServiceCallback serviceCallback); + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * + * @return the PagedList<CertificateItem> if successful. + */ + PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName); + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, + final String certificateName, final ListOperationCallback serviceCallback); + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * + * @return the PagedList<CertificateItem> if successful. + */ + PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName, + final Integer maxresults); + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, + final String certificateName, final Integer maxresults, + final ListOperationCallback serviceCallback); + + /** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param updateCertificatePolicyRequest + * the grouped properties for updating a certificate policy request + * + * @return the CertificatePolicy if successful. + */ + CertificatePolicy updateCertificatePolicy(UpdateCertificatePolicyRequest updateCertificatePolicyRequest); + + /** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param updateCertificatePolicyRequest + * the grouped properties for updating a certificate policy request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificatePolicyAsync( + UpdateCertificatePolicyRequest updateCertificatePolicyRequest, + final ServiceCallback serviceCallback); + + /** + * Updates the attributes associated with the specified certificate. + * + * @param updateCertificateRequest + * the grouped properties for updating a certificate request + * + * @return the CertificateBundle if successful. + */ + CertificateBundle updateCertificate(UpdateCertificateRequest updateCertificateRequest); + + /** + * Updates the attributes associated with the specified certificate. + * + * @param updateCertificateRequest + * the grouped properties for updating a certificate request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateAsync(UpdateCertificateRequest updateCertificateRequest, + final ServiceCallback serviceCallback); + + /** + * Gets information about a specified certificate. + * + * @param certificateIdentifier + * The certificate identifier + * + * @return the CertificateBundle if successful. + */ + CertificateBundle getCertificate(String certificateIdentifier); + + /** + * Gets information about a specified certificate. + * + * @param certificateIdentifier + * The certificate identifier + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture getCertificateAsync(String certificateIdentifier, + final ServiceCallback serviceCallback); + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate in the given vault + * + * @return the CertificateBundle if successful. + */ + CertificateBundle getCertificate(String vaultBaseUrl, String certificateName); + + /** + * Updates a certificate operation. + * + * @param updateCertificateOperationRequest + * the grouped properties for updating a certificate operation + * request + * + * @return the CertificateOperation if successful. + */ + CertificateOperation updateCertificateOperation( + UpdateCertificateOperationRequest updateCertificateOperationRequest); + + /** + * Updates a certificate operation. + * + * @param updateCertificateOperationRequest + * the grouped properties for updating a certificate operation + * request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateCertificateOperationAsync( + UpdateCertificateOperationRequest updateCertificateOperationRequest, + final ServiceCallback serviceCallback); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param mergeCertificateRequest + * the grouped properties for merging a certificate request + * + * @return the CertificateBundle if successful. + */ + CertificateBundle mergeCertificate(MergeCertificateRequest mergeCertificateRequest); + + /** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param mergeCertificateRequest + * the grouped properties for merging a certificate request + * + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture mergeCertificateAsync(MergeCertificateRequest mergeCertificateRequest, + final ServiceCallback serviceCallback); + + /** + * Gets the pending certificate signing request response. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * + * @return the String if successful. + */ + String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName); + + /** + * Gets the pending certificate signing request response. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPendingCertificateSigningRequestAsync(String vaultBaseUrl, String certificateName, + final ServiceCallback serviceCallback); + + /** + * Lists the deleted certificates in the specified vault currently available for + * recovery. The GetDeletedCertificates operation retrieves the certificates in + * the current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @throws KeyVaultErrorException + * thrown if the request is rejected by server + * @throws RuntimeException + * all other wrapped checked exceptions if the request fails to be + * sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + PagedList getDeletedCertificates(final String vaultBaseUrl, final Integer maxresults); + + /** + * Lists the deleted certificates in the specified vault currently available for + * recovery. The GetDeletedCertificates operation retrieves the certificates in + * the current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDeletedCertificatesAsync(final String vaultBaseUrl, + final Integer maxresults, final ListOperationCallback serviceCallback); + + /** + * Lists the deleted certificates in the specified vault currently available for + * recovery. The GetDeletedCertificates operation retrieves the certificates in + * the current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable> getDeletedCertificatesAsync(final String vaultBaseUrl, + final Integer maxresults); + + /** + * Lists the deleted certificates in the specified vault currently available for + * recovery. The GetDeletedCertificates operation retrieves the certificates in + * the current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl + * The vault name, for example https://myvault.vault.azure.net. + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @throws IllegalArgumentException + * thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + Observable>> getDeletedCertificatesWithServiceResponseAsync( + final String vaultBaseUrl, final Integer maxresults); + +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java new file mode 100644 index 0000000000000..f1d3c981b1475 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java @@ -0,0 +1,6823 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.keyvault; + +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.keyvault.models.BackupKeyResult; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateCreateParameters; +import com.microsoft.azure.keyvault.models.CertificateImportParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateIssuerSetParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerUpdateParameters; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateMergeParameters; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.CertificateUpdateParameters; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.IssuerAttributes; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyCreateParameters; +import com.microsoft.azure.keyvault.models.KeyImportParameters; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyOperationsParameters; +import com.microsoft.azure.keyvault.models.KeyRestoreParameters; +import com.microsoft.azure.keyvault.models.KeySignParameters; +import com.microsoft.azure.keyvault.models.KeyUpdateParameters; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyParameters; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.OrganizationDetails; +import com.microsoft.azure.keyvault.models.PageImpl; +import com.microsoft.azure.keyvault.models.SecretAttributes; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.models.SecretSetParameters; +import com.microsoft.azure.keyvault.models.SecretUpdateParameters; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the KeyVaultClientImpl class. + */ +final class KeyVaultClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private KeyVaultClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public KeyVaultClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public KeyVaultClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public KeyVaultClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of KeyVaultClient client. + * + * @param credentials the management credentials for Azure + */ + KeyVaultClientImpl(ServiceClientCredentials credentials) { + this("https://{vaultBaseUrl}", credentials); + } + + /** + * Initializes an instance of KeyVaultClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + KeyVaultClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KeyVaultClient client. + * + * @param restClient the REST client to connect to Azure. + */ + KeyVaultClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-10-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("Azure-SDK-For-Java/%s (%s)", + getClass().getPackage().getImplementationVersion(), + "KeyVaultClient, 2016-10-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(KeyVaultClientService.class); + } + + /** + * The interface defining all the services for KeyVaultClient to be + * used by Retrofit to perform actually REST calls. + */ + interface KeyVaultClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient createKey" }) + @POST("keys/{key-name}/create") + Observable> createKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient importKey" }) + @PUT("keys/{key-name}") + Observable> importKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyImportParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteKey" }) + @HTTP(path = "keys/{key-name}", method = "DELETE", hasBody = true) + Observable> deleteKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateKey" }) + @PATCH("keys/{key-name}/{key-version}") + Observable> updateKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKey" }) + @GET("keys/{key-name}/{key-version}") + Observable> getKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeyVersions" }) + @GET("keys/{key-name}/versions") + Observable> getKeyVersions(@Path("key-name") String keyName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeys" }) + @GET("keys") + Observable> getKeys(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient backupKey" }) + @POST("keys/{key-name}/backup") + Observable> backupKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient restoreKey" }) + @POST("keys/restore") + Observable> restoreKey(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyRestoreParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient encrypt" }) + @POST("keys/{key-name}/{key-version}/encrypt") + Observable> encrypt(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient decrypt" }) + @POST("keys/{key-name}/{key-version}/decrypt") + Observable> decrypt(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient sign" }) + @POST("keys/{key-name}/{key-version}/sign") + Observable> sign(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeySignParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient verify" }) + @POST("keys/{key-name}/{key-version}/verify") + Observable> verify(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyVerifyParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient wrapKey" }) + @POST("keys/{key-name}/{key-version}/wrapkey") + Observable> wrapKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient unwrapKey" }) + @POST("keys/{key-name}/{key-version}/unwrapkey") + Observable> unwrapKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setSecret" }) + @PUT("secrets/{secret-name}") + Observable> setSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecretSetParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteSecret" }) + @HTTP(path = "secrets/{secret-name}", method = "DELETE", hasBody = true) + Observable> deleteSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateSecret" }) + @PATCH("secrets/{secret-name}/{secret-version}") + Observable> updateSecret(@Path("secret-name") String secretName, @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecretUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecret" }) + @GET("secrets/{secret-name}/{secret-version}") + Observable> getSecret(@Path("secret-name") String secretName, @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecrets" }) + @GET("secrets") + Observable> getSecrets(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretVersions" }) + @GET("secrets/{secret-name}/versions") + Observable> getSecretVersions(@Path("secret-name") String secretName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificates" }) + @GET("certificates") + Observable> getCertificates(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificate" }) + @HTTP(path = "certificates/{certificate-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setCertificateContacts" }) + @PUT("certificates/contacts") + Observable> setCertificateContacts(@Body Contacts contacts, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateContacts" }) + @GET("certificates/contacts") + Observable> getCertificateContacts(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateContacts" }) + @HTTP(path = "certificates/contacts", method = "DELETE", hasBody = true) + Observable> deleteCertificateContacts(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuers" }) + @GET("certificates/issuers") + Observable> getCertificateIssuers(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setCertificateIssuer" }) + @PUT("certificates/issuers/{issuer-name}") + Observable> setCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateIssuerSetParameters parameter, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificateIssuer" }) + @PATCH("certificates/issuers/{issuer-name}") + Observable> updateCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateIssuerUpdateParameters parameter, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuer" }) + @GET("certificates/issuers/{issuer-name}") + Observable> getCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateIssuer" }) + @HTTP(path = "certificates/issuers/{issuer-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient createCertificate" }) + @POST("certificates/{certificate-name}/create") + Observable> createCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient importCertificate" }) + @POST("certificates/{certificate-name}/import") + Observable> importCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateImportParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateVersions" }) + @GET("certificates/{certificate-name}/versions") + Observable> getCertificateVersions(@Path("certificate-name") String certificateName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificatePolicy" }) + @GET("certificates/{certificate-name}/policy") + Observable> getCertificatePolicy(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificatePolicy" }) + @PATCH("certificates/{certificate-name}/policy") + Observable> updateCertificatePolicy(@Path("certificate-name") String certificateName, @Body CertificatePolicy certificatePolicy, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificate" }) + @PATCH("certificates/{certificate-name}/{certificate-version}") + Observable> updateCertificate(@Path("certificate-name") String certificateName, @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificate" }) + @GET("certificates/{certificate-name}/{certificate-version}") + Observable> getCertificate(@Path("certificate-name") String certificateName, @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificateOperation" }) + @PATCH("certificates/{certificate-name}/pending") + Observable> updateCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateOperationUpdateParameter certificateOperation, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateOperation" }) + @GET("certificates/{certificate-name}/pending") + Observable> getCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateOperation" }) + @HTTP(path = "certificates/{certificate-name}/pending", method = "DELETE", hasBody = true) + Observable> deleteCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient mergeCertificate" }) + @POST("certificates/{certificate-name}/pending/merge") + Observable> mergeCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateMergeParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeyVersionsNext" }) + @GET + Observable> getKeyVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeysNext" }) + @GET + Observable> getKeysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretsNext" }) + @GET + Observable> getSecretsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretVersionsNext" }) + @GET + Observable> getSecretVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificatesNext" }) + @GET + Observable> getCertificatesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuersNext" }) + @GET + Observable> getCertificateIssuersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateVersionsNext" }) + @GET + Observable> getCertificateVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @return the KeyBundle object if successful. + */ + public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).toBlocking().single().body(); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty), serviceCallback); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @return the observable to the KeyBundle object + */ + public Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @return the observable to the KeyBundle object + */ + public Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (kty == null) { + throw new IllegalArgumentException("Parameter kty is required and cannot be null."); + } + final Integer keySize = null; + final List keyOps = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + KeyCreateParameters parameters = new KeyCreateParameters(); + parameters.withKty(kty); + parameters.withKeySize(null); + parameters.withKeyOps(null); + parameters.withKeyAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bytes. For example, 1024 or 2048. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the KeyBundle object if successful. + */ + public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags).toBlocking().single().body(); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bytes. For example, 1024 or 2048. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags), serviceCallback); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bytes. For example, 1024 or 2048. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bytes. For example, 1024 or 2048. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (kty == null) { + throw new IllegalArgumentException("Parameter kty is required and cannot be null."); + } + Validator.validate(keyOps); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyCreateParameters parameters = new KeyCreateParameters(); + parameters.withKty(kty); + parameters.withKeySize(keySize); + parameters.withKeyOps(keyOps); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @return the KeyBundle object if successful. + */ + public KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key).toBlocking().single().body(); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key), serviceCallback); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @return the observable to the KeyBundle object + */ + public Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @return the observable to the KeyBundle object + */ + public Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + Validator.validate(key); + final Boolean hsm = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + KeyImportParameters parameters = new KeyImportParameters(); + parameters.withHsm(null); + parameters.withKey(key); + parameters.withKeyAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the KeyBundle object if successful. + */ + public KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags).toBlocking().single().body(); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags), serviceCallback); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + Validator.validate(key); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyImportParameters parameters = new KeyImportParameters(); + parameters.withHsm(hsm); + parameters.withKey(key); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @return the KeyBundle object if successful. + */ + public KeyBundle deleteKey(String vaultBaseUrl, String keyName) { + return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @return the observable to the KeyBundle object + */ + public Observable deleteKeyAsync(String vaultBaseUrl, String keyName) { + return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @return the observable to the KeyBundle object + */ + public Observable> deleteKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @return the KeyBundle object if successful. + */ + public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).toBlocking().single().body(); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @return the observable to the KeyBundle object + */ + public Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @return the observable to the KeyBundle object + */ + public Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final List keyOps = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + KeyUpdateParameters parameters = new KeyUpdateParameters(); + parameters.withKeyOps(null); + parameters.withKeyAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the KeyBundle object if successful. + */ + public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).toBlocking().single().body(); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags), serviceCallback); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the KeyBundle object + */ + public Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(keyOps); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyUpdateParameters parameters = new KeyUpdateParameters(); + parameters.withKeyOps(keyOps); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @return the KeyBundle object if successful. + */ + public KeyBundle getKey(String vaultBaseUrl, String keyName, String keyVersion) { + return getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).toBlocking().single().body(); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @return the observable to the KeyBundle object + */ + public Observable getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) { + return getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @return the observable to the KeyBundle object + */ + public Observable> getKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersions(final String vaultBaseUrl, final String keyName) { + ServiceResponse> response = getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName) { + return getKeyVersionsWithServiceResponseAsync(vaultBaseUrl, keyName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName) { + return getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsSinglePageAsync(final String vaultBaseUrl, final String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeyVersions(keyName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + ServiceResponse> response = getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + return getKeyVersionsWithServiceResponseAsync(vaultBaseUrl, keyName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + return getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsSinglePageAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeyVersions(keyName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeyVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeys(final String vaultBaseUrl) { + ServiceResponse> response = getKeysSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysAsync(final String vaultBaseUrl) { + return getKeysWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl) { + return getKeysSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeys(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getKeysSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysAsync(final String vaultBaseUrl, final Integer maxresults) { + return getKeysWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getKeysSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeysDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the BackupKeyResult object if successful. + */ + public BackupKeyResult backupKey(String vaultBaseUrl, String keyName) { + return backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the observable to the BackupKeyResult object + */ + public Observable backupKeyAsync(String vaultBaseUrl, String keyName) { + return backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, BackupKeyResult>() { + @Override + public BackupKeyResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @return the observable to the BackupKeyResult object + */ + public Observable> backupKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.backupKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Restores a backed up key to a vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @return the KeyBundle object if successful. + */ + public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup) { + return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).toBlocking().single().body(); + } + + /** + * Restores a backed up key to a vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup), serviceCallback); + } + + /** + * Restores a backed up key to a vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @return the observable to the KeyBundle object + */ + public Observable restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup) { + return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores a backed up key to a vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @return the observable to the KeyBundle object + */ + public Observable> restoreKeyWithServiceResponseAsync(String vaultBaseUrl, byte[] keyBundleBackup) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (keyBundleBackup == null) { + throw new IllegalArgumentException("Parameter keyBundleBackup is required and cannot be null."); + } + KeyRestoreParameters parameters = new KeyRestoreParameters(); + parameters.withKeyBundleBackup(keyBundleBackup); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.restoreKey(this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult encrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable> encryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.encrypt(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = encryptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse encryptDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult decrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable> decryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.decrypt(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = decryptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse decryptDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param value the Base64Url value + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult sign(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + return signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + return signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable> signWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeySignParameters parameters = new KeySignParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.sign(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = signDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse signDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Verifies a signature using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @return the KeyVerifyResult object if successful. + */ + public KeyVerifyResult verify(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + return verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature).toBlocking().single().body(); + } + + /** + * Verifies a signature using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature), serviceCallback); + } + + /** + * Verifies a signature using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @return the observable to the KeyVerifyResult object + */ + public Observable verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + return verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature).map(new Func1, KeyVerifyResult>() { + @Override + public KeyVerifyResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies a signature using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @return the observable to the KeyVerifyResult object + */ + public Observable> verifyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (digest == null) { + throw new IllegalArgumentException("Parameter digest is required and cannot be null."); + } + if (signature == null) { + throw new IllegalArgumentException("Parameter signature is required and cannot be null."); + } + KeyVerifyParameters parameters = new KeyVerifyParameters(); + parameters.withAlgorithm(algorithm); + parameters.withDigest(digest); + parameters.withSignature(signature); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.verify(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = verifyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse verifyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Wraps a symmetric key using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Wraps a symmetric key using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Wraps a symmetric key using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Wraps a symmetric key using a specified key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable> wrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.wrapKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = wrapKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse wrapKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult unwrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + * @param value the Base64Url value + * @return the observable to the KeyOperationResult object + */ + public Observable> unwrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.unwrapKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unwrapKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unwrapKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @return the SecretBundle object if successful. + */ + public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value).toBlocking().single().body(); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value), serviceCallback); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @return the observable to the SecretBundle object + */ + public Observable setSecretAsync(String vaultBaseUrl, String secretName, String value) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @return the observable to the SecretBundle object + */ + public Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + final Map tags = null; + final String contentType = null; + final SecretAttributes secretAttributes = null; + SecretSetParameters parameters = new SecretSetParameters(); + parameters.withValue(value); + parameters.withTags(null); + parameters.withContentType(null); + parameters.withSecretAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @return the SecretBundle object if successful. + */ + public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).toBlocking().single().body(); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes), serviceCallback); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @return the observable to the SecretBundle object + */ + public Observable setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets a secret in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @return the observable to the SecretBundle object + */ + public Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + Validator.validate(tags); + Validator.validate(secretAttributes); + SecretSetParameters parameters = new SecretSetParameters(); + parameters.withValue(value); + parameters.withTags(tags); + parameters.withContentType(contentType); + parameters.withSecretAttributes(secretAttributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a secret from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the SecretBundle object if successful. + */ + public SecretBundle deleteSecret(String vaultBaseUrl, String secretName) { + return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Deletes a secret from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Deletes a secret from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the observable to the SecretBundle object + */ + public Observable deleteSecretAsync(String vaultBaseUrl, String secretName) { + return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a secret from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the observable to the SecretBundle object + */ + public Observable> deleteSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the SecretBundle object if successful. + */ + public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body(); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion), serviceCallback); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the observable to the SecretBundle object + */ + public Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the observable to the SecretBundle object + */ + public Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String contentType = null; + final SecretAttributes secretAttributes = null; + final Map tags = null; + SecretUpdateParameters parameters = new SecretUpdateParameters(); + parameters.withContentType(null); + parameters.withSecretAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the SecretBundle object if successful. + */ + public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags), serviceCallback); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the SecretBundle object + */ + public Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the SecretBundle object + */ + public Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(secretAttributes); + Validator.validate(tags); + SecretUpdateParameters parameters = new SecretUpdateParameters(); + parameters.withContentType(contentType); + parameters.withSecretAttributes(secretAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the SecretBundle object if successful. + */ + public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) { + return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body(); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion), serviceCallback); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the observable to the SecretBundle object + */ + public Observable getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { + return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @return the observable to the SecretBundle object + */ + public Observable> getSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecrets(final String vaultBaseUrl) { + ServiceResponse> response = getSecretsSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsAsync(final String vaultBaseUrl) { + return getSecretsWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl) { + return getSecretsSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecrets(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getSecretsSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults) { + return getSecretsWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getSecretsSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersions(final String vaultBaseUrl, final String secretName) { + ServiceResponse> response = getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName) { + return getSecretVersionsWithServiceResponseAsync(vaultBaseUrl, secretName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName) { + return getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsSinglePageAsync(final String vaultBaseUrl, final String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecretVersions(secretName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersions(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + ServiceResponse> response = getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + return getSecretVersionsWithServiceResponseAsync(vaultBaseUrl, secretName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + return getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsSinglePageAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecretVersions(secretName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificates(final String vaultBaseUrl) { + ServiceResponse> response = getCertificatesSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesAsync(final String vaultBaseUrl) { + return getCertificatesWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl) { + return getCertificatesSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificates(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificates(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getCertificatesSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificatesSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificates(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificatesDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a certificate from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName) { + return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Deletes a certificate from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Deletes a certificate from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable deleteCertificateAsync(String vaultBaseUrl, String certificateName) { + return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a certificate from a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable> deleteCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets the certificate contacts for the specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @return the Contacts object if successful. + */ + public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts) { + return setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts).toBlocking().single().body(); + } + + /** + * Sets the certificate contacts for the specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts), serviceCallback); + } + + /** + * Sets the certificate contacts for the specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @return the observable to the Contacts object + */ + public Observable setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts) { + return setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the certificate contacts for the specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @return the observable to the Contacts object + */ + public Observable> setCertificateContactsWithServiceResponseAsync(String vaultBaseUrl, Contacts contacts) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (contacts == null) { + throw new IllegalArgumentException("Parameter contacts is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(contacts); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateContacts(contacts, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the Contacts object if successful. + */ + public Contacts getCertificateContacts(String vaultBaseUrl) { + return getCertificateContactsWithServiceResponseAsync(vaultBaseUrl).toBlocking().single().body(); + } + + /** + * Lists the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateContactsWithServiceResponseAsync(vaultBaseUrl), serviceCallback); + } + + /** + * Lists the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the Contacts object + */ + public Observable getCertificateContactsAsync(String vaultBaseUrl) { + return getCertificateContactsWithServiceResponseAsync(vaultBaseUrl).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the Contacts object + */ + public Observable> getCertificateContactsWithServiceResponseAsync(String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateContacts(this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the Contacts object if successful. + */ + public Contacts deleteCertificateContacts(String vaultBaseUrl) { + return deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl).toBlocking().single().body(); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl), serviceCallback); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the Contacts object + */ + public Observable deleteCertificateContactsAsync(String vaultBaseUrl) { + return deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the Contacts object + */ + public Observable> deleteCertificateContactsWithServiceResponseAsync(String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateContacts(this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuers(final String vaultBaseUrl) { + ServiceResponse> response = getCertificateIssuersSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersAsync(final String vaultBaseUrl) { + return getCertificateIssuersWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl) { + return getCertificateIssuersSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuers(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuers(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificateIssuersWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuers(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateIssuersDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider).toBlocking().single().body(); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider), serviceCallback); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @return the observable to the IssuerBundle object + */ + public Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @return the observable to the IssuerBundle object + */ + public Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (provider == null) { + throw new IllegalArgumentException("Parameter provider is required and cannot be null."); + } + final IssuerCredentials credentials = null; + final OrganizationDetails organizationDetails = null; + final IssuerAttributes attributes = null; + CertificateIssuerSetParameters parameter = new CertificateIssuerSetParameters(); + parameter.withProvider(provider); + parameter.withCredentials(null); + parameter.withOrganizationDetails(null); + parameter.withAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes), serviceCallback); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the observable to the IssuerBundle object + */ + public Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the observable to the IssuerBundle object + */ + public Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (provider == null) { + throw new IllegalArgumentException("Parameter provider is required and cannot be null."); + } + Validator.validate(credentials); + Validator.validate(organizationDetails); + Validator.validate(attributes); + CertificateIssuerSetParameters parameter = new CertificateIssuerSetParameters(); + parameter.withProvider(provider); + parameter.withCredentials(credentials); + parameter.withOrganizationDetails(organizationDetails); + parameter.withAttributes(attributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String provider = null; + final IssuerCredentials credentials = null; + final OrganizationDetails organizationDetails = null; + final IssuerAttributes attributes = null; + CertificateIssuerUpdateParameters parameter = new CertificateIssuerUpdateParameters(); + parameter.withProvider(null); + parameter.withCredentials(null); + parameter.withOrganizationDetails(null); + parameter.withAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes), serviceCallback); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the observable to the IssuerBundle object + */ + public Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @return the observable to the IssuerBundle object + */ + public Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(credentials); + Validator.validate(organizationDetails); + Validator.validate(attributes); + CertificateIssuerUpdateParameters parameter = new CertificateIssuerUpdateParameters(); + parameter.withProvider(provider); + parameter.withCredentials(credentials); + parameter.withOrganizationDetails(organizationDetails); + parameter.withAttributes(attributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName) { + return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Lists the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Lists the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable getCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable> getCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the IssuerBundle object if successful. + */ + public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName) { + return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Deletes the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Deletes the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified certificate issuer. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @return the observable to the IssuerBundle object + */ + public Observable> deleteCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the CertificateOperation object if successful. + */ + public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable createCertificateAsync(String vaultBaseUrl, String certificateName) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateCreateParameters parameters = new CertificateCreateParameters(); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the CertificateOperation object if successful. + */ + public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateOperation object + */ + public Observable createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate. If this is the first version, the certificate resource is created. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateOperation object + */ + public Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateCreateParameters parameters = new CertificateCreateParameters(); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).toBlocking().single().body(); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate), serviceCallback); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @return the observable to the CertificateBundle object + */ + public Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @return the observable to the CertificateBundle object + */ + public Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (base64EncodedCertificate == null) { + throw new IllegalArgumentException("Parameter base64EncodedCertificate is required and cannot be null."); + } + final String password = null; + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateImportParameters parameters = new CertificateImportParameters(); + parameters.withBase64EncodedCertificate(base64EncodedCertificate); + parameters.withPassword(null); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (base64EncodedCertificate == null) { + throw new IllegalArgumentException("Parameter base64EncodedCertificate is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateImportParameters parameters = new CertificateImportParameters(); + parameters.withBase64EncodedCertificate(base64EncodedCertificate); + parameters.withPassword(password); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName) { + ServiceResponse> response = getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName) { + return getCertificateVersionsWithServiceResponseAsync(vaultBaseUrl, certificateName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName) { + return getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsSinglePageAsync(final String vaultBaseUrl, final String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateVersions(certificateName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + ServiceResponse> response = getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + return getCertificateVersionsWithServiceResponseAsync(vaultBaseUrl, certificateName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + return getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsSinglePageAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateVersions(certificateName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the policy for a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @return the CertificatePolicy object if successful. + */ + public CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName) { + return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Lists the policy for a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificatePolicyAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Lists the policy for a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @return the observable to the CertificatePolicy object + */ + public Observable getCertificatePolicyAsync(String vaultBaseUrl, String certificateName) { + return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificatePolicy>() { + @Override + public CertificatePolicy call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the policy for a certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @return the observable to the CertificatePolicy object + */ + public Observable> getCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificatePolicy(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificatePolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificatePolicyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @return the CertificatePolicy object if successful. + */ + public CertificatePolicy updateCertificatePolicy(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + return updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy).toBlocking().single().body(); + } + + /** + * Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy), serviceCallback); + } + + /** + * Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @return the observable to the CertificatePolicy object + */ + public Observable updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + return updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy).map(new Func1, CertificatePolicy>() { + @Override + public CertificatePolicy call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @return the observable to the CertificatePolicy object + */ + public Observable> updateCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificatePolicy == null) { + throw new IllegalArgumentException("Parameter certificatePolicy is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificatePolicy(certificateName, certificatePolicy, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificatePolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificatePolicyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateUpdateParameters parameters = new CertificateUpdateParameters(); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateUpdateParameters parameters = new CertificateUpdateParameters(); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) { + return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body(); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion), serviceCallback); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @return the observable to the CertificateBundle object + */ + public Observable> getCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates a certificate operation. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @return the CertificateOperation object if successful. + */ + public CertificateOperation updateCertificateOperation(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + return updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested).toBlocking().single().body(); + } + + /** + * Updates a certificate operation. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested), serviceCallback); + } + + /** + * Updates a certificate operation. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @return the observable to the CertificateOperation object + */ + public Observable updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + return updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a certificate operation. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @return the observable to the CertificateOperation object + */ + public Observable> updateCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + CertificateOperationUpdateParameter certificateOperation = new CertificateOperationUpdateParameter(); + certificateOperation.withCancellationRequested(cancellationRequested); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), certificateOperation, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the operation associated with a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the CertificateOperation object if successful. + */ + public CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName) { + return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Gets the operation associated with a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Gets the operation associated with a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable getCertificateOperationAsync(String vaultBaseUrl, String certificateName) { + return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the operation associated with a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable> getCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the operation for a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the CertificateOperation object if successful. + */ + public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName) { + return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Deletes the operation for a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Deletes the operation for a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName) { + return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the operation for a specified certificate. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @return the observable to the CertificateOperation object + */ + public Observable> deleteCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).toBlocking().single().body(); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates), serviceCallback); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @return the observable to the CertificateBundle object + */ + public Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @return the observable to the CertificateBundle object + */ + public Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (x509Certificates == null) { + throw new IllegalArgumentException("Parameter x509Certificates is required and cannot be null."); + } + Validator.validate(x509Certificates); + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateMergeParameters parameters = new CertificateMergeParameters(); + parameters.withX509Certificates(x509Certificates); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.mergeCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = mergeCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the CertificateBundle object if successful. + */ + public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags), serviceCallback); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @return the observable to the CertificateBundle object + */ + public Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (x509Certificates == null) { + throw new IllegalArgumentException("Parameter x509Certificates is required and cannot be null."); + } + Validator.validate(x509Certificates); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateMergeParameters parameters = new CertificateMergeParameters(); + parameters.withX509Certificates(x509Certificates); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.mergeCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = mergeCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse mergeCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersionsNext(final String nextPageLink) { + ServiceResponse> response = getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsNextAsync(final String nextPageLink) { + return getKeyVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getKeyVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeyVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List keys in the specified vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeysNext(final String nextPageLink) { + ServiceResponse> response = getKeysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysNextAsync(final String nextPageLink) { + return getKeysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysNextWithServiceResponseAsync(final String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getKeysNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeysNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List secrets in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretsNext(final String nextPageLink) { + ServiceResponse> response = getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsNextAsync(final String nextPageLink) { + return getSecretsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsNextWithServiceResponseAsync(final String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSecretsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of the specified secret. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersionsNext(final String nextPageLink) { + ServiceResponse> response = getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of the specified secret. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of the specified secret. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsNextAsync(final String nextPageLink) { + return getSecretVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of the specified secret. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSecretVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificates in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificatesNext(final String nextPageLink) { + ServiceResponse> response = getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesNextAsync(final String nextPageLink) { + return getCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificatesNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificatesNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuersNext(final String nextPageLink) { + ServiceResponse> response = getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersNextAsync(final String nextPageLink) { + return getCertificateIssuersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificateIssuersNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateIssuersNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of a certificate. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersionsNext(final String nextPageLink) { + ServiceResponse> response = getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsNextAsync(final String nextPageLink) { + return getCertificateVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificateVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/ObjectIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/ObjectIdentifier.java new file mode 100644 index 0000000000000..cdd9309f3b71e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/ObjectIdentifier.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +import java.net.URI; +import java.net.URISyntaxException; +import java.security.InvalidParameterException; + +/** + * The key vault object identifier. + */ +public class ObjectIdentifier { + + /** + * Verifies whether the identifier belongs to a key vault object. + * @param collection the object collection e.g. 'keys', 'secrets' and 'certificates'. + * @param identifier the key vault object identifier. + * @return true if the identifier belongs to a key vault object. False otherwise. + */ + protected static boolean isObjectIdentifier(String collection, String identifier) { + + collection = verifyNonEmpty(collection, "collection"); + identifier = verifyNonEmpty(identifier, "identifier"); + + URI baseUri; + try { + baseUri = new URI(identifier); + } catch (URISyntaxException e) { + return false; + } + + // Path is of the form "/collection/name[/version]" + String[] segments = baseUri.getPath().split("/"); + if (segments.length != 3 && segments.length != 4) { + return false; + } + + if (!collection.equals(segments[1])) { + return false; + } + + return true; + } + + /** + * Verifies a value is null or empty. Returns the value if non-empty and throws exception if empty. + * @param value the value to verify. + * @param argName the name of the value. + * @return Returns the value if non-empty. + */ + protected static String verifyNonEmpty(String value, String argName) { + if (value != null) { + value = value.trim(); + if (value.isEmpty()) { + value = null; + } + } + if (value == null) { + throw new IllegalArgumentException(argName); + } + return value; + } + + protected String vault; + protected String name; + protected String version; + protected String baseIdentifier; + protected String identifier; + + /** + * Constructor. + */ + protected ObjectIdentifier() { + } + + /** + * Constructor. + * @param vault the vault url. + * @param collection the object collection name. e.g. 'keys', 'secrets' and 'certificates'. + * @param name the object name. + */ + protected ObjectIdentifier(String vault, String collection, String name) { + this(vault, collection, name, null); + } + + /** + * Constructor. + * @param vault the vault url. + * @param collection the object collection name. e.g. 'keys', 'secrets' and 'certificates'. + * @param name the object name. + * @param version the object version. + */ + protected ObjectIdentifier(String vault, String collection, String name, String version) { + + vault = verifyNonEmpty(vault, "vault"); + collection = verifyNonEmpty(collection, "collection"); + name = verifyNonEmpty(name, "name"); + + if (version != null) { + version = version.trim(); + } else { + version = ""; + } + + URI baseUri; + try { + baseUri = new URI(vault); + } catch (URISyntaxException e) { + throw new InvalidParameterException(String.format("Invalid ObjectIdentifier: %s. Not a valid URI", vault)); + } + + this.name = name; + this.version = version; + this.vault = String.format("%s://%s", baseUri.getScheme(), getFullAuthority(baseUri)); + baseIdentifier = String.format("%s/%s/%s", this.vault, collection, this.name); + identifier = (version == null || version.isEmpty()) ? baseIdentifier + : String.format("%s/%s", baseIdentifier, version); + } + + /** + * Constructor. + * @param collection the object collection name. e.g. 'keys', 'secrets' and 'certificates'. + * @param identifier the object identifier. + */ + protected ObjectIdentifier(String collection, String identifier) { + + if (collection == null || collection.length() == 0) { + throw new IllegalArgumentException("collection"); + } + + if (identifier == null || identifier.length() == 0) { + throw new IllegalArgumentException("identifier"); + } + + URI baseUri; + try { + baseUri = new URI(identifier); + } catch (URISyntaxException e) { + throw new InvalidParameterException( + String.format("Invalid ObjectIdentifier: %s. Not a valid URI", identifier)); + } + + // Path is of the form "/collection/name[/version]" + String[] segments = baseUri.getPath().split("/"); + if (segments.length != 3 && segments.length != 4) { + throw new InvalidParameterException(String + .format("Invalid ObjectIdentifier: %s. Bad number of segments: %d", identifier, segments.length)); + } + + if (!collection.equals(segments[1])) { + throw new InvalidParameterException( + String.format("Invalid ObjectIdentifier: %s. segment [1] should be '%s', found '%s'", identifier, + collection, segments[1])); + } + + name = segments[2]; + version = segments.length == 4 ? segments[3] : null; + vault = String.format("%s://%s", baseUri.getScheme(), getFullAuthority(baseUri)); + baseIdentifier = String.format("%s/%s/%s", vault, collection, name); + this.identifier = (version == null || version.equals("")) ? baseIdentifier + : String.format("%s/%s", baseIdentifier, version); + } + + /** + * Gets full authority for a URL by appending port to the url authority. + * @param uri the URL to get the full authority for. + * @return the full authority. + */ + protected String getFullAuthority(URI uri) { + String authority = uri.getAuthority(); + if (!authority.contains(":") && uri.getPort() > 0) { + // Append port for complete authority + authority = String.format("%s:%d", uri.getAuthority(), uri.getPort()); + } + return authority; + } + + /** + * @return The base identifier for an object, does not include the object + * version. + */ + public String baseIdentifier() { + return baseIdentifier; + } + + /** + * @return The identifier for an object, includes the objects version. + */ + public String identifier() { + return identifier; + } + + /** + * @return The name of the object. + */ + public String name() { + return name; + } + + /** + * @return The vault containing the object. + */ + public String vault() { + return vault; + } + + /** + * @return The version of the object. + */ + public String version() { + return version; + } + + @Override + public String toString() { + return identifier; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/SecretIdentifier.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/SecretIdentifier.java new file mode 100644 index 0000000000000..f667437b8e0f8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/SecretIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault; + +/** + * Key Vault secret identifier. + */ +public final class SecretIdentifier extends ObjectIdentifier { + + /** + * Verifies whether the identifier belongs to a key vault secret. + * @param identifier the key vault secret identifier. + * @return true if the identifier belongs to a key vault secret. False otherwise. + */ + public static boolean isSecretIdentifier(String identifier) { + return ObjectIdentifier.isObjectIdentifier("secrets", identifier); + } + + /** + * Constructor. + * @param vault the vault url. + * @param name the name of secret. + */ + public SecretIdentifier(String vault, String name) { + this(vault, name, ""); + } + + /** + * Constructor. + * @param vault the vault url. + * @param name the name of secret. + * @param version the secret version. + */ + public SecretIdentifier(String vault, String name, String version) { + super(vault, "secrets", name, version); + } + + /** + * Constructor. + * @param identifier the object identifier. + */ + public SecretIdentifier(String identifier) { + super("secrets", identifier); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/AuthenticationResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/AuthenticationResult.java new file mode 100644 index 0000000000000..6f1628acf30df --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/AuthenticationResult.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.keyvault.authentication; + +/** + * Stores authentication token and client key used for proof of possession + * authentication. + */ +public class AuthenticationResult { + private String authToken; + private String popKey; + + /** + * Constructor. + * + * @param authToken + * authentication token string. + * @param popKey + * serialized json web key used for pop authentication. + */ + public AuthenticationResult(String authToken, String popKey) { + this.authToken = authToken; + this.popKey = popKey; + } + + /** + * Retrieve stored authentication token. + * + * @return authentication token. + */ + public String getAuthToken() { + return authToken; + } + + /** + * Retrieve stored PoP key. + * + * @return proof of possession key. + */ + public String getPopKey() { + return popKey; + } +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java new file mode 100644 index 0000000000000..4559cac8332e4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.authentication; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import okhttp3.HttpUrl; + +/** + * Handles caching of the challenge. + */ +class ChallengeCache { + + private final HashMap> cachedChallenges = new HashMap>(); + + /** + * Uses authority to retrieve the cached values. + * + * @param url + * the url that is used as a cache key. + * @return cached value or null if value is not available. + */ + public Map getCachedChallenge(HttpUrl url) { + if (url == null) { + return null; + } + String authority = getAuthority(url); + authority = authority.toLowerCase(Locale.ENGLISH); + return cachedChallenges.get(authority); + } + + /** + * Uses authority to cache challenge. + * + * @param url + * the url that is used as a cache key. + * @param challenge + * the challenge to cache. + */ + public void addCachedChallenge(HttpUrl url, Map challenge) { + if (url == null || challenge == null) { + return; + } + String authority = getAuthority(url); + authority = authority.toLowerCase(Locale.ENGLISH); + cachedChallenges.put(authority, challenge); + } + + /** + * Gets authority of a url. + * + * @param url + * the url to get the authority for. + * @return the authority. + */ + public String getAuthority(HttpUrl url) { + String scheme = url.scheme(); + String host = url.host(); + int port = url.port(); + StringBuilder builder = new StringBuilder(); + if (scheme != null) { + builder.append(scheme).append("://"); + } + builder.append(host); + if (port >= 0) { + builder.append(':').append(port); + } + return builder.toString(); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java new file mode 100644 index 0000000000000..aeb7fa06f4b8e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.authentication; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Arrays; +import java.util.List; + +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.azure.keyvault.messagesecurity.HttpMessageSecurity; + +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.MediaType; +import okhttp3.Response; + +import org.apache.commons.lang3.tuple.Pair; + +/** + * An implementation of {@link ServiceClientCredentials} that supports automatic + * bearer token refresh. + * + */ +public abstract class KeyVaultCredentials implements ServiceClientCredentials { + + private static final String WWW_AUTHENTICATE = "WWW-Authenticate"; + private static final String BEARER_TOKEP_REFIX = "Bearer "; + private List supportedMethods = Arrays.asList("sign", "verify", "encrypt", "decrypt", "wrapkey", + "unwrapkey"); + + private final ChallengeCache cache = new ChallengeCache(); + + @Override + public void applyCredentialsFilter(OkHttpClient.Builder clientBuilder) { + + clientBuilder.addInterceptor(new Interceptor() { + + @Override + public Response intercept(Chain chain) throws IOException { + + Request originalRequest = chain.request(); + HttpUrl url = chain.request().url(); + + Map challengeMap = cache.getCachedChallenge(url); + Response response; + Pair authenticatedRequestPair; + + if (challengeMap != null) { + // challenge is cached, so there is no need to send an empty auth request. + authenticatedRequestPair = buildAuthenticatedRequest(originalRequest, challengeMap); + } else { + // challenge is new for the URL and is not cached, + // so the request is sent out to get the challenges in + // response + response = chain.proceed(buildEmptyRequest(originalRequest)); + + if (response.code() == 200) { + return response; + } else if (response.code() != 401) { + throw new IOException("Unexpected unauthorized response."); + } + authenticatedRequestPair = buildAuthenticatedRequest(originalRequest, response); + } + + response = chain.proceed(authenticatedRequestPair.getLeft()); + + if (response.code() == 200) { + return authenticatedRequestPair.getRight().unprotectResponse(response); + } else { + return response; + } + } + }); + } + + /** + * Builds request with authenticated header. Protects request body if supported. + * + * @param originalRequest + * unprotected request without auth token. + * @param challengeMap + * the challenge map. + * @return Pair of protected request and HttpMessageSecurity used for + * encryption. + */ + private Pair buildAuthenticatedRequest(Request originalRequest, + Map challengeMap) throws IOException { + + Boolean supportsPop = supportsMessageProtection(originalRequest.url().toString(), challengeMap); + AuthenticationResult authResult = getAuthenticationCredentials(supportsPop, challengeMap); + + if (authResult == null) { + return null; + } + + HttpMessageSecurity httpMessageSecurity = new HttpMessageSecurity(authResult.getAuthToken(), + supportsPop ? authResult.getPopKey() : "", + supportsPop ? challengeMap.get("x-ms-message-encryption-key") : "", + supportsPop ? challengeMap.get("x-ms-message-signing-key") : ""); + + Request request = httpMessageSecurity.protectRequest(originalRequest); + return Pair.of(request, httpMessageSecurity); + } + + /** + * Builds request with authenticated header. Protects request body if supported. + * + * @param originalRequest + * unprotected request without auth token. + * @param response + * response with unauthorized return code. + * @return Pair of protected request and HttpMessageSecurity used for + * encryption. + */ + private Pair buildAuthenticatedRequest(Request originalRequest, Response response) + throws IOException { + String authenticateHeader = response.header(WWW_AUTHENTICATE); + + Map challengeMap = extractChallenge(authenticateHeader, BEARER_TOKEP_REFIX); + + challengeMap.put("x-ms-message-encryption-key", response.header("x-ms-message-encryption-key")); + challengeMap.put("x-ms-message-signing-key", response.header("x-ms-message-signing-key")); + + // Cache the challenge + cache.addCachedChallenge(originalRequest.url(), challengeMap); + + return buildAuthenticatedRequest(originalRequest, challengeMap); + } + + /** + * Removes request body used for EKV authorization. + * + * @param request + * unprotected request without auth token. + * @return request with removed body. + */ + private Request buildEmptyRequest(Request request) { + RequestBody body = RequestBody.create(MediaType.parse("application/json"), "{}"); + if (request.method().equalsIgnoreCase("get")) { + return request; + } else { + return request.newBuilder().method(request.method(), body).build(); + } + } + + /** + * Checks if resource supports message protection. + * + * @param url + * resource url. + * @param challengeMap + * the challenge map. + * @return true if message protection is supported. + */ + private Boolean supportsMessageProtection(String url, Map challengeMap) { + + if (!"true".equals(challengeMap.get("supportspop"))) { + return false; + } + + // Message protection is enabled only for subset of keys operations. + if (!url.toLowerCase().contains("/keys/")) { + return false; + } + + String[] tokens = url.split("\\?")[0].split("/"); + return supportedMethods.contains(tokens[tokens.length - 1]); + } + + /** + * Extracts the authentication challenges from the challenge map and calls the + * authentication callback to get the bearer token and return it. + * + * @param supportsPop + * is resource supports pop authentication. + * @param challengeMap + * the challenge map. + * @return AuthenticationResult with bearer token and PoP key. + */ + private AuthenticationResult getAuthenticationCredentials(Boolean supportsPop, Map challengeMap) { + + String authorization = challengeMap.get("authorization"); + if (authorization == null) { + authorization = challengeMap.get("authorization_uri"); + } + + String resource = challengeMap.get("resource"); + String scope = challengeMap.get("scope"); + String schema = supportsPop ? "pop" : "bearer"; + return doAuthenticate(authorization, resource, scope, schema); + } + + /** + * Extracts the challenge off the authentication header. + * + * @param authenticateHeader + * the authentication header containing all the challenges. + * @param authChallengePrefix + * the authentication challenge name. + * @return a challenge map. + */ + private static Map extractChallenge(String authenticateHeader, String authChallengePrefix) { + if (!isValidChallenge(authenticateHeader, authChallengePrefix)) { + return null; + } + + authenticateHeader = authenticateHeader.toLowerCase().replace(authChallengePrefix.toLowerCase(), ""); + + String[] challenges = authenticateHeader.split(", "); + Map challengeMap = new HashMap(); + for (String pair : challenges) { + String[] keyValue = pair.split("="); + challengeMap.put(keyValue[0].replaceAll("\"", ""), keyValue[1].replaceAll("\"", "")); + } + return challengeMap; + } + + /** + * Verifies whether a challenge is bearer or not. + * + * @param authenticateHeader + * the authentication header containing all the challenges. + * @param authChallengePrefix + * the authentication challenge name. + * @return + */ + private static boolean isValidChallenge(String authenticateHeader, String authChallengePrefix) { + if (authenticateHeader != null && !authenticateHeader.isEmpty() + && authenticateHeader.toLowerCase().startsWith(authChallengePrefix.toLowerCase())) { + return true; + } + return false; + } + + /** + * Abstract method to be implemented. + * + * @param authorization + * Identifier of the authority, a URL. + * @param resource + * Identifier of the target resource that is the recipient of the + * requested token, a URL. + * + * @param scope + * The scope of the authentication request. + * + * @return AuthenticationResult with authorization token and PoP key. + * + * Answers a server challenge with a token header. + *

+ * Implementations typically use ADAL to get a token, as performed in + * the sample below: + *

+ * + *
+     * @Override
+     * public String doAuthenticate(String authorization, String resource, String scope) {
+     *     String clientId = ...; // client GUID as shown in Azure portal.
+     *     String clientKey = ...; // client key as provided by Azure portal.
+     *     AuthenticationResult token = getAccessTokenFromClientCredentials(authorization, resource, clientId, clientKey);
+     *     return token.getAccessToken();;
+     * }
+     *
+     * private static AuthenticationResult getAccessTokenFromClientCredentials(String authorization, String resource, String clientId, String clientKey) {
+     *     AuthenticationContext context = null;
+     *     AuthenticationResult result = null;
+     *     ExecutorService service = null;
+     *     try {
+     *         service = Executors.newFixedThreadPool(1);
+     *         context = new AuthenticationContext(authorization, false, service);
+     *         ClientCredential credentials = new ClientCredential(clientId, clientKey);
+     *         Future<AuthenticationResult> future = context.acquireToken(resource, credentials, null);
+     *         result = future.get();
+     *     } catch (Exception e) {
+     *         throw new RuntimeException(e);
+     *     } finally {
+     *         service.shutdown();
+     *     }
+     *
+     *     if (result == null) {
+     *         throw new RuntimeException("authentication result was null");
+     *     }
+     *     return result;
+     * }
+     *         
+ * + *

+ * Note: The client key must be securely stored. It's advised to use + * two client applications - one for development and other for + * production - managed by separate parties. + *

+ * + */ + public String doAuthenticate(String authorization, String resource, String scope) { + return ""; + } + + /** + * Method to be implemented. + * + * @param authorization + * Identifier of the authority, a URL. + * @param resource + * Identifier of the target resource that is the recipient of the + * requested token, a URL. + * @param scope + * The scope of the authentication request. + * + * @param schema + * Authentication schema. Can be 'pop' or 'bearer'. + * + * @return AuthenticationResult with authorization token and PoP key. + * + * Answers a server challenge with a token header. + *

+ * Implementations sends POST request to receive authentication token + * like in example below. ADAL currently doesn't support POP + * authentication. + *

+ * + *
+     *         public AuthenticationResult doAuthenticate(String authorization, String resource, String scope, String schema) {
+     *             JsonWebKey clientJwk = GenerateJsonWebKey();
+     *             JsonWebKey clientPublicJwk = GetJwkWithPublicKeyOnly(clientJwk);
+     *             String token = GetAccessToken(authorization, resource, "pop".equals(schema), clientPublicJwk);
+     *
+     *             return new AuthenticationResult(token, clientJwk.toString());
+     *         }
+     *
+     *         private JsonWebKey GenerateJsonWebKey() {
+     *             final KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
+     *             generator.initialize(2048);
+     *             KeyPair clientRsaKeyPair = generator.generateKeyPair();
+     *             JsonWebKey result = JsonWebKey.fromRSA(clientRsaKeyPair);
+     *             result.withKid(UUID.randomUUID().toString());
+     *             return result;
+     *         }
+     *
+     *         public static JsonWebKey GetJwkWithPublicKeyOnly(JsonWebKey jwk) {
+     *             KeyPair publicOnly = jwk.toRSA(false);
+     *             JsonWebKey jsonkeyPublic = JsonWebKey.fromRSA(publicOnly);
+     *             jsonkeyPublic.withKid(jwk.kid());
+     *             jsonkeyPublic.withKeyOps(Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.WRAP_KEY,
+     *                     JsonWebKeyOperation.VERIFY));
+     *             return jsonkeyPublic;
+     *         }
+     *
+     *         private String GetAccessToken(String authorization, String resource, boolean supportspop, JsonWebKey jwkPublic) {
+     *             CloseableHttpClient httpclient = HttpClients.createDefault();
+     *             HttpPost httppost = new HttpPost(authorization + "/oauth2/token");
+     * 
+     *             // Request parameters and other properties.
+     *             List<NameValuePair> params = new ArrayList<NameValuePair>(2);
+     *             params.add(new BasicNameValuePair("resource", resource));
+     *             params.add(new BasicNameValuePair("response_type", "token"));
+     *             params.add(new BasicNameValuePair("grant_type", "client_credentials"));
+     *             params.add(new BasicNameValuePair("client_id", this.getApplicationId()));
+     *             params.add(new BasicNameValuePair("client_secret", this.getApplicationSecret()));
+     *
+     *             if (supportspop) {
+     *                 params.add(new BasicNameValuePair("pop_jwk", jwkPublic.toString()));
+     *             }
+     *
+     *             httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
+     *
+     *             HttpResponse response = httpclient.execute(httppost);
+     *             HttpEntity entity = response.getEntity();
+     *
+     *             // Read the contents of an entity and return it as a String.
+     *             String content = EntityUtils.toString(entity);
+     *
+     *             ObjectMapper mapper = new ObjectMapper();
+     *             authreply reply = mapper.readValue(content, authreply.class);
+     *
+     *             return reply.access_token;
+     *         }
+     *         
+ * + *

+ * Note: The client key must be securely stored. It's advised to use + * two client applications - one for development and other for + * production - managed by separate parties. + *

+ */ + public AuthenticationResult doAuthenticate(String authorization, String resource, String scope, String schema) { + return new AuthenticationResult(doAuthenticate(authorization, resource, scope), ""); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/package-info.java new file mode 100644 index 0000000000000..a565f188320a8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the classes for KeyVaultClient. Performs cryptographic + * key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.authentication; diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java new file mode 100644 index 0000000000000..a6a6b055a62a9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java @@ -0,0 +1,13313 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.implementation; + +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.keyvault.KeyVaultClientBase; +import com.microsoft.azure.keyvault.models.BackupCertificateResult; +import com.microsoft.azure.keyvault.models.BackupKeyResult; +import com.microsoft.azure.keyvault.models.BackupSecretResult; +import com.microsoft.azure.keyvault.models.BackupStorageResult; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateCreateParameters; +import com.microsoft.azure.keyvault.models.CertificateImportParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateIssuerSetParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerUpdateParameters; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateMergeParameters; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.CertificateRestoreParameters; +import com.microsoft.azure.keyvault.models.CertificateUpdateParameters; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; +import com.microsoft.azure.keyvault.models.DeletedCertificateItem; +import com.microsoft.azure.keyvault.models.DeletedKeyBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyItem; +import com.microsoft.azure.keyvault.models.DeletedSasDefinitionBundle; +import com.microsoft.azure.keyvault.models.DeletedSasDefinitionItem; +import com.microsoft.azure.keyvault.models.DeletedSecretBundle; +import com.microsoft.azure.keyvault.models.DeletedSecretItem; +import com.microsoft.azure.keyvault.models.DeletedStorageAccountItem; +import com.microsoft.azure.keyvault.models.DeletedStorageBundle; +import com.microsoft.azure.keyvault.models.IssuerAttributes; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.models.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyCreateParameters; +import com.microsoft.azure.keyvault.models.KeyImportParameters; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyOperationsParameters; +import com.microsoft.azure.keyvault.models.KeyRestoreParameters; +import com.microsoft.azure.keyvault.models.KeySignParameters; +import com.microsoft.azure.keyvault.models.KeyUpdateParameters; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyParameters; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.OrganizationDetails; +import com.microsoft.azure.keyvault.models.PageImpl; +import com.microsoft.azure.keyvault.models.SasDefinitionAttributes; +import com.microsoft.azure.keyvault.models.SasDefinitionBundle; +import com.microsoft.azure.keyvault.models.SasDefinitionCreateParameters; +import com.microsoft.azure.keyvault.models.SasDefinitionItem; +import com.microsoft.azure.keyvault.models.SasDefinitionUpdateParameters; +import com.microsoft.azure.keyvault.models.SasTokenType; +import com.microsoft.azure.keyvault.models.SecretAttributes; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.models.SecretRestoreParameters; +import com.microsoft.azure.keyvault.models.SecretSetParameters; +import com.microsoft.azure.keyvault.models.SecretUpdateParameters; +import com.microsoft.azure.keyvault.models.StorageAccountAttributes; +import com.microsoft.azure.keyvault.models.StorageAccountCreateParameters; +import com.microsoft.azure.keyvault.models.StorageAccountItem; +import com.microsoft.azure.keyvault.models.StorageAccountRegenerteKeyParameters; +import com.microsoft.azure.keyvault.models.StorageAccountUpdateParameters; +import com.microsoft.azure.keyvault.models.StorageBundle; +import com.microsoft.azure.keyvault.models.StorageRestoreParameters; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the KeyVaultClientBaseImpl class. + */ +public class KeyVaultClientBaseImpl extends AzureServiceClient implements KeyVaultClientBase { + /** The Retrofit service to perform REST calls. */ + private KeyVaultClientBaseService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public KeyVaultClientBaseImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public KeyVaultClientBaseImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public KeyVaultClientBaseImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of KeyVaultClientBase client. + * + * @param credentials the management credentials for Azure + */ + public KeyVaultClientBaseImpl(ServiceClientCredentials credentials) { + this("https://{vaultBaseUrl}", credentials); + } + + /** + * Initializes an instance of KeyVaultClientBase client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private KeyVaultClientBaseImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KeyVaultClientBase client. + * + * @param restClient the REST client to connect to Azure. + */ + public KeyVaultClientBaseImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "7.0"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "KeyVaultClientBase", "7.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(KeyVaultClientBaseService.class); + } + + /** + * The interface defining all the services for KeyVaultClientBase to be + * used by Retrofit to perform actually REST calls. + */ + interface KeyVaultClientBaseService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase createKey" }) + @POST("keys/{key-name}/create") + Observable> createKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase importKey" }) + @PUT("keys/{key-name}") + Observable> importKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyImportParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteKey" }) + @HTTP(path = "keys/{key-name}", method = "DELETE", hasBody = true) + Observable> deleteKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateKey" }) + @PATCH("keys/{key-name}/{key-version}") + Observable> updateKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getKey" }) + @GET("keys/{key-name}/{key-version}") + Observable> getKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getKeyVersions" }) + @GET("keys/{key-name}/versions") + Observable> getKeyVersions(@Path("key-name") String keyName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getKeys" }) + @GET("keys") + Observable> getKeys(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase backupKey" }) + @POST("keys/{key-name}/backup") + Observable> backupKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase restoreKey" }) + @POST("keys/restore") + Observable> restoreKey(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyRestoreParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase encrypt" }) + @POST("keys/{key-name}/{key-version}/encrypt") + Observable> encrypt(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase decrypt" }) + @POST("keys/{key-name}/{key-version}/decrypt") + Observable> decrypt(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase sign" }) + @POST("keys/{key-name}/{key-version}/sign") + Observable> sign(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeySignParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase verify" }) + @POST("keys/{key-name}/{key-version}/verify") + Observable> verify(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyVerifyParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase wrapKey" }) + @POST("keys/{key-name}/{key-version}/wrapkey") + Observable> wrapKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase unwrapKey" }) + @POST("keys/{key-name}/{key-version}/unwrapkey") + Observable> unwrapKey(@Path("key-name") String keyName, @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedKeys" }) + @GET("deletedkeys") + Observable> getDeletedKeys(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedKey" }) + @GET("deletedkeys/{key-name}") + Observable> getDeletedKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase purgeDeletedKey" }) + @HTTP(path = "deletedkeys/{key-name}", method = "DELETE", hasBody = true) + Observable> purgeDeletedKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase recoverDeletedKey" }) + @POST("deletedkeys/{key-name}/recover") + Observable> recoverDeletedKey(@Path("key-name") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase setSecret" }) + @PUT("secrets/{secret-name}") + Observable> setSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecretSetParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteSecret" }) + @HTTP(path = "secrets/{secret-name}", method = "DELETE", hasBody = true) + Observable> deleteSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateSecret" }) + @PATCH("secrets/{secret-name}/{secret-version}") + Observable> updateSecret(@Path("secret-name") String secretName, @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecretUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSecret" }) + @GET("secrets/{secret-name}/{secret-version}") + Observable> getSecret(@Path("secret-name") String secretName, @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSecrets" }) + @GET("secrets") + Observable> getSecrets(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSecretVersions" }) + @GET("secrets/{secret-name}/versions") + Observable> getSecretVersions(@Path("secret-name") String secretName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSecrets" }) + @GET("deletedsecrets") + Observable> getDeletedSecrets(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSecret" }) + @GET("deletedsecrets/{secret-name}") + Observable> getDeletedSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase purgeDeletedSecret" }) + @HTTP(path = "deletedsecrets/{secret-name}", method = "DELETE", hasBody = true) + Observable> purgeDeletedSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase recoverDeletedSecret" }) + @POST("deletedsecrets/{secret-name}/recover") + Observable> recoverDeletedSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase backupSecret" }) + @POST("secrets/{secret-name}/backup") + Observable> backupSecret(@Path("secret-name") String secretName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase restoreSecret" }) + @POST("secrets/restore") + Observable> restoreSecret(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecretRestoreParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificates" }) + @GET("certificates") + Observable> getCertificates(@Query("maxresults") Integer maxresults, @Query("includePending") Boolean includePending, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteCertificate" }) + @HTTP(path = "certificates/{certificate-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase setCertificateContacts" }) + @PUT("certificates/contacts") + Observable> setCertificateContacts(@Body Contacts contacts, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateContacts" }) + @GET("certificates/contacts") + Observable> getCertificateContacts(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteCertificateContacts" }) + @HTTP(path = "certificates/contacts", method = "DELETE", hasBody = true) + Observable> deleteCertificateContacts(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateIssuers" }) + @GET("certificates/issuers") + Observable> getCertificateIssuers(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase setCertificateIssuer" }) + @PUT("certificates/issuers/{issuer-name}") + Observable> setCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateIssuerSetParameters parameter, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateCertificateIssuer" }) + @PATCH("certificates/issuers/{issuer-name}") + Observable> updateCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateIssuerUpdateParameters parameter, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateIssuer" }) + @GET("certificates/issuers/{issuer-name}") + Observable> getCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteCertificateIssuer" }) + @HTTP(path = "certificates/issuers/{issuer-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificateIssuer(@Path("issuer-name") String issuerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase createCertificate" }) + @POST("certificates/{certificate-name}/create") + Observable> createCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase importCertificate" }) + @POST("certificates/{certificate-name}/import") + Observable> importCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateImportParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateVersions" }) + @GET("certificates/{certificate-name}/versions") + Observable> getCertificateVersions(@Path("certificate-name") String certificateName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificatePolicy" }) + @GET("certificates/{certificate-name}/policy") + Observable> getCertificatePolicy(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateCertificatePolicy" }) + @PATCH("certificates/{certificate-name}/policy") + Observable> updateCertificatePolicy(@Path("certificate-name") String certificateName, @Body CertificatePolicy certificatePolicy, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateCertificate" }) + @PATCH("certificates/{certificate-name}/{certificate-version}") + Observable> updateCertificate(@Path("certificate-name") String certificateName, @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificate" }) + @GET("certificates/{certificate-name}/{certificate-version}") + Observable> getCertificate(@Path("certificate-name") String certificateName, @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateCertificateOperation" }) + @PATCH("certificates/{certificate-name}/pending") + Observable> updateCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateOperationUpdateParameter certificateOperation, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateOperation" }) + @GET("certificates/{certificate-name}/pending") + Observable> getCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteCertificateOperation" }) + @HTTP(path = "certificates/{certificate-name}/pending", method = "DELETE", hasBody = true) + Observable> deleteCertificateOperation(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase mergeCertificate" }) + @POST("certificates/{certificate-name}/pending/merge") + Observable> mergeCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateMergeParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase backupCertificate" }) + @POST("certificates/{certificate-name}/backup") + Observable> backupCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase restoreCertificate" }) + @POST("certificates/restore") + Observable> restoreCertificate(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateRestoreParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedCertificates" }) + @GET("deletedcertificates") + Observable> getDeletedCertificates(@Query("maxresults") Integer maxresults, @Query("includePending") Boolean includePending, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedCertificate" }) + @GET("deletedcertificates/{certificate-name}") + Observable> getDeletedCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase purgeDeletedCertificate" }) + @HTTP(path = "deletedcertificates/{certificate-name}", method = "DELETE", hasBody = true) + Observable> purgeDeletedCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase recoverDeletedCertificate" }) + @POST("deletedcertificates/{certificate-name}/recover") + Observable> recoverDeletedCertificate(@Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getStorageAccounts" }) + @GET("storage") + Observable> getStorageAccounts(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedStorageAccounts" }) + @GET("deletedstorage") + Observable> getDeletedStorageAccounts(@Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedStorageAccount" }) + @GET("deletedstorage/{storage-account-name}") + Observable> getDeletedStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase purgeDeletedStorageAccount" }) + @HTTP(path = "deletedstorage/{storage-account-name}", method = "DELETE", hasBody = true) + Observable> purgeDeletedStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase recoverDeletedStorageAccount" }) + @POST("deletedstorage/{storage-account-name}/recover") + Observable> recoverDeletedStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase backupStorageAccount" }) + @POST("storage/{storage-account-name}/backup") + Observable> backupStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase restoreStorageAccount" }) + @POST("storage/restore") + Observable> restoreStorageAccount(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageRestoreParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteStorageAccount" }) + @HTTP(path = "storage/{storage-account-name}", method = "DELETE", hasBody = true) + Observable> deleteStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getStorageAccount" }) + @GET("storage/{storage-account-name}") + Observable> getStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase setStorageAccount" }) + @PUT("storage/{storage-account-name}") + Observable> setStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateStorageAccount" }) + @PATCH("storage/{storage-account-name}") + Observable> updateStorageAccount(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase regenerateStorageAccountKey" }) + @POST("storage/{storage-account-name}/regeneratekey") + Observable> regenerateStorageAccountKey(@Path("storage-account-name") String storageAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountRegenerteKeyParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSasDefinitions" }) + @GET("storage/{storage-account-name}/sas") + Observable> getSasDefinitions(@Path("storage-account-name") String storageAccountName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSasDefinitions" }) + @GET("deletedstorage/{storage-account-name}/sas") + Observable> getDeletedSasDefinitions(@Path("storage-account-name") String storageAccountName, @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSasDefinition" }) + @GET("deletedstorage/{storage-account-name}/sas/{sas-definition-name}") + Observable> getDeletedSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase recoverDeletedSasDefinition" }) + @POST("deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover") + Observable> recoverDeletedSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase deleteSasDefinition" }) + @HTTP(path = "storage/{storage-account-name}/sas/{sas-definition-name}", method = "DELETE", hasBody = true) + Observable> deleteSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSasDefinition" }) + @GET("storage/{storage-account-name}/sas/{sas-definition-name}") + Observable> getSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase setSasDefinition" }) + @PUT("storage/{storage-account-name}/sas/{sas-definition-name}") + Observable> setSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SasDefinitionCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase updateSasDefinition" }) + @PATCH("storage/{storage-account-name}/sas/{sas-definition-name}") + Observable> updateSasDefinition(@Path("storage-account-name") String storageAccountName, @Path("sas-definition-name") String sasDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SasDefinitionUpdateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getKeyVersionsNext" }) + @GET + Observable> getKeyVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getKeysNext" }) + @GET + Observable> getKeysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedKeysNext" }) + @GET + Observable> getDeletedKeysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSecretsNext" }) + @GET + Observable> getSecretsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSecretVersionsNext" }) + @GET + Observable> getSecretVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSecretsNext" }) + @GET + Observable> getDeletedSecretsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificatesNext" }) + @GET + Observable> getCertificatesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateIssuersNext" }) + @GET + Observable> getCertificateIssuersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getCertificateVersionsNext" }) + @GET + Observable> getCertificateVersionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedCertificatesNext" }) + @GET + Observable> getDeletedCertificatesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getStorageAccountsNext" }) + @GET + Observable> getStorageAccountsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedStorageAccountsNext" }) + @GET + Observable> getDeletedStorageAccountsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getSasDefinitionsNext" }) + @GET + Observable> getSasDefinitionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClientBase getDeletedSasDefinitionsNext" }) + @GET + Observable> getDeletedSasDefinitionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).toBlocking().single().body(); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty), serviceCallback); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (kty == null) { + throw new IllegalArgumentException("Parameter kty is required and cannot be null."); + } + final Integer keySize = null; + final List keyOps = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + final JsonWebKeyCurveName curve = null; + KeyCreateParameters parameters = new KeyCreateParameters(); + parameters.withKty(kty); + parameters.withKeySize(null); + parameters.withKeyOps(null); + parameters.withKeyAttributes(null); + parameters.withTags(null); + parameters.withCurve(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, curve).toBlocking().single().body(); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, curve), serviceCallback); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, curve).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to the client. + * The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name for the new key. The system will generate the version name for the new key. + * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param keySize The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param keyOps the List<JsonWebKeyOperation> value + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param curve Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, JsonWebKeyCurveName curve) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (kty == null) { + throw new IllegalArgumentException("Parameter kty is required and cannot be null."); + } + Validator.validate(keyOps); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyCreateParameters parameters = new KeyCreateParameters(); + parameters.withKty(kty); + parameters.withKeySize(keySize); + parameters.withKeyOps(keyOps); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + parameters.withCurve(curve); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key).toBlocking().single().body(); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key), serviceCallback); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + Validator.validate(key); + final Boolean hsm = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + KeyImportParameters parameters = new KeyImportParameters(); + parameters.withHsm(null); + parameters.withKey(key); + parameters.withKeyAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle importKey(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags).toBlocking().single().body(); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags), serviceCallback); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and attributes to the client. + * The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName Name for the imported key. + * @param key The Json web key + * @param hsm Whether to import as a hardware key (HSM) or software key. + * @param keyAttributes The key management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> importKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + Validator.validate(key); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyImportParameters parameters = new KeyImportParameters(); + parameters.withHsm(hsm); + parameters.withKey(key); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importKey(keyName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedKeyBundle object if successful. + */ + public DeletedKeyBundle deleteKey(String vaultBaseUrl, String keyName) { + return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + public Observable deleteKeyAsync(String vaultBaseUrl, String keyName) { + return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, DeletedKeyBundle>() { + @Override + public DeletedKeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a key of any type from storage in Azure Key Vault. + * The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + public Observable> deleteKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).toBlocking().single().body(); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final List keyOps = null; + final KeyAttributes keyAttributes = null; + final Map tags = null; + KeyUpdateParameters parameters = new KeyUpdateParameters(); + parameters.withKeyOps(null); + parameters.withKeyAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).toBlocking().single().body(); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags), serviceCallback); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. + * In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of key to update. + * @param keyVersion The version of the key to update. + * @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + * @param keyAttributes the KeyAttributes value + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, List keyOps, KeyAttributes keyAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(keyOps); + Validator.validate(keyAttributes); + Validator.validate(tags); + KeyUpdateParameters parameters = new KeyUpdateParameters(); + parameters.withKeyOps(keyOps); + parameters.withKeyAttributes(keyAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle getKey(String vaultBaseUrl, String keyName, String keyVersion) { + return getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).toBlocking().single().body(); + } + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback); + } + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) { + return getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the public part of a stored key. + * The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> getKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersions(final String vaultBaseUrl, final String keyName) { + ServiceResponse> response = getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName) { + return getKeyVersionsWithServiceResponseAsync(vaultBaseUrl, keyName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName) { + return getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsSinglePageAsync(final String vaultBaseUrl, final String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeyVersions(keyName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + ServiceResponse> response = getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + return getKeyVersionsWithServiceResponseAsync(vaultBaseUrl, keyName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + return getKeyVersionsSinglePageAsync(vaultBaseUrl, keyName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsSinglePageAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeyVersions(keyName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeyVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeys(final String vaultBaseUrl) { + ServiceResponse> response = getKeysSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysAsync(final String vaultBaseUrl) { + return getKeysWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl) { + return getKeysSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeys(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getKeysSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysAsync(final String vaultBaseUrl, final Integer maxresults) { + return getKeysWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getKeysSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeysDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupKeyResult object if successful. + */ + public BackupKeyResult backupKey(String vaultBaseUrl, String keyName) { + return backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupKeyResult object + */ + public Observable backupKeyAsync(String vaultBaseUrl, String keyName) { + return backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, BackupKeyResult>() { + @Override + public BackupKeyResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Requests that a backup of the specified key be downloaded to the client. + * The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupKeyResult object + */ + public Observable> backupKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.backupKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup) { + return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).toBlocking().single().body(); + } + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup), serviceCallback); + } + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup) { + return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores a backed up key to a vault. + * Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyBundleBackup The backup blob associated with a key bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> restoreKeyWithServiceResponseAsync(String vaultBaseUrl, byte[] keyBundleBackup) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (keyBundleBackup == null) { + throw new IllegalArgumentException("Parameter keyBundleBackup is required and cannot be null."); + } + KeyRestoreParameters parameters = new KeyRestoreParameters(); + parameters.withKeyBundleBackup(keyBundleBackup); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.restoreKey(this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult encrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable encryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return encryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable> encryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.encrypt(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = encryptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse encryptDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult decrypt(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return decryptWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Decrypts a single block of encrypted data. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable> decryptWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.decrypt(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = decryptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse decryptDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult sign(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + return signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + return signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a signature from a digest using the specified key. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable> signWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeySignParameters parameters = new KeySignParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.sign(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = signDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse signDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyVerifyResult object if successful. + */ + public KeyVerifyResult verify(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + return verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature).toBlocking().single().body(); + } + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature), serviceCallback); + } + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyVerifyResult object + */ + public Observable verifyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + return verifyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature).map(new Func1, KeyVerifyResult>() { + @Override + public KeyVerifyResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies a signature using a specified key. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @param digest The digest used for signing. + * @param signature The signature to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyVerifyResult object + */ + public Observable> verifyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (digest == null) { + throw new IllegalArgumentException("Parameter digest is required and cannot be null."); + } + if (signature == null) { + throw new IllegalArgumentException("Parameter signature is required and cannot be null."); + } + KeyVerifyParameters parameters = new KeyVerifyParameters(); + parameters.withAlgorithm(algorithm); + parameters.withDigest(digest); + parameters.withSignature(signature); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.verify(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = verifyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse verifyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Wraps a symmetric key using a specified key. + * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable> wrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.wrapKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = wrapKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse wrapKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyOperationResult object if successful. + */ + public KeyOperationResult unwrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body(); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + return unwrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).map(new Func1, KeyOperationResult>() { + @Override + public KeyOperationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unwraps a symmetric key using the specified key that was initially used for wrapping that key. + * The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param keyVersion The version of the key. + * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param value the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyOperationResult object + */ + public Observable> unwrapKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (keyVersion == null) { + throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (algorithm == null) { + throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + KeyOperationsParameters parameters = new KeyOperationsParameters(); + parameters.withAlgorithm(algorithm); + parameters.withValue(value); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.unwrapKey(keyName, keyVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unwrapKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unwrapKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + public PagedList getDeletedKeys(final String vaultBaseUrl) { + ServiceResponse> response = getDeletedKeysSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedKeysSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable> getDeletedKeysAsync(final String vaultBaseUrl) { + return getDeletedKeysWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable>> getDeletedKeysWithServiceResponseAsync(final String vaultBaseUrl) { + return getDeletedKeysSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedKeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedKeysSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + public PagedList getDeletedKeys(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getDeletedKeysSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedKeysSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable> getDeletedKeysAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedKeysWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable>> getDeletedKeysWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedKeysSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedKeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedKeysSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedKeys(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedKeysDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedKeyBundle object if successful. + */ + public DeletedKeyBundle getDeletedKey(String vaultBaseUrl, String keyName) { + return getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + public Observable getDeletedKeyAsync(String vaultBaseUrl, String keyName) { + return getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, DeletedKeyBundle>() { + @Override + public DeletedKeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the public part of a deleted key. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedKeyBundle object + */ + public Observable> getDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void purgeDeletedKey(String vaultBaseUrl, String keyName) { + purgeDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture purgeDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable purgeDeletedKeyAsync(String vaultBaseUrl, String keyName) { + return purgeDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified key. + * The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> purgeDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.purgeDeletedKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = purgeDeletedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse purgeDeletedKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyBundle object if successful. + */ + public KeyBundle recoverDeletedKey(String vaultBaseUrl, String keyName) { + return recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); + } + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); + } + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable recoverDeletedKeyAsync(String vaultBaseUrl, String keyName) { + return recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1, KeyBundle>() { + @Override + public KeyBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recovers the deleted key to its latest version. + * The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the deleted key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyBundle object + */ + public Observable> recoverDeletedKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.recoverDeletedKey(keyName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverDeletedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverDeletedKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value).toBlocking().single().body(); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value), serviceCallback); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable setSecretAsync(String vaultBaseUrl, String secretName, String value) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + final Map tags = null; + final String contentType = null; + final SecretAttributes secretAttributes = null; + SecretSetParameters parameters = new SecretSetParameters(); + parameters.withValue(value); + parameters.withTags(null); + parameters.withContentType(null); + parameters.withSecretAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).toBlocking().single().body(); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes), serviceCallback); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable setSecretAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets a secret in a specified key vault. + * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param value The value of the secret. + * @param tags Application specific metadata in the form of key-value pairs. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> setSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String value, Map tags, String contentType, SecretAttributes secretAttributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + Validator.validate(tags); + Validator.validate(secretAttributes); + SecretSetParameters parameters = new SecretSetParameters(); + parameters.withValue(value); + parameters.withTags(tags); + parameters.withContentType(contentType); + parameters.withSecretAttributes(secretAttributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSecretBundle object if successful. + */ + public DeletedSecretBundle deleteSecret(String vaultBaseUrl, String secretName) { + return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + public Observable deleteSecretAsync(String vaultBaseUrl, String secretName) { + return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, DeletedSecretBundle>() { + @Override + public DeletedSecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a secret from a specified key vault. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + public Observable> deleteSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body(); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion), serviceCallback); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String contentType = null; + final SecretAttributes secretAttributes = null; + final Map tags = null; + SecretUpdateParameters parameters = new SecretUpdateParameters(); + parameters.withContentType(null); + parameters.withSecretAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags), serviceCallback); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the attributes associated with a specified secret in a given key vault. + * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param contentType Type of the secret value such as a password. + * @param secretAttributes The secret management attributes. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> updateSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(secretAttributes); + Validator.validate(tags); + SecretUpdateParameters parameters = new SecretUpdateParameters(); + parameters.withContentType(contentType); + parameters.withSecretAttributes(secretAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) { + return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body(); + } + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion), serviceCallback); + } + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { + return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specified secret from a given key vault. + * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param secretVersion The version of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> getSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName, String secretVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (secretVersion == null) { + throw new IllegalArgumentException("Parameter secretVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecret(secretName, secretVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecrets(final String vaultBaseUrl) { + ServiceResponse> response = getSecretsSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsAsync(final String vaultBaseUrl) { + return getSecretsWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl) { + return getSecretsSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecrets(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getSecretsSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsAsync(final String vaultBaseUrl, final Integer maxresults) { + return getSecretsWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getSecretsSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersions(final String vaultBaseUrl, final String secretName) { + ServiceResponse> response = getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName) { + return getSecretVersionsWithServiceResponseAsync(vaultBaseUrl, secretName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName) { + return getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsSinglePageAsync(final String vaultBaseUrl, final String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecretVersions(secretName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersions(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + ServiceResponse> response = getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + return getSecretVersionsWithServiceResponseAsync(vaultBaseUrl, secretName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + return getSecretVersionsSinglePageAsync(vaultBaseUrl, secretName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param maxresults Maximum number of results to return in a page. If not specified, the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsSinglePageAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSecretVersions(secretName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + public PagedList getDeletedSecrets(final String vaultBaseUrl) { + ServiceResponse> response = getDeletedSecretsSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSecretsSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable> getDeletedSecretsAsync(final String vaultBaseUrl) { + return getDeletedSecretsWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable>> getDeletedSecretsWithServiceResponseAsync(final String vaultBaseUrl) { + return getDeletedSecretsSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSecretsSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + public PagedList getDeletedSecrets(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getDeletedSecretsSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSecretsSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable> getDeletedSecretsAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedSecretsWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable>> getDeletedSecretsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedSecretsSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSecretsSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSecrets(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSecretsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedSecretsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSecretBundle object if successful. + */ + public DeletedSecretBundle getDeletedSecret(String vaultBaseUrl, String secretName) { + return getDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + public Observable getDeletedSecretAsync(String vaultBaseUrl, String secretName) { + return getDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, DeletedSecretBundle>() { + @Override + public DeletedSecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified deleted secret. + * The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSecretBundle object + */ + public Observable> getDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void purgeDeletedSecret(String vaultBaseUrl, String secretName) { + purgeDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture purgeDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable purgeDeletedSecretAsync(String vaultBaseUrl, String secretName) { + return purgeDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified secret. + * The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> purgeDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.purgeDeletedSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = purgeDeletedSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse purgeDeletedSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle recoverDeletedSecret(String vaultBaseUrl, String secretName) { + return recoverDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverDeletedSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable recoverDeletedSecretAsync(String vaultBaseUrl, String secretName) { + return recoverDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recovers the deleted secret to the latest version. + * Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the deleted secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> recoverDeletedSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.recoverDeletedSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverDeletedSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverDeletedSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupSecretResult object if successful. + */ + public BackupSecretResult backupSecret(String vaultBaseUrl, String secretName) { + return backupSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body(); + } + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback); + } + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupSecretResult object + */ + public Observable backupSecretAsync(String vaultBaseUrl, String secretName) { + return backupSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1, BackupSecretResult>() { + @Override + public BackupSecretResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Backs up the specified secret. + * Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupSecretResult object + */ + public Observable> backupSecretWithServiceResponseAsync(String vaultBaseUrl, String secretName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.backupSecret(secretName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretBundle object if successful. + */ + public SecretBundle restoreSecret(String vaultBaseUrl, byte[] secretBundleBackup) { + return restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup).toBlocking().single().body(); + } + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup), serviceCallback); + } + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup) { + return restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup).map(new Func1, SecretBundle>() { + @Override + public SecretBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores a backed up secret to a vault. + * Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param secretBundleBackup The backup blob associated with a secret bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretBundle object + */ + public Observable> restoreSecretWithServiceResponseAsync(String vaultBaseUrl, byte[] secretBundleBackup) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (secretBundleBackup == null) { + throw new IllegalArgumentException("Parameter secretBundleBackup is required and cannot be null."); + } + SecretRestoreParameters parameters = new SecretRestoreParameters(); + parameters.withSecretBundleBackup(secretBundleBackup); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.restoreSecret(this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreSecretDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreSecretDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificates(final String vaultBaseUrl) { + ServiceResponse> response = getCertificatesSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesAsync(final String vaultBaseUrl) { + return getCertificatesWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl) { + return getCertificatesSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + final Boolean includePending = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificates(maxresults, includePending, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificates(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + ServiceResponse> response = getCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + return getCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults, includePending) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + return getCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesSinglePageAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificates(maxresults, includePending, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificatesDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedCertificateBundle object if successful. + */ + public DeletedCertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName) { + return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + public Observable deleteCertificateAsync(String vaultBaseUrl, String certificateName) { + return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, DeletedCertificateBundle>() { + @Override + public DeletedCertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + public Observable> deleteCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts) { + return setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts).toBlocking().single().body(); + } + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts), serviceCallback); + } + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts) { + return setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the certificate contacts for the specified key vault. + * Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param contacts The contacts for the key vault certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable> setCertificateContactsWithServiceResponseAsync(String vaultBaseUrl, Contacts contacts) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (contacts == null) { + throw new IllegalArgumentException("Parameter contacts is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(contacts); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateContacts(contacts, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + public Contacts getCertificateContacts(String vaultBaseUrl) { + return getCertificateContactsWithServiceResponseAsync(vaultBaseUrl).toBlocking().single().body(); + } + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateContactsWithServiceResponseAsync(vaultBaseUrl), serviceCallback); + } + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable getCertificateContactsAsync(String vaultBaseUrl) { + return getCertificateContactsWithServiceResponseAsync(vaultBaseUrl).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the certificate contacts for a specified key vault. + * The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable> getCertificateContactsWithServiceResponseAsync(String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateContacts(this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Contacts object if successful. + */ + public Contacts deleteCertificateContacts(String vaultBaseUrl) { + return deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl).toBlocking().single().body(); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl), serviceCallback); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable deleteCertificateContactsAsync(String vaultBaseUrl) { + return deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl).map(new Func1, Contacts>() { + @Override + public Contacts call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the certificate contacts for a specified key vault. + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Contacts object + */ + public Observable> deleteCertificateContactsWithServiceResponseAsync(String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateContacts(this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateContactsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateContactsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuers(final String vaultBaseUrl) { + ServiceResponse> response = getCertificateIssuersSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersAsync(final String vaultBaseUrl) { + return getCertificateIssuersWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl) { + return getCertificateIssuersSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuers(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuers(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificateIssuersWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getCertificateIssuersSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuers(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateIssuersDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider).toBlocking().single().body(); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider), serviceCallback); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (provider == null) { + throw new IllegalArgumentException("Parameter provider is required and cannot be null."); + } + final IssuerCredentials credentials = null; + final OrganizationDetails organizationDetails = null; + final IssuerAttributes attributes = null; + CertificateIssuerSetParameters parameter = new CertificateIssuerSetParameters(); + parameter.withProvider(provider); + parameter.withCredentials(null); + parameter.withOrganizationDetails(null); + parameter.withAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle setCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes), serviceCallback); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return setCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the specified certificate issuer. + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (provider == null) { + throw new IllegalArgumentException("Parameter provider is required and cannot be null."); + } + Validator.validate(credentials); + Validator.validate(organizationDetails); + Validator.validate(attributes); + CertificateIssuerSetParameters parameter = new CertificateIssuerSetParameters(); + parameter.withProvider(provider); + parameter.withCredentials(credentials); + parameter.withOrganizationDetails(organizationDetails); + parameter.withAttributes(attributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String provider = null; + final IssuerCredentials credentials = null; + final OrganizationDetails organizationDetails = null; + final IssuerAttributes attributes = null; + CertificateIssuerUpdateParameters parameter = new CertificateIssuerUpdateParameters(); + parameter.withProvider(null); + parameter.withCredentials(null); + parameter.withOrganizationDetails(null); + parameter.withAttributes(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes), serviceCallback); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param provider The issuer provider. + * @param credentials The credentials to be used for the issuer. + * @param organizationDetails Details of the organization as provided to the issuer. + * @param attributes Attributes of the issuer object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(credentials); + Validator.validate(organizationDetails); + Validator.validate(attributes); + CertificateIssuerUpdateParameters parameter = new CertificateIssuerUpdateParameters(); + parameter.withProvider(provider); + parameter.withCredentials(credentials); + parameter.withOrganizationDetails(organizationDetails); + parameter.withAttributes(attributes); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName) { + return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable getCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the specified certificate issuer. + * The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> getCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IssuerBundle object if successful. + */ + public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName) { + return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body(); + } + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback); + } + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { + return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1, IssuerBundle>() { + @Override + public IssuerBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param issuerName The name of the issuer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IssuerBundle object + */ + public Observable> deleteCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (issuerName == null) { + throw new IllegalArgumentException("Parameter issuerName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateIssuerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateIssuerDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable createCertificateAsync(String vaultBaseUrl, String certificateName) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateCreateParameters parameters = new CertificateCreateParameters(); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate. + * If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateCreateParameters parameters = new CertificateCreateParameters(); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.createCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).toBlocking().single().body(); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate), serviceCallback); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (base64EncodedCertificate == null) { + throw new IllegalArgumentException("Parameter base64EncodedCertificate is required and cannot be null."); + } + final String password = null; + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateImportParameters parameters = new CertificateImportParameters(); + parameters.withBase64EncodedCertificate(base64EncodedCertificate); + parameters.withPassword(null); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate, password, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a certificate into a specified key vault. + * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param base64EncodedCertificate Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + * @param password If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> importCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (base64EncodedCertificate == null) { + throw new IllegalArgumentException("Parameter base64EncodedCertificate is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateImportParameters parameters = new CertificateImportParameters(); + parameters.withBase64EncodedCertificate(base64EncodedCertificate); + parameters.withPassword(password); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.importCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName) { + ServiceResponse> response = getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName) { + return getCertificateVersionsWithServiceResponseAsync(vaultBaseUrl, certificateName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName) { + return getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsSinglePageAsync(final String vaultBaseUrl, final String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateVersions(certificateName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersions(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + ServiceResponse> response = getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + return getCertificateVersionsWithServiceResponseAsync(vaultBaseUrl, certificateName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsWithServiceResponseAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + return getCertificateVersionsSinglePageAsync(vaultBaseUrl, certificateName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsSinglePageAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateVersions(certificateName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateVersionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificatePolicy object if successful. + */ + public CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName) { + return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificatePolicyAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + public Observable getCertificatePolicyAsync(String vaultBaseUrl, String certificateName) { + return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificatePolicy>() { + @Override + public CertificatePolicy call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the policy for a certificate. + * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in a given key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + public Observable> getCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificatePolicy(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificatePolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificatePolicyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificatePolicy object if successful. + */ + public CertificatePolicy updateCertificatePolicy(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + return updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy).toBlocking().single().body(); + } + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy), serviceCallback); + } + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + public Observable updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + return updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy).map(new Func1, CertificatePolicy>() { + @Override + public CertificatePolicy call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the policy for a certificate. + * Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificatePolicy The policy for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificatePolicy object + */ + public Observable> updateCertificatePolicyWithServiceResponseAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificatePolicy == null) { + throw new IllegalArgumentException("Parameter certificatePolicy is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificatePolicy(certificateName, certificatePolicy, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificatePolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificatePolicyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final CertificatePolicy certificatePolicy = null; + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateUpdateParameters parameters = new CertificateUpdateParameters(); + parameters.withCertificatePolicy(null); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given certificate. + * The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given key vault. + * @param certificateVersion The version of the certificate. + * @param certificatePolicy The management policy for the certificate. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> updateCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(certificatePolicy); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateUpdateParameters parameters = new CertificateUpdateParameters(); + parameters.withCertificatePolicy(certificatePolicy); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) { + return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body(); + } + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion), serviceCallback); + } + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a certificate. + * Gets information about a specific certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate in the given vault. + * @param certificateVersion The version of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> getCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, String certificateVersion) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (certificateVersion == null) { + throw new IllegalArgumentException("Parameter certificateVersion is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificate(certificateName, certificateVersion, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + public CertificateOperation updateCertificateOperation(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + return updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested).toBlocking().single().body(); + } + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested), serviceCallback); + } + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable updateCertificateOperationAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + return updateCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName, cancellationRequested).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a certificate operation. + * Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param cancellationRequested Indicates if cancellation was requested on the certificate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable> updateCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + CertificateOperationUpdateParameter certificateOperation = new CertificateOperationUpdateParameter(); + certificateOperation.withCancellationRequested(cancellationRequested); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), certificateOperation, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + public CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName) { + return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable getCertificateOperationAsync(String vaultBaseUrl, String certificateName) { + return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the creation operation of a certificate. + * Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable> getCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateOperation object if successful. + */ + public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName) { + return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName) { + return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateOperation>() { + @Override + public CertificateOperation call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the creation operation for a specific certificate. + * Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateOperation object + */ + public Observable> deleteCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteCertificateOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteCertificateOperationDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).toBlocking().single().body(); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates), serviceCallback); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (x509Certificates == null) { + throw new IllegalArgumentException("Parameter x509Certificates is required and cannot be null."); + } + Validator.validate(x509Certificates); + final CertificateAttributes certificateAttributes = null; + final Map tags = null; + CertificateMergeParameters parameters = new CertificateMergeParameters(); + parameters.withX509Certificates(x509Certificates); + parameters.withCertificateAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.mergeCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = mergeCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags).toBlocking().single().body(); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags), serviceCallback); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable mergeCertificateAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates, certificateAttributes, tags).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param x509Certificates The certificate or the certificate chain to merge. + * @param certificateAttributes The attributes of the certificate (optional). + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> mergeCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName, List x509Certificates, CertificateAttributes certificateAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (x509Certificates == null) { + throw new IllegalArgumentException("Parameter x509Certificates is required and cannot be null."); + } + Validator.validate(x509Certificates); + Validator.validate(certificateAttributes); + Validator.validate(tags); + CertificateMergeParameters parameters = new CertificateMergeParameters(); + parameters.withX509Certificates(x509Certificates); + parameters.withCertificateAttributes(certificateAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.mergeCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = mergeCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse mergeCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupCertificateResult object if successful. + */ + public BackupCertificateResult backupCertificate(String vaultBaseUrl, String certificateName) { + return backupCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupCertificateResult object + */ + public Observable backupCertificateAsync(String vaultBaseUrl, String certificateName) { + return backupCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, BackupCertificateResult>() { + @Override + public BackupCertificateResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Backs up the specified certificate. + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupCertificateResult object + */ + public Observable> backupCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.backupCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle restoreCertificate(String vaultBaseUrl, byte[] certificateBundleBackup) { + return restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup).toBlocking().single().body(); + } + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup), serviceCallback); + } + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup) { + return restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores a backed up certificate to a vault. + * Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateBundleBackup The backup blob associated with a certificate bundle. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> restoreCertificateWithServiceResponseAsync(String vaultBaseUrl, byte[] certificateBundleBackup) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (certificateBundleBackup == null) { + throw new IllegalArgumentException("Parameter certificateBundleBackup is required and cannot be null."); + } + CertificateRestoreParameters parameters = new CertificateRestoreParameters(); + parameters.withCertificateBundleBackup(certificateBundleBackup); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.restoreCertificate(this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + public PagedList getDeletedCertificates(final String vaultBaseUrl) { + ServiceResponse> response = getDeletedCertificatesSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedCertificatesSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable> getDeletedCertificatesAsync(final String vaultBaseUrl) { + return getDeletedCertificatesWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable>> getDeletedCertificatesWithServiceResponseAsync(final String vaultBaseUrl) { + return getDeletedCertificatesSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedCertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedCertificatesSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + final Boolean includePending = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedCertificates(maxresults, includePending, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + public PagedList getDeletedCertificates(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + ServiceResponse> response = getDeletedCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable> getDeletedCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + return getDeletedCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults, includePending) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable>> getDeletedCertificatesWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + return getDeletedCertificatesSinglePageAsync(vaultBaseUrl, maxresults, includePending) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param includePending Specifies whether to include certificates which are not completely provisioned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedCertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedCertificatesSinglePageAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedCertificates(maxresults, includePending, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedCertificatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedCertificatesDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedCertificateBundle object if successful. + */ + public DeletedCertificateBundle getDeletedCertificate(String vaultBaseUrl, String certificateName) { + return getDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + public Observable getDeletedCertificateAsync(String vaultBaseUrl, String certificateName) { + return getDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, DeletedCertificateBundle>() { + @Override + public DeletedCertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about the specified deleted certificate. + * The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedCertificateBundle object + */ + public Observable> getDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void purgeDeletedCertificate(String vaultBaseUrl, String certificateName) { + purgeDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture purgeDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable purgeDeletedCertificateAsync(String vaultBaseUrl, String certificateName) { + return purgeDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified deleted certificate. + * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> purgeDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.purgeDeletedCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = purgeDeletedCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse purgeDeletedCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateBundle object if successful. + */ + public CertificateBundle recoverDeletedCertificate(String vaultBaseUrl, String certificateName) { + return recoverDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body(); + } + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback); + } + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable recoverDeletedCertificateAsync(String vaultBaseUrl, String certificateName) { + return recoverDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1, CertificateBundle>() { + @Override + public CertificateBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recovers the deleted certificate back to its current version under /certificates. + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param certificateName The name of the deleted certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateBundle object + */ + public Observable> recoverDeletedCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.recoverDeletedCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverDeletedCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverDeletedCertificateDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + public PagedList getStorageAccounts(final String vaultBaseUrl) { + ServiceResponse> response = getStorageAccountsSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStorageAccountsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getStorageAccountsSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable> getStorageAccountsAsync(final String vaultBaseUrl) { + return getStorageAccountsWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable>> getStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl) { + return getStorageAccountsSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getStorageAccountsSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getStorageAccounts(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + public PagedList getStorageAccounts(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable> getStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults) { + return getStorageAccountsWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable>> getStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getStorageAccountsSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getStorageAccounts(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStorageAccountsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + public PagedList getDeletedStorageAccounts(final String vaultBaseUrl) { + ServiceResponse> response = getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable> getDeletedStorageAccountsAsync(final String vaultBaseUrl) { + return getDeletedStorageAccountsWithServiceResponseAsync(vaultBaseUrl) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable>> getDeletedStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl) { + return getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedStorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedStorageAccountsSinglePageAsync(final String vaultBaseUrl) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedStorageAccounts(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + public PagedList getDeletedStorageAccounts(final String vaultBaseUrl, final Integer maxresults) { + ServiceResponse> response = getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable> getDeletedStorageAccountsAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedStorageAccountsWithServiceResponseAsync(vaultBaseUrl, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable>> getDeletedStorageAccountsWithServiceResponseAsync(final String vaultBaseUrl, final Integer maxresults) { + return getDeletedStorageAccountsSinglePageAsync(vaultBaseUrl, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedStorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedStorageAccountsSinglePageAsync(final String vaultBaseUrl, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedStorageAccounts(maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedStorageAccountsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedStorageAccountsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedStorageBundle object if successful. + */ + public DeletedStorageBundle getDeletedStorageAccount(String vaultBaseUrl, String storageAccountName) { + return getDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + public Observable getDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return getDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, DeletedStorageBundle>() { + @Override + public DeletedStorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified deleted storage account. + * The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + public Observable> getDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void purgeDeletedStorageAccount(String vaultBaseUrl, String storageAccountName) { + purgeDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return purgeDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified storage account. + * The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> purgeDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.purgeDeletedStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = purgeDeletedStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse purgeDeletedStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle recoverDeletedStorageAccount(String vaultBaseUrl, String storageAccountName) { + return recoverDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return recoverDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recovers the deleted storage account. + * Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> recoverDeletedStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.recoverDeletedStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverDeletedStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverDeletedStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupStorageResult object if successful. + */ + public BackupStorageResult backupStorageAccount(String vaultBaseUrl, String storageAccountName) { + return backupStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStorageResult object + */ + public Observable backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return backupStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, BackupStorageResult>() { + @Override + public BackupStorageResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Backs up the specified storage account. + * Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStorageResult object + */ + public Observable> backupStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.backupStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle restoreStorageAccount(String vaultBaseUrl, byte[] storageBundleBackup) { + return restoreStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageBundleBackup).toBlocking().single().body(); + } + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restoreStorageAccountAsync(String vaultBaseUrl, byte[] storageBundleBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageBundleBackup), serviceCallback); + } + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable restoreStorageAccountAsync(String vaultBaseUrl, byte[] storageBundleBackup) { + return restoreStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageBundleBackup).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores a backed up storage account to a vault. + * Restores a backed up storage account to a vault. This operation requires the storage/restore permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageBundleBackup The backup blob associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> restoreStorageAccountWithServiceResponseAsync(String vaultBaseUrl, byte[] storageBundleBackup) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (storageBundleBackup == null) { + throw new IllegalArgumentException("Parameter storageBundleBackup is required and cannot be null."); + } + StorageRestoreParameters parameters = new StorageRestoreParameters(); + parameters.withStorageBundleBackup(storageBundleBackup); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.restoreStorageAccount(this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedStorageBundle object if successful. + */ + public DeletedStorageBundle deleteStorageAccount(String vaultBaseUrl, String storageAccountName) { + return deleteStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + public Observable deleteStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return deleteStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, DeletedStorageBundle>() { + @Override + public DeletedStorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a storage account. This operation requires the storage/delete permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedStorageBundle object + */ + public Observable> deleteStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName) { + return getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable getStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a specified storage account. This operation requires the storage/get permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> getStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle setStorageAccount(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey) { + return setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey).toBlocking().single().body(); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey), serviceCallback); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey) { + return setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> setStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (resourceId == null) { + throw new IllegalArgumentException("Parameter resourceId is required and cannot be null."); + } + if (activeKeyName == null) { + throw new IllegalArgumentException("Parameter activeKeyName is required and cannot be null."); + } + final String regenerationPeriod = null; + final StorageAccountAttributes storageAccountAttributes = null; + final Map tags = null; + StorageAccountCreateParameters parameters = new StorageAccountCreateParameters(); + parameters.withResourceId(resourceId); + parameters.withActiveKeyName(activeKeyName); + parameters.withAutoRegenerateKey(autoRegenerateKey); + parameters.withRegenerationPeriod(null); + parameters.withStorageAccountAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle setStorageAccount(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + return setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags).toBlocking().single().body(); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags), serviceCallback); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + return setStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new storage account. This operation requires the storage/set permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param resourceId Storage account resource id. + * @param activeKeyName Current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> setStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (resourceId == null) { + throw new IllegalArgumentException("Parameter resourceId is required and cannot be null."); + } + if (activeKeyName == null) { + throw new IllegalArgumentException("Parameter activeKeyName is required and cannot be null."); + } + Validator.validate(storageAccountAttributes); + Validator.validate(tags); + StorageAccountCreateParameters parameters = new StorageAccountCreateParameters(); + parameters.withResourceId(resourceId); + parameters.withActiveKeyName(activeKeyName); + parameters.withAutoRegenerateKey(autoRegenerateKey); + parameters.withRegenerationPeriod(regenerationPeriod); + parameters.withStorageAccountAttributes(storageAccountAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName) { + return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName) { + return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> updateStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String activeKeyName = null; + final Boolean autoRegenerateKey = null; + final String regenerationPeriod = null; + final StorageAccountAttributes storageAccountAttributes = null; + final Map tags = null; + StorageAccountUpdateParameters parameters = new StorageAccountUpdateParameters(); + parameters.withActiveKeyName(null); + parameters.withAutoRegenerateKey(null); + parameters.withRegenerationPeriod(null); + parameters.withStorageAccountAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName, activeKeyName, autoRegenerateKey, regenerationPeriod, storageAccountAttributes, tags).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param activeKeyName The current active storage account key name. + * @param autoRegenerateKey whether keyvault should manage the storage account for the user. + * @param regenerationPeriod The key regeneration time duration specified in ISO-8601 format. + * @param storageAccountAttributes The attributes of the storage account. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> updateStorageAccountWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(storageAccountAttributes); + Validator.validate(tags); + StorageAccountUpdateParameters parameters = new StorageAccountUpdateParameters(); + parameters.withActiveKeyName(activeKeyName); + parameters.withAutoRegenerateKey(autoRegenerateKey); + parameters.withRegenerationPeriod(regenerationPeriod); + parameters.withStorageAccountAttributes(storageAccountAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateStorageAccount(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateStorageAccountDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageBundle object if successful. + */ + public StorageBundle regenerateStorageAccountKey(String vaultBaseUrl, String storageAccountName, String keyName) { + return regenerateStorageAccountKeyWithServiceResponseAsync(vaultBaseUrl, storageAccountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateStorageAccountKeyAsync(String vaultBaseUrl, String storageAccountName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateStorageAccountKeyWithServiceResponseAsync(vaultBaseUrl, storageAccountName, keyName), serviceCallback); + } + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable regenerateStorageAccountKeyAsync(String vaultBaseUrl, String storageAccountName, String keyName) { + return regenerateStorageAccountKeyWithServiceResponseAsync(vaultBaseUrl, storageAccountName, keyName).map(new Func1, StorageBundle>() { + @Override + public StorageBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param keyName The storage account key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageBundle object + */ + public Observable> regenerateStorageAccountKeyWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String keyName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + StorageAccountRegenerteKeyParameters parameters = new StorageAccountRegenerteKeyParameters(); + parameters.withKeyName(keyName); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.regenerateStorageAccountKey(storageAccountName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateStorageAccountKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateStorageAccountKeyDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + public PagedList getSasDefinitions(final String vaultBaseUrl, final String storageAccountName) { + ServiceResponse> response = getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName) { + return getSasDefinitionsWithServiceResponseAsync(vaultBaseUrl, storageAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable>> getSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName) { + return getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSasDefinitionsSinglePageAsync(final String vaultBaseUrl, final String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSasDefinitions(storageAccountName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSasDefinitionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + public PagedList getSasDefinitions(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + ServiceResponse> response = getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable> getSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + return getSasDefinitionsWithServiceResponseAsync(vaultBaseUrl, storageAccountName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable>> getSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + return getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSasDefinitionsSinglePageAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSasDefinitions(storageAccountName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSasDefinitionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSasDefinitionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + public PagedList getDeletedSasDefinitions(final String vaultBaseUrl, final String storageAccountName) { + ServiceResponse> response = getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName) { + return getDeletedSasDefinitionsWithServiceResponseAsync(vaultBaseUrl, storageAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName) { + return getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSasDefinitionsSinglePageAsync(final String vaultBaseUrl, final String storageAccountName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Integer maxresults = null; + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSasDefinitions(storageAccountName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSasDefinitionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + public PagedList getDeletedSasDefinitions(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + ServiceResponse> response = getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable> getDeletedSasDefinitionsAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + return getDeletedSasDefinitionsWithServiceResponseAsync(vaultBaseUrl, storageAccountName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + return getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName, maxresults) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSasDefinitionsSinglePageAsync(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSasDefinitions(storageAccountName, maxresults, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSasDefinitionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedSasDefinitionsDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSasDefinitionBundle object if successful. + */ + public DeletedSasDefinitionBundle getDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return getDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); + } + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback); + } + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + public Observable getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return getDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1, DeletedSasDefinitionBundle>() { + @Override + public DeletedSasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified deleted sas definition. + * The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + public Observable> getDeletedSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getDeletedSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle recoverDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return recoverDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); + } + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback); + } + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return recoverDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recovers the deleted SAS definition. + * Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> recoverDeletedSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.recoverDeletedSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverDeletedSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverDeletedSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedSasDefinitionBundle object if successful. + */ + public DeletedSasDefinitionBundle deleteSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return deleteSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); + } + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback); + } + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + public Observable deleteSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return deleteSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1, DeletedSasDefinitionBundle>() { + @Override + public DeletedSasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedSasDefinitionBundle object + */ + public Observable> deleteSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.deleteSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle getSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return getSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); + } + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback); + } + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable getSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return getSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> getSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.getSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) { + return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod).toBlocking().single().body(); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod), serviceCallback); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) { + return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> setSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (templateUri == null) { + throw new IllegalArgumentException("Parameter templateUri is required and cannot be null."); + } + if (sasType == null) { + throw new IllegalArgumentException("Parameter sasType is required and cannot be null."); + } + if (validityPeriod == null) { + throw new IllegalArgumentException("Parameter validityPeriod is required and cannot be null."); + } + final SasDefinitionAttributes sasDefinitionAttributes = null; + final Map tags = null; + SasDefinitionCreateParameters parameters = new SasDefinitionCreateParameters(); + parameters.withTemplateUri(templateUri); + parameters.withSasType(sasType); + parameters.withValidityPeriod(validityPeriod); + parameters.withSasDefinitionAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags).toBlocking().single().body(); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags), serviceCallback); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> setSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (templateUri == null) { + throw new IllegalArgumentException("Parameter templateUri is required and cannot be null."); + } + if (sasType == null) { + throw new IllegalArgumentException("Parameter sasType is required and cannot be null."); + } + if (validityPeriod == null) { + throw new IllegalArgumentException("Parameter validityPeriod is required and cannot be null."); + } + Validator.validate(sasDefinitionAttributes); + Validator.validate(tags); + SasDefinitionCreateParameters parameters = new SasDefinitionCreateParameters(); + parameters.withTemplateUri(templateUri); + parameters.withSasType(sasType); + parameters.withValidityPeriod(validityPeriod); + parameters.withSasDefinitionAttributes(sasDefinitionAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.setSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle updateSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + return updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> updateSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final String templateUri = null; + final SasTokenType sasType = null; + final String validityPeriod = null; + final SasDefinitionAttributes sasDefinitionAttributes = null; + final Map tags = null; + SasDefinitionUpdateParameters parameters = new SasDefinitionUpdateParameters(); + parameters.withTemplateUri(null); + parameters.withSasType(null); + parameters.withValidityPeriod(null); + parameters.withSasDefinitionAttributes(null); + parameters.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SasDefinitionBundle object if successful. + */ + public SasDefinitionBundle updateSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + return updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags).toBlocking().single().body(); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags), serviceCallback); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable updateSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + return updateSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, sasDefinitionAttributes, tags).map(new Func1, SasDefinitionBundle>() { + @Override + public SasDefinitionBundle call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission. + * + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param storageAccountName The name of the storage account. + * @param sasDefinitionName The name of the SAS definition. + * @param templateUri The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + * @param sasType The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' + * @param validityPeriod The validity period of SAS tokens created according to the SAS definition. + * @param sasDefinitionAttributes The attributes of the SAS definition. + * @param tags Application specific metadata in the form of key-value pairs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SasDefinitionBundle object + */ + public Observable> updateSasDefinitionWithServiceResponseAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod, SasDefinitionAttributes sasDefinitionAttributes, Map tags) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (sasDefinitionName == null) { + throw new IllegalArgumentException("Parameter sasDefinitionName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(sasDefinitionAttributes); + Validator.validate(tags); + SasDefinitionUpdateParameters parameters = new SasDefinitionUpdateParameters(); + parameters.withTemplateUri(templateUri); + parameters.withSasType(sasType); + parameters.withValidityPeriod(validityPeriod); + parameters.withSasDefinitionAttributes(sasDefinitionAttributes); + parameters.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service.updateSasDefinition(storageAccountName, sasDefinitionName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateSasDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateSasDefinitionDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeyVersionsNext(final String nextPageLink) { + ServiceResponse> response = getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeyVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeyVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeyVersionsNextAsync(final String nextPageLink) { + return getKeyVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeyVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getKeyVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeyVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves a list of individual key versions with the same key name. + * The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeyVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getKeyVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeyVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeyVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyItem> object if successful. + */ + public PagedList getKeysNext(final String nextPageLink) { + ServiceResponse> response = getKeysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getKeysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable> getKeysNextAsync(final String nextPageLink) { + return getKeysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyItem> object + */ + public Observable>> getKeysNextWithServiceResponseAsync(final String nextPageLink) { + return getKeysNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getKeysNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getKeysNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getKeysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getKeysNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedKeyItem> object if successful. + */ + public PagedList getDeletedKeysNext(final String nextPageLink) { + ServiceResponse> response = getDeletedKeysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedKeysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable> getDeletedKeysNextAsync(final String nextPageLink) { + return getDeletedKeysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedKeyItem> object + */ + public Observable>> getDeletedKeysNextWithServiceResponseAsync(final String nextPageLink) { + return getDeletedKeysNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted keys in the specified vault. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedKeyItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedKeysNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getDeletedKeysNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedKeysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedKeysNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretsNext(final String nextPageLink) { + ServiceResponse> response = getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretsNextAsync(final String nextPageLink) { + return getSecretsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretsNextWithServiceResponseAsync(final String nextPageLink) { + return getSecretsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List secrets in a specified key vault. + * The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSecretsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecretItem> object if successful. + */ + public PagedList getSecretVersionsNext(final String nextPageLink) { + ServiceResponse> response = getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSecretVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSecretVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable> getSecretVersionsNextAsync(final String nextPageLink) { + return getSecretVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretItem> object + */ + public Observable>> getSecretVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getSecretVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSecretVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all versions of the specified secret. + * The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSecretVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSecretVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSecretVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSecretVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSecretItem> object if successful. + */ + public PagedList getDeletedSecretsNext(final String nextPageLink) { + ServiceResponse> response = getDeletedSecretsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSecretsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSecretsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable> getDeletedSecretsNextAsync(final String nextPageLink) { + return getDeletedSecretsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSecretItem> object + */ + public Observable>> getDeletedSecretsNextWithServiceResponseAsync(final String nextPageLink) { + return getDeletedSecretsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSecretsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted secrets for the specified vault. + * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSecretItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSecretsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getDeletedSecretsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSecretsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedSecretsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificatesNext(final String nextPageLink) { + ServiceResponse> response = getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificatesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificatesNextAsync(final String nextPageLink) { + return getCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificatesNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificatesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificates in a specified key vault. + * The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificatesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificatesNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificatesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificatesNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateIssuerItem> object if successful. + */ + public PagedList getCertificateIssuersNext(final String nextPageLink) { + ServiceResponse> response = getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateIssuersNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateIssuersNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable> getCertificateIssuersNextAsync(final String nextPageLink) { + return getCertificateIssuersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateIssuerItem> object + */ + public Observable>> getCertificateIssuersNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificateIssuersNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateIssuersNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateIssuerItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateIssuersNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificateIssuersNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateIssuersNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateIssuersNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateItem> object if successful. + */ + public PagedList getCertificateVersionsNext(final String nextPageLink) { + ServiceResponse> response = getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCertificateVersionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getCertificateVersionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable> getCertificateVersionsNextAsync(final String nextPageLink) { + return getCertificateVersionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateItem> object + */ + public Observable>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) { + return getCertificateVersionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the versions of a certificate. + * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getCertificateVersionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getCertificateVersionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getCertificateVersionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCertificateVersionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedCertificateItem> object if successful. + */ + public PagedList getDeletedCertificatesNext(final String nextPageLink) { + ServiceResponse> response = getDeletedCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedCertificatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedCertificatesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable> getDeletedCertificatesNextAsync(final String nextPageLink) { + return getDeletedCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedCertificateItem> object + */ + public Observable>> getDeletedCertificatesNextWithServiceResponseAsync(final String nextPageLink) { + return getDeletedCertificatesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedCertificatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the deleted certificates in the specified vault currently available for recovery. + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedCertificateItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedCertificatesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getDeletedCertificatesNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedCertificatesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedCertificatesNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountItem> object if successful. + */ + public PagedList getStorageAccountsNext(final String nextPageLink) { + ServiceResponse> response = getStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStorageAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getStorageAccountsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable> getStorageAccountsNextAsync(final String nextPageLink) { + return getStorageAccountsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountItem> object + */ + public Observable>> getStorageAccountsNextWithServiceResponseAsync(final String nextPageLink) { + return getStorageAccountsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getStorageAccountsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getStorageAccountsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getStorageAccountsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStorageAccountsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedStorageAccountItem> object if successful. + */ + public PagedList getDeletedStorageAccountsNext(final String nextPageLink) { + ServiceResponse> response = getDeletedStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedStorageAccountsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedStorageAccountsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable> getDeletedStorageAccountsNextAsync(final String nextPageLink) { + return getDeletedStorageAccountsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedStorageAccountItem> object + */ + public Observable>> getDeletedStorageAccountsNextWithServiceResponseAsync(final String nextPageLink) { + return getDeletedStorageAccountsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedStorageAccountsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted storage accounts for the specified vault. + * The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedStorageAccountItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedStorageAccountsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getDeletedStorageAccountsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedStorageAccountsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedStorageAccountsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SasDefinitionItem> object if successful. + */ + public PagedList getSasDefinitionsNext(final String nextPageLink) { + ServiceResponse> response = getSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSasDefinitionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSasDefinitionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable> getSasDefinitionsNextAsync(final String nextPageLink) { + return getSasDefinitionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SasDefinitionItem> object + */ + public Observable>> getSasDefinitionsNextWithServiceResponseAsync(final String nextPageLink) { + return getSasDefinitionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSasDefinitionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSasDefinitionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSasDefinitionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSasDefinitionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws KeyVaultErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedSasDefinitionItem> object if successful. + */ + public PagedList getDeletedSasDefinitionsNext(final String nextPageLink) { + ServiceResponse> response = getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeletedSasDefinitionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable> getDeletedSasDefinitionsNextAsync(final String nextPageLink) { + return getDeletedSasDefinitionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedSasDefinitionItem> object + */ + public Observable>> getDeletedSasDefinitionsNextWithServiceResponseAsync(final String nextPageLink) { + return getDeletedSasDefinitionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSasDefinitionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted SAS definitions for the specified vault and storage account. + * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedSasDefinitionItem> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getDeletedSasDefinitionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getDeletedSasDefinitionsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDeletedSasDefinitionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeletedSasDefinitionsNextDelegate(Response response) throws KeyVaultErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., KeyVaultErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(KeyVaultErrorException.class) + .build(response); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java new file mode 100644 index 0000000000000..043b28cf4742d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java @@ -0,0 +1,1941 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + */ + +package com.microsoft.azure.keyvault.implementation; + +import java.util.List; +import java.util.Map; + +import com.google.common.base.Joiner; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.CertificateIdentifier; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.KeyVaultClientCustom; +import com.microsoft.azure.keyvault.SecretIdentifier; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateCreateParameters; +import com.microsoft.azure.keyvault.models.CertificateImportParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateIssuerSetParameters; +import com.microsoft.azure.keyvault.models.CertificateIssuerUpdateParameters; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateMergeParameters; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.CertificateUpdateParameters; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.DeletedCertificateItem; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyCreateParameters; +import com.microsoft.azure.keyvault.models.KeyImportParameters; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyOperationsParameters; +import com.microsoft.azure.keyvault.models.KeyRestoreParameters; +import com.microsoft.azure.keyvault.models.KeySignParameters; +import com.microsoft.azure.keyvault.models.KeyUpdateParameters; +import com.microsoft.azure.keyvault.models.KeyVerifyParameters; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.models.SecretSetParameters; +import com.microsoft.azure.keyvault.models.SecretUpdateParameters; +import com.microsoft.azure.keyvault.requests.CreateCertificateRequest; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.ImportCertificateRequest; +import com.microsoft.azure.keyvault.requests.ImportKeyRequest; +import com.microsoft.azure.keyvault.requests.MergeCertificateRequest; +import com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateOperationRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificatePolicyRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateRequest; +import com.microsoft.azure.keyvault.requests.UpdateKeyRequest; +import com.microsoft.azure.keyvault.requests.UpdateSecretRequest; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.protocol.SerializerAdapter; + +import okhttp3.OkHttpClient; +import okhttp3.ResponseBody; +import retrofit2.Response; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HTTP; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import rx.Observable; +import rx.functions.Func1; + +/** + * Implementation of Key Vault Custom Client to maintain backwards compatibility. + * +*/ +public class KeyVaultClientCustomImpl extends KeyVaultClientBaseImpl implements KeyVaultClientCustom { + + private KeyVaultClientService service; + private AzureClient azureClient; + + protected KeyVaultClientCustomImpl(ServiceClientCredentials credentials) { + super(credentials); + } + + protected KeyVaultClientCustomImpl(RestClient restClient) { + super(restClient); + } + + /** + * Intializes the service. + */ + public void initializeService() { + service = restClient().retrofit().create(KeyVaultClientService.class); + } + + @Override + public OkHttpClient httpClient() { + return super.httpClient(); + } + + @Override + public SerializerAdapter serializerAdapter() { + return super.serializerAdapter(); + } + + /** + * The interface defining all the services for KeyVaultClient to be used by + * Retrofit to perform actually REST calls. + */ + interface KeyVaultClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient createKey" }) + @POST("keys/{key-name}/create") + Observable> createKey(@Path("key-name") String keyName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body KeyCreateParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, + @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient importKey" }) + @PUT("keys/{key-name}") + Observable> importKey(@Path("key-name") String keyName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body KeyImportParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, + @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteKey" }) + @HTTP(path = "keys/{key-name}", method = "DELETE", hasBody = true) + Observable> deleteKey(@Path("key-name") String keyName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateKey" }) + @PATCH("keys/{key-name}/{key-version}") + Observable> updateKey(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyUpdateParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKey" }) + @GET("keys/{key-name}/{key-version}") + Observable> getKey(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeyVersions" }) + @GET("keys/{key-name}/versions") + Observable> getKeyVersions(@Path("key-name") String keyName, + @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeys" }) + @GET("keys") + Observable> getKeys(@Query("maxresults") Integer maxresults, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient backupKey" }) + @POST("keys/{key-name}/backup") + Observable> backupKey(@Path("key-name") String keyName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient restoreKey" }) + @POST("keys/restore") + Observable> restoreKey(@Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyRestoreParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient encrypt" }) + @POST("keys/{key-name}/{key-version}/encrypt") + Observable> encrypt(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient decrypt" }) + @POST("keys/{key-name}/{key-version}/decrypt") + Observable> decrypt(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient sign" }) + @POST("keys/{key-name}/{key-version}/sign") + Observable> sign(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeySignParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient verify" }) + @POST("keys/{key-name}/{key-version}/verify") + Observable> verify(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyVerifyParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient wrapKey" }) + @POST("keys/{key-name}/{key-version}/wrapkey") + Observable> wrapKey(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient unwrapKey" }) + @POST("keys/{key-name}/{key-version}/unwrapkey") + Observable> unwrapKey(@Path("key-name") String keyName, + @Path("key-version") String keyVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body KeyOperationsParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setSecret" }) + @PUT("secrets/{secret-name}") + Observable> setSecret(@Path("secret-name") String secretName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body SecretSetParameters parameters, @Header("x-ms-parameterized-host") String parameterizedHost, + @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteSecret" }) + @HTTP(path = "secrets/{secret-name}", method = "DELETE", hasBody = true) + Observable> deleteSecret(@Path("secret-name") String secretName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateSecret" }) + @PATCH("secrets/{secret-name}/{secret-version}") + Observable> updateSecret(@Path("secret-name") String secretName, + @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body SecretUpdateParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecret" }) + @GET("secrets/{secret-name}/{secret-version}") + Observable> getSecret(@Path("secret-name") String secretName, + @Path("secret-version") String secretVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecrets" }) + @GET("secrets") + Observable> getSecrets(@Query("maxresults") Integer maxresults, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretVersions" }) + @GET("secrets/{secret-name}/versions") + Observable> getSecretVersions(@Path("secret-name") String secretName, + @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificates" }) + @GET("certificates") + Observable> getCertificates(@Query("maxresults") Integer maxresults, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificate" }) + @HTTP(path = "certificates/{certificate-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificate(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setCertificateContacts" }) + @PUT("certificates/contacts") + Observable> setCertificateContacts(@Body Contacts contacts, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateContacts" }) + @GET("certificates/contacts") + Observable> getCertificateContacts(@Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateContacts" }) + @HTTP(path = "certificates/contacts", method = "DELETE", hasBody = true) + Observable> deleteCertificateContacts(@Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuers" }) + @GET("certificates/issuers") + Observable> getCertificateIssuers(@Query("maxresults") Integer maxresults, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient setCertificateIssuer" }) + @PUT("certificates/issuers/{issuer-name}") + Observable> setCertificateIssuer(@Path("issuer-name") String issuerName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateIssuerSetParameters parameter, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificateIssuer" }) + @PATCH("certificates/issuers/{issuer-name}") + Observable> updateCertificateIssuer(@Path("issuer-name") String issuerName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateIssuerUpdateParameters parameter, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuer" }) + @GET("certificates/issuers/{issuer-name}") + Observable> getCertificateIssuer(@Path("issuer-name") String issuerName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateIssuer" }) + @HTTP(path = "certificates/issuers/{issuer-name}", method = "DELETE", hasBody = true) + Observable> deleteCertificateIssuer(@Path("issuer-name") String issuerName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient createCertificate" }) + @POST("certificates/{certificate-name}/create") + Observable> createCertificate(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateCreateParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient importCertificate" }) + @POST("certificates/{certificate-name}/import") + Observable> importCertificate(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateImportParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateVersions" }) + @GET("certificates/{certificate-name}/versions") + Observable> getCertificateVersions(@Path("certificate-name") String certificateName, + @Query("maxresults") Integer maxresults, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificatePolicy" }) + @GET("certificates/{certificate-name}/policy") + Observable> getCertificatePolicy(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificatePolicy" }) + @PATCH("certificates/{certificate-name}/policy") + Observable> updateCertificatePolicy(@Path("certificate-name") String certificateName, + @Body CertificatePolicy certificatePolicy, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificate" }) + @PATCH("certificates/{certificate-name}/{certificate-version}") + Observable> updateCertificate(@Path("certificate-name") String certificateName, + @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, @Body CertificateUpdateParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificate" }) + @GET("certificates/{certificate-name}/{certificate-version}") + Observable> getCertificate(@Path("certificate-name") String certificateName, + @Path("certificate-version") String certificateVersion, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient updateCertificateOperation" }) + @PATCH("certificates/{certificate-name}/pending") + Observable> updateCertificateOperation(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateOperationUpdateParameter certificateOperation, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateOperation" }) + @GET("certificates/{certificate-name}/pending") + Observable> getCertificateOperation(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient deleteCertificateOperation" }) + @HTTP(path = "certificates/{certificate-name}/pending", method = "DELETE", hasBody = true) + Observable> deleteCertificateOperation(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient mergeCertificate" }) + @POST("certificates/{certificate-name}/pending/merge") + Observable> mergeCertificate(@Path("certificate-name") String certificateName, + @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, + @Body CertificateMergeParameters parameters, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeyVersionsNext" }) + @GET + Observable> getKeyVersionsNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getKeysNext" }) + @GET + Observable> getKeysNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretsNext" }) + @GET + Observable> getSecretsNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getSecretVersionsNext" }) + @GET + Observable> getSecretVersionsNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificatesNext" }) + @GET + Observable> getCertificatesNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateIssuersNext" }) + @GET + Observable> getCertificateIssuersNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getCertificateVersionsNext" }) + @GET + Observable> getCertificateVersionsNext(@Url String nextUrl, + @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "Accept: application/pkcs10", + "x-ms-logging-context: com.microsoft.azure.keyvault.KeyVaultClient getPendingCertificateSigningRequest" }) + @GET("certificates/{certificate-name}/pending") + Observable> getPendingCertificateSigningRequest( + @Path("certificate-name") String certificateName, @Query("api-version") String apiVersion, + @Header("accept-language") String acceptLanguage, + @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. Authorization: Requires the keys/create permission. + * + * @param createKeyRequest + * the grouped properties for creating a key request + * @return the KeyBundle if successful. + */ + public KeyBundle createKey(CreateKeyRequest createKeyRequest) { + + return createKey(createKeyRequest.vaultBaseUrl(), createKeyRequest.keyName(), createKeyRequest.keyType(), + createKeyRequest.keySize(), createKeyRequest.keyOperations(), createKeyRequest.keyAttributes(), + createKeyRequest.tags(), createKeyRequest.curve()); + } + + /** + * Creates a new key, stores it, then returns key parameters and attributes to + * the client. The create key operation can be used to create any key type in + * Azure Key Vault. If the named key already exists, Azure Key Vault creates a + * new version of the key. Authorization: Requires the keys/create permission. + * + * @param createKeyRequest + * the grouped properties for creating a key request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createKeyAsync(CreateKeyRequest createKeyRequest, + ServiceCallback serviceCallback) { + createKeyRequest.vaultBaseUrl(); + return createKeyAsync(createKeyRequest.vaultBaseUrl(), createKeyRequest.keyName(), createKeyRequest.keyType(), + createKeyRequest.keySize(), createKeyRequest.keyOperations(), createKeyRequest.keyAttributes(), + createKeyRequest.tags(), createKeyRequest.curve(), serviceCallback); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and + * attributes to the client. The import key operation may be used to import any + * key type into an Azure Key Vault. If the named key already exists, Azure Key + * Vault creates a new version of the key. Authorization: requires the + * keys/import permission. + * + * @param importKeyRequest + * the grouped properties for importing a key request + * @return the KeyBundle if successful. + */ + public KeyBundle importKey(ImportKeyRequest importKeyRequest) { + return importKey(importKeyRequest.vaultBaseUrl(), importKeyRequest.keyName(), importKeyRequest.key(), + importKeyRequest.isHsm(), importKeyRequest.keyAttributes(), importKeyRequest.tags()); + } + + /** + * Imports an externally created key, stores it, and returns key parameters and + * attributes to the client. The import key operation may be used to import any + * key type into an Azure Key Vault. If the named key already exists, Azure Key + * Vault creates a new version of the key. Authorization: requires the + * keys/import permission. + * + * @param importKeyRequest + * the grouped properties for importing a key request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importKeyAsync(ImportKeyRequest importKeyRequest, + final ServiceCallback serviceCallback) { + return importKeyAsync(importKeyRequest.vaultBaseUrl(), importKeyRequest.keyName(), importKeyRequest.key(), + importKeyRequest.isHsm(), importKeyRequest.keyAttributes(), importKeyRequest.tags(), serviceCallback); + } + + /** + * The update key operation changes specified attributes of a stored key and can + * be applied to any key type and key version stored in Azure Key Vault. The + * cryptographic material of a key itself cannot be changed. In order to perform + * this operation, the key must already exist in the Key Vault. Authorization: + * requires the keys/update permission. + * + * @param updateKeyRequest + * the grouped properties for updating a key request + * @return the KeyBundle if successful. + */ + public KeyBundle updateKey(UpdateKeyRequest updateKeyRequest) { + return updateKey(updateKeyRequest.vaultBaseUrl(), updateKeyRequest.keyName(), updateKeyRequest.keyVersion(), + updateKeyRequest.keyOperations(), updateKeyRequest.keyAttributes(), updateKeyRequest.tags()); + } + + /** + * The update key operation changes specified attributes of a stored key and can + * be applied to any key type and key version stored in Azure Key Vault. The + * cryptographic material of a key itself cannot be changed. In order to perform + * this operation, the key must already exist in the Key Vault. Authorization: + * requires the keys/update permission. + * + * @param updateKeyRequest + * the grouped properties for updating a key request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateKeyAsync(UpdateKeyRequest updateKeyRequest, + final ServiceCallback serviceCallback) { + return updateKeyAsync(updateKeyRequest.vaultBaseUrl(), updateKeyRequest.keyName(), + updateKeyRequest.keyVersion(), updateKeyRequest.keyOperations(), updateKeyRequest.keyAttributes(), + updateKeyRequest.tags(), serviceCallback); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to + * all key types. If the requested key is symmetric, then no key material is + * released in the response. Authorization: Requires the keys/get permission. + * + * @param keyIdentifier + * The full key identifier + * @return the KeyBundle if successful. + */ + public KeyBundle getKey(String keyIdentifier) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return getKey(id.vault(), id.name(), id.version() == null ? "" : id.version()); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to + * all key types. If the requested key is symmetric, then no key material is + * released in the response. Authorization: Requires the keys/get permission. + * + * @param keyIdentifier + * The full key identifier + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getKeyAsync(String keyIdentifier, + final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return getKeyAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), serviceCallback); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to + * all key types. If the requested key is symmetric, then no key material is + * released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @return the KeyBundle if successful. + */ + public KeyBundle getKey(String vaultBaseUrl, String keyName) { + return getKey(vaultBaseUrl, keyName, ""); + } + + /** + * Gets the public part of a stored key. The get key operation is applicable to + * all key types. If the requested key is symmetric, then no key material is + * released in the response. Authorization: Requires the keys/get permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, + final ServiceCallback serviceCallback) { + return getKeyAsync(vaultBaseUrl, keyName, "", serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @return the PagedList<KeyItem> if successful. + */ + public PagedList listKeyVersions(final String vaultBaseUrl, final String keyName) { + return getKeyVersions(vaultBaseUrl, keyName); + } + + /** + * Wraps a symmetric key using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be wrapped + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture wrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return wrapKeyAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, + serviceCallback); + } + + /** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be unwrapped + * @return the KeyOperationResult if successful. + */ + public KeyOperationResult unwrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return unwrapKey(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value); + } + + /** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be unwrapped + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unwrapKeyAsync(String keyIdentifier, + JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, + final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return unwrapKeyAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, + serviceCallback); + } + + /** + * Wraps a symmetric key using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the key to be wrapped + * @return the KeyOperationResult if successful. + */ + public KeyOperationResult wrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return wrapKey(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, + final ListOperationCallback serviceCallback) { + return getKeyVersionsAsync(vaultBaseUrl, keyName, serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, + final Integer maxresults, final ListOperationCallback serviceCallback) { + return getKeyVersionsAsync(vaultBaseUrl, keyName, maxresults, serviceCallback); + } + + /** + * Retrieves a list of individual key versions with the same key name. The full + * key identifier, attributes, and tags are provided in the response. + * Authorization: Requires the keys/list permission. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<KeyItem> if successful. + */ + public PagedList listKeyVersions(final String vaultBaseUrl, final String keyName, + final Integer maxresults) { + return getKeyVersions(vaultBaseUrl, keyName, maxresults); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @return the PagedList<KeyItem> if successful. + */ + public PagedList listKeys(final String vaultBaseUrl) { + return getKeys(vaultBaseUrl); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listKeysAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback) { + return getKeysAsync(vaultBaseUrl, serviceCallback); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listKeysAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback) { + return getKeysAsync(vaultBaseUrl, maxresults, serviceCallback); + } + + /** + * List keys in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<KeyItem> if successful. + */ + public PagedList listKeys(final String vaultBaseUrl, final Integer maxresults) { + return getKeys(vaultBaseUrl, maxresults); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in a key vault. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be encrypted + * @return the KeyOperationResult if successful. + */ + public KeyOperationResult encrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return encrypt(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value); + } + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in a key vault. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be encrypted + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture encryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return encryptAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, + serviceCallback); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be decrypted + * @return the KeyOperationResult if successful. + */ + public KeyOperationResult decrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return decrypt(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value); + } + + /** + * Decrypts a single block of encrypted data. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be decrypted + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture decryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return decryptAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, + serviceCallback); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be signed + * @return the KeyOperationResult if successful. + */ + public KeyOperationResult sign(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return sign(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value); + } + + /** + * Creates a signature from a digest using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * algorithm identifier + * @param value + * the content to be signed + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture signAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, + byte[] value, final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return signAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, + serviceCallback); + } + + /** + * Verifies a signature using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * The signing/verification algorithm. For more information on + * possible algorithm types, see JsonWebKeySignatureAlgorithm. + * @param digest + * The digest used for signing + * @param signature + * The signature to be verified + * @return the KeyVerifyResult if successful. + */ + public KeyVerifyResult verify(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, + byte[] signature) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return verify(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, digest, signature); + } + + /** + * Verifies a signature using the specified key. + * + * @param keyIdentifier + * The full key identifier + * @param algorithm + * The signing/verification algorithm. For more information on + * possible algorithm types, see JsonWebKeySignatureAlgorithm. + * @param digest + * The digest used for signing + * @param signature + * The signature to be verified + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, + byte[] digest, byte[] signature, final ServiceCallback serviceCallback) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + return verifyAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, digest, + signature, serviceCallback); + } + + /** + * Sets a secret in the specified vault. + * + * @param setSecretRequest + * the grouped properties for setting a secret request + * @return the SecretBundle if successful. + */ + public SecretBundle setSecret(SetSecretRequest setSecretRequest) { + return setSecret(setSecretRequest.vaultBaseUrl(), setSecretRequest.secretName(), setSecretRequest.value(), + setSecretRequest.tags(), setSecretRequest.contentType(), setSecretRequest.secretAttributes()); + } + + /** + * Sets a secret in the specified vault. + * + * @param setSecretRequest + * the grouped properties for setting a secret request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSecretAsync(SetSecretRequest setSecretRequest, + final ServiceCallback serviceCallback) { + return setSecretAsync(setSecretRequest.vaultBaseUrl(), setSecretRequest.secretName(), setSecretRequest.value(), + setSecretRequest.tags(), setSecretRequest.contentType(), setSecretRequest.secretAttributes(), + serviceCallback); + } + + /** + * Updates the attributes associated with a specified secret in a given key + * vault. + * + * @param updateSecretRequest + * the grouped properties for updating a secret request + * @return the SecretBundle if successful. + */ + public SecretBundle updateSecret(UpdateSecretRequest updateSecretRequest) { + return updateSecret(updateSecretRequest.vaultBaseUrl(), updateSecretRequest.secretName(), + updateSecretRequest.secretVersion(), updateSecretRequest.contentType(), + updateSecretRequest.secretAttributes(), updateSecretRequest.tags()); + } + + /** + * Updates the attributes associated with a specified secret in a given key + * vault. + * + * @param updateSecretRequest + * the grouped properties for updating a secret request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSecretAsync(UpdateSecretRequest updateSecretRequest, + final ServiceCallback serviceCallback) { + return updateSecretAsync(updateSecretRequest.vaultBaseUrl(), updateSecretRequest.secretName(), + updateSecretRequest.secretVersion(), updateSecretRequest.contentType(), + updateSecretRequest.secretAttributes(), updateSecretRequest.tags(), serviceCallback); + } + + /** + * Get a specified secret from a given key vault. + * + * @param secretIdentifier + * The URL for the secret. + * @return the SecretBundle if successful. + */ + public SecretBundle getSecret(String secretIdentifier) { + SecretIdentifier id = new SecretIdentifier(secretIdentifier); + return getSecret(id.vault(), id.name(), id.version() == null ? "" : id.version()); + } + + /** + * Get a specified secret from a given key vault. + * + * @param secretIdentifier + * The URL for the secret. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSecretAsync(String secretIdentifier, + final ServiceCallback serviceCallback) { + SecretIdentifier id = new SecretIdentifier(secretIdentifier); + return getSecretAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), serviceCallback); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @return the SecretBundle if successful. + */ + public SecretBundle getSecret(String vaultBaseUrl, String secretName) { + return getSecret(vaultBaseUrl, secretName, ""); + } + + /** + * Get a specified secret from a given key vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, + final ServiceCallback serviceCallback) { + return getSecretAsync(vaultBaseUrl, secretName, "", serviceCallback); + } + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @return the PagedList<SecretItem> if successful. + */ + public PagedList listSecrets(final String vaultBaseUrl) { + return getSecrets(vaultBaseUrl); + } + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback) { + return getSecretsAsync(vaultBaseUrl, serviceCallback); + } + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<SecretItem> if successful. + */ + public PagedList listSecrets(final String vaultBaseUrl, final Integer maxresults) { + return getSecrets(vaultBaseUrl, maxresults); + } + + /** + * List secrets in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final Integer maxresults, + final ListOperationCallback serviceCallback) { + return getSecretsAsync(vaultBaseUrl, maxresults, serviceCallback); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @return the PagedList<SecretItem> if successful. + */ + public PagedList listSecretVersions(final String vaultBaseUrl, final String secretName) { + return getSecretVersions(vaultBaseUrl, secretName); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, + final ListOperationCallback serviceCallback) { + return getSecretVersionsAsync(vaultBaseUrl, secretName, serviceCallback); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<SecretItem> if successful. + */ + public PagedList listSecretVersions(final String vaultBaseUrl, final String secretName, + final Integer maxresults) { + return getSecretVersions(vaultBaseUrl, secretName, maxresults); + } + + /** + * List the versions of the specified secret. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, + final Integer maxresults, final ListOperationCallback serviceCallback) { + return getSecretVersionsAsync(vaultBaseUrl, secretName, maxresults, serviceCallback); + } + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @return the PagedList<CertificateItem> if successful. + */ + public PagedList listCertificates(final String vaultBaseUrl) { + return getCertificates(vaultBaseUrl); + } + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback) { + return getCertificatesAsync(vaultBaseUrl, serviceCallback); + } + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<CertificateItem> if successful. + */ + public PagedList listCertificates(final String vaultBaseUrl, final Integer maxresults) { + return getCertificates(vaultBaseUrl, maxresults); + } + + /** + * List certificates in the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, + final Integer maxresults, final ListOperationCallback serviceCallback) { + return getCertificatesAsync(vaultBaseUrl, maxresults, serviceCallback); + } + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @return the PagedList<CertificateIssuerItem> if successful. + */ + public PagedList listCertificateIssuers(final String vaultBaseUrl) { + return getCertificateIssuers(vaultBaseUrl); + } + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, + final ListOperationCallback serviceCallback) { + return getCertificateIssuersAsync(vaultBaseUrl, serviceCallback); + } + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<CertificateIssuerItem> if successful. + */ + public PagedList listCertificateIssuers(final String vaultBaseUrl, + final Integer maxresults) { + return getCertificateIssuers(vaultBaseUrl, maxresults); + } + + /** + * List certificate issuers for the specified vault. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, + final Integer maxresults, final ListOperationCallback serviceCallback) { + return getCertificateIssuersAsync(vaultBaseUrl, maxresults, serviceCallback); + } + + /** + * Sets the certificate contacts for the specified vault. + * + * @param setCertificateIssuerRequest + * the grouped properties for setting a certificate issuer request + * @return the IssuerBundle if successful. + */ + public IssuerBundle setCertificateIssuer(SetCertificateIssuerRequest setCertificateIssuerRequest) { + return setCertificateIssuer(setCertificateIssuerRequest.vaultBaseUrl(), + setCertificateIssuerRequest.issuerName(), setCertificateIssuerRequest.provider(), + setCertificateIssuerRequest.credentials(), setCertificateIssuerRequest.organizationDetails(), + setCertificateIssuerRequest.attributes()); + } + + /** + * Sets the certificate contacts for the specified vault. + * + * @param setCertificateIssuerRequest + * the grouped properties for setting a certificate issuer request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setCertificateIssuerAsync( + SetCertificateIssuerRequest setCertificateIssuerRequest, + final ServiceCallback serviceCallback) { + return setCertificateIssuerAsync(setCertificateIssuerRequest.vaultBaseUrl(), + setCertificateIssuerRequest.issuerName(), setCertificateIssuerRequest.provider(), + setCertificateIssuerRequest.credentials(), setCertificateIssuerRequest.organizationDetails(), + setCertificateIssuerRequest.attributes(), serviceCallback); + } + + /** + * Updates the specified certificate issuer. + * + * @param updateCertificateIssuerRequest + * the grouped properties for updating a certificate issuer request + * @return the IssuerBundle if successful. + */ + public IssuerBundle updateCertificateIssuer(UpdateCertificateIssuerRequest updateCertificateIssuerRequest) { + return updateCertificateIssuer(updateCertificateIssuerRequest.vaultBaseUrl(), + updateCertificateIssuerRequest.issuerName(), updateCertificateIssuerRequest.provider(), + updateCertificateIssuerRequest.credentials(), updateCertificateIssuerRequest.organizationDetails(), + updateCertificateIssuerRequest.attributes()); + } + + /** + * Updates the specified certificate issuer. + * + * @param updateCertificateIssuerRequest + * the grouped properties for updating a certificate issuer request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + * @throws IllegalArgumentException + * thrown if callback is null + */ + public ServiceFuture updateCertificateIssuerAsync( + UpdateCertificateIssuerRequest updateCertificateIssuerRequest, + final ServiceCallback serviceCallback) { + return updateCertificateIssuerAsync(updateCertificateIssuerRequest.vaultBaseUrl(), + updateCertificateIssuerRequest.issuerName(), updateCertificateIssuerRequest.provider(), + updateCertificateIssuerRequest.credentials(), updateCertificateIssuerRequest.organizationDetails(), + updateCertificateIssuerRequest.attributes(), serviceCallback); + } + + /** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param createCertificateRequest + * the grouped properties for creating a certificate request + * @return the CertificateOperation if successful. + */ + public CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest) { + return createCertificate(createCertificateRequest.vaultBaseUrl(), createCertificateRequest.certificateName(), + createCertificateRequest.certificatePolicy(), createCertificateRequest.certificateAttributes(), + createCertificateRequest.tags()); + } + + /** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param createCertificateRequest + * the grouped properties for creating a certificate request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createCertificateAsync(CreateCertificateRequest createCertificateRequest, + final ServiceCallback serviceCallback) { + return createCertificateAsync(createCertificateRequest.vaultBaseUrl(), + createCertificateRequest.certificateName(), createCertificateRequest.certificatePolicy(), + createCertificateRequest.certificateAttributes(), createCertificateRequest.tags(), serviceCallback); + } + + /** + * Imports a certificate into the specified vault. + * + * @param importCertificateRequest + * the grouped properties for importing a certificate request + * @return the CertificateBundle if successful. + */ + public CertificateBundle importCertificate(ImportCertificateRequest importCertificateRequest) { + return importCertificate(importCertificateRequest.vaultBaseUrl(), importCertificateRequest.certificateName(), + importCertificateRequest.base64EncodedCertificate(), importCertificateRequest.password(), + importCertificateRequest.certificatePolicy(), importCertificateRequest.certificateAttributes(), + importCertificateRequest.tags()); + } + + /** + * Imports a certificate into the specified vault. + * + * @param importCertificateRequest + * the grouped properties for importing a certificate request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importCertificateAsync(ImportCertificateRequest importCertificateRequest, + final ServiceCallback serviceCallback) { + return importCertificateAsync(importCertificateRequest.vaultBaseUrl(), + importCertificateRequest.certificateName(), importCertificateRequest.base64EncodedCertificate(), + importCertificateRequest.password(), importCertificateRequest.certificatePolicy(), + importCertificateRequest.certificateAttributes(), importCertificateRequest.tags(), serviceCallback); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @return the PagedList<CertificateItem> if successful. + */ + public PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName) { + return getCertificateVersions(vaultBaseUrl, certificateName); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, + final String certificateName, final ListOperationCallback serviceCallback) { + return getCertificateVersionsAsync(vaultBaseUrl, certificateName, serviceCallback); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @return the PagedList<CertificateItem> if successful. + */ + public PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName, + final Integer maxresults) { + return getCertificateVersions(vaultBaseUrl, certificateName, maxresults); + } + + /** + * List the versions of a certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param maxresults + * Maximum number of results to return in a page. If not specified + * the service will return up to 25 results. + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, + final String certificateName, final Integer maxresults, + final ListOperationCallback serviceCallback) { + return getCertificateVersionsAsync(vaultBaseUrl, certificateName, maxresults, serviceCallback); + } + + /** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param updateCertificatePolicyRequest + * the grouped properties for updating a certificate policy request + * @return the CertificatePolicy if successful. + */ + public CertificatePolicy updateCertificatePolicy(UpdateCertificatePolicyRequest updateCertificatePolicyRequest) { + return updateCertificatePolicy(updateCertificatePolicyRequest.vaultBaseUrl(), + updateCertificatePolicyRequest.certificateName(), updateCertificatePolicyRequest.certificatePolicy()); + } + + /** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param updateCertificatePolicyRequest + * the grouped properties for updating a certificate policy request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificatePolicyAsync( + UpdateCertificatePolicyRequest updateCertificatePolicyRequest, + final ServiceCallback serviceCallback) { + return updateCertificatePolicyAsync(updateCertificatePolicyRequest.vaultBaseUrl(), + updateCertificatePolicyRequest.certificateName(), updateCertificatePolicyRequest.certificatePolicy(), + serviceCallback); + } + + /** + * Updates the attributes associated with the specified certificate. + * + * @param updateCertificateRequest + * the grouped properties for updating a certificate request + * @return the CertificateBundle if successful. + */ + public CertificateBundle updateCertificate(UpdateCertificateRequest updateCertificateRequest) { + return updateCertificate(updateCertificateRequest.vaultBaseUrl(), updateCertificateRequest.certificateName(), + updateCertificateRequest.certificateVersion(), updateCertificateRequest.certificatePolicy(), + updateCertificateRequest.certificateAttributes(), updateCertificateRequest.tags()); + } + + /** + * Updates the attributes associated with the specified certificate. + * + * @param updateCertificateRequest + * the grouped properties for updating a certificate request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateAsync(UpdateCertificateRequest updateCertificateRequest, + final ServiceCallback serviceCallback) { + return updateCertificateAsync(updateCertificateRequest.vaultBaseUrl(), + updateCertificateRequest.certificateName(), updateCertificateRequest.certificateVersion(), + updateCertificateRequest.certificatePolicy(), updateCertificateRequest.certificateAttributes(), + updateCertificateRequest.tags(), serviceCallback); + } + + /** + * Gets information about a specified certificate. + * + * @param certificateIdentifier + * The certificate identifier + * @return the CertificateBundle if successful. + */ + public CertificateBundle getCertificate(String certificateIdentifier) { + CertificateIdentifier id = new CertificateIdentifier(certificateIdentifier); + return getCertificate(id.vault(), id.name(), id.version() == null ? "" : id.version()); + } + + /** + * Gets information about a specified certificate. + * + * @param certificateIdentifier + * The certificate identifier + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateAsync(String certificateIdentifier, + final ServiceCallback serviceCallback) { + CertificateIdentifier id = new CertificateIdentifier(certificateIdentifier); + return getCertificateAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), serviceCallback); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate in the given vault + * @return the CertificateBundle if successful. + */ + public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName) { + return getCertificate(vaultBaseUrl, certificateName, ""); + } + + /** + * Gets information about a specified certificate. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate in the given vault + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, + final ServiceCallback serviceCallback) { + return getCertificateAsync(vaultBaseUrl, certificateName, "", serviceCallback); + } + + /** + * Updates a certificate operation. + * + * @param updateCertificateOperationRequest + * the grouped properties for updating a certificate operation + * request + * @return the CertificateOperation if successful. + */ + public CertificateOperation updateCertificateOperation( + UpdateCertificateOperationRequest updateCertificateOperationRequest) { + return updateCertificateOperation(updateCertificateOperationRequest.vaultBaseUrl(), + updateCertificateOperationRequest.certificateName(), + updateCertificateOperationRequest.cancellationRequested()); + } + + /** + * Updates a certificate operation. + * + * @param updateCertificateOperationRequest + * the grouped properties for updating a certificate operation + * request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateCertificateOperationAsync( + UpdateCertificateOperationRequest updateCertificateOperationRequest, + final ServiceCallback serviceCallback) { + return updateCertificateOperationAsync(updateCertificateOperationRequest.vaultBaseUrl(), + updateCertificateOperationRequest.certificateName(), + updateCertificateOperationRequest.cancellationRequested(), serviceCallback); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param mergeCertificateRequest + * the grouped properties for merging a certificate request + * @return the CertificateBundle if successful. + */ + public CertificateBundle mergeCertificate(MergeCertificateRequest mergeCertificateRequest) { + return mergeCertificate(mergeCertificateRequest.vaultBaseUrl(), mergeCertificateRequest.certificateName(), + mergeCertificateRequest.x509Certificates(), mergeCertificateRequest.certificateAttributes(), + mergeCertificateRequest.tags()); + } + + /** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param mergeCertificateRequest + * the grouped properties for merging a certificate request + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture mergeCertificateAsync(MergeCertificateRequest mergeCertificateRequest, + final ServiceCallback serviceCallback) { + return mergeCertificateAsync(mergeCertificateRequest.vaultBaseUrl(), mergeCertificateRequest.certificateName(), + mergeCertificateRequest.x509Certificates(), mergeCertificateRequest.certificateAttributes(), + mergeCertificateRequest.tags(), serviceCallback); + } + + /** + * Gets the pending certificate signing request response. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @return the String if successful. + */ + public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName) { + return getPendingCertificateSigningRequestWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking() + .single().body(); + } + + /** + * Gets the pending certificate signing request response. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @param serviceCallback + * the async ServiceCallback to handle successful and failed + * responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPendingCertificateSigningRequestAsync(String vaultBaseUrl, String certificateName, + final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse( + getPendingCertificateSigningRequestWithServiceResponseAsync(vaultBaseUrl, certificateName), + serviceCallback); + } + + /** + * Gets the pending certificate signing request response. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate + * @return the observable to the String object + */ + private Observable> getPendingCertificateSigningRequestWithServiceResponseAsync( + String vaultBaseUrl, String certificateName) { + if (vaultBaseUrl == null) { + throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl); + return service + .getPendingCertificateSigningRequest(certificateName, this.apiVersion(), this.acceptLanguage(), + parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = new ServiceResponse( + response.body().string(), response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + @Override + public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, + List keyOps, KeyAttributes keyAttributes, Map tags) { + return createKey(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, null); + } + + @Override + public ServiceFuture createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, + Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags, + ServiceCallback serviceCallback) { + return createKeyAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, null, serviceCallback); + } + + @Override + public Observable createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, + Integer keySize, List keyOps, KeyAttributes keyAttributes, Map tags) { + return createKeyAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, + (JsonWebKeyCurveName) null); + } + + @Override + public Observable> createKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, + JsonWebKeyType kty, Integer keySize, List keyOps, KeyAttributes keyAttributes, + Map tags) { + return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags, + null); + } + + @Override + public PagedList getCertificates(String vaultBaseUrl, Integer maxresults) { + return getCertificates(vaultBaseUrl, maxresults, false); + } + + @Override + public ServiceFuture> getCertificatesAsync(String vaultBaseUrl, Integer maxresults, + ListOperationCallback serviceCallback) { + return getCertificatesAsync(vaultBaseUrl, maxresults, false, serviceCallback); + } + + @Override + public Observable> getCertificatesAsync(String vaultBaseUrl, Integer maxresults) { + return getCertificatesAsync(vaultBaseUrl, maxresults, false); + } + + @Override + public Observable>> getCertificatesWithServiceResponseAsync( + String vaultBaseUrl, Integer maxresults) { + return getCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults, false); + } + + @Override + public PagedList getDeletedCertificates(String vaultBaseUrl, Integer maxresults) { + return getDeletedCertificates(vaultBaseUrl, maxresults, false); + } + + @Override + public ServiceFuture> getDeletedCertificatesAsync(String vaultBaseUrl, + Integer maxresults, ListOperationCallback serviceCallback) { + return getDeletedCertificatesAsync(vaultBaseUrl, maxresults, false, serviceCallback); + } + + @Override + public Observable> getDeletedCertificatesAsync(String vaultBaseUrl, + Integer maxresults) { + return getDeletedCertificatesAsync(vaultBaseUrl, maxresults, false); + } + + @Override + public Observable>> getDeletedCertificatesWithServiceResponseAsync( + String vaultBaseUrl, Integer maxresults) { + return getDeletedCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults, false); + } + +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/package-info.java new file mode 100644 index 0000000000000..9ddd63a760d90 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the classes for KeyVaultClient. Performs cryptographic + * key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.implementation; \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/HttpMessageSecurity.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/HttpMessageSecurity.java new file mode 100644 index 0000000000000..ae55d1ea721ad --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/HttpMessageSecurity.java @@ -0,0 +1,384 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import java.io.IOException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.UUID; +import java.util.concurrent.ExecutionException; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; + +import com.microsoft.azure.keyvault.cryptography.RsaKey; +import com.microsoft.azure.keyvault.cryptography.SymmetricKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.internal.http.HttpHeaders; +import okio.Buffer; + +/** + * Implements message security protocol. Encrypts requests & decrypts + * responses. + */ +public class HttpMessageSecurity { + private static final String AUTHENTICATE = "Authorization"; + private static final String BEARER_TOKEP_REFIX = "Bearer "; + + private boolean testMode = false; + private String clientSecurityToken; + private JsonWebKey clientSignatureKey; + private JsonWebKey clientEncryptionKey; + private JsonWebKey serverSignatureKey; + private JsonWebKey serverEncryptionKey; + + /** + * Constructor. + * + * @param clientSecurityToken + * pop or bearer authentication token. + * @param clientSignatureKeyString + * string with client signing key (public + private parts) or null if + * not supported + * @param serverEncryptionKeyString + * string with server encryption key (public only) or null if not + * supported + * @param serverSignatureKeyString + * string with server signing key (public only) or null if not + * supported + * @throws IOException + * throws IOException + */ + public HttpMessageSecurity(String clientSecurityToken, String clientSignatureKeyString, + String serverEncryptionKeyString, String serverSignatureKeyString) throws IOException { + + this.clientSecurityToken = clientSecurityToken; + + if (clientSignatureKeyString != null && !clientSignatureKeyString.equals("")) { + this.clientSignatureKey = MessageSecurityHelper.jsonWebKeyFromString(clientSignatureKeyString); + } + if (serverSignatureKeyString != null && !serverSignatureKeyString.equals("")) { + this.serverSignatureKey = MessageSecurityHelper.jsonWebKeyFromString(serverSignatureKeyString); + } + if (serverEncryptionKeyString != null && !serverEncryptionKeyString.equals("")) { + this.serverEncryptionKey = MessageSecurityHelper.jsonWebKeyFromString(serverEncryptionKeyString); + } + + this.clientEncryptionKey = MessageSecurityHelper.generateJsonWebKey(); + } + + /** + * Constructor (tests only). + * + * @param clientSecurityToken + * pop or bearer authentication token. + * @param clientEncryptionString + * string with client signing key (public + private parts) or null if + * not supported + * @param clientSignatureKeyString + * string with client signing key (public + private parts) or null if + * not supported + * @param serverEncryptionKeyString + * string with server encryption key (public only) or null if not + * supported + * @param serverSignatureKeyString + * string with server signing key (public only) or null if not + * supported + * @param testMode + * true for test mode (uses 0 for timestamp) + * @throws IOException + * throws IOException + */ + public HttpMessageSecurity(String clientSecurityToken, String clientEncryptionString, + String clientSignatureKeyString, String serverEncryptionKeyString, String serverSignatureKeyString, + boolean testMode) throws IOException { + this(clientSecurityToken, clientSignatureKeyString, serverEncryptionKeyString, serverSignatureKeyString); + this.testMode = testMode; + if (clientEncryptionString != null && !clientEncryptionString.equals("")) { + this.clientEncryptionKey = MessageSecurityHelper.jsonWebKeyFromString(clientEncryptionString); + } + } + + /** + * Protects existing request. Replaces its body with encrypted version. + * + * @param request + * existing request. + * + * @return new request with encrypted body if supported or existing request. + * + * @throws IOException throws IOException + */ + public Request protectRequest(Request request) throws IOException { + try { + Request result = request.newBuilder().header(AUTHENTICATE, BEARER_TOKEP_REFIX + clientSecurityToken) + .build(); + + if (!supportsProtection()) { + return result; + } + + Buffer buffer = new Buffer(); + request.body().writeTo(buffer); + String currentbody = buffer.readUtf8(); + + if (currentbody == null || currentbody.length() == 0) { + return result; + } + + JsonWebKey clientPublicEncryptionKey = MessageSecurityHelper.getJwkWithPublicKeyOnly(clientEncryptionKey); + + String payload = currentbody.substring(0, currentbody.length() - 1) + ",\"rek\":{\"jwk\":" + + clientPublicEncryptionKey.toString() + "}}"; + + JWEObject jweObject = protectPayload(payload); + + JWSHeader jwsHeader = new JWSHeader("RS256", clientSignatureKey.kid(), clientSecurityToken, + getCurrentTimestamp(), "PoP", null); + + String jwsHeaderJsonb64 = MessageSecurityHelper.stringToBase64Url(jwsHeader.serialize()); + String protectedPayload = MessageSecurityHelper.stringToBase64Url(jweObject.serialize()); + byte[] data = (jwsHeaderJsonb64 + "." + protectedPayload).getBytes(); + + RsaKey clientSignatureRsaKey = new RsaKey(clientSignatureKey.kid(), clientSignatureKey.toRSA(true)); + Pair signature = clientSignatureRsaKey.signAsync(getSha256(data), "RS256").get(); + + JWSObject jwsObject = new JWSObject(jwsHeader, protectedPayload, + MessageSecurityHelper.bytesToBase64Url(signature.getKey())); + + RequestBody body = RequestBody.create(MediaType.parse("application/jose+json"), jwsObject.serialize()); + + return result.newBuilder().method(request.method(), body).build(); + } catch (ExecutionException e) { + // unexpected; + return null; + } catch (InterruptedException e) { + // unexpected; + return null; + } catch (NoSuchAlgorithmException e) { + // unexpected; + return null; + } + } + + /** + * Unprotects response if needed. Replaces its body with unencrypted version. + * + * @param response + * server response. + * + * @return new response with unencrypted body if supported or existing response. + * + * @throws IOException throws IOException + */ + public Response unprotectResponse(Response response) throws IOException { + try { + if (!supportsProtection() || !HttpHeaders.hasBody(response)) { + return response; + } + + if (!response.header("content-type").toLowerCase().contains("application/jose+json")) { + return response; + } + + JWSObject jwsObject = JWSObject.deserialize(response.body().string()); + JWSHeader jwsHeader = jwsObject.jwsHeader(); + + if (!jwsHeader.kid().equals(serverSignatureKey.kid()) || !jwsHeader.alg().equals("RS256")) { + throw new IOException("Invalid protected response"); + } + + byte[] data = (jwsObject.originalProtected() + "." + jwsObject.payload()).getBytes(); + byte[] signature = MessageSecurityHelper.base64UrltoByteArray(jwsObject.signature()); + + RsaKey serverSignatureRsaKey = new RsaKey(serverSignatureKey.kid(), serverSignatureKey.toRSA(false)); + boolean signed = serverSignatureRsaKey.verifyAsync(getSha256(data), signature, "RS256").get(); + if (!signed) { + throw new IOException("Wrong signature."); + } + + String decrypted = unprotectPayload(jwsObject.payload()); + + MediaType contentType = response.body().contentType(); + ResponseBody body = ResponseBody.create(contentType, decrypted); + return response.newBuilder().body(body).build(); + } catch (ExecutionException e) { + // unexpected; + return null; + } catch (InterruptedException e) { + // unexpected; + return null; + } catch (NoSuchAlgorithmException e) { + // unexpected; + return null; + } + } + + /** + * Return current timestamp. Returns always 0 for tests. + * + * @return current timestamp or 0 for test mode. + */ + private long getCurrentTimestamp() { + if (testMode) { + return 0; + } else { + return System.currentTimeMillis() / 1000; + } + } + + /** + * Check if HttmMessageSecurity has all required keys. + * + * @return true if there is client signature key and two server keys. + */ + private boolean supportsProtection() { + return this.clientSignatureKey != null && this.serverSignatureKey != null && this.serverEncryptionKey != null; + } + + /** + * Encrypt provided payload and return proper JWEObject. + * + * @param payload + * string to be encrypted. + * + * @return JWEObject with encrypted payload. + * + * @throws IOException throws IOException + */ + private JWEObject protectPayload(String payload) throws IOException { + try { + JWEHeader jweHeader = new JWEHeader("RSA-OAEP", serverEncryptionKey.kid(), "A128CBC-HS256"); + + byte[] aesKeyBytes = generateAesKey(); + + SymmetricKey aesKey = new SymmetricKey(UUID.randomUUID().toString(), aesKeyBytes); + + byte[] iv = generateAesIv(); + + RsaKey serverEncryptionRsaKey = new RsaKey(serverEncryptionKey.kid(), serverEncryptionKey.toRSA(false)); + Triple encryptedKey = serverEncryptionRsaKey + .encryptAsync(aesKeyBytes, null, null, "RSA-OAEP").get(); + + Triple cipher = aesKey + .encryptAsync(payload.getBytes(), iv, + MessageSecurityHelper.stringToBase64Url(jweHeader.serialize()).getBytes(), "A128CBC-HS256") + .get(); + + JWEObject jweObject = new JWEObject(jweHeader, + MessageSecurityHelper.bytesToBase64Url((!testMode) ? encryptedKey.getLeft() : "key".getBytes()), + MessageSecurityHelper.bytesToBase64Url(iv), + MessageSecurityHelper.bytesToBase64Url(cipher.getLeft()), + MessageSecurityHelper.bytesToBase64Url(cipher.getMiddle())); + + return jweObject; + } catch (ExecutionException e) { + // unexpected; + return null; + } catch (InterruptedException e) { + // unexpected; + return null; + } catch (NoSuchAlgorithmException e) { + // unexpected; + return null; + } + } + + /** + * Unencrypt encrypted payload. + * + * @param payload + * base64url serialized JWEObject. + * + * @return Unencrypted message. + */ + private String unprotectPayload(String payload) throws IOException { + try { + JWEObject jweObject = JWEObject.deserialize(MessageSecurityHelper.base64UrltoString(payload)); + JWEHeader jweHeader = jweObject.jweHeader(); + + if (!clientEncryptionKey.kid().equals(jweHeader.kid()) || !jweHeader.alg().equals("RSA-OAEP") + || !jweHeader.enc().equals("A128CBC-HS256")) { + throw new IOException("Invalid protected response"); + } + + byte[] key = MessageSecurityHelper.base64UrltoByteArray(jweObject.encryptedKey()); + + RsaKey clientEncryptionRsaKey = new RsaKey(clientEncryptionKey.kid(), clientEncryptionKey.toRSA(true)); + byte[] aesKeyBytes = clientEncryptionRsaKey.decryptAsync(key, null, null, null, "RSA-OAEP").get(); + + SymmetricKey aesKey = new SymmetricKey(UUID.randomUUID().toString(), aesKeyBytes); + byte[] result = aesKey.decryptAsync(MessageSecurityHelper.base64UrltoByteArray(jweObject.cipherText()), + MessageSecurityHelper.base64UrltoByteArray(jweObject.iv()), + jweObject.originalProtected().getBytes(), + MessageSecurityHelper.base64UrltoByteArray(jweObject.tag()), "A128CBC-HS256").get(); + + return new String(result); + } catch (ExecutionException e) { + // unexpected; + return null; + } catch (InterruptedException e) { + // unexpected; + return null; + } catch (NoSuchAlgorithmException e) { + // unexpected; + return null; + } + } + + /** + * Get SHA256 hash for byte array. + * + * @param data + * byte array. + * + * @return byte array with sha256 hash. + */ + private byte[] getSha256(byte[] data) throws NoSuchAlgorithmException { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + return digest.digest(data); + } + + /** + * Generates AES key. + * + * @return Random AES key or pre-defined value for test mode. + */ + private byte[] generateAesKey() { + byte[] bytes = new byte[32]; + if (!testMode) { + SecureRandom random = new SecureRandom(); + random.nextBytes(bytes); + } else { + bytes = "TEST1234TEST1234TEST1234TEST1234".getBytes(); + } + return bytes; + } + + /** + * Generates initialization vector for AES encryption. + * + * @return Random IV or pre-defined value for test mode. + */ + private byte[] generateAesIv() { + byte[] bytes = new byte[16]; + if (!testMode) { + SecureRandom random = new SecureRandom(); + random.nextBytes(bytes); + } else { + bytes = "TEST1234TEST1234".getBytes(); + } + return bytes; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEHeader.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEHeader.java new file mode 100644 index 0000000000000..c687b1d33c40b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEHeader.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Objects; + +/** + * Json Web Encryption Header class. + */ +class JWEHeader { + + private String alg; + private String kid; + private String enc; + + /** + * Constructor. + */ + JWEHeader() { + + } + + /** + * Constructor. + * + * @param alg + * Encryption algorithm (for key). (Supported: RSA-OAEP) + * @param kid + * Key Id + * @param enc + * Encryption algorithm (for data). (Supported: A128CBC-HS256) + */ + JWEHeader(String alg, String kid, String enc) { + this.alg = alg; + this.kid = kid; + this.enc = enc; + } + + /** + * Compare two JWEHeaders. + * + * @return true if JWEHeaders are identical. + */ + public boolean equals(JWEHeader other) { + return this.alg.equals(other.alg) && this.kid.equals(other.kid) && this.enc.equals(other.enc); + } + + /** + * Hash code for objects. + * + * @return hashcode + */ + public int hashCode() { + return Objects.hash(this.alg, this.kid, this.enc); + } + + /** + * Serialize JWEHeader to json string. + * + * @return Json string with serialized JWEHeader. + */ + public String serialize() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(this); + } + + /** + * Construct JWEHeader from json string. + * + * @param json + * json string. + * + * @return Constructed JWEHeader + */ + public static JWEHeader deserialize(String json) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(json, JWEHeader.class); + } + + /** + * Construct JWEHeader from base64url string. + * + * @param base64 + * base64 url string. + * + * @return Constructed JWEHeader + */ + public static JWEHeader fromBase64String(String base64) throws IOException { + String json = MessageSecurityHelper.base64UrltoString(base64); + return deserialize(json); + } + + /** + * Encryption algorithm (for key). (Supported: RSA-OAEP) + */ + @JsonProperty("alg") + public String alg() { + return alg; + } + + /** + * Key Id. + */ + @JsonProperty("kid") + public String kid() { + return kid; + } + + /** + * Encryption algorithm (for data). (Supported: A128CBC-HS256) + */ + @JsonProperty("enc") + public String enc() { + return enc; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEObject.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEObject.java new file mode 100644 index 0000000000000..4a4ebded0cc5f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEObject.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Objects; + +/** + * Json Web Encryption object class. + */ +class JWEObject { + private JWEHeader jweHeader; + private String originalProtected; + private String encryptedKey; + private String iv; + private String cipherText; + private String tag; + + /** + * Constructor. + * + * @param jweHeader + * Corresponding jweHeader object. + * @param encryptedKey + * base64url encrypted key. + * @param iv + * base64url iv. + * @param cipherText + * base64url encrypted data. + * @param tag + * base64url authorization tag. + */ + JWEObject(JWEHeader jweHeader, String encryptedKey, String iv, String cipherText, String tag) { + this.jweHeader = jweHeader; + this.encryptedKey = encryptedKey; + this.iv = iv; + this.cipherText = cipherText; + this.tag = tag; + } + + /** + * Constructor. + * + * @param jweHeaderB64 + * base64url json with serialized jweHeader. + * @param encryptedKey + * base64url encrypted key. + * @param iv + * base64url iv. + * @param cipherText + * base64url encrypted data. + * @param tag + * base64url authorization tag. + */ + @JsonCreator + JWEObject(@JsonProperty("protected") String jweHeaderB64, @JsonProperty("encrypted_key") String encryptedKey, + @JsonProperty("iv") String iv, @JsonProperty("ciphertext") String cipherText, + @JsonProperty("tag") String tag) throws Exception { + this.jweHeader = JWEHeader.fromBase64String(jweHeaderB64); + this.originalProtected = jweHeaderB64; + this.encryptedKey = encryptedKey; + this.iv = iv; + this.cipherText = cipherText; + this.tag = tag; + } + + /** + * Compare two JweObject. + * + * @return true if JWEObject are identical. + */ + public boolean equals(JWEObject other) { + return jweHeader.equals(other.jweHeader) && encryptedKey.equals(other.encryptedKey) && iv.equals(other.iv) + && cipherText.equals(other.cipherText) && tag.equals(other.tag); + } + + /** + * Hash code for objects. + * + * @return hashcode + */ + public int hashCode() { + return Objects.hash(this.jweHeader, this.encryptedKey, this.iv, this.cipherText, this.tag); + } + + /** + * Serialize JWEObject to json string. + * + * @return Json string with serialized JWEObject. + */ + public String serialize() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(this); + } + + /** + * Construct JWEObject from json string. + * + * @param json + * json string. + * + * @return Constructed JWEObject + */ + public static JWEObject deserialize(String json) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(json, JWEObject.class); + } + + /** + * JWEHeader object. + */ + public JWEHeader jweHeader() { + return jweHeader; + } + + /** + * base64url json with serialized jweHeader. + */ + @JsonProperty("protected") + public String protectedB64() throws Exception { + return MessageSecurityHelper.stringToBase64Url(jweHeader.serialize()); + } + + /** + * Original base64url with serialized jweHeader (when constructed from json + * string). + */ + public String originalProtected() { + return originalProtected; + } + + /** + * base64url encrypted key. + */ + @JsonProperty("encrypted_key") + public String encryptedKey() { + return encryptedKey; + } + + /** + * base64url iv. + */ + @JsonProperty("iv") + public String iv() { + return iv; + } + + /** + * base64url encrypted text. + */ + @JsonProperty("ciphertext") + public String cipherText() { + return cipherText; + } + + /** + * base64url tag. + */ + @JsonProperty("tag") + public String tag() { + return tag; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSHeader.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSHeader.java new file mode 100644 index 0000000000000..59595cd3f6b35 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSHeader.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Objects; + +/** + * Json Web Signature header class. + */ +class JWSHeader { + + private String alg; + private String kid; + private String at; + private long ts; + private String p; + private String typ; + + /** + * Constructor. + */ + JWSHeader() { + } + + /** + * Constructor. + * + * @param alg + * signing algorithm (RS256). + * @param kid + * signing key id. + * @param at + * authorization token. + * @param ts + * timestamp. + * @param typ + * authorization type (PoP). + * @param p + * p + */ + JWSHeader(String alg, String kid, String at, long ts, String typ, String p) { + this.alg = alg; + this.kid = kid; + this.at = at; + this.ts = ts; + this.p = p; + this.typ = typ; + } + + /** + * Compare two JwsHeader. + * + * @return true if JWSHeaders are identical. + */ + public boolean equals(JWSHeader other) { + return this.alg.equals(other.alg) && this.kid.equals(other.kid) && this.at.equals(other.at) + && this.ts == other.ts && this.p.equals(other.p) && this.typ.equals(other.typ); + } + + /** + * Hash code for objects. + * + * @return hashcode + */ + public int hashCode() { + return Objects.hash(this.alg, this.kid, this.at, this.ts, this.p, this.typ); + } + + /** + * Serialize JWSHeader to json string. + * + * @return Json string with serialized JWSHeader. + */ + public String serialize() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(this); + } + + /** + * Construct JWSHeader from json string. + * + * @param json + * json string. + * + * @return Constructed JWSHeader + */ + public static JWSHeader deserialize(String json) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(json, JWSHeader.class); + } + + /** + * Construct JWSHeader from base64url string. + * + * @param base64 + * base64 url string. + * + * @return Constructed JWSHeader + */ + public static JWSHeader fromBase64String(String base64) throws IOException { + String json = MessageSecurityHelper.base64UrltoString(base64); + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(json, JWSHeader.class); + } + + /** + * signing algorithm (RS256). + */ + @JsonProperty("alg") + public String alg() { + return alg; + } + + /** + * signing key id. + */ + @JsonProperty("kid") + public String kid() { + return kid; + } + + /** + * authorization token. + */ + @JsonProperty("at") + public String at() { + return at; + } + + /** + * timestamp. + */ + @JsonProperty("ts") + public long ts() { + return ts; + } + + /** + * authorization type (PoP). + */ + @JsonProperty("typ") + public String typ() { + return typ; + } + + /** + * p . + */ + @JsonProperty("p") + public String p() { + return p; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSObject.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSObject.java new file mode 100644 index 0000000000000..871f5b67d272c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSObject.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Objects; + +/** + * Json Web Signature object class. + */ +class JWSObject { + private JWSHeader jwsHeader; + private String originalProtected; + private String payload; + private String signature; + + /** + * Constructor. + * + * @param JWSHeader + * JWSHeader. + * @param payload + * base64url protected payload (JWEObject). + * @param signature + * base64url signature for (protected + "." + payload) data. + */ + JWSObject(JWSHeader jwsHeader, String payload, String signature) { + this.jwsHeader = jwsHeader; + this.payload = payload; + this.signature = signature; + } + + /** + * Constructor. + * + * @param jwsHeaderB64 + * base64 json string with JWSHeader. + * @param payload + * base64url protected payload (JWEObject). + * @param signature + * base64url signature for (protected + "." + payload) data. + */ + @JsonCreator + JWSObject(@JsonProperty("protected") String jwsHeaderB64, @JsonProperty("payload") String payload, + @JsonProperty("signature") String signature) throws Exception { + this.jwsHeader = JWSHeader.fromBase64String(jwsHeaderB64); + this.originalProtected = jwsHeaderB64; + this.payload = payload; + this.signature = signature; + } + + /** + * Compare two JWSObject. + * + * @return true if JWSObjects are identical. + */ + public boolean equals(JWSObject other) { + return this.payload.equals(other.payload) && this.jwsHeader.equals(other.jwsHeader) + && this.signature.equals(other.signature); + } + + /** + * Hash code for objects. + * + * @return hashcode + */ + public int hashCode() { + return Objects.hash(this.payload, this.jwsHeader, this.signature); + } + + /** + * Serialize JWSObject to json string. + * + * @return Json string with serialized JWSObject. + */ + public String serialize() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(this); + } + + /** + * Construct JWSObject from json string. + * + * @param json + * json string. + * + * @return Constructed JWSObject + */ + public static JWSObject deserialize(String json) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(json, JWSObject.class); + } + + /** + * Retrieve JWSHeader object. + */ + public JWSHeader jwsHeader() { + return jwsHeader; + } + + /** + * Original base64url with serialized jwsHeader (when constructed from json + * string). + */ + public String originalProtected() { + return originalProtected; + } + + /** + * base64 json string with JWSHeader. + */ + @JsonProperty("protected") + public String protectedB64() throws Exception { + return MessageSecurityHelper.stringToBase64Url(jwsHeader.serialize()); + } + + /** + * base64url protected payload (JWEObject). + */ + @JsonProperty("payload") + public String payload() { + return payload; + } + + /** + * base64url signature for (protected + "." + payload) data. + */ + @JsonProperty("signature") + public String signature() { + return signature; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/MessageSecurityHelper.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/MessageSecurityHelper.java new file mode 100644 index 0000000000000..7ded26891a4db --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/MessageSecurityHelper.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.messagesecurity; + +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; + +import org.apache.commons.codec.binary.Base64; + +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.UUID; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * Implements helper methods for message security. + */ +class MessageSecurityHelper { + /** + * Convert base64Url string to bytes array. + * + * @param base64url + * Base64Url string. + * + * @returns Decoded bytes array. + */ + public static byte[] base64UrltoByteArray(String base64url) { + return Base64.decodeBase64(base64url.replace('-', '+').replace('_', '/')); + } + + /** + * Convert base64Url string to String. + * + * @param base64url + * Base64Url string. + * + * @returns Decoded string. + */ + public static String base64UrltoString(String base64url) { + return new String(base64UrltoByteArray(base64url)); + } + + /** + * Convert bytes array to Base64Url string. + * + * @param bytes + * bytes array. + * + * @returns Encoded string. + */ + public static String bytesToBase64Url(byte[] bytes) { + String result = (new String(Base64.encodeBase64(bytes))).replace("=", "").replace("\\", "").replace('+', '-') + .replace('/', '_'); + return result; + } + + /** + * Convert bytes array to Base64Url string. + * + * @param str + * string. + * + * @returns Encoded string. + */ + public static String stringToBase64Url(String str) { + return bytesToBase64Url(str.getBytes()); + } + + /** + * Convert serialized JsonWebKey string to JsonWebKey object. + * + * @param jwkString + * serialized JsonWebKey. + * + * @returns JsonWebKey object. + */ + public static JsonWebKey jsonWebKeyFromString(String jwkString) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(jwkString, JsonWebKey.class); + } + + /** + * Generates new JsonWebKey with random KeyID. + * + * @returns JsonWebKey object. + */ + public static JsonWebKey generateJsonWebKey() { + try { + final KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); + generator.initialize(2048); + KeyPair clientRsaKeyPair = generator.generateKeyPair(); + JsonWebKey result = JsonWebKey.fromRSA(clientRsaKeyPair); + result.withKid(UUID.randomUUID().toString()); + return result; + } catch (NoSuchAlgorithmException e) { + // Unexpected. Should never be thrown. + return null; + } + } + + /** + * Converts JsonWebKey with private key to JsonWebKey with public key only. + * + * @param jwk + * JsonWebKey with private key. + * @returns JsonWebKey object with public key only. + */ + public static JsonWebKey getJwkWithPublicKeyOnly(JsonWebKey jwk) { + KeyPair publicOnly = jwk.toRSA(false); + JsonWebKey jsonkeyPublic = JsonWebKey.fromRSA(publicOnly); + jsonkeyPublic.withKid(jwk.kid()); + jsonkeyPublic.withKeyOps( + Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.WRAP_KEY, JsonWebKeyOperation.VERIFY)); + return jsonkeyPublic; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/package-info.java new file mode 100644 index 0000000000000..c487c40ca28b6 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the classes for KeyVaultClient. Performs cryptographic + * key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.messagesecurity; diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Action.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Action.java new file mode 100644 index 0000000000000..e087781cdcc3c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Action.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The action that will be executed. + */ +public class Action { + /** + * The type of the action. Possible values include: 'EmailContacts', + * 'AutoRenew'. + */ + @JsonProperty(value = "action_type") + private ActionType actionType; + + /** + * Get the actionType value. + * + * @return the actionType value + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType value. + * + * @param actionType the actionType value to set + * @return the Action object itself. + */ + public Action withActionType(ActionType actionType) { + this.actionType = actionType; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/ActionType.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/ActionType.java new file mode 100644 index 0000000000000..1eed810b18ffa --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/ActionType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ActionType. + */ +public enum ActionType { + /** Enum value EmailContacts. */ + EMAIL_CONTACTS("EmailContacts"), + + /** Enum value AutoRenew. */ + AUTO_RENEW("AutoRenew"); + + /** The actual serialized value for a ActionType instance. */ + private String value; + + ActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed ActionType object, or null if unable to parse. + */ + @JsonCreator + public static ActionType fromString(String value) { + ActionType[] items = ActionType.values(); + for (ActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/AdministratorDetails.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/AdministratorDetails.java new file mode 100644 index 0000000000000..e1ae21d10dd11 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/AdministratorDetails.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the organization administrator of the certificate issuer. + */ +public class AdministratorDetails { + /** + * First name. + */ + @JsonProperty(value = "first_name") + private String firstName; + + /** + * Last name. + */ + @JsonProperty(value = "last_name") + private String lastName; + + /** + * Email addresss. + */ + @JsonProperty(value = "email") + private String emailAddress; + + /** + * Phone number. + */ + @JsonProperty(value = "phone") + private String phone; + + /** + * Get the firstName value. + * + * @return the firstName value + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName value. + * + * @param firstName the firstName value to set + * @return the AdministratorDetails object itself. + */ + public AdministratorDetails withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName value. + * + * @return the lastName value + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName value. + * + * @param lastName the lastName value to set + * @return the AdministratorDetails object itself. + */ + public AdministratorDetails withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the emailAddress value. + * + * @return the emailAddress value + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the emailAddress value. + * + * @param emailAddress the emailAddress value to set + * @return the AdministratorDetails object itself. + */ + public AdministratorDetails withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get the phone value. + * + * @return the phone value + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone value. + * + * @param phone the phone value to set + * @return the AdministratorDetails object itself. + */ + public AdministratorDetails withPhone(String phone) { + this.phone = phone; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Attributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Attributes.java new file mode 100644 index 0000000000000..9611767ac83e7 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Attributes.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object attributes managed by the KeyVault service. + */ +public class Attributes { + /** + * Determines whether the object is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Not before date in UTC. + */ + @JsonProperty(value = "nbf") + private Long notBefore; + + /** + * Expiry date in UTC. + */ + @JsonProperty(value = "exp") + private Long expires; + + /** + * Creation time in UTC. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /** + * Last updated time in UTC. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the Attributes object itself. + */ + public Attributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the notBefore value. + * + * @return the notBefore value + */ + public DateTime notBefore() { + if (this.notBefore == null) { + return null; + } + return new DateTime(this.notBefore * 1000L, DateTimeZone.UTC); + } + + /** + * Set the notBefore value. + * + * @param notBefore the notBefore value to set + * @return the Attributes object itself. + */ + public Attributes withNotBefore(DateTime notBefore) { + if (notBefore == null) { + this.notBefore = null; + } else { + this.notBefore = notBefore.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + } + return this; + } + + /** + * Get the expires value. + * + * @return the expires value + */ + public DateTime expires() { + if (this.expires == null) { + return null; + } + return new DateTime(this.expires * 1000L, DateTimeZone.UTC); + } + + /** + * Set the expires value. + * + * @param expires the expires value to set + * @return the Attributes object itself. + */ + public Attributes withExpires(DateTime expires) { + if (expires == null) { + this.expires = null; + } else { + this.expires = expires.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + } + return this; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return new DateTime(this.created * 1000L, DateTimeZone.UTC); + } + + /** + * Get the updated value. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return new DateTime(this.updated * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupCertificateResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupCertificateResult.java new file mode 100644 index 0000000000000..80817434103a3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupCertificateResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The backup certificate result, containing the backup blob. + */ +public class BackupCertificateResult { + /** + * The backup blob containing the backed up certificate. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url value; + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupKeyResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupKeyResult.java new file mode 100644 index 0000000000000..22c1dfb7c4b65 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupKeyResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The backup key result, containing the backup blob. + */ +public class BackupKeyResult { + /** + * The backup blob containing the backed up key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url value; + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupSecretResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupSecretResult.java new file mode 100644 index 0000000000000..8c5cf6d7f2ba3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupSecretResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The backup secret result, containing the backup blob. + */ +public class BackupSecretResult { + /** + * The backup blob containing the backed up secret. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url value; + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupStorageResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupStorageResult.java new file mode 100644 index 0000000000000..9b4d93b777001 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/BackupStorageResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The backup storage result, containing the backup blob. + */ +public class BackupStorageResult { + /** + * The backup blob containing the backed up storage account. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url value; + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateAttributes.java new file mode 100644 index 0000000000000..810216c00c89a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateAttributes.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate management attributes. + */ +public class CertificateAttributes extends Attributes { + /** + * Reflects the deletion recovery level currently in effect for + * certificates in the current vault. If it contains 'Purgeable', the + * certificate can be permanently deleted by a privileged user; otherwise, + * only the system can purge the certificate, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription'. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /** + * Get the recoveryLevel value. + * + * @return the recoveryLevel value + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateBundle.java new file mode 100644 index 0000000000000..f9efa540df630 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateBundle.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A certificate bundle consists of a certificate (X509) plus its attributes. + */ +public class CertificateBundle extends com.microsoft.azure.keyvault.models.custom.CertificateBundle { + /** + * The certificate id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The key id. + */ + @JsonProperty(value = "kid", access = JsonProperty.Access.WRITE_ONLY) + private String kid; + + /** + * The secret id. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String sid; + + /** + * Thumbprint of the certificate. + */ + @JsonProperty(value = "x5t", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url x509Thumbprint; + + /** + * The management policy. + */ + @JsonProperty(value = "policy", access = JsonProperty.Access.WRITE_ONLY) + private CertificatePolicy policy; + + /** + * CER contents of x509 certificate. + */ + @JsonProperty(value = "cer") + private byte[] cer; + + /** + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The certificate attributes. + */ + @JsonProperty(value = "attributes") + private CertificateAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the kid value. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Get the sid value. + * + * @return the sid value + */ + public String sid() { + return this.sid; + } + + /** + * Get the x509Thumbprint value. + * + * @return the x509Thumbprint value + */ + public byte[] x509Thumbprint() { + if (this.x509Thumbprint == null) { + return null; + } + return this.x509Thumbprint.decodedBytes(); + } + + /** + * Get the policy value. + * + * @return the policy value + */ + public CertificatePolicy policy() { + return this.policy; + } + + /** + * Get the cer value. + * + * @return the cer value + */ + public byte[] cer() { + return this.cer; + } + + /** + * Set the cer value. + * + * @param cer the cer value to set + * @return the CertificateBundle object itself. + */ + public CertificateBundle withCer(byte[] cer) { + this.cer = cer; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the CertificateBundle object itself. + */ + public CertificateBundle withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public CertificateAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the CertificateBundle object itself. + */ + public CertificateBundle withAttributes(CertificateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateBundle object itself. + */ + public CertificateBundle withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateCreateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateCreateParameters.java new file mode 100644 index 0000000000000..301126e91b8b0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateCreateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate create parameters. + */ +public class CertificateCreateParameters { + /** + * The management policy for the certificate. + */ + @JsonProperty(value = "policy") + private CertificatePolicy certificatePolicy; + + /** + * The attributes of the certificate (optional). + */ + @JsonProperty(value = "attributes") + private CertificateAttributes certificateAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the certificatePolicy value. + * + * @return the certificatePolicy value + */ + public CertificatePolicy certificatePolicy() { + return this.certificatePolicy; + } + + /** + * Set the certificatePolicy value. + * + * @param certificatePolicy the certificatePolicy value to set + * @return the CertificateCreateParameters object itself. + */ + public CertificateCreateParameters withCertificatePolicy(CertificatePolicy certificatePolicy) { + this.certificatePolicy = certificatePolicy; + return this; + } + + /** + * Get the certificateAttributes value. + * + * @return the certificateAttributes value + */ + public CertificateAttributes certificateAttributes() { + return this.certificateAttributes; + } + + /** + * Set the certificateAttributes value. + * + * @param certificateAttributes the certificateAttributes value to set + * @return the CertificateCreateParameters object itself. + */ + public CertificateCreateParameters withCertificateAttributes(CertificateAttributes certificateAttributes) { + this.certificateAttributes = certificateAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateCreateParameters object itself. + */ + public CertificateCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateImportParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateImportParameters.java new file mode 100644 index 0000000000000..ca53338933c96 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateImportParameters.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate import parameters. + */ +public class CertificateImportParameters { + /** + * Base64 encoded representation of the certificate object to import. This + * certificate needs to contain the private key. + */ + @JsonProperty(value = "value", required = true) + private String base64EncodedCertificate; + + /** + * If the private key in base64EncodedCertificate is encrypted, the + * password used for encryption. + */ + @JsonProperty(value = "pwd") + private String password; + + /** + * The management policy for the certificate. + */ + @JsonProperty(value = "policy") + private CertificatePolicy certificatePolicy; + + /** + * The attributes of the certificate (optional). + */ + @JsonProperty(value = "attributes") + private CertificateAttributes certificateAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the base64EncodedCertificate value. + * + * @return the base64EncodedCertificate value + */ + public String base64EncodedCertificate() { + return this.base64EncodedCertificate; + } + + /** + * Set the base64EncodedCertificate value. + * + * @param base64EncodedCertificate the base64EncodedCertificate value to set + * @return the CertificateImportParameters object itself. + */ + public CertificateImportParameters withBase64EncodedCertificate(String base64EncodedCertificate) { + this.base64EncodedCertificate = base64EncodedCertificate; + return this; + } + + /** + * Get the password value. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password value. + * + * @param password the password value to set + * @return the CertificateImportParameters object itself. + */ + public CertificateImportParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the certificatePolicy value. + * + * @return the certificatePolicy value + */ + public CertificatePolicy certificatePolicy() { + return this.certificatePolicy; + } + + /** + * Set the certificatePolicy value. + * + * @param certificatePolicy the certificatePolicy value to set + * @return the CertificateImportParameters object itself. + */ + public CertificateImportParameters withCertificatePolicy(CertificatePolicy certificatePolicy) { + this.certificatePolicy = certificatePolicy; + return this; + } + + /** + * Get the certificateAttributes value. + * + * @return the certificateAttributes value + */ + public CertificateAttributes certificateAttributes() { + return this.certificateAttributes; + } + + /** + * Set the certificateAttributes value. + * + * @param certificateAttributes the certificateAttributes value to set + * @return the CertificateImportParameters object itself. + */ + public CertificateImportParameters withCertificateAttributes(CertificateAttributes certificateAttributes) { + this.certificateAttributes = certificateAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateImportParameters object itself. + */ + public CertificateImportParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerItem.java new file mode 100644 index 0000000000000..f56b05b916c2a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerItem.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate issuer item containing certificate issuer metadata. + */ +public class CertificateIssuerItem { + /** + * Certificate Identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The issuer provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the CertificateIssuerItem object itself. + */ + public CertificateIssuerItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the CertificateIssuerItem object itself. + */ + public CertificateIssuerItem withProvider(String provider) { + this.provider = provider; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerSetParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerSetParameters.java new file mode 100644 index 0000000000000..9ef7c67f757c8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerSetParameters.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate issuer set parameters. + */ +public class CertificateIssuerSetParameters { + /** + * The issuer provider. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /** + * The credentials to be used for the issuer. + */ + @JsonProperty(value = "credentials") + private IssuerCredentials credentials; + + /** + * Details of the organization as provided to the issuer. + */ + @JsonProperty(value = "org_details") + private OrganizationDetails organizationDetails; + + /** + * Attributes of the issuer object. + */ + @JsonProperty(value = "attributes") + private IssuerAttributes attributes; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the CertificateIssuerSetParameters object itself. + */ + public CertificateIssuerSetParameters withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the credentials value. + * + * @return the credentials value + */ + public IssuerCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials value. + * + * @param credentials the credentials value to set + * @return the CertificateIssuerSetParameters object itself. + */ + public CertificateIssuerSetParameters withCredentials(IssuerCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the organizationDetails value. + * + * @return the organizationDetails value + */ + public OrganizationDetails organizationDetails() { + return this.organizationDetails; + } + + /** + * Set the organizationDetails value. + * + * @param organizationDetails the organizationDetails value to set + * @return the CertificateIssuerSetParameters object itself. + */ + public CertificateIssuerSetParameters withOrganizationDetails(OrganizationDetails organizationDetails) { + this.organizationDetails = organizationDetails; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public IssuerAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the CertificateIssuerSetParameters object itself. + */ + public CertificateIssuerSetParameters withAttributes(IssuerAttributes attributes) { + this.attributes = attributes; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerUpdateParameters.java new file mode 100644 index 0000000000000..656be38775bd4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateIssuerUpdateParameters.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate issuer update parameters. + */ +public class CertificateIssuerUpdateParameters { + /** + * The issuer provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The credentials to be used for the issuer. + */ + @JsonProperty(value = "credentials") + private IssuerCredentials credentials; + + /** + * Details of the organization as provided to the issuer. + */ + @JsonProperty(value = "org_details") + private OrganizationDetails organizationDetails; + + /** + * Attributes of the issuer object. + */ + @JsonProperty(value = "attributes") + private IssuerAttributes attributes; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the CertificateIssuerUpdateParameters object itself. + */ + public CertificateIssuerUpdateParameters withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the credentials value. + * + * @return the credentials value + */ + public IssuerCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials value. + * + * @param credentials the credentials value to set + * @return the CertificateIssuerUpdateParameters object itself. + */ + public CertificateIssuerUpdateParameters withCredentials(IssuerCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the organizationDetails value. + * + * @return the organizationDetails value + */ + public OrganizationDetails organizationDetails() { + return this.organizationDetails; + } + + /** + * Set the organizationDetails value. + * + * @param organizationDetails the organizationDetails value to set + * @return the CertificateIssuerUpdateParameters object itself. + */ + public CertificateIssuerUpdateParameters withOrganizationDetails(OrganizationDetails organizationDetails) { + this.organizationDetails = organizationDetails; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public IssuerAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the CertificateIssuerUpdateParameters object itself. + */ + public CertificateIssuerUpdateParameters withAttributes(IssuerAttributes attributes) { + this.attributes = attributes; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateItem.java new file mode 100644 index 0000000000000..b61faa2a94585 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateItem.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate item containing certificate metadata. + */ +public class CertificateItem { + /** + * Certificate identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The certificate management attributes. + */ + @JsonProperty(value = "attributes") + private CertificateAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Thumbprint of the certificate. + */ + @JsonProperty(value = "x5t") + private Base64Url x509Thumbprint; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the CertificateItem object itself. + */ + public CertificateItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public CertificateAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the CertificateItem object itself. + */ + public CertificateItem withAttributes(CertificateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateItem object itself. + */ + public CertificateItem withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the x509Thumbprint value. + * + * @return the x509Thumbprint value + */ + public byte[] x509Thumbprint() { + if (this.x509Thumbprint == null) { + return null; + } + return this.x509Thumbprint.decodedBytes(); + } + + /** + * Set the x509Thumbprint value. + * + * @param x509Thumbprint the x509Thumbprint value to set + * @return the CertificateItem object itself. + */ + public CertificateItem withX509Thumbprint(byte[] x509Thumbprint) { + if (x509Thumbprint == null) { + this.x509Thumbprint = null; + } else { + this.x509Thumbprint = Base64Url.encode(x509Thumbprint); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateMergeParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateMergeParameters.java new file mode 100644 index 0000000000000..6d404066143ab --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateMergeParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate merge parameters. + */ +public class CertificateMergeParameters { + /** + * The certificate or the certificate chain to merge. + */ + @JsonProperty(value = "x5c", required = true) + private List x509Certificates; + + /** + * The attributes of the certificate (optional). + */ + @JsonProperty(value = "attributes") + private CertificateAttributes certificateAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the x509Certificates value. + * + * @return the x509Certificates value + */ + public List x509Certificates() { + return this.x509Certificates; + } + + /** + * Set the x509Certificates value. + * + * @param x509Certificates the x509Certificates value to set + * @return the CertificateMergeParameters object itself. + */ + public CertificateMergeParameters withX509Certificates(List x509Certificates) { + this.x509Certificates = x509Certificates; + return this; + } + + /** + * Get the certificateAttributes value. + * + * @return the certificateAttributes value + */ + public CertificateAttributes certificateAttributes() { + return this.certificateAttributes; + } + + /** + * Set the certificateAttributes value. + * + * @param certificateAttributes the certificateAttributes value to set + * @return the CertificateMergeParameters object itself. + */ + public CertificateMergeParameters withCertificateAttributes(CertificateAttributes certificateAttributes) { + this.certificateAttributes = certificateAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateMergeParameters object itself. + */ + public CertificateMergeParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperation.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperation.java new file mode 100644 index 0000000000000..9e00258247b69 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperation.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A certificate operation is returned in case of asynchronous requests. + */ +public class CertificateOperation extends com.microsoft.azure.keyvault.models.custom.CertificateOperation { + /** + * The certificate id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Parameters for the issuer of the X509 component of a certificate. + */ + @JsonProperty(value = "issuer") + private IssuerParameters issuerParameters; + + /** + * The certificate signing request (CSR) that is being used in the + * certificate operation. + */ + @JsonProperty(value = "csr") + private byte[] csr; + + /** + * Indicates if cancellation was requested on the certificate operation. + */ + @JsonProperty(value = "cancellation_requested") + private Boolean cancellationRequested; + + /** + * Status of the certificate operation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The status details of the certificate operation. + */ + @JsonProperty(value = "status_details") + private String statusDetails; + + /** + * Error encountered, if any, during the certificate operation. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Location which contains the result of the certificate operation. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Identifier for the certificate operation. + */ + @JsonProperty(value = "request_id") + private String requestId; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the issuerParameters value. + * + * @return the issuerParameters value + */ + public IssuerParameters issuerParameters() { + return this.issuerParameters; + } + + /** + * Set the issuerParameters value. + * + * @param issuerParameters the issuerParameters value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withIssuerParameters(IssuerParameters issuerParameters) { + this.issuerParameters = issuerParameters; + return this; + } + + /** + * Get the csr value. + * + * @return the csr value + */ + public byte[] csr() { + return this.csr; + } + + /** + * Set the csr value. + * + * @param csr the csr value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withCsr(byte[] csr) { + this.csr = csr; + return this; + } + + /** + * Get the cancellationRequested value. + * + * @return the cancellationRequested value + */ + public Boolean cancellationRequested() { + return this.cancellationRequested; + } + + /** + * Set the cancellationRequested value. + * + * @param cancellationRequested the cancellationRequested value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withCancellationRequested(Boolean cancellationRequested) { + this.cancellationRequested = cancellationRequested; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the statusDetails value. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Set the statusDetails value. + * + * @param statusDetails the statusDetails value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withStatusDetails(String statusDetails) { + this.statusDetails = statusDetails; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the requestId value. + * + * @return the requestId value + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set + * @return the CertificateOperation object itself. + */ + public CertificateOperation withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperationUpdateParameter.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperationUpdateParameter.java new file mode 100644 index 0000000000000..98a494bc31cd4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateOperationUpdateParameter.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate operation update parameters. + */ +public class CertificateOperationUpdateParameter { + /** + * Indicates if cancellation was requested on the certificate operation. + */ + @JsonProperty(value = "cancellation_requested", required = true) + private boolean cancellationRequested; + + /** + * Get the cancellationRequested value. + * + * @return the cancellationRequested value + */ + public boolean cancellationRequested() { + return this.cancellationRequested; + } + + /** + * Set the cancellationRequested value. + * + * @param cancellationRequested the cancellationRequested value to set + * @return the CertificateOperationUpdateParameter object itself. + */ + public CertificateOperationUpdateParameter withCancellationRequested(boolean cancellationRequested) { + this.cancellationRequested = cancellationRequested; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificatePolicy.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificatePolicy.java new file mode 100644 index 0000000000000..44f94ba02a39d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificatePolicy.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Management policy for a certificate. + */ +public class CertificatePolicy { + /** + * The certificate id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Properties of the key backing a certificate. + */ + @JsonProperty(value = "key_props") + private KeyProperties keyProperties; + + /** + * Properties of the secret backing a certificate. + */ + @JsonProperty(value = "secret_props") + private SecretProperties secretProperties; + + /** + * Properties of the X509 component of a certificate. + */ + @JsonProperty(value = "x509_props") + private X509CertificateProperties x509CertificateProperties; + + /** + * Actions that will be performed by Key Vault over the lifetime of a + * certificate. + */ + @JsonProperty(value = "lifetime_actions") + private List lifetimeActions; + + /** + * Parameters for the issuer of the X509 component of a certificate. + */ + @JsonProperty(value = "issuer") + private IssuerParameters issuerParameters; + + /** + * The certificate attributes. + */ + @JsonProperty(value = "attributes") + private CertificateAttributes attributes; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the keyProperties value. + * + * @return the keyProperties value + */ + public KeyProperties keyProperties() { + return this.keyProperties; + } + + /** + * Set the keyProperties value. + * + * @param keyProperties the keyProperties value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withKeyProperties(KeyProperties keyProperties) { + this.keyProperties = keyProperties; + return this; + } + + /** + * Get the secretProperties value. + * + * @return the secretProperties value + */ + public SecretProperties secretProperties() { + return this.secretProperties; + } + + /** + * Set the secretProperties value. + * + * @param secretProperties the secretProperties value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withSecretProperties(SecretProperties secretProperties) { + this.secretProperties = secretProperties; + return this; + } + + /** + * Get the x509CertificateProperties value. + * + * @return the x509CertificateProperties value + */ + public X509CertificateProperties x509CertificateProperties() { + return this.x509CertificateProperties; + } + + /** + * Set the x509CertificateProperties value. + * + * @param x509CertificateProperties the x509CertificateProperties value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withX509CertificateProperties(X509CertificateProperties x509CertificateProperties) { + this.x509CertificateProperties = x509CertificateProperties; + return this; + } + + /** + * Get the lifetimeActions value. + * + * @return the lifetimeActions value + */ + public List lifetimeActions() { + return this.lifetimeActions; + } + + /** + * Set the lifetimeActions value. + * + * @param lifetimeActions the lifetimeActions value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withLifetimeActions(List lifetimeActions) { + this.lifetimeActions = lifetimeActions; + return this; + } + + /** + * Get the issuerParameters value. + * + * @return the issuerParameters value + */ + public IssuerParameters issuerParameters() { + return this.issuerParameters; + } + + /** + * Set the issuerParameters value. + * + * @param issuerParameters the issuerParameters value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withIssuerParameters(IssuerParameters issuerParameters) { + this.issuerParameters = issuerParameters; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public CertificateAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the CertificatePolicy object itself. + */ + public CertificatePolicy withAttributes(CertificateAttributes attributes) { + this.attributes = attributes; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateRestoreParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateRestoreParameters.java new file mode 100644 index 0000000000000..094f070e38e20 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateRestoreParameters.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate restore parameters. + */ +public class CertificateRestoreParameters { + /** + * The backup blob associated with a certificate bundle. + */ + @JsonProperty(value = "value", required = true) + private Base64Url certificateBundleBackup; + + /** + * Get the certificateBundleBackup value. + * + * @return the certificateBundleBackup value + */ + public byte[] certificateBundleBackup() { + if (this.certificateBundleBackup == null) { + return null; + } + return this.certificateBundleBackup.decodedBytes(); + } + + /** + * Set the certificateBundleBackup value. + * + * @param certificateBundleBackup the certificateBundleBackup value to set + * @return the CertificateRestoreParameters object itself. + */ + public CertificateRestoreParameters withCertificateBundleBackup(byte[] certificateBundleBackup) { + if (certificateBundleBackup == null) { + this.certificateBundleBackup = null; + } else { + this.certificateBundleBackup = Base64Url.encode(certificateBundleBackup); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateUpdateParameters.java new file mode 100644 index 0000000000000..7beed06ec6bed --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/CertificateUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The certificate update parameters. + */ +public class CertificateUpdateParameters { + /** + * The management policy for the certificate. + */ + @JsonProperty(value = "policy") + private CertificatePolicy certificatePolicy; + + /** + * The attributes of the certificate (optional). + */ + @JsonProperty(value = "attributes") + private CertificateAttributes certificateAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the certificatePolicy value. + * + * @return the certificatePolicy value + */ + public CertificatePolicy certificatePolicy() { + return this.certificatePolicy; + } + + /** + * Set the certificatePolicy value. + * + * @param certificatePolicy the certificatePolicy value to set + * @return the CertificateUpdateParameters object itself. + */ + public CertificateUpdateParameters withCertificatePolicy(CertificatePolicy certificatePolicy) { + this.certificatePolicy = certificatePolicy; + return this; + } + + /** + * Get the certificateAttributes value. + * + * @return the certificateAttributes value + */ + public CertificateAttributes certificateAttributes() { + return this.certificateAttributes; + } + + /** + * Set the certificateAttributes value. + * + * @param certificateAttributes the certificateAttributes value to set + * @return the CertificateUpdateParameters object itself. + */ + public CertificateUpdateParameters withCertificateAttributes(CertificateAttributes certificateAttributes) { + this.certificateAttributes = certificateAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CertificateUpdateParameters object itself. + */ + public CertificateUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contact.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contact.java new file mode 100644 index 0000000000000..729c6ec106249 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contact.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The contact information for the vault certificates. + */ +public class Contact { + /** + * Email addresss. + */ + @JsonProperty(value = "email") + private String emailAddress; + + /** + * Name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Phone number. + */ + @JsonProperty(value = "phone") + private String phone; + + /** + * Get the emailAddress value. + * + * @return the emailAddress value + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the emailAddress value. + * + * @param emailAddress the emailAddress value to set + * @return the Contact object itself. + */ + public Contact withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Contact object itself. + */ + public Contact withName(String name) { + this.name = name; + return this; + } + + /** + * Get the phone value. + * + * @return the phone value + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone value. + * + * @param phone the phone value to set + * @return the Contact object itself. + */ + public Contact withPhone(String phone) { + this.phone = phone; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contacts.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contacts.java new file mode 100644 index 0000000000000..b9b0b3547b252 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Contacts.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The contacts for the vault certificates. + */ +public class Contacts { + /** + * Identifier for the contacts collection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The contact list for the vault certificates. + */ + @JsonProperty(value = "contacts") + private List contactList; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the contactList value. + * + * @return the contactList value + */ + public List contactList() { + return this.contactList; + } + + /** + * Set the contactList value. + * + * @param contactList the contactList value to set + * @return the Contacts object itself. + */ + public Contacts withContactList(List contactList) { + this.contactList = contactList; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateBundle.java new file mode 100644 index 0000000000000..4b1926c6784a7 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateBundle.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Deleted Certificate consisting of its previous id, attributes and its + * tags, as well as information on when it will be purged. + */ +public class DeletedCertificateBundle extends CertificateBundle { + /** + * The url of the recovery object, used to identify and recover the deleted + * certificate. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the certificate is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the certificate was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedCertificateBundle object itself. + */ + public DeletedCertificateBundle withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateItem.java new file mode 100644 index 0000000000000..5d14c76254649 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedCertificateItem.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted certificate item containing metadata about the deleted + * certificate. + */ +public class DeletedCertificateItem extends CertificateItem { + /** + * The url of the recovery object, used to identify and recover the deleted + * certificate. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the certificate is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the certificate was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedCertificateItem object itself. + */ + public DeletedCertificateItem withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyBundle.java new file mode 100644 index 0000000000000..5125230205aaf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyBundle.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + * info. + */ +public class DeletedKeyBundle extends KeyBundle { + /** + * The url of the recovery object, used to identify and recover the deleted + * key. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the key is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the key was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedKeyBundle object itself. + */ + public DeletedKeyBundle withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyItem.java new file mode 100644 index 0000000000000..b374bebf643cf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedKeyItem.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted key item containing the deleted key metadata and information + * about deletion. + */ +public class DeletedKeyItem extends KeyItem { + /** + * The url of the recovery object, used to identify and recover the deleted + * key. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the key is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the key was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedKeyItem object itself. + */ + public DeletedKeyItem withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionBundle.java new file mode 100644 index 0000000000000..35575a25186bd --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionBundle.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A deleted SAS definition bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + */ +public class DeletedSasDefinitionBundle extends SasDefinitionBundle { + /** + * The url of the recovery object, used to identify and recover the deleted + * SAS definition. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the SAS definition is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the SAS definition was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedSasDefinitionBundle object itself. + */ + public DeletedSasDefinitionBundle withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionItem.java new file mode 100644 index 0000000000000..15aae9e35ac9b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionItem.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted SAS definition item containing metadata about the deleted SAS + * definition. + */ +public class DeletedSasDefinitionItem extends SasDefinitionItem { + /** + * The url of the recovery object, used to identify and recover the deleted + * SAS definition. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the SAS definition is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the SAS definition was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedSasDefinitionItem object itself. + */ + public DeletedSasDefinitionItem withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretBundle.java new file mode 100644 index 0000000000000..001639d311206 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretBundle.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Deleted Secret consisting of its previous id, attributes and its tags, as + * well as information on when it will be purged. + */ +public class DeletedSecretBundle extends SecretBundle { + /** + * The url of the recovery object, used to identify and recover the deleted + * secret. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the secret is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the secret was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedSecretBundle object itself. + */ + public DeletedSecretBundle withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretItem.java new file mode 100644 index 0000000000000..35865f3641280 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSecretItem.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted secret item containing metadata about the deleted secret. + */ +public class DeletedSecretItem extends SecretItem { + /** + * The url of the recovery object, used to identify and recover the deleted + * secret. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the secret is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the secret was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedSecretItem object itself. + */ + public DeletedSecretItem withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageAccountItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageAccountItem.java new file mode 100644 index 0000000000000..290bb199a4e74 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageAccountItem.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted storage account item containing metadata about the deleted + * storage account. + */ +public class DeletedStorageAccountItem extends StorageAccountItem { + /** + * The url of the recovery object, used to identify and recover the deleted + * storage account. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the storage account is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the storage account was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedStorageAccountItem object itself. + */ + public DeletedStorageAccountItem withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageBundle.java new file mode 100644 index 0000000000000..7d1baa4ca5209 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedStorageBundle.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A deleted storage account bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + */ +public class DeletedStorageBundle extends StorageBundle { + /** + * The url of the recovery object, used to identify and recover the deleted + * storage account. + */ + @JsonProperty(value = "recoveryId") + private String recoveryId; + + /** + * The time when the storage account is scheduled to be purged, in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledPurgeDate; + + /** + * The time when the storage account was deleted, in UTC. + */ + @JsonProperty(value = "deletedDate", access = JsonProperty.Access.WRITE_ONLY) + private Long deletedDate; + + /** + * Get the recoveryId value. + * + * @return the recoveryId value + */ + public String recoveryId() { + return this.recoveryId; + } + + /** + * Set the recoveryId value. + * + * @param recoveryId the recoveryId value to set + * @return the DeletedStorageBundle object itself. + */ + public DeletedStorageBundle withRecoveryId(String recoveryId) { + this.recoveryId = recoveryId; + return this; + } + + /** + * Get the scheduledPurgeDate value. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + if (this.scheduledPurgeDate == null) { + return null; + } + return new DateTime(this.scheduledPurgeDate * 1000L, DateTimeZone.UTC); + } + + /** + * Get the deletedDate value. + * + * @return the deletedDate value + */ + public DateTime deletedDate() { + if (this.deletedDate == null) { + return null; + } + return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletionRecoveryLevel.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletionRecoveryLevel.java new file mode 100644 index 0000000000000..8e02a9c883289 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletionRecoveryLevel.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeletionRecoveryLevel. + */ +public final class DeletionRecoveryLevel { + /** Static value Purgeable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel PURGEABLE = new DeletionRecoveryLevel("Purgeable"); + + /** Static value Recoverable+Purgeable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE_PURGEABLE = new DeletionRecoveryLevel("Recoverable+Purgeable"); + + /** Static value Recoverable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE = new DeletionRecoveryLevel("Recoverable"); + + /** Static value Recoverable+ProtectedSubscription for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE_PROTECTED_SUBSCRIPTION = new DeletionRecoveryLevel("Recoverable+ProtectedSubscription"); + + private String value; + + /** + * Creates a custom value for DeletionRecoveryLevel. + * @param value the custom value + */ + public DeletionRecoveryLevel(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof DeletionRecoveryLevel)) { + return false; + } + if (obj == this) { + return true; + } + DeletionRecoveryLevel rhs = (DeletionRecoveryLevel) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Error.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Error.java new file mode 100644 index 0000000000000..78fc47d0bca65 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Error.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key vault server error. + */ +public class Error { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The innerError property. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private Error innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public Error innerError() { + return this.innerError; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerAttributes.java new file mode 100644 index 0000000000000..baf741301bec1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerAttributes.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The attributes of an issuer managed by the Key Vault service. + */ +public class IssuerAttributes { + /** + * Determines whether the issuer is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Creation time in UTC. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /** + * Last updated time in UTC. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the IssuerAttributes object itself. + */ + public IssuerAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return new DateTime(this.created * 1000L, DateTimeZone.UTC); + } + + /** + * Get the updated value. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return new DateTime(this.updated * 1000L, DateTimeZone.UTC); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerBundle.java new file mode 100644 index 0000000000000..a6b6d53e87527 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerBundle.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The issuer for Key Vault certificate. + */ +public class IssuerBundle extends com.microsoft.azure.keyvault.models.custom.IssuerBundle { + /** + * Identifier for the issuer object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The issuer provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The credentials to be used for the issuer. + */ + @JsonProperty(value = "credentials") + private IssuerCredentials credentials; + + /** + * Details of the organization as provided to the issuer. + */ + @JsonProperty(value = "org_details") + private OrganizationDetails organizationDetails; + + /** + * Attributes of the issuer object. + */ + @JsonProperty(value = "attributes") + private IssuerAttributes attributes; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the IssuerBundle object itself. + */ + public IssuerBundle withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the credentials value. + * + * @return the credentials value + */ + public IssuerCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials value. + * + * @param credentials the credentials value to set + * @return the IssuerBundle object itself. + */ + public IssuerBundle withCredentials(IssuerCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the organizationDetails value. + * + * @return the organizationDetails value + */ + public OrganizationDetails organizationDetails() { + return this.organizationDetails; + } + + /** + * Set the organizationDetails value. + * + * @param organizationDetails the organizationDetails value to set + * @return the IssuerBundle object itself. + */ + public IssuerBundle withOrganizationDetails(OrganizationDetails organizationDetails) { + this.organizationDetails = organizationDetails; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public IssuerAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the IssuerBundle object itself. + */ + public IssuerBundle withAttributes(IssuerAttributes attributes) { + this.attributes = attributes; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerCredentials.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerCredentials.java new file mode 100644 index 0000000000000..ea804477220fc --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerCredentials.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The credentials to be used for the certificate issuer. + */ +public class IssuerCredentials { + /** + * The user name/account name/account id. + */ + @JsonProperty(value = "account_id") + private String accountId; + + /** + * The password/secret/account key. + */ + @JsonProperty(value = "pwd") + private String password; + + /** + * Get the accountId value. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId value. + * + * @param accountId the accountId value to set + * @return the IssuerCredentials object itself. + */ + public IssuerCredentials withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the password value. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password value. + * + * @param password the password value to set + * @return the IssuerCredentials object itself. + */ + public IssuerCredentials withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerParameters.java new file mode 100644 index 0000000000000..4258978ca5574 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/IssuerParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for the issuer of the X509 component of a certificate. + */ +public class IssuerParameters { + /** + * Name of the referenced issuer object or reserved names; for example, + * 'Self' or 'Unknown'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Type of certificate to be requested from the issuer provider. + */ + @JsonProperty(value = "cty") + private String certificateType; + + /** + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + */ + @JsonProperty(value = "cert_transparency") + private Boolean certificateTransparency; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the IssuerParameters object itself. + */ + public IssuerParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the certificateType value. + * + * @return the certificateType value + */ + public String certificateType() { + return this.certificateType; + } + + /** + * Set the certificateType value. + * + * @param certificateType the certificateType value to set + * @return the IssuerParameters object itself. + */ + public IssuerParameters withCertificateType(String certificateType) { + this.certificateType = certificateType; + return this; + } + + /** + * Get the certificateTransparency value. + * + * @return the certificateTransparency value + */ + public Boolean certificateTransparency() { + return this.certificateTransparency; + } + + /** + * Set the certificateTransparency value. + * + * @param certificateTransparency the certificateTransparency value to set + * @return the IssuerParameters object itself. + */ + public IssuerParameters withCertificateTransparency(Boolean certificateTransparency) { + this.certificateTransparency = certificateTransparency; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/JsonWebKeyCurveName.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/JsonWebKeyCurveName.java new file mode 100644 index 0000000000000..a1c2caf1021e3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/JsonWebKeyCurveName.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JsonWebKeyCurveName. + */ +public final class JsonWebKeyCurveName { + /** Static value P-256 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256 = new JsonWebKeyCurveName("P-256"); + + /** Static value P-384 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_384 = new JsonWebKeyCurveName("P-384"); + + /** Static value P-521 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_521 = new JsonWebKeyCurveName("P-521"); + + /** Static value P-256K for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256K = new JsonWebKeyCurveName("P-256K"); + + private String value; + + /** + * Creates a custom value for JsonWebKeyCurveName. + * @param value the custom value + */ + public JsonWebKeyCurveName(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof JsonWebKeyCurveName)) { + return false; + } + if (obj == this) { + return true; + } + JsonWebKeyCurveName rhs = (JsonWebKeyCurveName) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyAttributes.java new file mode 100644 index 0000000000000..27c31153d2fe8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyAttributes.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The attributes of a key managed by the key vault service. + */ +public class KeyAttributes extends Attributes { + /** + * Reflects the deletion recovery level currently in effect for keys in the + * current vault. If it contains 'Purgeable' the key can be permanently + * deleted by a privileged user; otherwise, only the system can purge the + * key, at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription'. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /** + * Get the recoveryLevel value. + * + * @return the recoveryLevel value + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyBundle.java new file mode 100644 index 0000000000000..a505c687375ec --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyBundle.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A KeyBundle consisting of a WebKey plus its attributes. + */ +public class KeyBundle extends com.microsoft.azure.keyvault.models.custom.KeyBundle { + /** + * The Json web key. + */ + @JsonProperty(value = "key") + private JsonWebKey key; + + /** + * The key management attributes. + */ + @JsonProperty(value = "attributes") + private KeyAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * True if the key's lifetime is managed by key vault. If this is a key + * backing a certificate, then managed will be true. + */ + @JsonProperty(value = "managed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean managed; + + /** + * Get the key value. + * + * @return the key value + */ + public JsonWebKey key() { + return this.key; + } + + /** + * Set the key value. + * + * @param key the key value to set + * @return the KeyBundle object itself. + */ + public KeyBundle withKey(JsonWebKey key) { + this.key = key; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public KeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the KeyBundle object itself. + */ + public KeyBundle withAttributes(KeyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the KeyBundle object itself. + */ + public KeyBundle withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the managed value. + * + * @return the managed value + */ + public Boolean managed() { + return this.managed; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyCreateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyCreateParameters.java new file mode 100644 index 0000000000000..76ecda2394e71 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyCreateParameters.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key create parameters. + */ +public class KeyCreateParameters { + /** + * The type of key to create. For valid values, see JsonWebKeyType. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'. + */ + @JsonProperty(value = "kty", required = true) + private JsonWebKeyType kty; + + /** + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + @JsonProperty(value = "key_size") + private Integer keySize; + + /** + * The keyOps property. + */ + @JsonProperty(value = "key_ops") + private List keyOps; + + /** + * The keyAttributes property. + */ + @JsonProperty(value = "attributes") + private KeyAttributes keyAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible + * values include: 'P-256', 'P-384', 'P-521', 'P-256K'. + */ + @JsonProperty(value = "crv") + private JsonWebKeyCurveName curve; + + /** + * Get the kty value. + * + * @return the kty value + */ + public JsonWebKeyType kty() { + return this.kty; + } + + /** + * Set the kty value. + * + * @param kty the kty value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withKty(JsonWebKeyType kty) { + this.kty = kty; + return this; + } + + /** + * Get the keySize value. + * + * @return the keySize value + */ + public Integer keySize() { + return this.keySize; + } + + /** + * Set the keySize value. + * + * @param keySize the keySize value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withKeySize(Integer keySize) { + this.keySize = keySize; + return this; + } + + /** + * Get the keyOps value. + * + * @return the keyOps value + */ + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps value. + * + * @param keyOps the keyOps value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the keyAttributes value. + * + * @return the keyAttributes value + */ + public KeyAttributes keyAttributes() { + return this.keyAttributes; + } + + /** + * Set the keyAttributes value. + * + * @param keyAttributes the keyAttributes value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withKeyAttributes(KeyAttributes keyAttributes) { + this.keyAttributes = keyAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the curve value. + * + * @return the curve value + */ + public JsonWebKeyCurveName curve() { + return this.curve; + } + + /** + * Set the curve value. + * + * @param curve the curve value to set + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withCurve(JsonWebKeyCurveName curve) { + this.curve = curve; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyImportParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyImportParameters.java new file mode 100644 index 0000000000000..255f53a64bc6d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyImportParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key import parameters. + */ +public class KeyImportParameters { + /** + * Whether to import as a hardware key (HSM) or software key. + */ + @JsonProperty(value = "Hsm") + private Boolean hsm; + + /** + * The Json web key. + */ + @JsonProperty(value = "key", required = true) + private JsonWebKey key; + + /** + * The key management attributes. + */ + @JsonProperty(value = "attributes") + private KeyAttributes keyAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the hsm value. + * + * @return the hsm value + */ + public Boolean hsm() { + return this.hsm; + } + + /** + * Set the hsm value. + * + * @param hsm the hsm value to set + * @return the KeyImportParameters object itself. + */ + public KeyImportParameters withHsm(Boolean hsm) { + this.hsm = hsm; + return this; + } + + /** + * Get the key value. + * + * @return the key value + */ + public JsonWebKey key() { + return this.key; + } + + /** + * Set the key value. + * + * @param key the key value to set + * @return the KeyImportParameters object itself. + */ + public KeyImportParameters withKey(JsonWebKey key) { + this.key = key; + return this; + } + + /** + * Get the keyAttributes value. + * + * @return the keyAttributes value + */ + public KeyAttributes keyAttributes() { + return this.keyAttributes; + } + + /** + * Set the keyAttributes value. + * + * @param keyAttributes the keyAttributes value to set + * @return the KeyImportParameters object itself. + */ + public KeyImportParameters withKeyAttributes(KeyAttributes keyAttributes) { + this.keyAttributes = keyAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the KeyImportParameters object itself. + */ + public KeyImportParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyItem.java new file mode 100644 index 0000000000000..03617a863ebb2 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyItem.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key item containing key metadata. + */ +public class KeyItem { + /** + * Key identifier. + */ + @JsonProperty(value = "kid") + private String kid; + + /** + * The key management attributes. + */ + @JsonProperty(value = "attributes") + private KeyAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * True if the key's lifetime is managed by key vault. If this is a key + * backing a certificate, then managed will be true. + */ + @JsonProperty(value = "managed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean managed; + + /** + * Get the kid value. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Set the kid value. + * + * @param kid the kid value to set + * @return the KeyItem object itself. + */ + public KeyItem withKid(String kid) { + this.kid = kid; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public KeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the KeyItem object itself. + */ + public KeyItem withAttributes(KeyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the KeyItem object itself. + */ + public KeyItem withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the managed value. + * + * @return the managed value + */ + public Boolean managed() { + return this.managed; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationResult.java new file mode 100644 index 0000000000000..3761229220c18 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationResult.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key operation result. + */ +public class KeyOperationResult { + /** + * Key identifier. + */ + @JsonProperty(value = "kid", access = JsonProperty.Access.WRITE_ONLY) + private String kid; + + /** + * The result property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Base64Url result; + + /** + * Get the kid value. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Get the result value. + * + * @return the result value + */ + public byte[] result() { + if (this.result == null) { + return null; + } + return this.result.decodedBytes(); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationsParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationsParameters.java new file mode 100644 index 0000000000000..167b8a5521f2e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyOperationsParameters.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key operations parameters. + */ +public class KeyOperationsParameters { + /** + * algorithm identifier. Possible values include: 'RSA-OAEP', + * 'RSA-OAEP-256', 'RSA1_5'. + */ + @JsonProperty(value = "alg", required = true) + private JsonWebKeyEncryptionAlgorithm algorithm; + + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private Base64Url value; + + /** + * Get the algorithm value. + * + * @return the algorithm value + */ + public JsonWebKeyEncryptionAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm value. + * + * @param algorithm the algorithm value to set + * @return the KeyOperationsParameters object itself. + */ + public KeyOperationsParameters withAlgorithm(JsonWebKeyEncryptionAlgorithm algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the KeyOperationsParameters object itself. + */ + public KeyOperationsParameters withValue(byte[] value) { + if (value == null) { + this.value = null; + } else { + this.value = Base64Url.encode(value); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyProperties.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyProperties.java new file mode 100644 index 0000000000000..fe32ccf726a3b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyProperties.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the key pair backing a certificate. + */ +public class KeyProperties { + /** + * Indicates if the private key can be exported. + */ + @JsonProperty(value = "exportable") + private Boolean exportable; + + /** + * The type of key pair to be used for the certificate. Possible values + * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'. + */ + @JsonProperty(value = "kty") + private JsonWebKeyType keyType; + + /** + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + @JsonProperty(value = "key_size") + private Integer keySize; + + /** + * Indicates if the same key pair will be used on certificate renewal. + */ + @JsonProperty(value = "reuse_key") + private Boolean reuseKey; + + /** + * Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible + * values include: 'P-256', 'P-384', 'P-521', 'P-256K'. + */ + @JsonProperty(value = "crv") + private JsonWebKeyCurveName curve; + + /** + * Get the exportable value. + * + * @return the exportable value + */ + public Boolean exportable() { + return this.exportable; + } + + /** + * Set the exportable value. + * + * @param exportable the exportable value to set + * @return the KeyProperties object itself. + */ + public KeyProperties withExportable(Boolean exportable) { + this.exportable = exportable; + return this; + } + + /** + * Get the keyType value. + * + * @return the keyType value + */ + public JsonWebKeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType value. + * + * @param keyType the keyType value to set + * @return the KeyProperties object itself. + */ + public KeyProperties withKeyType(JsonWebKeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the keySize value. + * + * @return the keySize value + */ + public Integer keySize() { + return this.keySize; + } + + /** + * Set the keySize value. + * + * @param keySize the keySize value to set + * @return the KeyProperties object itself. + */ + public KeyProperties withKeySize(Integer keySize) { + this.keySize = keySize; + return this; + } + + /** + * Get the reuseKey value. + * + * @return the reuseKey value + */ + public Boolean reuseKey() { + return this.reuseKey; + } + + /** + * Set the reuseKey value. + * + * @param reuseKey the reuseKey value to set + * @return the KeyProperties object itself. + */ + public KeyProperties withReuseKey(Boolean reuseKey) { + this.reuseKey = reuseKey; + return this; + } + + /** + * Get the curve value. + * + * @return the curve value + */ + public JsonWebKeyCurveName curve() { + return this.curve; + } + + /** + * Set the curve value. + * + * @param curve the curve value to set + * @return the KeyProperties object itself. + */ + public KeyProperties withCurve(JsonWebKeyCurveName curve) { + this.curve = curve; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyRestoreParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyRestoreParameters.java new file mode 100644 index 0000000000000..0cf867e681bd5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyRestoreParameters.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key restore parameters. + */ +public class KeyRestoreParameters { + /** + * The backup blob associated with a key bundle. + */ + @JsonProperty(value = "value", required = true) + private Base64Url keyBundleBackup; + + /** + * Get the keyBundleBackup value. + * + * @return the keyBundleBackup value + */ + public byte[] keyBundleBackup() { + if (this.keyBundleBackup == null) { + return null; + } + return this.keyBundleBackup.decodedBytes(); + } + + /** + * Set the keyBundleBackup value. + * + * @param keyBundleBackup the keyBundleBackup value to set + * @return the KeyRestoreParameters object itself. + */ + public KeyRestoreParameters withKeyBundleBackup(byte[] keyBundleBackup) { + if (keyBundleBackup == null) { + this.keyBundleBackup = null; + } else { + this.keyBundleBackup = Base64Url.encode(keyBundleBackup); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeySignParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeySignParameters.java new file mode 100644 index 0000000000000..c5d40edb4dec4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeySignParameters.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key operations parameters. + */ +public class KeySignParameters { + /** + * The signing/verification algorithm identifier. For more information on + * possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible + * values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', + * 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K'. + */ + @JsonProperty(value = "alg", required = true) + private JsonWebKeySignatureAlgorithm algorithm; + + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private Base64Url value; + + /** + * Get the algorithm value. + * + * @return the algorithm value + */ + public JsonWebKeySignatureAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm value. + * + * @param algorithm the algorithm value to set + * @return the KeySignParameters object itself. + */ + public KeySignParameters withAlgorithm(JsonWebKeySignatureAlgorithm algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + if (this.value == null) { + return null; + } + return this.value.decodedBytes(); + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the KeySignParameters object itself. + */ + public KeySignParameters withValue(byte[] value) { + if (value == null) { + this.value = null; + } else { + this.value = Base64Url.encode(value); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUpdateParameters.java new file mode 100644 index 0000000000000..9752c5bb33f14 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUpdateParameters.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key update parameters. + */ +public class KeyUpdateParameters { + /** + * Json web key operations. For more information on possible key + * operations, see JsonWebKeyOperation. + */ + @JsonProperty(value = "key_ops") + private List keyOps; + + /** + * The keyAttributes property. + */ + @JsonProperty(value = "attributes") + private KeyAttributes keyAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the keyOps value. + * + * @return the keyOps value + */ + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps value. + * + * @param keyOps the keyOps value to set + * @return the KeyUpdateParameters object itself. + */ + public KeyUpdateParameters withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the keyAttributes value. + * + * @return the keyAttributes value + */ + public KeyAttributes keyAttributes() { + return this.keyAttributes; + } + + /** + * Set the keyAttributes value. + * + * @param keyAttributes the keyAttributes value to set + * @return the KeyUpdateParameters object itself. + */ + public KeyUpdateParameters withKeyAttributes(KeyAttributes keyAttributes) { + this.keyAttributes = keyAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the KeyUpdateParameters object itself. + */ + public KeyUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUsageType.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUsageType.java new file mode 100644 index 0000000000000..3bb0eb952bc93 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyUsageType.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyUsageType. + */ +public final class KeyUsageType { + /** Static value digitalSignature for KeyUsageType. */ + public static final KeyUsageType DIGITAL_SIGNATURE = new KeyUsageType("digitalSignature"); + + /** Static value nonRepudiation for KeyUsageType. */ + public static final KeyUsageType NON_REPUDIATION = new KeyUsageType("nonRepudiation"); + + /** Static value keyEncipherment for KeyUsageType. */ + public static final KeyUsageType KEY_ENCIPHERMENT = new KeyUsageType("keyEncipherment"); + + /** Static value dataEncipherment for KeyUsageType. */ + public static final KeyUsageType DATA_ENCIPHERMENT = new KeyUsageType("dataEncipherment"); + + /** Static value keyAgreement for KeyUsageType. */ + public static final KeyUsageType KEY_AGREEMENT = new KeyUsageType("keyAgreement"); + + /** Static value keyCertSign for KeyUsageType. */ + public static final KeyUsageType KEY_CERT_SIGN = new KeyUsageType("keyCertSign"); + + /** Static value cRLSign for KeyUsageType. */ + public static final KeyUsageType C_RLSIGN = new KeyUsageType("cRLSign"); + + /** Static value encipherOnly for KeyUsageType. */ + public static final KeyUsageType ENCIPHER_ONLY = new KeyUsageType("encipherOnly"); + + /** Static value decipherOnly for KeyUsageType. */ + public static final KeyUsageType DECIPHER_ONLY = new KeyUsageType("decipherOnly"); + + private String value; + + /** + * Creates a custom value for KeyUsageType. + * @param value the custom value + */ + public KeyUsageType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof KeyUsageType)) { + return false; + } + if (obj == this) { + return true; + } + KeyUsageType rhs = (KeyUsageType) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultError.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultError.java new file mode 100644 index 0000000000000..9ed31855cc490 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultError.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key vault error exception. + */ +public class KeyVaultError { + /** + * The error property. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultErrorException.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultErrorException.java new file mode 100644 index 0000000000000..8bd16782f46cd --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVaultErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with KeyVaultError information. + */ +public class KeyVaultErrorException extends RestException { + /** + * Initializes a new instance of the KeyVaultErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public KeyVaultErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the KeyVaultErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public KeyVaultErrorException(final String message, final Response response, final KeyVaultError body) { + super(message, response, body); + } + + @Override + public KeyVaultError body() { + return (KeyVaultError) super.body(); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyParameters.java new file mode 100644 index 0000000000000..56e9cc88fd720 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyParameters.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key verify parameters. + */ +public class KeyVerifyParameters { + /** + * The signing/verification algorithm. For more information on possible + * algorithm types, see JsonWebKeySignatureAlgorithm. Possible values + * include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', + * 'ES256', 'ES384', 'ES512', 'ES256K'. + */ + @JsonProperty(value = "alg", required = true) + private JsonWebKeySignatureAlgorithm algorithm; + + /** + * The digest used for signing. + */ + @JsonProperty(value = "digest", required = true) + private Base64Url digest; + + /** + * The signature to be verified. + */ + @JsonProperty(value = "value", required = true) + private Base64Url signature; + + /** + * Get the algorithm value. + * + * @return the algorithm value + */ + public JsonWebKeySignatureAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm value. + * + * @param algorithm the algorithm value to set + * @return the KeyVerifyParameters object itself. + */ + public KeyVerifyParameters withAlgorithm(JsonWebKeySignatureAlgorithm algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get the digest value. + * + * @return the digest value + */ + public byte[] digest() { + if (this.digest == null) { + return null; + } + return this.digest.decodedBytes(); + } + + /** + * Set the digest value. + * + * @param digest the digest value to set + * @return the KeyVerifyParameters object itself. + */ + public KeyVerifyParameters withDigest(byte[] digest) { + if (digest == null) { + this.digest = null; + } else { + this.digest = Base64Url.encode(digest); + } + return this; + } + + /** + * Get the signature value. + * + * @return the signature value + */ + public byte[] signature() { + if (this.signature == null) { + return null; + } + return this.signature.decodedBytes(); + } + + /** + * Set the signature value. + * + * @param signature the signature value to set + * @return the KeyVerifyParameters object itself. + */ + public KeyVerifyParameters withSignature(byte[] signature) { + if (signature == null) { + this.signature = null; + } else { + this.signature = Base64Url.encode(signature); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyResult.java new file mode 100644 index 0000000000000..85857ede68f2e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/KeyVerifyResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key verify result. + */ +public class KeyVerifyResult { + /** + * True if the signature is verified, otherwise false. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Boolean value; + + /** + * Get the value value. + * + * @return the value value + */ + public Boolean value() { + return this.value; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/LifetimeAction.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/LifetimeAction.java new file mode 100644 index 0000000000000..0ef49541eada7 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/LifetimeAction.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Action and its trigger that will be performed by Key Vault over the lifetime + * of a certificate. + */ +public class LifetimeAction { + /** + * The condition that will execute the action. + */ + @JsonProperty(value = "trigger") + private Trigger trigger; + + /** + * The action that will be executed. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get the trigger value. + * + * @return the trigger value + */ + public Trigger trigger() { + return this.trigger; + } + + /** + * Set the trigger value. + * + * @param trigger the trigger value to set + * @return the LifetimeAction object itself. + */ + public LifetimeAction withTrigger(Trigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the action value. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action value. + * + * @param action the action value to set + * @return the LifetimeAction object itself. + */ + public LifetimeAction withAction(Action action) { + this.action = action; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/OrganizationDetails.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/OrganizationDetails.java new file mode 100644 index 0000000000000..fbbeb04fc9116 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/OrganizationDetails.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the organization of the certificate issuer. + */ +public class OrganizationDetails { + /** + * Id of the organization. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Details of the organization administrator. + */ + @JsonProperty(value = "admin_details") + private List adminDetails; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the OrganizationDetails object itself. + */ + public OrganizationDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the adminDetails value. + * + * @return the adminDetails value + */ + public List adminDetails() { + return this.adminDetails; + } + + /** + * Set the adminDetails value. + * + * @param adminDetails the adminDetails value to set + * @return the OrganizationDetails object itself. + */ + public OrganizationDetails withAdminDetails(List adminDetails) { + this.adminDetails = adminDetails; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PageImpl.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PageImpl.java new file mode 100644 index 0000000000000..014d89366c516 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PendingCertificateSigningRequestResult.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PendingCertificateSigningRequestResult.java new file mode 100644 index 0000000000000..d508235abe6e0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/PendingCertificateSigningRequestResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The pending certificate signing request result. + */ +public class PendingCertificateSigningRequestResult { + /** + * The pending certificate signing request as Base64 encoded string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionAttributes.java new file mode 100644 index 0000000000000..bfb59d2dfd267 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionAttributes.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SAS definition management attributes. + */ +public class SasDefinitionAttributes { + /** + * the enabled state of the object. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Creation time in UTC. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /** + * Last updated time in UTC. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** + * Reflects the deletion recovery level currently in effect for SAS + * definitions in the current vault. If it contains 'Purgeable' the SAS + * definition can be permanently deleted by a privileged user; otherwise, + * only the system can purge the SAS definition, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription'. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the SasDefinitionAttributes object itself. + */ + public SasDefinitionAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return new DateTime(this.created * 1000L, DateTimeZone.UTC); + } + + /** + * Get the updated value. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return new DateTime(this.updated * 1000L, DateTimeZone.UTC); + } + + /** + * Get the recoveryLevel value. + * + * @return the recoveryLevel value + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionBundle.java new file mode 100644 index 0000000000000..3c1f038242171 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionBundle.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A SAS definition bundle consists of key vault SAS definition details plus + * its attributes. + */ +public class SasDefinitionBundle { + /** + * The SAS definition id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Storage account SAS definition secret id. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String secretId; + + /** + * The SAS definition token template signed with an arbitrary key. Tokens + * created according to the SAS definition will have the same properties as + * the template. + */ + @JsonProperty(value = "templateUri", access = JsonProperty.Access.WRITE_ONLY) + private String templateUri; + + /** + * The type of SAS token the SAS definition will create. Possible values + * include: 'account', 'service'. + */ + @JsonProperty(value = "sasType", access = JsonProperty.Access.WRITE_ONLY) + private SasTokenType sasType; + + /** + * The validity period of SAS tokens created according to the SAS + * definition. + */ + @JsonProperty(value = "validityPeriod", access = JsonProperty.Access.WRITE_ONLY) + private String validityPeriod; + + /** + * The SAS definition attributes. + */ + @JsonProperty(value = "attributes", access = JsonProperty.Access.WRITE_ONLY) + private SasDefinitionAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the secretId value. + * + * @return the secretId value + */ + public String secretId() { + return this.secretId; + } + + /** + * Get the templateUri value. + * + * @return the templateUri value + */ + public String templateUri() { + return this.templateUri; + } + + /** + * Get the sasType value. + * + * @return the sasType value + */ + public SasTokenType sasType() { + return this.sasType; + } + + /** + * Get the validityPeriod value. + * + * @return the validityPeriod value + */ + public String validityPeriod() { + return this.validityPeriod; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public SasDefinitionAttributes attributes() { + return this.attributes; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionCreateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionCreateParameters.java new file mode 100644 index 0000000000000..98c9980225850 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionCreateParameters.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SAS definition create parameters. + */ +public class SasDefinitionCreateParameters { + /** + * The SAS definition token template signed with an arbitrary key. Tokens + * created according to the SAS definition will have the same properties as + * the template. + */ + @JsonProperty(value = "templateUri", required = true) + private String templateUri; + + /** + * The type of SAS token the SAS definition will create. Possible values + * include: 'account', 'service'. + */ + @JsonProperty(value = "sasType", required = true) + private SasTokenType sasType; + + /** + * The validity period of SAS tokens created according to the SAS + * definition. + */ + @JsonProperty(value = "validityPeriod", required = true) + private String validityPeriod; + + /** + * The attributes of the SAS definition. + */ + @JsonProperty(value = "attributes") + private SasDefinitionAttributes sasDefinitionAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the templateUri value. + * + * @return the templateUri value + */ + public String templateUri() { + return this.templateUri; + } + + /** + * Set the templateUri value. + * + * @param templateUri the templateUri value to set + * @return the SasDefinitionCreateParameters object itself. + */ + public SasDefinitionCreateParameters withTemplateUri(String templateUri) { + this.templateUri = templateUri; + return this; + } + + /** + * Get the sasType value. + * + * @return the sasType value + */ + public SasTokenType sasType() { + return this.sasType; + } + + /** + * Set the sasType value. + * + * @param sasType the sasType value to set + * @return the SasDefinitionCreateParameters object itself. + */ + public SasDefinitionCreateParameters withSasType(SasTokenType sasType) { + this.sasType = sasType; + return this; + } + + /** + * Get the validityPeriod value. + * + * @return the validityPeriod value + */ + public String validityPeriod() { + return this.validityPeriod; + } + + /** + * Set the validityPeriod value. + * + * @param validityPeriod the validityPeriod value to set + * @return the SasDefinitionCreateParameters object itself. + */ + public SasDefinitionCreateParameters withValidityPeriod(String validityPeriod) { + this.validityPeriod = validityPeriod; + return this; + } + + /** + * Get the sasDefinitionAttributes value. + * + * @return the sasDefinitionAttributes value + */ + public SasDefinitionAttributes sasDefinitionAttributes() { + return this.sasDefinitionAttributes; + } + + /** + * Set the sasDefinitionAttributes value. + * + * @param sasDefinitionAttributes the sasDefinitionAttributes value to set + * @return the SasDefinitionCreateParameters object itself. + */ + public SasDefinitionCreateParameters withSasDefinitionAttributes(SasDefinitionAttributes sasDefinitionAttributes) { + this.sasDefinitionAttributes = sasDefinitionAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SasDefinitionCreateParameters object itself. + */ + public SasDefinitionCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionItem.java new file mode 100644 index 0000000000000..b6b8edccb8fa5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionItem.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SAS definition item containing storage SAS definition metadata. + */ +public class SasDefinitionItem { + /** + * The storage SAS identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The storage account SAS definition secret id. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String secretId; + + /** + * The SAS definition management attributes. + */ + @JsonProperty(value = "attributes", access = JsonProperty.Access.WRITE_ONLY) + private SasDefinitionAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the secretId value. + * + * @return the secretId value + */ + public String secretId() { + return this.secretId; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public SasDefinitionAttributes attributes() { + return this.attributes; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionUpdateParameters.java new file mode 100644 index 0000000000000..1604a6295176d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasDefinitionUpdateParameters.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SAS definition update parameters. + */ +public class SasDefinitionUpdateParameters { + /** + * The SAS definition token template signed with an arbitrary key. Tokens + * created according to the SAS definition will have the same properties as + * the template. + */ + @JsonProperty(value = "templateUri") + private String templateUri; + + /** + * The type of SAS token the SAS definition will create. Possible values + * include: 'account', 'service'. + */ + @JsonProperty(value = "sasType") + private SasTokenType sasType; + + /** + * The validity period of SAS tokens created according to the SAS + * definition. + */ + @JsonProperty(value = "validityPeriod") + private String validityPeriod; + + /** + * The attributes of the SAS definition. + */ + @JsonProperty(value = "attributes") + private SasDefinitionAttributes sasDefinitionAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the templateUri value. + * + * @return the templateUri value + */ + public String templateUri() { + return this.templateUri; + } + + /** + * Set the templateUri value. + * + * @param templateUri the templateUri value to set + * @return the SasDefinitionUpdateParameters object itself. + */ + public SasDefinitionUpdateParameters withTemplateUri(String templateUri) { + this.templateUri = templateUri; + return this; + } + + /** + * Get the sasType value. + * + * @return the sasType value + */ + public SasTokenType sasType() { + return this.sasType; + } + + /** + * Set the sasType value. + * + * @param sasType the sasType value to set + * @return the SasDefinitionUpdateParameters object itself. + */ + public SasDefinitionUpdateParameters withSasType(SasTokenType sasType) { + this.sasType = sasType; + return this; + } + + /** + * Get the validityPeriod value. + * + * @return the validityPeriod value + */ + public String validityPeriod() { + return this.validityPeriod; + } + + /** + * Set the validityPeriod value. + * + * @param validityPeriod the validityPeriod value to set + * @return the SasDefinitionUpdateParameters object itself. + */ + public SasDefinitionUpdateParameters withValidityPeriod(String validityPeriod) { + this.validityPeriod = validityPeriod; + return this; + } + + /** + * Get the sasDefinitionAttributes value. + * + * @return the sasDefinitionAttributes value + */ + public SasDefinitionAttributes sasDefinitionAttributes() { + return this.sasDefinitionAttributes; + } + + /** + * Set the sasDefinitionAttributes value. + * + * @param sasDefinitionAttributes the sasDefinitionAttributes value to set + * @return the SasDefinitionUpdateParameters object itself. + */ + public SasDefinitionUpdateParameters withSasDefinitionAttributes(SasDefinitionAttributes sasDefinitionAttributes) { + this.sasDefinitionAttributes = sasDefinitionAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SasDefinitionUpdateParameters object itself. + */ + public SasDefinitionUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasTokenType.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasTokenType.java new file mode 100644 index 0000000000000..56a9b0c7760ca --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SasTokenType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SasTokenType. + */ +public final class SasTokenType { + /** Static value account for SasTokenType. */ + public static final SasTokenType ACCOUNT = new SasTokenType("account"); + + /** Static value service for SasTokenType. */ + public static final SasTokenType SERVICE = new SasTokenType("service"); + + private String value; + + /** + * Creates a custom value for SasTokenType. + * @param value the custom value + */ + public SasTokenType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof SasTokenType)) { + return false; + } + if (obj == this) { + return true; + } + SasTokenType rhs = (SasTokenType) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretAttributes.java new file mode 100644 index 0000000000000..b3e08b9afa0b1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretAttributes.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret management attributes. + */ +public class SecretAttributes extends Attributes { + /** + * Reflects the deletion recovery level currently in effect for secrets in + * the current vault. If it contains 'Purgeable', the secret can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the secret, at the end of the retention interval. Possible values + * include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription'. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /** + * Get the recoveryLevel value. + * + * @return the recoveryLevel value + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretBundle.java new file mode 100644 index 0000000000000..180f6a418d157 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretBundle.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A secret consisting of a value, id and its attributes. + */ +public class SecretBundle extends com.microsoft.azure.keyvault.models.custom.SecretBundle { + /** + * The secret value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The secret id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The secret management attributes. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * If this is a secret backing a KV certificate, then this field specifies + * the corresponding key backing the KV certificate. + */ + @JsonProperty(value = "kid", access = JsonProperty.Access.WRITE_ONLY) + private String kid; + + /** + * True if the secret's lifetime is managed by key vault. If this is a + * secret backing a certificate, then managed will be true. + */ + @JsonProperty(value = "managed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean managed; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the SecretBundle object itself. + */ + public SecretBundle withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SecretBundle object itself. + */ + public SecretBundle withId(String id) { + this.id = id; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the SecretBundle object itself. + */ + public SecretBundle withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the SecretBundle object itself. + */ + public SecretBundle withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SecretBundle object itself. + */ + public SecretBundle withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the kid value. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Get the managed value. + * + * @return the managed value + */ + public Boolean managed() { + return this.managed; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretItem.java new file mode 100644 index 0000000000000..9001d0f515d1b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretItem.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret item containing secret metadata. + */ +public class SecretItem { + /** + * Secret identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The secret management attributes. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Type of the secret value such as a password. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * True if the secret's lifetime is managed by key vault. If this is a key + * backing a certificate, then managed will be true. + */ + @JsonProperty(value = "managed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean managed; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SecretItem object itself. + */ + public SecretItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes value. + * + * @param attributes the attributes value to set + * @return the SecretItem object itself. + */ + public SecretItem withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SecretItem object itself. + */ + public SecretItem withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the SecretItem object itself. + */ + public SecretItem withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the managed value. + * + * @return the managed value + */ + public Boolean managed() { + return this.managed; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretProperties.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretProperties.java new file mode 100644 index 0000000000000..ceff8a773326e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the key backing a certificate. + */ +public class SecretProperties { + /** + * The media type (MIME type). + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the SecretProperties object itself. + */ + public SecretProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretRestoreParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretRestoreParameters.java new file mode 100644 index 0000000000000..27100e54dab42 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretRestoreParameters.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret restore parameters. + */ +public class SecretRestoreParameters { + /** + * The backup blob associated with a secret bundle. + */ + @JsonProperty(value = "value", required = true) + private Base64Url secretBundleBackup; + + /** + * Get the secretBundleBackup value. + * + * @return the secretBundleBackup value + */ + public byte[] secretBundleBackup() { + if (this.secretBundleBackup == null) { + return null; + } + return this.secretBundleBackup.decodedBytes(); + } + + /** + * Set the secretBundleBackup value. + * + * @param secretBundleBackup the secretBundleBackup value to set + * @return the SecretRestoreParameters object itself. + */ + public SecretRestoreParameters withSecretBundleBackup(byte[] secretBundleBackup) { + if (secretBundleBackup == null) { + this.secretBundleBackup = null; + } else { + this.secretBundleBackup = Base64Url.encode(secretBundleBackup); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretSetParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretSetParameters.java new file mode 100644 index 0000000000000..515d369e87dbe --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretSetParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret set parameters. + */ +public class SecretSetParameters { + /** + * The value of the secret. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Type of the secret value such as a password. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The secret management attributes. + */ + @JsonProperty(value = "attributes") + private SecretAttributes secretAttributes; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the SecretSetParameters object itself. + */ + public SecretSetParameters withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SecretSetParameters object itself. + */ + public SecretSetParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the SecretSetParameters object itself. + */ + public SecretSetParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the secretAttributes value. + * + * @return the secretAttributes value + */ + public SecretAttributes secretAttributes() { + return this.secretAttributes; + } + + /** + * Set the secretAttributes value. + * + * @param secretAttributes the secretAttributes value to set + * @return the SecretSetParameters object itself. + */ + public SecretSetParameters withSecretAttributes(SecretAttributes secretAttributes) { + this.secretAttributes = secretAttributes; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretUpdateParameters.java new file mode 100644 index 0000000000000..89e02e0374990 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SecretUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret update parameters. + */ +public class SecretUpdateParameters { + /** + * Type of the secret value such as a password. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The secret management attributes. + */ + @JsonProperty(value = "attributes") + private SecretAttributes secretAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the SecretUpdateParameters object itself. + */ + public SecretUpdateParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the secretAttributes value. + * + * @return the secretAttributes value + */ + public SecretAttributes secretAttributes() { + return this.secretAttributes; + } + + /** + * Set the secretAttributes value. + * + * @param secretAttributes the secretAttributes value to set + * @return the SecretUpdateParameters object itself. + */ + public SecretUpdateParameters withSecretAttributes(SecretAttributes secretAttributes) { + this.secretAttributes = secretAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the SecretUpdateParameters object itself. + */ + public SecretUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountAttributes.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountAttributes.java new file mode 100644 index 0000000000000..109e2c51bd5a9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountAttributes.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account management attributes. + */ +public class StorageAccountAttributes { + /** + * the enabled state of the object. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Creation time in UTC. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /** + * Last updated time in UTC. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** + * Reflects the deletion recovery level currently in effect for storage + * accounts in the current vault. If it contains 'Purgeable' the storage + * account can be permanently deleted by a privileged user; otherwise, only + * the system can purge the storage account, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription'. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the StorageAccountAttributes object itself. + */ + public StorageAccountAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return new DateTime(this.created * 1000L, DateTimeZone.UTC); + } + + /** + * Get the updated value. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return new DateTime(this.updated * 1000L, DateTimeZone.UTC); + } + + /** + * Get the recoveryLevel value. + * + * @return the recoveryLevel value + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountCreateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountCreateParameters.java new file mode 100644 index 0000000000000..cb49d6e14429f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountCreateParameters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account create parameters. + */ +public class StorageAccountCreateParameters { + /** + * Storage account resource id. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * Current active storage account key name. + */ + @JsonProperty(value = "activeKeyName", required = true) + private String activeKeyName; + + /** + * whether keyvault should manage the storage account for the user. + */ + @JsonProperty(value = "autoRegenerateKey", required = true) + private boolean autoRegenerateKey; + + /** + * The key regeneration time duration specified in ISO-8601 format. + */ + @JsonProperty(value = "regenerationPeriod") + private String regenerationPeriod; + + /** + * The attributes of the storage account. + */ + @JsonProperty(value = "attributes") + private StorageAccountAttributes storageAccountAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the activeKeyName value. + * + * @return the activeKeyName value + */ + public String activeKeyName() { + return this.activeKeyName; + } + + /** + * Set the activeKeyName value. + * + * @param activeKeyName the activeKeyName value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withActiveKeyName(String activeKeyName) { + this.activeKeyName = activeKeyName; + return this; + } + + /** + * Get the autoRegenerateKey value. + * + * @return the autoRegenerateKey value + */ + public boolean autoRegenerateKey() { + return this.autoRegenerateKey; + } + + /** + * Set the autoRegenerateKey value. + * + * @param autoRegenerateKey the autoRegenerateKey value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAutoRegenerateKey(boolean autoRegenerateKey) { + this.autoRegenerateKey = autoRegenerateKey; + return this; + } + + /** + * Get the regenerationPeriod value. + * + * @return the regenerationPeriod value + */ + public String regenerationPeriod() { + return this.regenerationPeriod; + } + + /** + * Set the regenerationPeriod value. + * + * @param regenerationPeriod the regenerationPeriod value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withRegenerationPeriod(String regenerationPeriod) { + this.regenerationPeriod = regenerationPeriod; + return this; + } + + /** + * Get the storageAccountAttributes value. + * + * @return the storageAccountAttributes value + */ + public StorageAccountAttributes storageAccountAttributes() { + return this.storageAccountAttributes; + } + + /** + * Set the storageAccountAttributes value. + * + * @param storageAccountAttributes the storageAccountAttributes value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withStorageAccountAttributes(StorageAccountAttributes storageAccountAttributes) { + this.storageAccountAttributes = storageAccountAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountItem.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountItem.java new file mode 100644 index 0000000000000..93c041ee25fcb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountItem.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account item containing storage account metadata. + */ +public class StorageAccountItem { + /** + * Storage identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Storage account resource Id. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * The storage account management attributes. + */ + @JsonProperty(value = "attributes", access = JsonProperty.Access.WRITE_ONLY) + private StorageAccountAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public StorageAccountAttributes attributes() { + return this.attributes; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountRegenerteKeyParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountRegenerteKeyParameters.java new file mode 100644 index 0000000000000..c29c60bde444f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountRegenerteKeyParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account key regenerate parameters. + */ +public class StorageAccountRegenerteKeyParameters { + /** + * The storage account key name. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the keyName value. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName value. + * + * @param keyName the keyName value to set + * @return the StorageAccountRegenerteKeyParameters object itself. + */ + public StorageAccountRegenerteKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountUpdateParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountUpdateParameters.java new file mode 100644 index 0000000000000..636137fff2eaa --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageAccountUpdateParameters.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account update parameters. + */ +public class StorageAccountUpdateParameters { + /** + * The current active storage account key name. + */ + @JsonProperty(value = "activeKeyName") + private String activeKeyName; + + /** + * whether keyvault should manage the storage account for the user. + */ + @JsonProperty(value = "autoRegenerateKey") + private Boolean autoRegenerateKey; + + /** + * The key regeneration time duration specified in ISO-8601 format. + */ + @JsonProperty(value = "regenerationPeriod") + private String regenerationPeriod; + + /** + * The attributes of the storage account. + */ + @JsonProperty(value = "attributes") + private StorageAccountAttributes storageAccountAttributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the activeKeyName value. + * + * @return the activeKeyName value + */ + public String activeKeyName() { + return this.activeKeyName; + } + + /** + * Set the activeKeyName value. + * + * @param activeKeyName the activeKeyName value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withActiveKeyName(String activeKeyName) { + this.activeKeyName = activeKeyName; + return this; + } + + /** + * Get the autoRegenerateKey value. + * + * @return the autoRegenerateKey value + */ + public Boolean autoRegenerateKey() { + return this.autoRegenerateKey; + } + + /** + * Set the autoRegenerateKey value. + * + * @param autoRegenerateKey the autoRegenerateKey value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAutoRegenerateKey(Boolean autoRegenerateKey) { + this.autoRegenerateKey = autoRegenerateKey; + return this; + } + + /** + * Get the regenerationPeriod value. + * + * @return the regenerationPeriod value + */ + public String regenerationPeriod() { + return this.regenerationPeriod; + } + + /** + * Set the regenerationPeriod value. + * + * @param regenerationPeriod the regenerationPeriod value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withRegenerationPeriod(String regenerationPeriod) { + this.regenerationPeriod = regenerationPeriod; + return this; + } + + /** + * Get the storageAccountAttributes value. + * + * @return the storageAccountAttributes value + */ + public StorageAccountAttributes storageAccountAttributes() { + return this.storageAccountAttributes; + } + + /** + * Set the storageAccountAttributes value. + * + * @param storageAccountAttributes the storageAccountAttributes value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withStorageAccountAttributes(StorageAccountAttributes storageAccountAttributes) { + this.storageAccountAttributes = storageAccountAttributes; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageBundle.java new file mode 100644 index 0000000000000..86a2525d4a46b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageBundle.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Storage account bundle consists of key vault storage account details plus + * its attributes. + */ +public class StorageBundle { + /** + * The storage account id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The storage account resource id. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * The current active storage account key name. + */ + @JsonProperty(value = "activeKeyName", access = JsonProperty.Access.WRITE_ONLY) + private String activeKeyName; + + /** + * whether keyvault should manage the storage account for the user. + */ + @JsonProperty(value = "autoRegenerateKey", access = JsonProperty.Access.WRITE_ONLY) + private Boolean autoRegenerateKey; + + /** + * The key regeneration time duration specified in ISO-8601 format. + */ + @JsonProperty(value = "regenerationPeriod", access = JsonProperty.Access.WRITE_ONLY) + private String regenerationPeriod; + + /** + * The storage account attributes. + */ + @JsonProperty(value = "attributes", access = JsonProperty.Access.WRITE_ONLY) + private StorageAccountAttributes attributes; + + /** + * Application specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the activeKeyName value. + * + * @return the activeKeyName value + */ + public String activeKeyName() { + return this.activeKeyName; + } + + /** + * Get the autoRegenerateKey value. + * + * @return the autoRegenerateKey value + */ + public Boolean autoRegenerateKey() { + return this.autoRegenerateKey; + } + + /** + * Get the regenerationPeriod value. + * + * @return the regenerationPeriod value + */ + public String regenerationPeriod() { + return this.regenerationPeriod; + } + + /** + * Get the attributes value. + * + * @return the attributes value + */ + public StorageAccountAttributes attributes() { + return this.attributes; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageRestoreParameters.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageRestoreParameters.java new file mode 100644 index 0000000000000..32ec85fe5ac9c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/StorageRestoreParameters.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.microsoft.rest.Base64Url; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secret restore parameters. + */ +public class StorageRestoreParameters { + /** + * The backup blob associated with a storage account. + */ + @JsonProperty(value = "value", required = true) + private Base64Url storageBundleBackup; + + /** + * Get the storageBundleBackup value. + * + * @return the storageBundleBackup value + */ + public byte[] storageBundleBackup() { + if (this.storageBundleBackup == null) { + return null; + } + return this.storageBundleBackup.decodedBytes(); + } + + /** + * Set the storageBundleBackup value. + * + * @param storageBundleBackup the storageBundleBackup value to set + * @return the StorageRestoreParameters object itself. + */ + public StorageRestoreParameters withStorageBundleBackup(byte[] storageBundleBackup) { + if (storageBundleBackup == null) { + this.storageBundleBackup = null; + } else { + this.storageBundleBackup = Base64Url.encode(storageBundleBackup); + } + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SubjectAlternativeNames.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SubjectAlternativeNames.java new file mode 100644 index 0000000000000..2ab51851f4793 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/SubjectAlternativeNames.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The subject alternate names of a X509 object. + */ +public class SubjectAlternativeNames { + /** + * Email addresses. + */ + @JsonProperty(value = "emails") + private List emails; + + /** + * Domain names. + */ + @JsonProperty(value = "dns_names") + private List dnsNames; + + /** + * User principal names. + */ + @JsonProperty(value = "upns") + private List upns; + + /** + * Get the emails value. + * + * @return the emails value + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails value. + * + * @param emails the emails value to set + * @return the SubjectAlternativeNames object itself. + */ + public SubjectAlternativeNames withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Get the dnsNames value. + * + * @return the dnsNames value + */ + public List dnsNames() { + return this.dnsNames; + } + + /** + * Set the dnsNames value. + * + * @param dnsNames the dnsNames value to set + * @return the SubjectAlternativeNames object itself. + */ + public SubjectAlternativeNames withDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + return this; + } + + /** + * Get the upns value. + * + * @return the upns value + */ + public List upns() { + return this.upns; + } + + /** + * Set the upns value. + * + * @param upns the upns value to set + * @return the SubjectAlternativeNames object itself. + */ + public SubjectAlternativeNames withUpns(List upns) { + this.upns = upns; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Trigger.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Trigger.java new file mode 100644 index 0000000000000..c42884ce962ca --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/Trigger.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A condition to be satisfied for an action to be executed. + */ +public class Trigger { + /** + * Percentage of lifetime at which to trigger. Value should be between 1 + * and 99. + */ + @JsonProperty(value = "lifetime_percentage") + private Integer lifetimePercentage; + + /** + * Days before expiry to attempt renewal. Value should be between 1 and + * validity_in_months multiplied by 27. If validity_in_months is 36, then + * value should be between 1 and 972 (36 * 27). + */ + @JsonProperty(value = "days_before_expiry") + private Integer daysBeforeExpiry; + + /** + * Get the lifetimePercentage value. + * + * @return the lifetimePercentage value + */ + public Integer lifetimePercentage() { + return this.lifetimePercentage; + } + + /** + * Set the lifetimePercentage value. + * + * @param lifetimePercentage the lifetimePercentage value to set + * @return the Trigger object itself. + */ + public Trigger withLifetimePercentage(Integer lifetimePercentage) { + this.lifetimePercentage = lifetimePercentage; + return this; + } + + /** + * Get the daysBeforeExpiry value. + * + * @return the daysBeforeExpiry value + */ + public Integer daysBeforeExpiry() { + return this.daysBeforeExpiry; + } + + /** + * Set the daysBeforeExpiry value. + * + * @param daysBeforeExpiry the daysBeforeExpiry value to set + * @return the Trigger object itself. + */ + public Trigger withDaysBeforeExpiry(Integer daysBeforeExpiry) { + this.daysBeforeExpiry = daysBeforeExpiry; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/X509CertificateProperties.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/X509CertificateProperties.java new file mode 100644 index 0000000000000..34a279a73e5b9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/X509CertificateProperties.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.keyvault.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the X509 component of a certificate. + */ +public class X509CertificateProperties { + /** + * The subject name. Should be a valid X509 distinguished Name. + */ + @JsonProperty(value = "subject") + private String subject; + + /** + * The enhanced key usage. + */ + @JsonProperty(value = "ekus") + private List ekus; + + /** + * The subject alternative names. + */ + @JsonProperty(value = "sans") + private SubjectAlternativeNames subjectAlternativeNames; + + /** + * List of key usages. + */ + @JsonProperty(value = "key_usage") + private List keyUsage; + + /** + * The duration that the ceritifcate is valid in months. + */ + @JsonProperty(value = "validity_months") + private Integer validityInMonths; + + /** + * Get the subject value. + * + * @return the subject value + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject value. + * + * @param subject the subject value to set + * @return the X509CertificateProperties object itself. + */ + public X509CertificateProperties withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the ekus value. + * + * @return the ekus value + */ + public List ekus() { + return this.ekus; + } + + /** + * Set the ekus value. + * + * @param ekus the ekus value to set + * @return the X509CertificateProperties object itself. + */ + public X509CertificateProperties withEkus(List ekus) { + this.ekus = ekus; + return this; + } + + /** + * Get the subjectAlternativeNames value. + * + * @return the subjectAlternativeNames value + */ + public SubjectAlternativeNames subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames value. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set + * @return the X509CertificateProperties object itself. + */ + public X509CertificateProperties withSubjectAlternativeNames(SubjectAlternativeNames subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the keyUsage value. + * + * @return the keyUsage value + */ + public List keyUsage() { + return this.keyUsage; + } + + /** + * Set the keyUsage value. + * + * @param keyUsage the keyUsage value to set + * @return the X509CertificateProperties object itself. + */ + public X509CertificateProperties withKeyUsage(List keyUsage) { + this.keyUsage = keyUsage; + return this; + } + + /** + * Get the validityInMonths value. + * + * @return the validityInMonths value + */ + public Integer validityInMonths() { + return this.validityInMonths; + } + + /** + * Set the validityInMonths value. + * + * @param validityInMonths the validityInMonths value to set + * @return the X509CertificateProperties object itself. + */ + public X509CertificateProperties withValidityInMonths(Integer validityInMonths) { + this.validityInMonths = validityInMonths; + return this; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateBundle.java new file mode 100644 index 0000000000000..85b6eeeadd1e8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateBundle.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.models.custom; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.CertificateIdentifier; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.SecretIdentifier; + +import java.io.IOException; + +/** + * A certificate bundle consists of a certificate (X509) plus its attributes. + */ +public class CertificateBundle { + + /** + * The certificate id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The key id. + */ + @JsonProperty(value = "kid", access = JsonProperty.Access.WRITE_ONLY) + private String kid; + + /** + * The secret id. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String sid; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the kid value. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Get the sid value. + * + * @return the sid value + */ + public String sid() { + return this.sid; + } + + + /** + * The certificate identifier. + * @return certificate identifier + */ + public CertificateIdentifier certificateIdentifier() { + if (id() == null || id().isEmpty()) { + return null; + } + return new CertificateIdentifier(id()); + } + + /** + * The secret identifier. + * @return secret identifier + */ + public SecretIdentifier secretIdentifier() { + if (sid() == null || sid().isEmpty()) { + return null; + } + return new SecretIdentifier(sid()); + } + + /** + * The key identifier. + * @return key identifier + */ + public KeyIdentifier keyIdentifier() { + if (kid() == null || kid().isEmpty()) { + return null; + } + return new KeyIdentifier(kid()); + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateOperation.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateOperation.java new file mode 100644 index 0000000000000..b04553b54a3b8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/CertificateOperation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.models.custom; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.CertificateOperationIdentifier; + +import java.io.IOException; + +/** + * A certificate operation is returned in case of asynchronous requests. + */ +public class CertificateOperation { + /** + * The certificate id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * The certificate operation identifier. + * @return the identifier value + */ + public CertificateOperationIdentifier certificateOperationIdentifier() { + if (id() == null || id().isEmpty()) { + return null; + } + return new CertificateOperationIdentifier(id()); + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/IssuerBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/IssuerBundle.java new file mode 100644 index 0000000000000..09d0bdda30f9d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/IssuerBundle.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.models.custom; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.IssuerIdentifier; + +import java.io.IOException; + +/** + * The issuer for Key Vault certificate. + */ +public class IssuerBundle { + /** + * Identifier for the issuer object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * The issuer identifier. + * @return identifier for issuer + */ + public IssuerIdentifier issuerIdentifier() { + if (id() == null || id().isEmpty()) { + return null; + } + return new IssuerIdentifier(id()); + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/KeyBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/KeyBundle.java new file mode 100644 index 0000000000000..2990cb852f452 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/KeyBundle.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.models.custom; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; + +import java.io.IOException; + +/** + * A KeyBundle consisting of a WebKey plus its attributes. + */ +public class KeyBundle { + + /** + * The Json web key. + */ + @JsonProperty(value = "key") + private JsonWebKey key; + + + /** + * Get the key value. + * + * @return the key value + */ + public JsonWebKey key() { + return this.key; + } + + /** + * The key identifier. + * @return identifier for the key + */ + public KeyIdentifier keyIdentifier() { + if (key() == null || key().kid() == null || key().kid().length() == 0) { + return null; + } + return new KeyIdentifier(key().kid()); + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/SecretBundle.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/SecretBundle.java new file mode 100644 index 0000000000000..643ae12dcfbcf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/SecretBundle.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.models.custom; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.microsoft.azure.keyvault.SecretIdentifier; + +import java.io.IOException; + +/** + * A secret consisting of a value, id and its attributes. + */ +public class SecretBundle { + + + /** + * The secret id. + */ + @JsonProperty(value = "id") + private String id; + + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * the secret identifier. + * @return The Identifier value + */ + public SecretIdentifier secretIdentifier() { + if (id() == null || id().length() == 0) { + return null; + } + return new SecretIdentifier(id()); + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonGenerationException e) { + throw new IllegalStateException(e); + } catch (JsonMappingException e) { + throw new IllegalStateException(e); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/package-info.java new file mode 100644 index 0000000000000..0ae4922426f57 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains the classes for KeyVaultClient. Performs cryptographic + * key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.models.custom; diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/package-info.java new file mode 100644 index 0000000000000..641d85ba33229 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the models classes for KeyVaultClientBase. + * The key vault client performs cryptographic key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.models; diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/package-info.java new file mode 100644 index 0000000000000..d9a1e4e792184 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for KeyVaultClientBase. + * The key vault client performs cryptographic key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault; diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateCertificateRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateCertificateRequest.java new file mode 100644 index 0000000000000..5340938fe4508 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateCertificateRequest.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyProperties; +import com.microsoft.azure.keyvault.models.LifetimeAction; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; + +/** + * The create certificate request class. + */ +public final class CreateCertificateRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final CertificatePolicy certificatePolicy; + private final CertificateAttributes certificateAttributes; + private final Map tags; + + /** + * the {@link CreateCertificateRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + + // Optional parameters + private CertificatePolicy policy; + private CertificateAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link CreateCertificateRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param certificateName + * The name of the certificate in the given vault + */ + public Builder(String vaultBaseUrl, String certificateName) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + } + + /** + * Set the certificatePolicy value. Mandatory if sending the create + * request for the first time. + * + * @param certificatePolicy + * The management policy for the certificate. + * @return the Builder object itself. + */ + public Builder withPolicy(CertificatePolicy certificatePolicy) { + this.policy = certificatePolicy; + return this; + } + + /** + * Set the attributes value. + * + * @param attributes + * The attributes of the certificate. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (CertificateAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link CreateCertificateRequest} object. + * + * @return the {@link CreateCertificateRequest} object. + */ + public CreateCertificateRequest build() { + return new CreateCertificateRequest(this); + } + } + + private CreateCertificateRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + + if (builder.attributes != null) { + certificateAttributes = (CertificateAttributes) new CertificateAttributes() + .withNotBefore(builder.attributes.notBefore()).withEnabled(builder.attributes.enabled()) + .withExpires(builder.attributes.expires()); + } else { + certificateAttributes = null; + } + + if (builder.policy != null) { + certificatePolicy = new CertificatePolicy(); + if (builder.policy.attributes() != null) { + certificatePolicy.withAttributes((CertificateAttributes) new CertificateAttributes() + .withEnabled(builder.policy.attributes().enabled()) + .withExpires(builder.policy.attributes().expires()) + .withNotBefore(builder.policy.attributes().notBefore())); + } + if (builder.policy.issuerParameters() != null) { + certificatePolicy + .withIssuerParameters(new IssuerParameters().withName(builder.policy.issuerParameters().name())); + } + if (builder.policy.x509CertificateProperties() != null) { + certificatePolicy.withX509CertificateProperties(new X509CertificateProperties() + .withValidityInMonths(builder.policy.x509CertificateProperties().validityInMonths()) + .withSubjectAlternativeNames( + builder.policy.x509CertificateProperties().subjectAlternativeNames()) + .withSubject(builder.policy.x509CertificateProperties().subject()) + .withEkus(builder.policy.x509CertificateProperties().ekus()) + .withKeyUsage(builder.policy.x509CertificateProperties().keyUsage())); + } + if (builder.policy.lifetimeActions() != null) { + certificatePolicy.withLifetimeActions(new ArrayList(builder.policy.lifetimeActions())); + } + if (builder.policy.keyProperties() != null) { + certificatePolicy.withKeyProperties( + new KeyProperties().withExportable(builder.policy.keyProperties().exportable()) + .withKeySize(builder.policy.keyProperties().keySize()) + .withKeyType(builder.policy.keyProperties().keyType()) + .withReuseKey(builder.policy.keyProperties().reuseKey())); + } + if (builder.policy.secretProperties() != null) { + certificatePolicy.withSecretProperties( + new SecretProperties().withContentType(builder.policy.secretProperties().contentType())); + } + } else { + certificatePolicy = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the certificate policy + */ + public CertificatePolicy certificatePolicy() { + return certificatePolicy; + } + + /** + * @return the certificate attributes + */ + public CertificateAttributes certificateAttributes() { + return certificateAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateKeyRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateKeyRequest.java new file mode 100644 index 0000000000000..ce15d4c64398c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/CreateKeyRequest.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.JsonWebKeyCurveName; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +/** + * The create key request class. + */ +public final class CreateKeyRequest { + + private final String vaultBaseUrl; + private final String keyName; + private final JsonWebKeyType keyType; + private final Integer keySize; + private final List keyOperations; + private final KeyAttributes keyAttributes; + private final Map tags; + private final JsonWebKeyCurveName curve; + + /** + * The {@link CreateKeyRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String keyName; + private final JsonWebKeyType keyType; + + // Optional parameters + private Integer keySize; + private List keyOperations; + private KeyAttributes attributes; + private Map tags; + private JsonWebKeyCurveName curve; + + /** + * The builder for constructing {@link CreateKeyRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param keyName + * The name of the key in the given vault + * @param keyType + * The type of key to create. Valid key types, see JsonWebKeyType. + * Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, + * Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + */ + public Builder(String vaultBaseUrl, String keyName, JsonWebKeyType keyType) { + this.vaultBaseUrl = vaultBaseUrl; + this.keyName = keyName; + this.keyType = keyType; + } + + /** + * Set the key size value. + * + * @param size + * the size of the key. + * @return the Builder object itself. + */ + public Builder withKeySize(Integer size) { + this.keySize = size; + return this; + } + + /** + * Set the key operations value. + * + * @param keyOperations + * the key operation list. + * @return the Builder object itself. + */ + public Builder withKeyOperations(List keyOperations) { + this.keyOperations = keyOperations; + return this; + } + + /** + * Set the key attributes value. + * + * @param attributes + * the key management attributes value to set. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (KeyAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Set the curve value. + * + * @param curve + * Defines values for JsonWebKeyCurveName; + * + * @return the Builder object itself. + */ + public Builder withCurve(JsonWebKeyCurveName curve) { + this.curve = curve; + return this; + } + + /** + * builds the {@link CreateKeyRequest} object. + * + * @return the {@link CreateKeyRequest} object. + */ + public CreateKeyRequest build() { + return new CreateKeyRequest(this); + } + } + + private CreateKeyRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + keyName = builder.keyName; + keyType = builder.keyType; + keySize = builder.keySize; + + if (builder.keyOperations != null) { + keyOperations = new ArrayList(builder.keyOperations); + } else { + keyOperations = null; + } + + if (builder.attributes != null) { + keyAttributes = (KeyAttributes) new KeyAttributes().withNotBefore(builder.attributes.notBefore()) + .withEnabled(builder.attributes.enabled()).withExpires(builder.attributes.expires()); + } else { + keyAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + + if (builder.curve != null) { + curve = builder.curve; + } else { + curve = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the key name + */ + public String keyName() { + return keyName; + } + + /** + * @return the key type + */ + public JsonWebKeyType keyType() { + return keyType; + } + + /** + * @return the key size + */ + public Integer keySize() { + return keySize; + } + + /** + * @return the key operations + */ + public List keyOperations() { + return keyOperations; + } + + /** + * @return the key attributes + */ + public KeyAttributes keyAttributes() { + return keyAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } + + /** + * @return the curve + */ + public JsonWebKeyCurveName curve() { + return curve; + } +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportCertificateRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportCertificateRequest.java new file mode 100644 index 0000000000000..a39eac190cac2 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportCertificateRequest.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyProperties; +import com.microsoft.azure.keyvault.models.LifetimeAction; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; + +/** + * The import certificate request class. + */ +public final class ImportCertificateRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final String base64EncodedCertificate; + private final String password; + private final CertificatePolicy certificatePolicy; + private final CertificateAttributes certificateAttributes; + private final Map tags; + + /** + * the {@link ImportCertificateRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + private final String base64EncodedCertificate; + + // Optional parameters + private String password; + private CertificatePolicy policy; + private CertificateAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link ImportCertificateRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param certificateName + * The name of the certificate in the given vault + * @param base64EncodedCertificate + * Base64 encoded representation of the certificate object to + * import. This certificate needs to contain the private key. + */ + public Builder(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + this.base64EncodedCertificate = base64EncodedCertificate; + } + + /** + * Set the password. + * + * @param password + * If the private key in base64EncodedCertificate is + * encrypted, the password used for encryption. + * @return the Builder object itself. + */ + public Builder withPassword(String password) { + this.password = password; + return this; + } + + /** + * Set the certificate policy. + * + * @param policy + * The management policy for the certificate. + * @return the Builder object itself. + */ + public Builder withPolicy(CertificatePolicy policy) { + this.policy = policy; + return this; + } + + /** + * Set the certificate attributes. + * + * @param attributes + * The attributes of the certificate. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (CertificateAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link ImportCertificateRequest} object. + * + * @return the {@link ImportCertificateRequest} object. + */ + public ImportCertificateRequest build() { + return new ImportCertificateRequest(this); + } + } + + private ImportCertificateRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + base64EncodedCertificate = builder.base64EncodedCertificate; + password = builder.password; + + if (builder.attributes != null) { + certificateAttributes = (CertificateAttributes) new CertificateAttributes() + .withNotBefore(builder.attributes.notBefore()).withEnabled(builder.attributes.enabled()) + .withExpires(builder.attributes.expires()); + } + else { + certificateAttributes = null; + } + + if (builder.policy != null) { + certificatePolicy = new CertificatePolicy(); + if (builder.policy.attributes() != null) { + certificatePolicy.withAttributes((CertificateAttributes) new CertificateAttributes() + .withEnabled(builder.policy.attributes().enabled()) + .withExpires(builder.policy.attributes().expires()) + .withNotBefore(builder.policy.attributes().notBefore())); + } + if (builder.policy.issuerParameters() != null) { + certificatePolicy + .withIssuerParameters(new IssuerParameters().withName(builder.policy.issuerParameters().name())); + } + if (builder.policy.x509CertificateProperties() != null) { + certificatePolicy.withX509CertificateProperties(new X509CertificateProperties() + .withValidityInMonths(builder.policy.x509CertificateProperties().validityInMonths()) + .withSubjectAlternativeNames( + builder.policy.x509CertificateProperties().subjectAlternativeNames()) + .withSubject(builder.policy.x509CertificateProperties().subject()) + .withEkus(builder.policy.x509CertificateProperties().ekus()) + .withKeyUsage(builder.policy.x509CertificateProperties().keyUsage())); + } + if (builder.policy.lifetimeActions() != null) { + certificatePolicy.withLifetimeActions(new ArrayList(builder.policy.lifetimeActions())); + } + if (builder.policy.keyProperties() != null) { + certificatePolicy.withKeyProperties( + new KeyProperties().withExportable(builder.policy.keyProperties().exportable()) + .withKeySize(builder.policy.keyProperties().keySize()) + .withKeyType(builder.policy.keyProperties().keyType()) + .withReuseKey(builder.policy.keyProperties().reuseKey())); + } + if (builder.policy.secretProperties() != null) { + certificatePolicy.withSecretProperties( + new SecretProperties().withContentType(builder.policy.secretProperties().contentType())); + } + } else { + certificatePolicy = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the base64 encoded certificate + */ + public String base64EncodedCertificate() { + return base64EncodedCertificate; + } + + /** + * @return the password + */ + public String password() { + return password; + } + + /** + * @return the certificatePolicy + */ + public CertificatePolicy certificatePolicy() { + return certificatePolicy; + } + + /** + * @return the certificateAttributes + */ + public CertificateAttributes certificateAttributes() { + return certificateAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportKeyRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportKeyRequest.java new file mode 100644 index 0000000000000..c8fd5942920b6 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/ImportKeyRequest.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; + +/** + * The import key request class. + */ +public final class ImportKeyRequest { + + private final String vaultBaseUrl; + private final String keyName; + private final JsonWebKey key; + private final boolean isHsm; + private final KeyAttributes keyAttributes; + private final Map tags; + + /** + * The {@link ImportKeyRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String keyName; + private final JsonWebKey key; + + // Optional parameters + private boolean isHsm; + private KeyAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link ImportKeyRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param keyName + * The name of the key in the given vault. + * @param key + * The Json web key. + */ + public Builder(String vaultBaseUrl, String keyName, JsonWebKey key) { + this.vaultBaseUrl = vaultBaseUrl; + this.keyName = keyName; + this.key = key; + } + + /** + * Set the isHsm to true if the key is imported as a hardware key to + * HSM, false otherwise. + * + * @param isHsm + * True, if the key is hardware key to be stored in HSM. + * false otherwise + * @return the Builder object itself. + */ + public Builder withHsm(boolean isHsm) { + this.isHsm = isHsm; + return this; + } + + /** + * Set the key attributes value. + * + * @param attributes + * the key management attributes value to set + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (KeyAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link ImportKeyRequest} object. + * + * @return the {@link ImportKeyRequest} object. + */ + public ImportKeyRequest build() { + return new ImportKeyRequest(this); + } + } + + private ImportKeyRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + keyName = builder.keyName; + isHsm = builder.isHsm; + + if (builder.key != null) { + key = new JsonWebKey().withKty(builder.key.kty()).withN(builder.key.n()).withE(builder.key.e()) + .withD(builder.key.d()).withP(builder.key.p()).withQ(builder.key.q()).withDp(builder.key.dp()) + .withDq(builder.key.dq()).withQi(builder.key.qi()).withK(builder.key.k()).withT(builder.key.t()); + if (builder.key.keyOps() != null) { + key.withKeyOps(new ArrayList(builder.key.keyOps())); + } + } else { + key = null; + } + + if (builder.attributes != null) { + keyAttributes = (KeyAttributes) new KeyAttributes().withNotBefore(builder.attributes.notBefore()) + .withEnabled(builder.attributes.enabled()).withExpires(builder.attributes.expires()); + } else { + keyAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the key name + */ + public String keyName() { + return keyName; + } + + /** + * @return the key + */ + public JsonWebKey key() { + return key; + } + + /** + * @return the isHsm + */ + public boolean isHsm() { + return isHsm; + } + + /** + * @return the key attribute + */ + public KeyAttributes keyAttributes() { + return keyAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/MergeCertificateRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/MergeCertificateRequest.java new file mode 100644 index 0000000000000..8b97e06b0245e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/MergeCertificateRequest.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.CertificateAttributes; + +/** + * The merge certificate request class. + */ +public final class MergeCertificateRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final List x509Certificates; + private final CertificateAttributes certificateAttributes; + private final Map tags; + + /** + * The {@link MergeCertificateRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + private final List x509Certificates; + + // Optional parameters + private CertificateAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link MergeCertificateRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param certificateName + * The name of the certificate in the given vault. + * @param x509Certificates + * The certificate or the certificate chain to merge. + */ + public Builder(String vaultBaseUrl, String certificateName, List x509Certificates) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + this.x509Certificates = x509Certificates; + } + + /** + * Set the attributes value. + * + * @param attributes + * The attributes of the certificate. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (CertificateAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link MergeCertificateRequest} object. + * + * @return the {@link MergeCertificateRequest} object. + */ + public MergeCertificateRequest build() { + return new MergeCertificateRequest(this); + } + } + + private MergeCertificateRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + x509Certificates = new ArrayList(builder.x509Certificates); + + if (builder.attributes != null) { + certificateAttributes = (CertificateAttributes) new CertificateAttributes() + .withNotBefore(builder.attributes.notBefore()).withEnabled(builder.attributes.enabled()) + .withExpires(builder.attributes.expires()); + } else { + certificateAttributes = null; + } + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the x509 certificates + */ + public List x509Certificates() { + return x509Certificates; + } + + /** + * @return the certificate attributes + */ + public CertificateAttributes certificateAttributes() { + return certificateAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetCertificateIssuerRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetCertificateIssuerRequest.java new file mode 100644 index 0000000000000..ba6a77927622c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetCertificateIssuerRequest.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; + +import com.microsoft.azure.keyvault.models.AdministratorDetails; +import com.microsoft.azure.keyvault.models.IssuerAttributes; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.models.OrganizationDetails; + +/** + * The set certificate issuer request class. + */ +public final class SetCertificateIssuerRequest { + + private final String vaultBaseUrl; + private final String issuerName; + private final String provider; + private final IssuerCredentials credentials; + private final OrganizationDetails organizationDetails; + private final IssuerAttributes attributes; + + /** + * The {@link SetCertificateIssuerRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String issuerName; + private final String provider; + + // Optional parameters + private IssuerCredentials credentials; + private OrganizationDetails organizationDetails; + private IssuerAttributes attributes; + + /** + * The builder for constructing {@link SetCertificateIssuerRequest} + * object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param issuerName + * The name of the issuer. + * @param provider The name of the issuer. + */ + public Builder(String vaultBaseUrl, String issuerName, String provider) { + this.vaultBaseUrl = vaultBaseUrl; + this.issuerName = issuerName; + this.provider = provider; + } + + /** + * Set issuer credentials. + * + * @param credentials + * The issuer credentials. + * @return the Builder object itself. + */ + public Builder withCredentials(IssuerCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Set issuer organization details. + * + * @param organizationDetails + * The issuer organization details. + * @return the Builder object itself. + */ + public Builder withOrganizationDetails(OrganizationDetails organizationDetails) { + this.organizationDetails = organizationDetails; + return this; + } + + /** + * Set issuer attributes. + * + * @param attributes + * The issuer attributes. + * @return the Builder object itself. + */ + public Builder withAttributes(IssuerAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * builds the {@link SetCertificateIssuerRequest} object. + * + * @return the {@link SetCertificateIssuerRequest} object. + */ + public SetCertificateIssuerRequest build() { + return new SetCertificateIssuerRequest(this); + } + } + + private SetCertificateIssuerRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + issuerName = builder.issuerName; + provider = builder.provider; + if (builder.organizationDetails != null) { + organizationDetails = new OrganizationDetails() + .withId(builder.organizationDetails.id()) + .withAdminDetails(new ArrayList(builder.organizationDetails.adminDetails())); + } else { + organizationDetails = null; + } + if (builder.credentials != null) { + credentials = new IssuerCredentials() + .withAccountId(builder.credentials.accountId()) + .withPassword(builder.credentials.password()); + } else { + credentials = null; + } + if (builder.attributes != null) { + attributes = new IssuerAttributes().withEnabled(builder.attributes.enabled()); + } else { + attributes = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the issuer name + */ + public String issuerName() { + return issuerName; + } + + /** + * @return the issuer provider name + */ + public String provider() { + return provider; + } + + /** + * @return the issuer credentials + */ + public IssuerCredentials credentials() { + return credentials; + } + + /** + * @return the organization details + */ + public OrganizationDetails organizationDetails() { + return organizationDetails; + } + + /** + * @return the issuer attributes + */ + public IssuerAttributes attributes() { + return attributes; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetSecretRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetSecretRequest.java new file mode 100644 index 0000000000000..79caf1dc45d5e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/SetSecretRequest.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.SecretAttributes; + +/** + * The set secret request class. + */ +public final class SetSecretRequest { + private final String vaultBaseUrl; + private final String secretName; + private final String value; + private final String contentType; + private final SecretAttributes secretAttributes; + private final Map tags; + + /** + * The {@link SetSecretRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String secretName; + private final String value; + + // Optional parameters + private String contentType; + private SecretAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link SetSecretRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net + * @param secretName + * The name of the secret in the given vault + * @param value + * The value of the secret + */ + public Builder(String vaultBaseUrl, String secretName, String value) { + this.vaultBaseUrl = vaultBaseUrl; + this.secretName = secretName; + this.value = value; + } + + /** + * Set the content type value. + * + * @param contentType + * Type of the secret value such as a password + * @return the Builder object itself. + */ + public Builder withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Set the attributes value. + * + * @param attributes + * The secret management attributes. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (SecretAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link SetSecretRequest} object. + * + * @return the {@link SetSecretRequest} object. + */ + public SetSecretRequest build() { + return new SetSecretRequest(this); + } + } + + private SetSecretRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + secretName = builder.secretName; + value = builder.value; + contentType = builder.contentType; + + if (builder.attributes != null) { + secretAttributes = (SecretAttributes) new SecretAttributes().withNotBefore(builder.attributes.notBefore()) + .withEnabled(builder.attributes.enabled()).withExpires(builder.attributes.expires()); + } else { + secretAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vaultBaseUrl + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the secretName + */ + public String secretName() { + return secretName; + } + + /** + * @return the value + */ + public String value() { + return value; + } + + /** + * @return the contentType + */ + public String contentType() { + return contentType; + } + + /** + * @return the secretAttributes + */ + public SecretAttributes secretAttributes() { + return secretAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateIssuerRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateIssuerRequest.java new file mode 100644 index 0000000000000..6ec959abd8e90 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateIssuerRequest.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; + +import com.microsoft.azure.keyvault.models.AdministratorDetails; +import com.microsoft.azure.keyvault.models.IssuerAttributes; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.models.OrganizationDetails; + +/** + * The update certificate issuer request class. + */ +public final class UpdateCertificateIssuerRequest { + private final String vaultBaseUrl; + private final String issuerName; + private final String provider; + private final IssuerCredentials credentials; + private final OrganizationDetails organizationDetails; + private final IssuerAttributes attributes; + + /** + * The {@link UpdateCertificateIssuerRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String issuerName; + + // Optional parameters + private String provider; + private IssuerCredentials credentials; + private OrganizationDetails organizationDetails; + private IssuerAttributes attributes; + + /** + * The builder for constructing {@link UpdateCertificateIssuerRequest} + * object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param issuerName + * The name of the issuer in the given vault. + */ + public Builder(String vaultBaseUrl, String issuerName) { + this.vaultBaseUrl = vaultBaseUrl; + this.issuerName = issuerName; + } + + /** + * Set issuer credentials. + * + * @param provider + * The issuer provider. + * @return the Builder object itself. + */ + public Builder withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Set issuer credentials. + * + * @param credentials + * The issuer credentials. + * @return the Builder object itself. + */ + public Builder withCredentials(IssuerCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Set issuer organization details. + * + * @param organizationDetails + * The issuer organization details. + * @return the Builder object itself. + */ + public Builder withOrganizationDetails(OrganizationDetails organizationDetails) { + this.organizationDetails = organizationDetails; + return this; + } + + /** + * Set issuer attributes. + * + * @param attributes + * The issuer attributes. + * @return the Builder object itself. + */ + public Builder withAttributes(IssuerAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * builds the {@link UpdateCertificateIssuerRequest} object. + * + * @return the {@link UpdateCertificateIssuerRequest} object. + */ + public UpdateCertificateIssuerRequest build() { + return new UpdateCertificateIssuerRequest(this); + } + } + + private UpdateCertificateIssuerRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + issuerName = builder.issuerName; + provider = builder.provider; + if (builder.organizationDetails != null) { + organizationDetails = new OrganizationDetails() + .withId(builder.organizationDetails.id()) + .withAdminDetails(new ArrayList(builder.organizationDetails.adminDetails())); + } else { + organizationDetails = null; + } + if (builder.credentials != null) { + credentials = new IssuerCredentials() + .withAccountId(builder.credentials.accountId()) + .withPassword(builder.credentials.password()); + } else { + credentials = null; + } + if (builder.attributes != null) { + attributes = new IssuerAttributes().withEnabled(builder.attributes.enabled()); + } else { + attributes = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the issuer name + */ + public String issuerName() { + return issuerName; + } + + /** + * @return the issuer provider name + */ + public String provider() { + return provider; + } + + /** + * @return the issuer credentials + */ + public IssuerCredentials credentials() { + return credentials; + } + + /** + * @return the organization details + */ + public OrganizationDetails organizationDetails() { + return organizationDetails; + } + + /** + * @return the issuer attributes + */ + public IssuerAttributes attributes() { + return attributes; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateOperationRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateOperationRequest.java new file mode 100644 index 0000000000000..b1e736daa8bb0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateOperationRequest.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +/** + * The update certificate operation request class. + */ +public final class UpdateCertificateOperationRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final Boolean cancellationRequested; + + /** + * The {@link UpdateCertificateOperationRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + private final Boolean cancellationRequested; + + // Optional parameters + + /** + * The builder for constructing {@link CreateCertificateRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param certificateName + * The name of the certificate in the given vault. + * @param cancellationRequested + * Indicates if cancellation was requested on the certificate operation. + */ + public Builder(String vaultBaseUrl, String certificateName, Boolean cancellationRequested) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + this.cancellationRequested = cancellationRequested; + } + + /** + * builds the {@link UpdateCertificateOperationRequest} object. + * + * @return the {@link UpdateCertificateOperationRequest} object. + */ + public UpdateCertificateOperationRequest build() { + return new UpdateCertificateOperationRequest(this); + } + } + + private UpdateCertificateOperationRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + cancellationRequested = builder.cancellationRequested; + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the certificate policy + */ + public Boolean cancellationRequested() { + return cancellationRequested; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificatePolicyRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificatePolicyRequest.java new file mode 100644 index 0000000000000..088889840fff0 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificatePolicyRequest.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; + +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyProperties; +import com.microsoft.azure.keyvault.models.LifetimeAction; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; + +/** + * The update certificate policy request class. + */ +public final class UpdateCertificatePolicyRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final CertificatePolicy certificatePolicy; + + /** + * The {@link UpdateCertificatePolicyRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + + // Optional parameters + private CertificatePolicy policy; + + /** + * The builder for constructing {@link UpdateCertificatePolicyRequest} + * object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param certificateName + * The name of the certificate in the given vault. + */ + public Builder(String vaultBaseUrl, String certificateName) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + } + + /** + * Set the certificatePolicy value. + * + * @param certificatePolicy + * The management policy for the certificate. + * @return the Builder object itself. + */ + public Builder withPolicy(CertificatePolicy certificatePolicy) { + this.policy = certificatePolicy; + return this; + } + + /** + * builds the {@link UpdateCertificatePolicyRequest} object. + * + * @return the {@link UpdateCertificatePolicyRequest} object. + */ + public UpdateCertificatePolicyRequest build() { + return new UpdateCertificatePolicyRequest(this); + } + } + + private UpdateCertificatePolicyRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + + if (builder.policy != null) { + certificatePolicy = new CertificatePolicy(); + if (builder.policy.attributes() != null) { + certificatePolicy.withAttributes((CertificateAttributes) new CertificateAttributes() + .withEnabled(builder.policy.attributes().enabled()) + .withExpires(builder.policy.attributes().expires()) + .withNotBefore(builder.policy.attributes().notBefore())); + } + if (builder.policy.issuerParameters() != null) { + certificatePolicy + .withIssuerParameters(new IssuerParameters().withName(builder.policy.issuerParameters().name())); + } + if (builder.policy.x509CertificateProperties() != null) { + certificatePolicy.withX509CertificateProperties(new X509CertificateProperties() + .withValidityInMonths(builder.policy.x509CertificateProperties().validityInMonths()) + .withSubjectAlternativeNames( + builder.policy.x509CertificateProperties().subjectAlternativeNames()) + .withSubject(builder.policy.x509CertificateProperties().subject()) + .withEkus(builder.policy.x509CertificateProperties().ekus()) + .withKeyUsage(builder.policy.x509CertificateProperties().keyUsage())); + } + if (builder.policy.lifetimeActions() != null) { + certificatePolicy.withLifetimeActions(new ArrayList(builder.policy.lifetimeActions())); + } + if (builder.policy.keyProperties() != null) { + certificatePolicy.withKeyProperties( + new KeyProperties().withExportable(builder.policy.keyProperties().exportable()) + .withKeySize(builder.policy.keyProperties().keySize()) + .withKeyType(builder.policy.keyProperties().keyType()) + .withReuseKey(builder.policy.keyProperties().reuseKey())); + } + if (builder.policy.secretProperties() != null) { + certificatePolicy.withSecretProperties( + new SecretProperties().withContentType(builder.policy.secretProperties().contentType())); + } + } else { + certificatePolicy = new CertificatePolicy(); + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the certificate policy + */ + public CertificatePolicy certificatePolicy() { + return certificatePolicy; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateRequest.java new file mode 100644 index 0000000000000..236c31df3a967 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateCertificateRequest.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyProperties; +import com.microsoft.azure.keyvault.models.LifetimeAction; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; + +/** + * The update certificate request class. + */ +public final class UpdateCertificateRequest { + private final String vaultBaseUrl; + private final String certificateName; + private final String certificateVersion; + private final CertificatePolicy certificatePolicy; + private final CertificateAttributes certificateAttributes; + private final Map tags; + + /** + * The {@link UpdateCertificateRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String certificateName; + + // Optional parameters + private String certificateVersion; + private CertificateAttributes attributes; + private Map tags; + private CertificatePolicy policy; + + /** + * The builder for constructing {@link UpdateCertificateRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param certificateName + * The name of the certificate in the given vault. + */ + public Builder(String vaultBaseUrl, String certificateName) { + this.vaultBaseUrl = vaultBaseUrl; + this.certificateName = certificateName; + } + + /** + * Set the certificate version value. + * + * @param version + * The version of the certificate. + * @return the Builder object itself. + */ + public Builder withCertificateVersion(String version) { + this.certificateVersion = version; + return this; + } + + /** + * Set the certificatePolicy value. Mandatory if sending the create + * request for the first time. + * + * @param certificatePolicy + * The management policy for the certificate. + * @return the Builder object itself. + */ + public Builder withPolicy(CertificatePolicy certificatePolicy) { + this.policy = certificatePolicy; + return this; + } + + /** + * Set the attributes value. + * + * @param attributes + * The attributes of the certificate. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (CertificateAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link UpdateCertificateRequest} object. + * + * @return the {@link UpdateCertificateRequest} object. + */ + public UpdateCertificateRequest build() { + return new UpdateCertificateRequest(this); + } + } + + private UpdateCertificateRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + certificateName = builder.certificateName; + certificateVersion = builder.certificateVersion == null ? "" : builder.certificateVersion; + + if (builder.attributes != null) { + certificateAttributes = (CertificateAttributes) new CertificateAttributes() + .withNotBefore(builder.attributes.notBefore()).withEnabled(builder.attributes.enabled()) + .withExpires(builder.attributes.expires()); + } else { + certificateAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + + if (builder.policy != null) { + certificatePolicy = new CertificatePolicy(); + if (builder.policy.attributes() != null) { + certificatePolicy.withAttributes((CertificateAttributes) new CertificateAttributes() + .withEnabled(builder.policy.attributes().enabled()) + .withExpires(builder.policy.attributes().expires()) + .withNotBefore(builder.policy.attributes().notBefore())); + } + if (builder.policy.issuerParameters() != null) { + certificatePolicy + .withIssuerParameters(new IssuerParameters().withName(builder.policy.issuerParameters().name())); + } + if (builder.policy.x509CertificateProperties() != null) { + certificatePolicy.withX509CertificateProperties(new X509CertificateProperties() + .withValidityInMonths(builder.policy.x509CertificateProperties().validityInMonths()) + .withSubjectAlternativeNames( + builder.policy.x509CertificateProperties().subjectAlternativeNames()) + .withSubject(builder.policy.x509CertificateProperties().subject()) + .withEkus(builder.policy.x509CertificateProperties().ekus()) + .withKeyUsage(builder.policy.x509CertificateProperties().keyUsage())); + } + if (builder.policy.lifetimeActions() != null) { + certificatePolicy.withLifetimeActions(new ArrayList(builder.policy.lifetimeActions())); + } + if (builder.policy.keyProperties() != null) { + certificatePolicy.withKeyProperties( + new KeyProperties().withExportable(builder.policy.keyProperties().exportable()) + .withKeySize(builder.policy.keyProperties().keySize()) + .withKeyType(builder.policy.keyProperties().keyType()) + .withReuseKey(builder.policy.keyProperties().reuseKey())); + } + if (builder.policy.secretProperties() != null) { + certificatePolicy.withSecretProperties( + new SecretProperties().withContentType(builder.policy.secretProperties().contentType())); + } + } else { + certificatePolicy = new CertificatePolicy(); + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the certificate name + */ + public String certificateName() { + return certificateName; + } + + /** + * @return the certificate version + */ + public String certificateVersion() { + return certificateVersion; + } + + /** + * @return the certificate policy + */ + public CertificatePolicy certificatePolicy() { + return certificatePolicy; + } + + /** + * @return the certificate attributes + */ + public CertificateAttributes certificateAttributes() { + return certificateAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateKeyRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateKeyRequest.java new file mode 100644 index 0000000000000..429ee4e80ee51 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateKeyRequest.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; + +/** + * The key update request class. + */ +public final class UpdateKeyRequest { + + private final String vaultBaseUrl; + private final String keyName; + private final String keyVersion; + private final List keyOperations; + private final KeyAttributes keyAttributes; + private final Map tags; + + /** + * The {@link UpdateKeyRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String keyName; + + // Optional parameters + private String keyVersion; + private List keyOperations; + private KeyAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link UpdateKeyRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param keyName + * The name of the key in the given vault. + */ + public Builder(String vaultBaseUrl, String keyName) { + this.vaultBaseUrl = vaultBaseUrl; + this.keyName = keyName; + } + + /** + * The builder for constructing {@link UpdateKeyRequest} object. + * + * @param keyIdentifier + * The key identifier, e.g. + * https://{vault-name}.vault.azure.net/keys/{key-name}/{key- + * version}. + */ + public Builder(String keyIdentifier) { + KeyIdentifier id = new KeyIdentifier(keyIdentifier); + this.vaultBaseUrl = id.vault(); + this.keyName = id.name(); + this.keyVersion = id.version(); + } + + /** + * Set the key version value. + * + * @param keyVersion + * the key version. + * @return the Builder object itself. + */ + public Builder withVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Set the key operations value. + * + * @param keyOperations + * the key operation list + * @return the Builder object itself. + */ + public Builder withKeyOperations(List keyOperations) { + this.keyOperations = keyOperations; + return this; + } + + /** + * Set the key attributes value. + * + * @param attributes + * the key management attributes value to set + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (KeyAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link UpdateKeyRequest} object. + * + * @return the {@link UpdateKeyRequest} object. + */ + public UpdateKeyRequest build() { + return new UpdateKeyRequest(this); + } + } + + private UpdateKeyRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + keyName = builder.keyName; + keyVersion = builder.keyVersion == null ? "" : builder.keyVersion; + + if (builder.keyOperations != null) { + keyOperations = new ArrayList(builder.keyOperations); + } else { + keyOperations = null; + } + + if (builder.attributes != null) { + keyAttributes = (KeyAttributes) new KeyAttributes().withEnabled(builder.attributes.enabled()) + .withExpires(builder.attributes.expires()).withNotBefore(builder.attributes.notBefore()); + } else { + keyAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vault base url + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the key name + */ + public String keyName() { + return keyName; + } + + /** + * @return the key version + */ + public String keyVersion() { + return keyVersion; + } + + /** + * @return the key operations + */ + public List keyOperations() { + return keyOperations; + } + + /** + * @return the key attributes + */ + public KeyAttributes keyAttributes() { + return keyAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateSecretRequest.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateSecretRequest.java new file mode 100644 index 0000000000000..547c3d6f859e1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/UpdateSecretRequest.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.requests; + +import java.util.Collections; +import java.util.Map; + +import com.microsoft.azure.keyvault.SecretIdentifier; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.SecretAttributes; + +/** + * The update secret request class. + */ +public final class UpdateSecretRequest { + private final String vaultBaseUrl; + private final String secretName; + private final String secretVersion; + private final String contentType; + private final SecretAttributes secretAttributes; + private final Map tags; + + /** + * The {@link UpdateSecretRequest} builder. + */ + public static class Builder { + + // Required parameters + private final String vaultBaseUrl; + private final String secretName; + + // Optional parameters + private String secretVersion; + private String contentType; + private SecretAttributes attributes; + private Map tags; + + /** + * The builder for constructing {@link UpdateSecretRequest} object. + * + * @param vaultBaseUrl + * The vault name, e.g. https://myvault.vault.azure.net. + * @param secretName + * The name of the secret in the given vault. + */ + public Builder(String vaultBaseUrl, String secretName) { + this.vaultBaseUrl = vaultBaseUrl; + this.secretName = secretName; + } + + /** + * The builder for constructing {@link UpdateSecretRequest} object. + * + * @param secretId + * The secret identifier, e.g. + * https://{vault-name}.vault.azure.net/secrets/{secret-name} + * /{ secret-version}. + */ + public Builder(String secretId) { + SecretIdentifier id = new SecretIdentifier(secretId); + this.vaultBaseUrl = id.vault(); + this.secretName = id.name(); + this.secretVersion = id.version(); + } + + /** + * Sets the secret version. + * @param version the secret version. + * @return the Builder object itself. + */ + public Builder withVersion(String version) { + this.secretVersion = version; + return this; + } + + /** + * Set the content type value. + * + * @param contentType + * Type of the secret value such as a password. + * @return the Builder object itself. + */ + public Builder withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Set the attributes value. + * + * @param attributes + * The secret management attributes. + * @return the Builder object itself. + */ + public Builder withAttributes(Attributes attributes) { + this.attributes = (SecretAttributes) attributes; + return this; + } + + /** + * Set the tags value. + * + * @param tags + * Application-specific metadata in the form of key-value + * pairs. + * @return the Builder object itself. + */ + public Builder withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * builds the {@link UpdateSecretRequest} object. + * + * @return the {@link UpdateSecretRequest} object. + */ + public UpdateSecretRequest build() { + return new UpdateSecretRequest(this); + } + } + + private UpdateSecretRequest(Builder builder) { + vaultBaseUrl = builder.vaultBaseUrl; + secretName = builder.secretName; + secretVersion = builder.secretVersion == null ? "" : builder.secretVersion; + contentType = builder.contentType; + + if (builder.attributes != null) { + secretAttributes = (SecretAttributes) new SecretAttributes().withNotBefore(builder.attributes.notBefore()) + .withEnabled(builder.attributes.enabled()).withExpires(builder.attributes.expires()); + } else { + secretAttributes = null; + } + + if (builder.tags != null) { + tags = Collections.unmodifiableMap(builder.tags); + } else { + tags = null; + } + } + + /** + * @return the vaultBaseUrl + */ + public String vaultBaseUrl() { + return vaultBaseUrl; + } + + /** + * @return the secretName + */ + public String secretName() { + return secretName; + } + + /** + * @return the secretVersion + */ + public String secretVersion() { + return secretVersion; + } + + /** + * @return the contentType + */ + public String contentType() { + return contentType; + } + + /** + * @return the secretAttributes + */ + public SecretAttributes secretAttributes() { + return secretAttributes; + } + + /** + * @return the tags + */ + public Map tags() { + return tags; + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/package-info.java b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/package-info.java new file mode 100644 index 0000000000000..a2056d0f77634 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/requests/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains the classes for KeyVaultClient. Performs cryptographic + * key operations and vault operations against the Key Vault service. + */ +package com.microsoft.azure.keyvault.requests; diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/AsyncOperationsTest.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/AsyncOperationsTest.java new file mode 100644 index 0000000000000..3918faf1fba8d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/AsyncOperationsTest.java @@ -0,0 +1,318 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.test; + +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.ExecutionException; + +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import org.junit.Assert; +import org.junit.Test; + +import com.microsoft.azure.keyvault.models.BackupKeyResult; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.CertificateIssuerItem; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.Contact; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; +import com.microsoft.azure.keyvault.requests.CreateCertificateRequest; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateOperationRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificatePolicyRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateRequest; +import com.microsoft.azure.keyvault.requests.UpdateKeyRequest; +import com.microsoft.azure.keyvault.requests.UpdateSecretRequest; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.rest.ServiceCallback; + +public class AsyncOperationsTest extends KeyVaultClientIntegrationTestBase { + + @Test + public void keyAsyncForAsyncOperationsTest() throws Exception { + + String vault = getVaultUri(); + String keyname = "mykey"; + + CreateKeyRequest createKeyRequest = new CreateKeyRequest.Builder(vault, keyname, JsonWebKeyType.RSA).build(); + KeyBundle keyBundle = keyVaultClient.createKeyAsync(createKeyRequest, null).get(); + Assert.assertNotNull(keyBundle); + + UpdateKeyRequest updateKeyRequest = new UpdateKeyRequest.Builder(keyBundle.key().kid()).build(); + keyBundle = keyVaultClient.updateKeyAsync(updateKeyRequest, null).get(); + Assert.assertNotNull(keyBundle); + + keyBundle = keyVaultClient.getKeyAsync(keyBundle.key().kid(), null).get(); + Assert.assertNotNull(keyBundle); + + List keyItems = keyVaultClient.listKeysAsync(vault, 2, null).get(); + Assert.assertNotNull(keyItems); + + List keyVersionItems = keyVaultClient.listKeyVersionsAsync(vault, keyname, 2, null).get(); + Assert.assertNotNull(keyVersionItems); + + BackupKeyResult backupResult = keyVaultClient.backupKeyAsync(vault, keyname, null).get(); + Assert.assertNotNull(backupResult); + + keyVaultClient.deleteKeyAsync(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name(), null).get(); + pollOnKeyDeletion(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name()); + keyVaultClient.purgeDeletedKey(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name()); + SdkContext.sleep(20000); + + KeyBundle restoreResult = keyVaultClient.restoreKeyAsync(vault, backupResult.value(), null).get(); + Assert.assertNotNull(restoreResult); + + KeyOperationResult encryptResult = keyVaultClient + .encryptAsync(keyBundle.key().kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, new byte[100], null).get(); + Assert.assertNotNull(encryptResult); + + KeyOperationResult decryptResult = keyVaultClient.decryptAsync(keyBundle.key().kid(), + JsonWebKeyEncryptionAlgorithm.RSA_OAEP, encryptResult.result(), null).get(); + Assert.assertNotNull(decryptResult); + + KeyOperationResult wrapResult = keyVaultClient + .wrapKeyAsync(keyBundle.key().kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, new byte[100], null).get(); + Assert.assertNotNull(wrapResult); + + KeyOperationResult unwrapResult = keyVaultClient.unwrapKeyAsync(keyBundle.key().kid(), + JsonWebKeyEncryptionAlgorithm.RSA_OAEP, wrapResult.result(), null).get(); + Assert.assertNotNull(unwrapResult); + + byte[] plainText = new byte[100]; + new Random(0x1234567L).nextBytes(plainText); + MessageDigest md = MessageDigest.getInstance("SHA-256"); + md.update(plainText); + byte[] digest = md.digest(); + KeyOperationResult signResult = keyVaultClient + .signAsync(keyBundle.key().kid(), JsonWebKeySignatureAlgorithm.RS256, digest, null).get(); + Assert.assertNotNull(signResult); + + KeyVerifyResult verifypResult = keyVaultClient.verifyAsync(keyBundle.key().kid(), + JsonWebKeySignatureAlgorithm.RS256, digest, signResult.result(), null).get(); + Assert.assertTrue(verifypResult.value()); + + keyBundle = keyVaultClient + .deleteKeyAsync(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name(), null).get(); + Assert.assertNotNull(keyBundle); + pollOnKeyDeletion(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name()); + keyVaultClient.purgeDeletedKey(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name()); + SdkContext.sleep(20000); + // Get the unavailable key to throw exception -> it gets stuck + + try { + keyVaultClient.deleteKeyAsync(keyBundle.keyIdentifier().vault(), keyBundle.keyIdentifier().name(), null) + .get(); + } catch (ExecutionException ex) { + + Throwable t = ex.getCause(); + if (t instanceof KeyVaultErrorException) { + Assert.assertEquals("KeyNotFound", ((KeyVaultErrorException) t).body().error().code()); + } else + throw ex; + } + + } + + @Test + public void secretAsyncForAsyncOperationsTest() throws Exception { + + String vault = getVaultUri(); + String secretname = "mySecret"; + String password = "password"; + + SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vault, secretname, password).build(); + SecretBundle secretBundle = keyVaultClient.setSecretAsync(setSecretRequest, null).get(); + Assert.assertNotNull(secretBundle); + + UpdateSecretRequest updateSecretRequest = new UpdateSecretRequest.Builder(secretBundle.id()).build(); + secretBundle = keyVaultClient.updateSecretAsync(updateSecretRequest, null).get(); + Assert.assertNotNull(secretBundle); + + secretBundle = keyVaultClient.getSecretAsync(secretBundle.id(), null).get(); + Assert.assertNotNull(secretBundle); + + List secretItems = keyVaultClient.listSecretsAsync(vault, 2, null).get(); + Assert.assertNotNull(secretItems); + + List secretVersionItems = keyVaultClient.listSecretVersionsAsync(vault, secretname, 2, null).get(); + Assert.assertNotNull(secretVersionItems); + + secretBundle = keyVaultClient.deleteSecretAsync(vault, secretname, null).get(); + Assert.assertNotNull(secretBundle); + + try { + keyVaultClient.deleteSecretAsync(vault, secretname, null).get(); + + } catch (ExecutionException ex) { + + Throwable t = ex.getCause(); + if (t instanceof KeyVaultErrorException) { + Assert.assertEquals("SecretNotFound", ((KeyVaultErrorException) t).body().error().code()); + } else + throw ex; + } + pollOnSecretDeletion(vault, secretname); + keyVaultClient.purgeDeletedSecretAsync(vault, secretname, null).get(); + SdkContext.sleep(20000); + } + + @Test + public void certificateAsyncForAsyncOperationsTest() throws Exception { + + String vault = getVaultUri(); + String certificateName = "myCertificate"; + + CreateCertificateRequest createCertificateRequest = new CreateCertificateRequest.Builder(vault, certificateName) + .withPolicy(new CertificatePolicy() + .withSecretProperties(new SecretProperties().withContentType("application/x-pkcs12")) + .withIssuerParameters(new IssuerParameters().withName("Self")) + .withX509CertificateProperties(new X509CertificateProperties() + .withSubject("CN=SelfSignedJavaPkcs12").withValidityInMonths(12))) + .build(); + CertificateOperation certificateOperation = keyVaultClient + .createCertificateAsync(createCertificateRequest, null).get(); + Assert.assertNotNull(certificateOperation); + + UpdateCertificateOperationRequest updateCertificateOperationRequest = new UpdateCertificateOperationRequest.Builder( + vault, certificateName, false).build(); + certificateOperation = keyVaultClient.updateCertificateOperationAsync(updateCertificateOperationRequest, null) + .get(); + Assert.assertNotNull(certificateOperation); + + Map tags = new HashMap(); + tags.put("tag1", "foo"); + UpdateCertificateRequest updateCertificateRequest = new UpdateCertificateRequest.Builder(vault, certificateName) + .withTags(tags).build(); + CertificateBundle certificateBundle = keyVaultClient.updateCertificateAsync(updateCertificateRequest, null) + .get(); + Assert.assertNotNull(certificateBundle); + + UpdateCertificatePolicyRequest updateCertificatePolicyRequest = new UpdateCertificatePolicyRequest.Builder( + vault, certificateName).build(); + CertificatePolicy certificatePolicy = keyVaultClient + .updateCertificatePolicyAsync(updateCertificatePolicyRequest, null).get(); + Assert.assertNotNull(certificatePolicy); + + certificatePolicy = keyVaultClient.getCertificatePolicyAsync(vault, certificateName, null).get(); + Assert.assertNotNull(certificatePolicy); + + certificateOperation = keyVaultClient.getCertificateOperationAsync(vault, certificateName, null).get(); + Assert.assertNotNull(certificateOperation); + + certificateBundle = keyVaultClient + .getCertificateAsync(vault, certificateName, (ServiceCallback) null).get(); + Assert.assertNotNull(certificateBundle); + + String cert = keyVaultClient.getPendingCertificateSigningRequestAsync(vault, certificateName, null).get(); + Assert.assertTrue(!cert.isEmpty()); + + List certificateItem = keyVaultClient.listCertificatesAsync(vault, null).get(); + Assert.assertNotNull(certificateItem); + + List certificateVersionItem = keyVaultClient + .listCertificateVersionsAsync(vault, certificateName, null).get(); + Assert.assertNotNull(certificateVersionItem); + + keyVaultClient.deleteCertificateOperationAsync(vault, certificateName, null).get(); + keyVaultClient.deleteCertificateAsync(vault, certificateName, null).get(); + pollOnCertificateDeletion(vault, certificateName); + + try { + keyVaultClient.deleteCertificateAsync(vault, certificateName, null).get(); + } catch (ExecutionException ex) { + + Throwable t = ex.getCause(); + if (t instanceof KeyVaultErrorException) { + Assert.assertEquals("CertificateNotFound", ((KeyVaultErrorException) t).body().error().code()); + } else + throw ex; + } + + keyVaultClient.purgeDeletedCertificate(vault, certificateName); + SdkContext.sleep(20000); + } + + @Test + public void issuerAsyncForAsyncOperationsTest() throws Exception { + + String vault = getVaultUri(); + String issuerName = "myIssuer"; + + SetCertificateIssuerRequest setCertificateIssuerRequest = new SetCertificateIssuerRequest.Builder(vault, + issuerName, "Test").build(); + IssuerBundle certificateIssuer = keyVaultClient.setCertificateIssuerAsync(setCertificateIssuerRequest, null) + .get(); + Assert.assertNotNull(certificateIssuer); + + UpdateCertificateIssuerRequest updateCertificateIssuerRequest = new UpdateCertificateIssuerRequest.Builder( + vault, issuerName).withProvider("SslAdmin").build(); + certificateIssuer = keyVaultClient.updateCertificateIssuerAsync(updateCertificateIssuerRequest, null).get(); + Assert.assertNotNull(certificateIssuer); + + certificateIssuer = keyVaultClient.getCertificateIssuerAsync(vault, issuerName, null).get(); + Assert.assertNotNull(certificateIssuer); + + List issuers = keyVaultClient.listCertificateIssuersAsync(vault, null).get(); + Assert.assertNotNull(issuers); + + keyVaultClient.deleteCertificateIssuerAsync(vault, issuerName, null).get(); + } + + @Test + public void certificateContactsAsyncForAsyncOperationsTest() throws Exception { + + String vault = getVaultUri(); + + Contact contact1 = new Contact(); + contact1.withName("James"); + contact1.withEmailAddress("james@contoso.com"); + contact1.withPhone("7777777777"); + + Contact contact2 = new Contact(); + contact2.withName("Ethan"); + contact2.withEmailAddress("ethan@contoso.com"); + contact2.withPhone("8888888888"); + + List contactList = new ArrayList(); + contactList.add(contact1); + contactList.add(contact2); + + Contacts certificateContacts = new Contacts(); + certificateContacts.withContactList(contactList); + + Contacts contacts = keyVaultClient.setCertificateContactsAsync(vault, certificateContacts, (ServiceCallback) null).get(); + Assert.assertNotNull(contacts); + + contacts = keyVaultClient.getCertificateContactsAsync(vault, null).get(); + Assert.assertNotNull(contacts); + + keyVaultClient.deleteCertificateContactsAsync(vault, null).get(); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/CertificateOperationsTest.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/CertificateOperationsTest.java new file mode 100644 index 0000000000000..885ff4bbbaf8d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/CertificateOperationsTest.java @@ -0,0 +1,1168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.test; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.ExecutionException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; + +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import org.apache.commons.codec.binary.Base64; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.CertificateIdentifier; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.SecretIdentifier; +import com.microsoft.azure.keyvault.models.AdministratorDetails; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.CertificateAttributes; +import com.microsoft.azure.keyvault.models.CertificateBundle; +import com.microsoft.azure.keyvault.models.Contact; +import com.microsoft.azure.keyvault.models.Contacts; +import com.microsoft.azure.keyvault.models.IssuerBundle; +import com.microsoft.azure.keyvault.models.IssuerCredentials; +import com.microsoft.azure.keyvault.models.IssuerParameters; +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.OrganizationDetails; +import com.microsoft.azure.keyvault.models.CertificateItem; +import com.microsoft.azure.keyvault.models.CertificateOperation; +import com.microsoft.azure.keyvault.models.CertificatePolicy; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretProperties; +import com.microsoft.azure.keyvault.models.X509CertificateProperties; +import com.microsoft.azure.keyvault.requests.CreateCertificateRequest; +import com.microsoft.azure.keyvault.requests.ImportCertificateRequest; +import com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateOperationRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificatePolicyRequest; +import com.microsoft.azure.keyvault.requests.UpdateCertificateRequest; + +public class CertificateOperationsTest extends KeyVaultClientIntegrationTestBase { + + static final String ALGO_RSA = "RSA"; + + static final String X509 = "X.509"; + + static final String PKCS12 = "PKCS12"; + + static final String MIME_PKCS12 = "application/x-pkcs12"; + + static final String MIME_PEM = "application/x-pem-file"; + + static final String ISSUER_SELF = "Self"; + + static final String ISSUER_TEST = "Test"; + + static final String ISSUER_UNKNOWN = "Unknown"; + + static final String STATUS_IN_PROGRESS = "inProgress"; + + static final String STATUS_COMPLETED = "Completed"; + + static final Base64 _base64 = new Base64(-1, null, true); + + static final Pattern _privateKey = Pattern.compile("-{5}BEGIN PRIVATE KEY-{5}(?:\\s|\\r|\\n)+" + + "([a-zA-Z0-9+/=\r\n]+)" + "-{5}END PRIVATE KEY-{5}(?:\\s|\\r|\\n)+"); + + static final Pattern _certificate = Pattern.compile("-{5}BEGIN CERTIFICATE-{5}(?:\\s|\\r|\\n)+" + + "([a-zA-Z0-9+/=\r\n]+)" + "-{5}END CERTIFICATE-{5}(?:\\s|\\r|\\n)+"); + + private static final int MAX_CERTS = 4; + private static final int PAGELIST_MAX_CERTS = 3; + + private static final Map sTags = new HashMap(); + + /** + * Create a self-signed certificate in PKCS12 format (which includes the + * private key) certificate. + * + * @throws Exception + */ + @Test + public void createSelfSignedCertificatePkcs12ForCertificateOperationsTest() throws Exception { + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties() + .withContentType(MIME_PKCS12); + + String subjectName = "CN=SelfSignedJavaPkcs12"; + X509CertificateProperties x509Properties = new X509CertificateProperties() + .withSubject(subjectName) + .withValidityInMonths(12); + + // Set issuer to "Self" + IssuerParameters issuerParameters = new IssuerParameters() + .withName(ISSUER_SELF); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + Attributes attribute = new CertificateAttributes() + .withEnabled(true) + .withExpires(new DateTime().withYear(2050).withMonthOfYear(1)) + .withNotBefore(new DateTime().withYear(2000).withMonthOfYear(1)); + + String vaultUri = getVaultUri(); + String certificateName = "createSelfSignedJavaPkcs12"; + + CreateCertificateRequest createCertificateRequest = + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .withAttributes(attribute) + .withTags(sTags) + .build(); + + CertificateOperation certificateOperation = keyVaultClient.createCertificate(createCertificateRequest); + + Assert.assertNotNull(certificateOperation); + Assert.assertTrue(certificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)); + + CertificateBundle certificateBundle = pollOnCertificateOperation(certificateOperation); + validateCertificateBundle(certificateBundle, certificatePolicy); + compareAttributes(attribute, createCertificateRequest.certificateAttributes()); + + // Load the CER part into X509Certificate object + X509Certificate x509Certificate = loadCerToX509Certificate(certificateBundle); + + Assert.assertTrue(x509Certificate.getSubjectX500Principal().getName().equals(subjectName)); + Assert.assertTrue(x509Certificate.getIssuerX500Principal().getName().equals(subjectName)); + + // Retrieve the secret backing the certificate + SecretIdentifier secretIdentifier = certificateBundle.secretIdentifier(); + SecretBundle secret = keyVaultClient.getSecret(secretIdentifier.baseIdentifier()); + Assert.assertTrue(secret.managed()); + + // Retrieve the key backing the certificate + KeyIdentifier keyIdentifier = certificateBundle.keyIdentifier(); + KeyBundle keyBundle = keyVaultClient.getKey(keyIdentifier.baseIdentifier()); + Assert.assertTrue(keyBundle.managed()); + + // Load the secret into a KeyStore + String secretPassword = ""; + KeyStore keyStore = loadSecretToKeyStore(secret, secretPassword); + + // Validate the certificate and key in the KeyStore + validateCertificateKeyInKeyStore(keyStore, x509Certificate, secretPassword); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + Assert.assertNotNull(deletedCertificateBundle); + + pollOnCertificateDeletion(getVaultUri(), certificateName); + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Create a self-signed certificate in PEM format (which includes the + * private key) certificate. + * + * @throws Exception + */ + @Test + public void createSelfSignedCertificatePemForCertificateOperationsTest() throws Exception { + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties() + .withContentType(MIME_PEM); + + String subjectName = "CN=SelfSignedJavaPem"; + X509CertificateProperties x509Properties = new X509CertificateProperties() + .withSubject(subjectName) + .withValidityInMonths(12); + + // Set issuer to "Self" + IssuerParameters issuerParameters = new IssuerParameters() + .withName(ISSUER_SELF); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + String vaultUri = getVaultUri(); + String certificateName = "SelfSignedJavaPem"; + CertificateOperation certificateOperation = keyVaultClient.createCertificate( + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .build()); + + Assert.assertNotNull(certificateOperation); + Assert.assertTrue(certificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)); + + CertificateBundle certificateBundle = pollOnCertificateOperation(certificateOperation); + validateCertificateBundle(certificateBundle, certificatePolicy); + + validatePem(certificateBundle, subjectName); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + Assert.assertNotNull(deletedCertificateBundle); + + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + pollOnCertificateDeletion(getVaultUri(), certificateName); + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Create a test-issuer issued certificate in PKCS12 format (which includes + * the private key) certificate. + * + * @throws Exception + */ + @Test + public void createCertificatePkcs12ForCertificateOperationsTest() throws Exception { + // Construct organization administrator details + AdministratorDetails administratorDetails = new AdministratorDetails() + .withFirstName("John") + .withLastName("Doe") + .withEmailAddress("john.doe@contoso.com") + .withPhone("1234567890"); + + // Construct organization details + List administratorsDetails = new ArrayList(); + administratorsDetails.add(administratorDetails); + OrganizationDetails organizationDetails = new OrganizationDetails() + .withAdminDetails(administratorsDetails); + + // Construct certificate issuer credentials + IssuerCredentials credentials = new IssuerCredentials() + .withAccountId("account1") + .withPassword("Pa$$w0rd"); + + String certificateIssuerName = "createCertificateJavaPkcs12Issuer01"; + IssuerBundle createdCertificateIssuer = keyVaultClient.setCertificateIssuer( + new SetCertificateIssuerRequest + .Builder(getVaultUri(),certificateIssuerName, ISSUER_TEST) + .withCredentials(credentials) + .withOrganizationDetails(organizationDetails) + .build()); + + validateCertificateIssuer(createdCertificateIssuer, certificateIssuerName); + + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties() + .withContentType(MIME_PKCS12); + + String subjectName = "CN=TestJavaPkcs12"; + X509CertificateProperties x509Properties = new X509CertificateProperties() + .withSubject(subjectName) + .withValidityInMonths(12); + + // Set issuer reference to the created issuer + IssuerParameters issuerParameters = new IssuerParameters(); + issuerParameters.withName(createdCertificateIssuer.issuerIdentifier().name()); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + String vaultUri = getVaultUri(); + String certificateName = "createTestJavaPkcs12"; + CertificateOperation certificateOperation = keyVaultClient.createCertificate( + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .build()); + + Assert.assertNotNull(certificateOperation); + Assert.assertTrue(certificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)); + + + CertificateBundle certificateBundle = pollOnCertificateOperation(certificateOperation); + validateCertificateBundle(certificateBundle, certificatePolicy); + + // Load the CER part into X509Certificate object + X509Certificate x509Certificate = loadCerToX509Certificate(certificateBundle); + + Assert.assertTrue(x509Certificate.getSubjectX500Principal().getName().equals(subjectName)); + Assert.assertTrue(x509Certificate.getIssuerX500Principal().getName().equals(subjectName)); + + // Retrieve the secret backing the certificate + SecretIdentifier secretIdentifier = certificateBundle.secretIdentifier(); + SecretBundle secret = keyVaultClient.getSecret(secretIdentifier.baseIdentifier()); + Assert.assertTrue(secret.managed()); + + // Load the secret into a KeyStore + String secretPassword = ""; + KeyStore keyStore = loadSecretToKeyStore(secret, secretPassword); + + // Validate the certificate and key in the KeyStore + validateCertificateKeyInKeyStore(keyStore, x509Certificate, secretPassword); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + Assert.assertNotNull(deletedCertificateBundle); + + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + pollOnCertificateDeletion(getVaultUri(), certificateName); + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Create a test-issuer certificate in PEM format (which includes the + * private key) certificate. + * + * @throws Exception + */ + @Test + public void createCertificatePemForCertificateOperationsTest() throws Exception { + // Construct organization administrator details + AdministratorDetails administratorDetails = new AdministratorDetails() + .withFirstName("John") + .withLastName("Doe") + .withEmailAddress("john.doe@contoso.com") + .withPhone("1234567890"); + + // Construct organization details + OrganizationDetails organizationDetails = new OrganizationDetails(); + List administratorsDetails = new ArrayList(); + administratorsDetails.add(administratorDetails); + organizationDetails.withAdminDetails(administratorsDetails); + + // Construct certificate issuer credentials + IssuerCredentials credentials = new IssuerCredentials() + .withAccountId("account1") + .withPassword("Pa$$w0rd"); + + String certificateIssuerName = "createCertificateJavaPemIssuer01"; + IssuerBundle createdCertificateIssuer = keyVaultClient.setCertificateIssuer( + new SetCertificateIssuerRequest + .Builder(getVaultUri(), certificateIssuerName, ISSUER_TEST) + .withCredentials(credentials) + .withOrganizationDetails(organizationDetails) + .build()); + validateCertificateIssuer(createdCertificateIssuer, certificateIssuerName); + + // Set content type to indicate the certificate is PEM format. + SecretProperties secretProperties = new SecretProperties(); + secretProperties.withContentType(MIME_PEM); + + X509CertificateProperties x509Properties = new X509CertificateProperties(); + String subjectName = "CN=TestJavaPem"; + x509Properties.withSubject(subjectName); + x509Properties.withValidityInMonths(12); + + // Set issuer reference to the created issuer + IssuerParameters issuerParameters = new IssuerParameters(); + issuerParameters.withName(createdCertificateIssuer.issuerIdentifier().name()); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + String vaultUri = getVaultUri(); + String certificateName = "createTestJavaPem"; + CertificateOperation certificateOperation = keyVaultClient.createCertificate( + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .build()); + + Assert.assertNotNull(certificateOperation); + Assert.assertTrue(certificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)); + + CertificateBundle certificateBundle = pollOnCertificateOperation(certificateOperation); + validateCertificateBundle(certificateBundle, certificatePolicy); + + validatePem(certificateBundle, subjectName); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + Assert.assertNotNull(deletedCertificateBundle); + + + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } + catch(KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + pollOnCertificateDeletion(getVaultUri(), certificateName); + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Create a certificate signing request with key in Key Vault. + * @throws Exception + */ + @Test + public void createCsrForCertificateOperationsTest() throws Exception { + SecretProperties secretProperties = new SecretProperties(); + secretProperties.withContentType(MIME_PKCS12); + + X509CertificateProperties x509Properties = new X509CertificateProperties(); + String subjectName = "CN=ManualEnrollmentJava"; + x509Properties.withSubject(subjectName); + x509Properties.withValidityInMonths(12); + + // Set issuer to "Unknown" + IssuerParameters issuerParameters = new IssuerParameters(); + issuerParameters.withName(ISSUER_UNKNOWN); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + String vaultUri = getVaultUri(); + String certificateName = "createManualEnrollmentJava"; + CertificateOperation certificateOperation = keyVaultClient.createCertificate( + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .build()); + + Assert.assertNotNull(certificateOperation); + Assert.assertTrue(certificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)); + Assert.assertNotNull(certificateOperation.csr()); + + String csr = keyVaultClient.getPendingCertificateSigningRequest(vaultUri, certificateName); + Assert.assertNotNull(csr); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + Assert.assertNotNull(deletedCertificateBundle); + + pollOnCertificateDeletion(getVaultUri(), certificateName); + + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Cancel the certificate create asynchronously + * @throws Exception + * + */ + @Test + public void certificateAsyncRequestCancellationForCertificateOperationsTest() throws Exception { + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties() + .withContentType(MIME_PKCS12); + + String subjectName = "CN=SelfSignedJavaPkcs12"; + X509CertificateProperties x509Properties = new X509CertificateProperties() + .withSubject(subjectName) + .withValidityInMonths(12); + + // Set issuer to "Self" + IssuerParameters issuerParameters = new IssuerParameters() + .withName(ISSUER_SELF); + + CertificatePolicy certificatePolicy = new CertificatePolicy() + .withSecretProperties(secretProperties) + .withIssuerParameters(issuerParameters) + .withX509CertificateProperties(x509Properties); + + String vaultUri = getVaultUri(); + String certificateName = "cancellationRequestedCertJava"; + keyVaultClient.createCertificate( + new CreateCertificateRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicy) + .build()); + + CertificateOperation cancelledCertificateOperation = keyVaultClient.updateCertificateOperation( + new UpdateCertificateOperationRequest + .Builder(vaultUri, certificateName, true) + .build()); + + Assert.assertNotNull(cancelledCertificateOperation); + Assert.assertTrue(cancelledCertificateOperation.cancellationRequested()); + + keyVaultClient.deleteCertificateOperation(getVaultUri(), certificateName); + keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + pollOnCertificateDeletion(getVaultUri(), certificateName); + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(20000); + } + + /** + * Import a PKCS12 format (which includes the private key) certificate. + */ + @Test + public void importCertificatePkcs12ForCertificateOperationsTest() throws Exception { + String certificateContent = "MIIJOwIBAzCCCPcGCSqGSIb3DQEHAaCCCOgEggjkMIII4DCCBgkGCSqGSIb3DQEHAaCCBfoEggX2MIIF8jCCBe4GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAj15YH9pOE58AICB9AEggTYLrI+SAru2dBZRQRlJY7XQ3LeLkah2FcRR3dATDshZ2h0IA2oBrkQIdsLyAAWZ32qYR1qkWxLHn9AqXgu27AEbOk35+pITZaiy63YYBkkpR+pDdngZt19Z0PWrGwHEq5z6BHS2GLyyN8SSOCbdzCz7blj3+7IZYoMj4WOPgOm/tQ6U44SFWek46QwN2zeA4i97v7ftNNns27ms52jqfhOvTA9c/wyfZKAY4aKJfYYUmycKjnnRl012ldS2lOkASFt+lu4QCa72IY6ePtRudPCvmzRv2pkLYS6z3cI7omT8nHP3DymNOqLbFqr5O2M1ZYaLC63Q3xt3eVvbcPh3N08D1hHkhz/KDTvkRAQpvrW8ISKmgDdmzN55Pe55xHfSWGB7gPw8sZea57IxFzWHTK2yvTslooWoosmGxanYY2IG/no3EbPOWDKjPZ4ilYJe5JJ2immlxPz+2e2EOCKpDI+7fzQcRz3PTd3BK+budZ8aXX8aW/lOgKS8WmxZoKnOJBNWeTNWQFugmktXfdPHAdxMhjUXqeGQd8wTvZ4EzQNNafovwkI7IV/ZYoa++RGofVR3ZbRSiBNF6TDj/qXFt0wN/CQnsGAmQAGNiN+D4mY7i25dtTu/Jc7OxLdhAUFpHyJpyrYWLfvOiS5WYBeEDHkiPUa/8eZSPA3MXWZR1RiuDvuNqMjct1SSwdXADTtF68l/US1ksU657+XSC+6ly1A/upz+X71+C4Ho6W0751j5ZMT6xKjGh5pee7MVuduxIzXjWIy3YSd0fIT3U0A5NLEvJ9rfkx6JiHjRLx6V1tqsrtT6BsGtmCQR1UCJPLqsKVDvAINx3cPA/CGqr5OX2BGZlAihGmN6n7gv8w4O0k0LPTAe5YefgXN3m9pE867N31GtHVZaJ/UVgDNYS2jused4rw76ZWN41akx2QN0JSeMJqHXqVz6AKfz8ICS/dFnEGyBNpXiMRxrY/QPKi/wONwqsbDxRW7vZRVKs78pBkE0ksaShlZk5GkeayDWC/7Hi/NqUFtIloK9XB3paLxo1DGu5qqaF34jZdktzkXp0uZqpp+FfKZaiovMjt8F7yHCPk+LYpRsU2Cyc9DVoDA6rIgf+uEP4jppgehsxyT0lJHax2t869R2jYdsXwYUXjgwHIV0voj7bJYPGFlFjXOp6ZW86scsHM5xfsGQoK2Fp838VT34SHE1ZXU/puM7rviREHYW72pfpgGZUILQMohuTPnd8tFtAkbrmjLDo+k9xx7HUvgoFTiNNWuq/cRjr70FKNguMMTIrid+HwfmbRoaxENWdLcOTNeascER2a+37UQolKD5ksrPJG6RdNA7O2pzp3micDYRs/+s28cCIxO//J/d4nsgHp6RTuCu4+Jm9k0YTw2Xg75b2cWKrxGnDUgyIlvNPaZTB5QbMid4x44/lE0LLi9kcPQhRgrK07OnnrMgZvVGjt1CLGhKUv7KFc3xV1r1rwKkosxnoG99oCoTQtregcX5rIMjHgkc1IdflGJkZzaWMkYVFOJ4Weynz008i4ddkske5vabZs37Lb8iggUYNBYZyGzalruBgnQyK4fz38Fae4nWYjyildVfgyo/fCePR2ovOfphx9OQJi+M9BoFmPrAg+8ARDZ+R+5yzYuEc9ZoVX7nkp7LTGB3DANBgkrBgEEAYI3EQIxADATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECNX+VL2MxzzWAgIH0ICCAojmRBO+CPfVNUO0s+BVuwhOzikAGNBmQHNChmJ/pyzPbMUbx7tO63eIVSc67iERda2WCEmVwPigaVQkPaumsfp8+L6iV/BMf5RKlyRXcwh0vUdu2Qa7qadD+gFQ2kngf4Dk6vYo2/2HxayuIf6jpwe8vql4ca3ZtWXfuRix2fwgltM0bMz1g59d7x/glTfNqxNlsty0A/rWrPJjNbOPRU2XykLuc3AtlTtYsQ32Zsmu67A7UNBw6tVtkEXlFDqhavEhUEO3dvYqMY+QLxzpZhA0q44ZZ9/ex0X6QAFNK5wuWxCbupHWsgxRwKftrxyszMHsAvNoNcTlqcctee+ecNwTJQa1/MDbnhO6/qHA7cfG1qYDq8Th635vGNMW1w3sVS7l0uEvdayAsBHWTcOC2tlMa5bfHrhY8OEIqj5bN5H9RdFy8G/W239tjDu1OYjBDydiBqzBn8HG1DSj1Pjc0kd/82d4ZU0308KFTC3yGcRad0GnEH0Oi3iEJ9HbriUbfVMbXNHOF+MktWiDVqzndGMKmuJSdfTBKvGFvejAWVO5E4mgLvoaMmbchc3BO7sLeraHnJN5hvMBaLcQI38N86mUfTR8AP6AJ9c2k514KaDLclm4z6J8dMz60nUeo5D3YD09G6BavFHxSvJ8MF0Lu5zOFzEePDRFm9mH8W0N/sFlIaYfD/GWU/w44mQucjaBk95YtqOGRIj58tGDWr8iUdHwaYKGqU24zGeRae9DhFXPzZshV1ZGsBQFRaoYkyLAwdJWIXTi+c37YaC8FRSEnnNmS79Dou1Kc3BvK4EYKAD2KxjtUebrV174gD0Q+9YuJ0GXOTspBvCFd5VT2Rw5zDNrA/J3F5fMCk4wOzAfMAcGBSsOAwIaBBSxgh2xyF+88V4vAffBmZXv8Txt4AQU4O/NX4MjxSodbE7ApNAMIvrtREwCAgfQ"; + String certificatePassword = "123"; + + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties().withContentType(MIME_PKCS12); + CertificatePolicy certificatePolicy = new CertificatePolicy().withSecretProperties(secretProperties); + Attributes attribute = new CertificateAttributes().withEnabled(true); + + String vaultUri = getVaultUri(); + String certificateName = "importCertPkcs"; + CertificateBundle certificateBundle = keyVaultClient.importCertificate( + new ImportCertificateRequest + .Builder(vaultUri, certificateName, certificateContent) + .withPassword(certificatePassword) + .withPolicy(certificatePolicy) + .withAttributes(attribute) + .withTags(sTags) + .build()); + + // Validate the certificate bundle created + validateCertificateBundle(certificateBundle, certificatePolicy); + Assert.assertTrue(toHexString(certificateBundle.x509Thumbprint()).equalsIgnoreCase("7cb8b7539d87ba7215357b9b9049dff2d3fa59ba")); + Assert.assertEquals(attribute.enabled(), certificateBundle.attributes().enabled()); + + // Load the CER part into X509Certificate object + X509Certificate x509Certificate = loadCerToX509Certificate(certificateBundle); + + Assert.assertTrue(x509Certificate.getSubjectX500Principal().getName().equals("CN=KeyVaultTest")); + Assert.assertTrue(x509Certificate.getIssuerX500Principal().getName().equals("CN=Root Agency")); + + // Retrieve the secret backing the certificate + SecretIdentifier secretIdentifier = certificateBundle.secretIdentifier(); + SecretBundle secret = keyVaultClient.getSecret(secretIdentifier.baseIdentifier()); + Assert.assertTrue(secret.managed()); + + // Load the secret into a KeyStore + String secretPassword = ""; + KeyStore keyStore = loadSecretToKeyStore(secret, secretPassword); + + // Validate the certificate and key in the KeyStore + validateCertificateKeyInKeyStore(keyStore, x509Certificate, secretPassword); + + CertificateBundle deletedCertificateBundle = keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + pollOnCertificateDeletion(getVaultUri(), certificateName); + + try { + keyVaultClient.getCertificate(deletedCertificateBundle.certificateIdentifier().baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateNotFound", e.body().error().code()); + } + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(10000); + } + + /** + * Import a PKCS12 format (which includes the private key) certificate. + */ + @Test + public void certificateUpdateForCertificateOperationsTest() throws Exception { + String certificateContent = "MIIJOwIBAzCCCPcGCSqGSIb3DQEHAaCCCOgEggjkMIII4DCCBgkGCSqGSIb3DQEHAaCCBfoEggX2MIIF8jCCBe4GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAj15YH9pOE58AICB9AEggTYLrI+SAru2dBZRQRlJY7XQ3LeLkah2FcRR3dATDshZ2h0IA2oBrkQIdsLyAAWZ32qYR1qkWxLHn9AqXgu27AEbOk35+pITZaiy63YYBkkpR+pDdngZt19Z0PWrGwHEq5z6BHS2GLyyN8SSOCbdzCz7blj3+7IZYoMj4WOPgOm/tQ6U44SFWek46QwN2zeA4i97v7ftNNns27ms52jqfhOvTA9c/wyfZKAY4aKJfYYUmycKjnnRl012ldS2lOkASFt+lu4QCa72IY6ePtRudPCvmzRv2pkLYS6z3cI7omT8nHP3DymNOqLbFqr5O2M1ZYaLC63Q3xt3eVvbcPh3N08D1hHkhz/KDTvkRAQpvrW8ISKmgDdmzN55Pe55xHfSWGB7gPw8sZea57IxFzWHTK2yvTslooWoosmGxanYY2IG/no3EbPOWDKjPZ4ilYJe5JJ2immlxPz+2e2EOCKpDI+7fzQcRz3PTd3BK+budZ8aXX8aW/lOgKS8WmxZoKnOJBNWeTNWQFugmktXfdPHAdxMhjUXqeGQd8wTvZ4EzQNNafovwkI7IV/ZYoa++RGofVR3ZbRSiBNF6TDj/qXFt0wN/CQnsGAmQAGNiN+D4mY7i25dtTu/Jc7OxLdhAUFpHyJpyrYWLfvOiS5WYBeEDHkiPUa/8eZSPA3MXWZR1RiuDvuNqMjct1SSwdXADTtF68l/US1ksU657+XSC+6ly1A/upz+X71+C4Ho6W0751j5ZMT6xKjGh5pee7MVuduxIzXjWIy3YSd0fIT3U0A5NLEvJ9rfkx6JiHjRLx6V1tqsrtT6BsGtmCQR1UCJPLqsKVDvAINx3cPA/CGqr5OX2BGZlAihGmN6n7gv8w4O0k0LPTAe5YefgXN3m9pE867N31GtHVZaJ/UVgDNYS2jused4rw76ZWN41akx2QN0JSeMJqHXqVz6AKfz8ICS/dFnEGyBNpXiMRxrY/QPKi/wONwqsbDxRW7vZRVKs78pBkE0ksaShlZk5GkeayDWC/7Hi/NqUFtIloK9XB3paLxo1DGu5qqaF34jZdktzkXp0uZqpp+FfKZaiovMjt8F7yHCPk+LYpRsU2Cyc9DVoDA6rIgf+uEP4jppgehsxyT0lJHax2t869R2jYdsXwYUXjgwHIV0voj7bJYPGFlFjXOp6ZW86scsHM5xfsGQoK2Fp838VT34SHE1ZXU/puM7rviREHYW72pfpgGZUILQMohuTPnd8tFtAkbrmjLDo+k9xx7HUvgoFTiNNWuq/cRjr70FKNguMMTIrid+HwfmbRoaxENWdLcOTNeascER2a+37UQolKD5ksrPJG6RdNA7O2pzp3micDYRs/+s28cCIxO//J/d4nsgHp6RTuCu4+Jm9k0YTw2Xg75b2cWKrxGnDUgyIlvNPaZTB5QbMid4x44/lE0LLi9kcPQhRgrK07OnnrMgZvVGjt1CLGhKUv7KFc3xV1r1rwKkosxnoG99oCoTQtregcX5rIMjHgkc1IdflGJkZzaWMkYVFOJ4Weynz008i4ddkske5vabZs37Lb8iggUYNBYZyGzalruBgnQyK4fz38Fae4nWYjyildVfgyo/fCePR2ovOfphx9OQJi+M9BoFmPrAg+8ARDZ+R+5yzYuEc9ZoVX7nkp7LTGB3DANBgkrBgEEAYI3EQIxADATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECNX+VL2MxzzWAgIH0ICCAojmRBO+CPfVNUO0s+BVuwhOzikAGNBmQHNChmJ/pyzPbMUbx7tO63eIVSc67iERda2WCEmVwPigaVQkPaumsfp8+L6iV/BMf5RKlyRXcwh0vUdu2Qa7qadD+gFQ2kngf4Dk6vYo2/2HxayuIf6jpwe8vql4ca3ZtWXfuRix2fwgltM0bMz1g59d7x/glTfNqxNlsty0A/rWrPJjNbOPRU2XykLuc3AtlTtYsQ32Zsmu67A7UNBw6tVtkEXlFDqhavEhUEO3dvYqMY+QLxzpZhA0q44ZZ9/ex0X6QAFNK5wuWxCbupHWsgxRwKftrxyszMHsAvNoNcTlqcctee+ecNwTJQa1/MDbnhO6/qHA7cfG1qYDq8Th635vGNMW1w3sVS7l0uEvdayAsBHWTcOC2tlMa5bfHrhY8OEIqj5bN5H9RdFy8G/W239tjDu1OYjBDydiBqzBn8HG1DSj1Pjc0kd/82d4ZU0308KFTC3yGcRad0GnEH0Oi3iEJ9HbriUbfVMbXNHOF+MktWiDVqzndGMKmuJSdfTBKvGFvejAWVO5E4mgLvoaMmbchc3BO7sLeraHnJN5hvMBaLcQI38N86mUfTR8AP6AJ9c2k514KaDLclm4z6J8dMz60nUeo5D3YD09G6BavFHxSvJ8MF0Lu5zOFzEePDRFm9mH8W0N/sFlIaYfD/GWU/w44mQucjaBk95YtqOGRIj58tGDWr8iUdHwaYKGqU24zGeRae9DhFXPzZshV1ZGsBQFRaoYkyLAwdJWIXTi+c37YaC8FRSEnnNmS79Dou1Kc3BvK4EYKAD2KxjtUebrV174gD0Q+9YuJ0GXOTspBvCFd5VT2Rw5zDNrA/J3F5fMCk4wOzAfMAcGBSsOAwIaBBSxgh2xyF+88V4vAffBmZXv8Txt4AQU4O/NX4MjxSodbE7ApNAMIvrtREwCAgfQ"; + String certificatePassword = "123"; + + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties().withContentType(MIME_PKCS12); + CertificatePolicy certificatePolicy = new CertificatePolicy().withSecretProperties(secretProperties); + + String vaultUri = getVaultUri(); + String certificateName = "updateCertJava"; + keyVaultClient.importCertificate( + new ImportCertificateRequest + .Builder(vaultUri, certificateName, certificateContent) + .withPassword(certificatePassword) + .withPolicy(certificatePolicy) + .build()); + + + Attributes attribute = new CertificateAttributes() + .withExpires(new DateTime().withYear(2050).withMonthOfYear(1)) + .withNotBefore(new DateTime().withYear(2000).withMonthOfYear(1)); + CertificateBundle updatedCertBundle = keyVaultClient.updateCertificate( + new UpdateCertificateRequest + .Builder(vaultUri, certificateName) + .withAttributes(attribute.withEnabled(false)) + .withTags(sTags) + .build()); + Assert.assertEquals(attribute.enabled(), updatedCertBundle.attributes().enabled()); + Assert.assertEquals(sTags.toString(), updatedCertBundle.tags().toString()); + + CertificatePolicy certificatePolicyUpdate = certificatePolicy.withIssuerParameters(new IssuerParameters().withName(ISSUER_SELF)); + CertificatePolicy updatedCertificatePolicy = keyVaultClient.updateCertificatePolicy( + new UpdateCertificatePolicyRequest + .Builder(vaultUri, certificateName) + .withPolicy(certificatePolicyUpdate) + .build()); + Assert.assertEquals(certificatePolicyUpdate.issuerParameters().name(), updatedCertificatePolicy.issuerParameters().name()); + + CertificatePolicy policy = keyVaultClient.getCertificatePolicy(vaultUri, certificateName); + Assert.assertEquals(certificatePolicyUpdate.issuerParameters().name(), policy.issuerParameters().name()); + + keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + pollOnCertificateDeletion(getVaultUri(), certificateName); + + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + SdkContext.sleep(10000); + } + + /** + * List certificates in a vault. + */ + @Test + public void listCertificatesForCertificateOperationsTest() throws Exception { + String certificateName = "listCertificate"; + String certificateContent = "MIIJOwIBAzCCCPcGCSqGSIb3DQEHAaCCCOgEggjkMIII4DCCBgkGCSqGSIb3DQEHAaCCBfoEggX2MIIF8jCCBe4GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAj15YH9pOE58AICB9AEggTYLrI+SAru2dBZRQRlJY7XQ3LeLkah2FcRR3dATDshZ2h0IA2oBrkQIdsLyAAWZ32qYR1qkWxLHn9AqXgu27AEbOk35+pITZaiy63YYBkkpR+pDdngZt19Z0PWrGwHEq5z6BHS2GLyyN8SSOCbdzCz7blj3+7IZYoMj4WOPgOm/tQ6U44SFWek46QwN2zeA4i97v7ftNNns27ms52jqfhOvTA9c/wyfZKAY4aKJfYYUmycKjnnRl012ldS2lOkASFt+lu4QCa72IY6ePtRudPCvmzRv2pkLYS6z3cI7omT8nHP3DymNOqLbFqr5O2M1ZYaLC63Q3xt3eVvbcPh3N08D1hHkhz/KDTvkRAQpvrW8ISKmgDdmzN55Pe55xHfSWGB7gPw8sZea57IxFzWHTK2yvTslooWoosmGxanYY2IG/no3EbPOWDKjPZ4ilYJe5JJ2immlxPz+2e2EOCKpDI+7fzQcRz3PTd3BK+budZ8aXX8aW/lOgKS8WmxZoKnOJBNWeTNWQFugmktXfdPHAdxMhjUXqeGQd8wTvZ4EzQNNafovwkI7IV/ZYoa++RGofVR3ZbRSiBNF6TDj/qXFt0wN/CQnsGAmQAGNiN+D4mY7i25dtTu/Jc7OxLdhAUFpHyJpyrYWLfvOiS5WYBeEDHkiPUa/8eZSPA3MXWZR1RiuDvuNqMjct1SSwdXADTtF68l/US1ksU657+XSC+6ly1A/upz+X71+C4Ho6W0751j5ZMT6xKjGh5pee7MVuduxIzXjWIy3YSd0fIT3U0A5NLEvJ9rfkx6JiHjRLx6V1tqsrtT6BsGtmCQR1UCJPLqsKVDvAINx3cPA/CGqr5OX2BGZlAihGmN6n7gv8w4O0k0LPTAe5YefgXN3m9pE867N31GtHVZaJ/UVgDNYS2jused4rw76ZWN41akx2QN0JSeMJqHXqVz6AKfz8ICS/dFnEGyBNpXiMRxrY/QPKi/wONwqsbDxRW7vZRVKs78pBkE0ksaShlZk5GkeayDWC/7Hi/NqUFtIloK9XB3paLxo1DGu5qqaF34jZdktzkXp0uZqpp+FfKZaiovMjt8F7yHCPk+LYpRsU2Cyc9DVoDA6rIgf+uEP4jppgehsxyT0lJHax2t869R2jYdsXwYUXjgwHIV0voj7bJYPGFlFjXOp6ZW86scsHM5xfsGQoK2Fp838VT34SHE1ZXU/puM7rviREHYW72pfpgGZUILQMohuTPnd8tFtAkbrmjLDo+k9xx7HUvgoFTiNNWuq/cRjr70FKNguMMTIrid+HwfmbRoaxENWdLcOTNeascER2a+37UQolKD5ksrPJG6RdNA7O2pzp3micDYRs/+s28cCIxO//J/d4nsgHp6RTuCu4+Jm9k0YTw2Xg75b2cWKrxGnDUgyIlvNPaZTB5QbMid4x44/lE0LLi9kcPQhRgrK07OnnrMgZvVGjt1CLGhKUv7KFc3xV1r1rwKkosxnoG99oCoTQtregcX5rIMjHgkc1IdflGJkZzaWMkYVFOJ4Weynz008i4ddkske5vabZs37Lb8iggUYNBYZyGzalruBgnQyK4fz38Fae4nWYjyildVfgyo/fCePR2ovOfphx9OQJi+M9BoFmPrAg+8ARDZ+R+5yzYuEc9ZoVX7nkp7LTGB3DANBgkrBgEEAYI3EQIxADATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECNX+VL2MxzzWAgIH0ICCAojmRBO+CPfVNUO0s+BVuwhOzikAGNBmQHNChmJ/pyzPbMUbx7tO63eIVSc67iERda2WCEmVwPigaVQkPaumsfp8+L6iV/BMf5RKlyRXcwh0vUdu2Qa7qadD+gFQ2kngf4Dk6vYo2/2HxayuIf6jpwe8vql4ca3ZtWXfuRix2fwgltM0bMz1g59d7x/glTfNqxNlsty0A/rWrPJjNbOPRU2XykLuc3AtlTtYsQ32Zsmu67A7UNBw6tVtkEXlFDqhavEhUEO3dvYqMY+QLxzpZhA0q44ZZ9/ex0X6QAFNK5wuWxCbupHWsgxRwKftrxyszMHsAvNoNcTlqcctee+ecNwTJQa1/MDbnhO6/qHA7cfG1qYDq8Th635vGNMW1w3sVS7l0uEvdayAsBHWTcOC2tlMa5bfHrhY8OEIqj5bN5H9RdFy8G/W239tjDu1OYjBDydiBqzBn8HG1DSj1Pjc0kd/82d4ZU0308KFTC3yGcRad0GnEH0Oi3iEJ9HbriUbfVMbXNHOF+MktWiDVqzndGMKmuJSdfTBKvGFvejAWVO5E4mgLvoaMmbchc3BO7sLeraHnJN5hvMBaLcQI38N86mUfTR8AP6AJ9c2k514KaDLclm4z6J8dMz60nUeo5D3YD09G6BavFHxSvJ8MF0Lu5zOFzEePDRFm9mH8W0N/sFlIaYfD/GWU/w44mQucjaBk95YtqOGRIj58tGDWr8iUdHwaYKGqU24zGeRae9DhFXPzZshV1ZGsBQFRaoYkyLAwdJWIXTi+c37YaC8FRSEnnNmS79Dou1Kc3BvK4EYKAD2KxjtUebrV174gD0Q+9YuJ0GXOTspBvCFd5VT2Rw5zDNrA/J3F5fMCk4wOzAfMAcGBSsOAwIaBBSxgh2xyF+88V4vAffBmZXv8Txt4AQU4O/NX4MjxSodbE7ApNAMIvrtREwCAgfQ"; + String certificatePassword = "123"; + + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties(); + secretProperties.withContentType(MIME_PKCS12); + CertificatePolicy certificatePolicy = new CertificatePolicy(); + certificatePolicy.withSecretProperties(secretProperties); + + HashSet certificates = new HashSet(); + for (int i = 0; i < MAX_CERTS; ++i) { + int failureCount = 0; + for (;;) { + try { + CertificateBundle certificateBundle = keyVaultClient.importCertificate( + new ImportCertificateRequest + .Builder(getVaultUri(), certificateName + i, certificateContent) + .withPassword(certificatePassword) + .withPolicy(certificatePolicy) + .build()); + CertificateIdentifier id = certificateBundle.certificateIdentifier(); + certificates.add(id.baseIdentifier()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Waiting to avoid throttling"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listCertificates(getVaultUri(), PAGELIST_MAX_CERTS); + Assert.assertTrue(PAGELIST_MAX_CERTS >= listResult.currentPage().items().size()); + + HashSet toDelete = new HashSet(); + + for (CertificateItem item : listResult) { + if(item != null) { + CertificateIdentifier id = new CertificateIdentifier(item.id()); + toDelete.add(id.name()); + certificates.remove(item.id()); + } + } + + Assert.assertEquals(0, certificates.size()); + + for (String toDeleteCertificateName : toDelete) { + keyVaultClient.deleteCertificate(getVaultUri(), toDeleteCertificateName); + pollOnCertificateDeletion(getVaultUri(), toDeleteCertificateName); + keyVaultClient.purgeDeletedCertificate(getVaultUri(), toDeleteCertificateName); + SdkContext.sleep(10000); + } + } + + /** + * List versions of a certificate in a vault. + */ + @Test + public void listCertificateVersionsForCertificateOperationsTest() throws Exception { + String certificateName = "listCertificateVersions"; + String certificateContent = "MIIJOwIBAzCCCPcGCSqGSIb3DQEHAaCCCOgEggjkMIII4DCCBgkGCSqGSIb3DQEHAaCCBfoEggX2MIIF8jCCBe4GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAj15YH9pOE58AICB9AEggTYLrI+SAru2dBZRQRlJY7XQ3LeLkah2FcRR3dATDshZ2h0IA2oBrkQIdsLyAAWZ32qYR1qkWxLHn9AqXgu27AEbOk35+pITZaiy63YYBkkpR+pDdngZt19Z0PWrGwHEq5z6BHS2GLyyN8SSOCbdzCz7blj3+7IZYoMj4WOPgOm/tQ6U44SFWek46QwN2zeA4i97v7ftNNns27ms52jqfhOvTA9c/wyfZKAY4aKJfYYUmycKjnnRl012ldS2lOkASFt+lu4QCa72IY6ePtRudPCvmzRv2pkLYS6z3cI7omT8nHP3DymNOqLbFqr5O2M1ZYaLC63Q3xt3eVvbcPh3N08D1hHkhz/KDTvkRAQpvrW8ISKmgDdmzN55Pe55xHfSWGB7gPw8sZea57IxFzWHTK2yvTslooWoosmGxanYY2IG/no3EbPOWDKjPZ4ilYJe5JJ2immlxPz+2e2EOCKpDI+7fzQcRz3PTd3BK+budZ8aXX8aW/lOgKS8WmxZoKnOJBNWeTNWQFugmktXfdPHAdxMhjUXqeGQd8wTvZ4EzQNNafovwkI7IV/ZYoa++RGofVR3ZbRSiBNF6TDj/qXFt0wN/CQnsGAmQAGNiN+D4mY7i25dtTu/Jc7OxLdhAUFpHyJpyrYWLfvOiS5WYBeEDHkiPUa/8eZSPA3MXWZR1RiuDvuNqMjct1SSwdXADTtF68l/US1ksU657+XSC+6ly1A/upz+X71+C4Ho6W0751j5ZMT6xKjGh5pee7MVuduxIzXjWIy3YSd0fIT3U0A5NLEvJ9rfkx6JiHjRLx6V1tqsrtT6BsGtmCQR1UCJPLqsKVDvAINx3cPA/CGqr5OX2BGZlAihGmN6n7gv8w4O0k0LPTAe5YefgXN3m9pE867N31GtHVZaJ/UVgDNYS2jused4rw76ZWN41akx2QN0JSeMJqHXqVz6AKfz8ICS/dFnEGyBNpXiMRxrY/QPKi/wONwqsbDxRW7vZRVKs78pBkE0ksaShlZk5GkeayDWC/7Hi/NqUFtIloK9XB3paLxo1DGu5qqaF34jZdktzkXp0uZqpp+FfKZaiovMjt8F7yHCPk+LYpRsU2Cyc9DVoDA6rIgf+uEP4jppgehsxyT0lJHax2t869R2jYdsXwYUXjgwHIV0voj7bJYPGFlFjXOp6ZW86scsHM5xfsGQoK2Fp838VT34SHE1ZXU/puM7rviREHYW72pfpgGZUILQMohuTPnd8tFtAkbrmjLDo+k9xx7HUvgoFTiNNWuq/cRjr70FKNguMMTIrid+HwfmbRoaxENWdLcOTNeascER2a+37UQolKD5ksrPJG6RdNA7O2pzp3micDYRs/+s28cCIxO//J/d4nsgHp6RTuCu4+Jm9k0YTw2Xg75b2cWKrxGnDUgyIlvNPaZTB5QbMid4x44/lE0LLi9kcPQhRgrK07OnnrMgZvVGjt1CLGhKUv7KFc3xV1r1rwKkosxnoG99oCoTQtregcX5rIMjHgkc1IdflGJkZzaWMkYVFOJ4Weynz008i4ddkske5vabZs37Lb8iggUYNBYZyGzalruBgnQyK4fz38Fae4nWYjyildVfgyo/fCePR2ovOfphx9OQJi+M9BoFmPrAg+8ARDZ+R+5yzYuEc9ZoVX7nkp7LTGB3DANBgkrBgEEAYI3EQIxADATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECNX+VL2MxzzWAgIH0ICCAojmRBO+CPfVNUO0s+BVuwhOzikAGNBmQHNChmJ/pyzPbMUbx7tO63eIVSc67iERda2WCEmVwPigaVQkPaumsfp8+L6iV/BMf5RKlyRXcwh0vUdu2Qa7qadD+gFQ2kngf4Dk6vYo2/2HxayuIf6jpwe8vql4ca3ZtWXfuRix2fwgltM0bMz1g59d7x/glTfNqxNlsty0A/rWrPJjNbOPRU2XykLuc3AtlTtYsQ32Zsmu67A7UNBw6tVtkEXlFDqhavEhUEO3dvYqMY+QLxzpZhA0q44ZZ9/ex0X6QAFNK5wuWxCbupHWsgxRwKftrxyszMHsAvNoNcTlqcctee+ecNwTJQa1/MDbnhO6/qHA7cfG1qYDq8Th635vGNMW1w3sVS7l0uEvdayAsBHWTcOC2tlMa5bfHrhY8OEIqj5bN5H9RdFy8G/W239tjDu1OYjBDydiBqzBn8HG1DSj1Pjc0kd/82d4ZU0308KFTC3yGcRad0GnEH0Oi3iEJ9HbriUbfVMbXNHOF+MktWiDVqzndGMKmuJSdfTBKvGFvejAWVO5E4mgLvoaMmbchc3BO7sLeraHnJN5hvMBaLcQI38N86mUfTR8AP6AJ9c2k514KaDLclm4z6J8dMz60nUeo5D3YD09G6BavFHxSvJ8MF0Lu5zOFzEePDRFm9mH8W0N/sFlIaYfD/GWU/w44mQucjaBk95YtqOGRIj58tGDWr8iUdHwaYKGqU24zGeRae9DhFXPzZshV1ZGsBQFRaoYkyLAwdJWIXTi+c37YaC8FRSEnnNmS79Dou1Kc3BvK4EYKAD2KxjtUebrV174gD0Q+9YuJ0GXOTspBvCFd5VT2Rw5zDNrA/J3F5fMCk4wOzAfMAcGBSsOAwIaBBSxgh2xyF+88V4vAffBmZXv8Txt4AQU4O/NX4MjxSodbE7ApNAMIvrtREwCAgfQ"; + String certificatePassword = "123"; + + // Set content type to indicate the certificate is PKCS12 format. + SecretProperties secretProperties = new SecretProperties(); + secretProperties.withContentType(MIME_PKCS12); + CertificatePolicy certificatePolicy = new CertificatePolicy(); + certificatePolicy.withSecretProperties(secretProperties); + + HashSet certificates = new HashSet(); + for (int i = 0; i < MAX_CERTS; ++i) { + int failureCount = 0; + for (;;) { + try { + CertificateBundle certificateBundle = keyVaultClient.importCertificate( + new ImportCertificateRequest + .Builder(getVaultUri(), certificateName, certificateContent) + .withPassword(certificatePassword) + .withPolicy(certificatePolicy) + .build()); + CertificateIdentifier id = certificateBundle.certificateIdentifier(); + certificates.add(id.identifier()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Waiting to avoid throttling"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listCertificateVersions(getVaultUri(), certificateName, PAGELIST_MAX_CERTS); + Assert.assertTrue(PAGELIST_MAX_CERTS >= listResult.currentPage().items().size()); + + listResult = keyVaultClient.listCertificateVersions(getVaultUri(), certificateName); + + for (CertificateItem item : listResult) { + if(item != null) { + certificates.remove(item.id()); + } + } + + Assert.assertEquals(0, certificates.size()); + + keyVaultClient.deleteCertificate(getVaultUri(), certificateName); + pollOnCertificateDeletion(getVaultUri(), certificateName); + keyVaultClient.purgeDeletedCertificate(getVaultUri(), certificateName); + } + + /** + * CRUD for Certificate issuers + */ + @Test + public void issuerCrudOperationsForCertificateOperationsTest() throws Exception { + // Construct organization administrator details + AdministratorDetails administratorDetails = new AdministratorDetails() + .withFirstName("John") + .withLastName("Doe") + .withEmailAddress("john.doe@contoso.com") + .withPhone("1234567890"); + + // Construct organization details + OrganizationDetails organizationDetails = new OrganizationDetails(); + List administratorsDetails = new ArrayList(); + administratorsDetails.add(administratorDetails); + organizationDetails.withAdminDetails(administratorsDetails); + + // Construct certificate issuer credentials + IssuerCredentials credentials = new IssuerCredentials() + .withAccountId("account1") + .withPassword("Pa$$w0rd"); + + IssuerBundle certificateIssuer = new IssuerBundle() + .withProvider(ISSUER_TEST) + .withCredentials(credentials) + .withOrganizationDetails(organizationDetails); + + IssuerBundle createdCertificateIssuer = keyVaultClient.setCertificateIssuer( + new SetCertificateIssuerRequest + .Builder(getVaultUri(), "issuer1", certificateIssuer.provider()) + .withCredentials(certificateIssuer.credentials()) + .withOrganizationDetails(certificateIssuer.organizationDetails()) + .build()); + + validateCertificateIssuer(certificateIssuer, createdCertificateIssuer); + + String certificateIssuerName = createdCertificateIssuer.issuerIdentifier().name(); + IssuerBundle retrievedCertificateIssuer = keyVaultClient.getCertificateIssuer(getVaultUri(), + certificateIssuerName); + + validateCertificateIssuer(certificateIssuer, retrievedCertificateIssuer); + + IssuerCredentials updatedCredentials = new IssuerCredentials() + .withAccountId("account2") + .withPassword("Secur!Ty"); + + retrievedCertificateIssuer.withCredentials(updatedCredentials); + IssuerBundle updatedCertificateIssuer = keyVaultClient.updateCertificateIssuer( + new UpdateCertificateIssuerRequest + .Builder(getVaultUri(), certificateIssuerName) + .withProvider(ISSUER_TEST) + .withCredentials(updatedCredentials) + .withOrganizationDetails(retrievedCertificateIssuer.organizationDetails()) + .withAttributes(retrievedCertificateIssuer.attributes()) + .build()); + + validateCertificateIssuer(retrievedCertificateIssuer, updatedCertificateIssuer); + + Assert.assertNotNull(updatedCertificateIssuer.organizationDetails()); + + IssuerBundle deletedCertificateIssuer = keyVaultClient.deleteCertificateIssuer(getVaultUri(), certificateIssuerName); + + validateCertificateIssuer(updatedCertificateIssuer, deletedCertificateIssuer); + + try { + keyVaultClient.getCertificateIssuer(getVaultUri(), certificateIssuerName); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("CertificateIssuerNotFound", e.body().error().code()); + } + } + + /** + * CRUD for Certificate contacts + * @throws Exception + */ + @Test + public void contactsCrudOperationsForCertificateOperationsTest() throws Exception { + // Create + Contact contact1 = new Contact(); + contact1.withName("James"); + contact1.withEmailAddress("james@contoso.com"); + contact1.withPhone("7777777777"); + + Contact contact2 = new Contact(); + contact2.withName("Ethan"); + contact2.withEmailAddress("ethan@contoso.com"); + contact2.withPhone("8888888888"); + + List contacts = new ArrayList(); + contacts.add(contact1); + contacts.add(contact2); + + Contacts certificateContacts = new Contacts(); + certificateContacts.withContactList(contacts); + Contacts createdCertificateContacts = keyVaultClient.setCertificateContacts(getVaultUri(), certificateContacts); + Assert.assertNotNull(createdCertificateContacts); + Assert.assertNotNull(createdCertificateContacts.contactList()); + Assert.assertTrue(createdCertificateContacts.contactList().size() == 2); + Contact[] createContacts = createdCertificateContacts.contactList().toArray(new Contact[createdCertificateContacts.contactList().size()]); + Assert.assertTrue(createContacts[0].name().equalsIgnoreCase("James")); + Assert.assertTrue(createContacts[0].emailAddress().equalsIgnoreCase("james@contoso.com")); + Assert.assertTrue(createContacts[0].phone().equalsIgnoreCase("7777777777")); + Assert.assertTrue(createContacts[1].name().equalsIgnoreCase("Ethan")); + Assert.assertTrue(createContacts[1].emailAddress().equalsIgnoreCase("ethan@contoso.com")); + Assert.assertTrue(createContacts[1].phone().equalsIgnoreCase("8888888888")); + + // Get + Contacts retrievedCertificateContacts = keyVaultClient.getCertificateContacts(getVaultUri()); + Assert.assertNotNull(retrievedCertificateContacts); + Assert.assertNotNull(retrievedCertificateContacts.contactList()); + Assert.assertTrue(retrievedCertificateContacts.contactList().size() == 2); + + // Delete + Contacts deletedCertificateContacts = keyVaultClient.deleteCertificateContacts(getVaultUri()); + Assert.assertNotNull(deletedCertificateContacts); + Assert.assertNotNull(deletedCertificateContacts.contactList()); + Assert.assertTrue(deletedCertificateContacts.contactList().size() == 2); + + // Get after delete + try { + keyVaultClient.getCertificateContacts(getVaultUri()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("ContactsNotFound", e.body().error().code()); + } + } + + /** + * Polls on a certificate operation for completion. + * + * @throws Exception + */ + private static CertificateBundle pollOnCertificateOperation(CertificateOperation certificateOperation) + throws Exception { + + // Wait for enrollment to complete. We will wait for 200 seconds + int pendingPollCount = 0; + while (pendingPollCount < 21) { + String certificateName = certificateOperation.certificateOperationIdentifier().name(); + CertificateOperation pendingCertificateOperation = keyVaultClient + .getCertificateOperation(getVaultUri(), certificateName); + if (pendingCertificateOperation.status().equalsIgnoreCase(STATUS_IN_PROGRESS)) { + SdkContext.sleep(10000); + pendingPollCount += 1; + continue; + } + + if (pendingCertificateOperation.status().equalsIgnoreCase(STATUS_COMPLETED)) { + return keyVaultClient.getCertificate(pendingCertificateOperation.target()); + } + + throw new Exception(String.format( + "Polling on pending certificate returned an unexpected result. Error code = {1}, Error message = {2}", + pendingCertificateOperation.error().code(), + pendingCertificateOperation.error().message())); + } + + throw new Exception("Pending certificate processing delayed"); + } + + /** + * Extracts private key from PEM contents + * + * @throws InvalidKeySpecException + * @throws NoSuchAlgorithmException + */ + private static PrivateKey extractPrivateKeyFromPemContents(String pemContents) + throws InvalidKeySpecException, NoSuchAlgorithmException { + Matcher matcher = _privateKey.matcher(pemContents); + if (!matcher.find()) { + throw new IllegalArgumentException("No private key found in PEM contents."); + } + + byte[] privateKeyBytes = _base64.decode(matcher.group(1)); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(ALGO_RSA); + PrivateKey privateKey = keyFactory.generatePrivate(keySpec); + return privateKey; + } + + /** + * Extracts certificates from PEM contents + * + * @throws CertificateException + * @throws IOException + */ + private static List extractCertificatesFromPemContents(String pemContents) + throws CertificateException, IOException { + Matcher matcher = _certificate.matcher(pemContents); + if (!matcher.find()) { + throw new IllegalArgumentException("No certificate found in PEM contents."); + } + + List result = new ArrayList(); + int offset = 0; + while (true) { + if (!matcher.find(offset)) { + break; + } + byte[] certBytes = _base64.decode(matcher.group(1)); + ByteArrayInputStream certStream = new ByteArrayInputStream(certBytes); + CertificateFactory certificateFactory = CertificateFactory.getInstance(X509); + X509Certificate x509Certificate = (X509Certificate) certificateFactory.generateCertificate(certStream); + certStream.close(); + + result.add(x509Certificate); + offset = matcher.end(); + } + + return result; + } + + /** + * Verify a RSA key pair with a simple encrypt/decrypt test. + * + * @throws NoSuchPaddingException + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + * @throws BadPaddingException + * @throws IllegalBlockSizeException + */ + private static void verifyRSAKeyPair(KeyPair keyPair) throws NoSuchAlgorithmException, NoSuchPaddingException, + InvalidKeyException, IllegalBlockSizeException, BadPaddingException { + // Validate algorithm is RSA + Assert.assertTrue(keyPair.getPublic().getAlgorithm().equals(ALGO_RSA)); + Assert.assertTrue(keyPair.getPrivate().getAlgorithm().equals(ALGO_RSA)); + + // Generate an array of 10 random bytes + byte[] plainData = new byte[10]; + Random random = new Random(); + random.nextBytes(plainData); + + // Encrypt using the public key + Cipher encryptCipher = Cipher.getInstance(ALGO_RSA); + encryptCipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); + byte[] encryptedData = encryptCipher.doFinal(plainData); + + // Decrypt using the private key + Cipher decryptCipher = Cipher.getInstance(ALGO_RSA); + decryptCipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate()); + byte[] decryptedData = decryptCipher.doFinal(encryptedData); + + // Validate plainData is equal to decryptedData + Assert.assertArrayEquals(plainData, decryptedData); + } + + private String toHexString(byte[] x5t) { + + if(x5t == null) + return ""; + + StringBuilder hexString = new StringBuilder(); + for (int i = 0; i < x5t.length; i++) { + String hex = Integer.toHexString(0xFF & x5t[i]); + if (hex.length() == 1) { + hexString.append('0'); + } + hexString.append(hex); + } + + return hexString.toString().replace("-", ""); + } + + private void validateCertificateBundle(CertificateBundle certificateBundle, CertificatePolicy certificatePolicy) { + Assert.assertNotNull(certificateBundle); + Assert.assertNotNull(certificateBundle.id()); + Assert.assertNotNull(certificateBundle.keyIdentifier()); + Assert.assertNotNull(certificateBundle.secretIdentifier()); + Assert.assertNotNull(certificateBundle.x509Thumbprint()); + + if (certificatePolicy != null) { + Assert.assertNotNull(certificateBundle.policy()); + Assert.assertNotNull(certificateBundle.policy().issuerParameters()); + Assert.assertNotNull(certificateBundle.policy().issuerParameters().name()); + if(certificatePolicy.issuerParameters() != null) { + Assert.assertTrue(certificateBundle.policy().issuerParameters().name().equalsIgnoreCase(certificatePolicy.issuerParameters().name())); + } + } + } + + private X509Certificate loadCerToX509Certificate(CertificateBundle certificateBundle) throws CertificateException, IOException { + Assert.assertNotNull(certificateBundle.cer()); + ByteArrayInputStream cerStream = new ByteArrayInputStream(certificateBundle.cer()); + CertificateFactory certificateFactory = CertificateFactory.getInstance(X509); + X509Certificate x509Certificate = (X509Certificate) certificateFactory.generateCertificate(cerStream); + cerStream.close(); + return x509Certificate; + } + + private void validateCertificateIssuer(IssuerBundle expecred, IssuerBundle actual) { + Assert.assertNotNull(actual); + Assert.assertNotNull(actual.provider()); + Assert.assertTrue(actual.provider().equals(expecred.provider())); + + Assert.assertNotNull(actual.credentials()); + Assert.assertNotNull(actual.credentials().accountId()); + Assert.assertTrue(actual.credentials().accountId().equals(expecred.credentials().accountId())); + Assert.assertNull(actual.credentials().password()); + + Assert.assertNotNull(actual.organizationDetails()); + } + + private void validateCertificateKeyInKeyStore(KeyStore keyStore, X509Certificate x509Certificate, String secretPassword) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { + String defaultAlias = Collections.list(keyStore.aliases()).get(0); + X509Certificate secretCertificate = (X509Certificate) keyStore.getCertificate(defaultAlias); + Assert.assertNotNull(secretCertificate); + Assert.assertTrue(secretCertificate.getSubjectX500Principal().getName() + .equals(x509Certificate.getSubjectX500Principal().getName())); + Assert.assertTrue(secretCertificate.getIssuerX500Principal().getName() + .equals(x509Certificate.getIssuerX500Principal().getName())); + Assert.assertTrue(secretCertificate.getSerialNumber().equals(x509Certificate.getSerialNumber())); + + + // Validate the key in the KeyStore + Key secretKey = keyStore.getKey(defaultAlias, secretPassword.toCharArray()); + Assert.assertNotNull(secretKey); + Assert.assertTrue(secretKey instanceof PrivateKey); + PrivateKey secretPrivateKey = (PrivateKey) secretKey; + + // Create a KeyPair with the private key from the KeyStore and public + // key from the certificate to verify they match + KeyPair keyPair = new KeyPair(secretCertificate.getPublicKey(), secretPrivateKey); + Assert.assertNotNull(keyPair); + verifyRSAKeyPair(keyPair); + } + + private void validateCertificateIssuer(IssuerBundle issuer, String issuerName) { + Assert.assertNotNull(issuer); + Assert.assertNotNull(issuer.issuerIdentifier()); + Assert.assertNotNull(issuer.issuerIdentifier().name()); + Assert.assertTrue(issuer.issuerIdentifier().name().equalsIgnoreCase(issuerName)); + } + + private KeyStore loadSecretToKeyStore(SecretBundle secret, String secretPassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { + ByteArrayInputStream secretStream = new ByteArrayInputStream(_base64.decode(secret.value())); + KeyStore keyStore = KeyStore.getInstance(PKCS12); + keyStore.load(secretStream, secretPassword.toCharArray()); + secretStream.close(); + return keyStore; + } + + private void validatePem(CertificateBundle certificateBundle, String subjectName) throws CertificateException, IOException, KeyVaultErrorException, IllegalArgumentException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { + // Load the CER part into X509Certificate object + X509Certificate x509Certificate = loadCerToX509Certificate(certificateBundle); + + Assert.assertTrue(x509Certificate.getSubjectX500Principal().getName().equals(subjectName)); + Assert.assertTrue(x509Certificate.getIssuerX500Principal().getName().equals(subjectName)); + + // Retrieve the secret backing the certificate + SecretIdentifier secretIdentifier = certificateBundle.secretIdentifier(); + SecretBundle secret = keyVaultClient.getSecret(secretIdentifier.baseIdentifier()); + Assert.assertTrue(secret.managed()); + String secretValue = secret.value(); + + // Extract private key from PEM + PrivateKey secretPrivateKey = extractPrivateKeyFromPemContents(secretValue); + Assert.assertNotNull(secretPrivateKey); + + // Extract certificates from PEM + List certificates = extractCertificatesFromPemContents(secretValue); + Assert.assertNotNull(certificates); + Assert.assertTrue(certificates.size() == 1); + + // has the public key corresponding to the private key. + X509Certificate secretCertificate = certificates.get(0); + Assert.assertNotNull(secretCertificate); + Assert.assertTrue(secretCertificate.getSubjectX500Principal().getName() + .equals(x509Certificate.getSubjectX500Principal().getName())); + Assert.assertTrue(secretCertificate.getIssuerX500Principal().getName() + .equals(x509Certificate.getIssuerX500Principal().getName())); + Assert.assertTrue(secretCertificate.getSerialNumber().equals(x509Certificate.getSerialNumber())); + + // Create a KeyPair with the private key from the KeyStore and public + // key from the certificate to verify they match + KeyPair keyPair = new KeyPair(secretCertificate.getPublicKey(), secretPrivateKey); + Assert.assertNotNull(keyPair); + verifyRSAKeyPair(keyPair); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/EnhancedKeyVaultTest.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/EnhancedKeyVaultTest.java new file mode 100644 index 0000000000000..abfd063fbef5c --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/EnhancedKeyVaultTest.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.test; + +import com.microsoft.azure.keyvault.messagesecurity.HttpMessageSecurity; + +import org.junit.Assert; +import org.junit.Test; +import org.apache.commons.codec.binary.Base64; + +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.MediaType; +import okhttp3.Response; +import okhttp3.ResponseBody; + +import okio.Buffer; + + + +public class EnhancedKeyVaultTest { + String clientEncryptionKeyBase64 = "eyJraWQiOiI2NDk2NWRjYi0yZTY0LTRhMjQtYmFjMC1kNWI3NGNiMWY3YzQiLCJrdHkiOiJSU0EiLCJrZXlfb3BzIjpudWxsLCJuIjoici1kbkVZRElaemoxbVc4eXdKamJuV3BWQ2pzRXFjZ3BXTm1yRWdsWW10MUtnZnZpZTAxMEwyX05UTnZnYW5FTWY1Z2I2ZUp0UjZkOE9SN2kybXpIOVpHV1pkbVBfbkstNUJWOG9pRjdEeVpMTXptS0NtQUluazJVZV94Q0dqb0dDOUR4R1pHZWhOUWpJU2J2LURtTW4wY0UzVGh1YTVXRWt3b1h3Xzg4d1VhU2tsMk5EQXUyUjYtY1kwVldkMVFuWldrZE5qRllaZ1Uzc0tnWnRJRFh2b1oxNFBoTGY1T2tXMDlmRkdGQVUxaTRiLXkyWktyNndRQnljTUhmR1pqZ0owYXVrYWVXcTZQMnRwTmVJc1I5SDYxbkZjUkxOamw5dWptVWVNbWd6RWFzN2VtTGhNY1pDVURWbzh4aG8yU1NQTlh6RDVXQUN1MkNYSGxlWGZPSU5RIiwiZSI6IkFRQUIiLCJkIjoiTUZidE1oZ3Itb0hpckdtc2p0VHk5VTExVlR4bXlhbWlBekstR2xUTExyUEZkX2NhaER3Q3c4NTdvcldCOUg1Z3F1ZklNX3Z2Z0JOOHhjM0JGYmx6TWY3eVQ4YjhGVGFfVXJxODUybEFBaWZKM3FmZlVYNlduN28tSmR4cTVmNHdEeXM2Tm9hWUEzU3d1cm1TbEtwc0JKRmx1czE1T3NONkRWWm10WXY4ekRmLUNYem1hSEdaeG00RHZFdGJVYXMyLWo0TWRkN2U3VXNVZlg1ajBQMXNTS2YzS2ZfeGIxSVR2MC1mOFJDTy04SWozcGVQN19sRkVFTTZYRTRPS3JiSFlRc1VDVHhiZHVBMElzTGxNMHp3UFJ1NU04ZnFmLTR5VjRoc3ZMOHNGWElnWHdNRkpWc1hjek5iQldfLWtsVDczdDgxZVVubllJR21qeDQtLVE3clFRIiwiZHAiOiJ4Z1NGRXVMcm5pdHlHVVpxZXpIdjV6SW0yemhsVEpnUGp4UE41ZWJQbjF2S3JhOUxDVTdkRTZWd21WZWhVdnFlMFhIR2IyakNFTXdwQmNURk0xRlBVRERwaTVmdzMtcWkzQ3pWTHdUN2I4M1ZNcVZYYUFHN0h6MjJUWjhFU04ycHFkSVVKNS1yTzY0UGJSMWZRVWNEWkhnOGJnU2Jrc0NRbDduOWxYekE4d0UiLCJkcSI6IkNxTlJKRXc1cEhXWi1xSGwtU09remdveGpfckNiY0JKdE1hMGRTOXpSZ1ptb1N0UkxZM1QyZ1ZPN3R4RzVERkxCNXFqbVdhYUhISWNlQW00U2lXVUliUEZDV0lOWG9IZ0UzaFhqbnVOLUthU2c3UzJRR21tY09BMWN3Z1BFX0ZxNEFlRGhncEJrYjJCeUs0Y0UzN044RmhJdG91OTB0TFp0YzhDWGx6Wm8zMCIsInFpIjoiZzRZb3Z5UnRWMVAtM0tnUnIzRHd6VWxrSFpReUJUS0szVzljOXRnOEhQS2dwT3hoaXpOU29YVjBQT0RLZmRLTmFvSEx5d3AxR3dDMWxueW1ORnNVVTRXMnhDa2FuMmJKMlVRTzh5bnEtNjlRZlY0MmtPcjhNQm5vNXQ5MVdXTjJwV2NSRnZVVFNya2VaZkZJY3RxcFVtY0hQNUN2SWc2Z2xnTXVCaWlVa0FnIiwicCI6IjFIQnNjOE5oT201TXVkVmZGYldldjE4akRuclcyZ25GOXNMV1JKemE0VFJYZVZZeVpDWDZQb0I4dFp1cmJTUklNbjNqTEZFMGFCOWFsXzYwZDdhRi1VdTl2VGtfSUxPMU15aVNTWmpyYjNvd0FxaTk4WjlUYWxBRHpXWWdXZjJIbTZ5VWp1YTcyMXkxOUtldHlrQmphdHhWTGtUMzZ1NExYY2dJNm1MSzlqayIsInEiOiIwX2tpSThGQ21qWGxaZ2hNTkI2cHBfZmZ5aW5BWHR2cmlNbllTNllPNTAwSHJCYnBHejRrNGNfNDJqQTlEekUxaXVqNkFvR2lyZWF5YU9fQ0NHVmM5UVItZm4wM3Noc2h6cTlkWTN0bmRYN2lYYzhkdmlUTl9pNjU5NDQyb19XaVBreG1QYURhMzFDdGxrcWZfNW45NlBwbWZ1Z2lJc1JYaWI4Wlp6bjh3ZDAiLCJrIjpudWxsLCJrZXlfaHNtIjpudWxsfQ=="; + String clientSignatureKeyBase64 = "eyJraWQiOiI2NDk2NWRjYi0yZTY0LTRhMjQtYmFjMC1kNWI3NGNiMWY3YzQiLCJrdHkiOiJSU0EiLCJrZXlfb3BzIjpudWxsLCJuIjoici1kbkVZRElaemoxbVc4eXdKamJuV3BWQ2pzRXFjZ3BXTm1yRWdsWW10MUtnZnZpZTAxMEwyX05UTnZnYW5FTWY1Z2I2ZUp0UjZkOE9SN2kybXpIOVpHV1pkbVBfbkstNUJWOG9pRjdEeVpMTXptS0NtQUluazJVZV94Q0dqb0dDOUR4R1pHZWhOUWpJU2J2LURtTW4wY0UzVGh1YTVXRWt3b1h3Xzg4d1VhU2tsMk5EQXUyUjYtY1kwVldkMVFuWldrZE5qRllaZ1Uzc0tnWnRJRFh2b1oxNFBoTGY1T2tXMDlmRkdGQVUxaTRiLXkyWktyNndRQnljTUhmR1pqZ0owYXVrYWVXcTZQMnRwTmVJc1I5SDYxbkZjUkxOamw5dWptVWVNbWd6RWFzN2VtTGhNY1pDVURWbzh4aG8yU1NQTlh6RDVXQUN1MkNYSGxlWGZPSU5RIiwiZSI6IkFRQUIiLCJkIjoiTUZidE1oZ3Itb0hpckdtc2p0VHk5VTExVlR4bXlhbWlBekstR2xUTExyUEZkX2NhaER3Q3c4NTdvcldCOUg1Z3F1ZklNX3Z2Z0JOOHhjM0JGYmx6TWY3eVQ4YjhGVGFfVXJxODUybEFBaWZKM3FmZlVYNlduN28tSmR4cTVmNHdEeXM2Tm9hWUEzU3d1cm1TbEtwc0JKRmx1czE1T3NONkRWWm10WXY4ekRmLUNYem1hSEdaeG00RHZFdGJVYXMyLWo0TWRkN2U3VXNVZlg1ajBQMXNTS2YzS2ZfeGIxSVR2MC1mOFJDTy04SWozcGVQN19sRkVFTTZYRTRPS3JiSFlRc1VDVHhiZHVBMElzTGxNMHp3UFJ1NU04ZnFmLTR5VjRoc3ZMOHNGWElnWHdNRkpWc1hjek5iQldfLWtsVDczdDgxZVVubllJR21qeDQtLVE3clFRIiwiZHAiOiJ4Z1NGRXVMcm5pdHlHVVpxZXpIdjV6SW0yemhsVEpnUGp4UE41ZWJQbjF2S3JhOUxDVTdkRTZWd21WZWhVdnFlMFhIR2IyakNFTXdwQmNURk0xRlBVRERwaTVmdzMtcWkzQ3pWTHdUN2I4M1ZNcVZYYUFHN0h6MjJUWjhFU04ycHFkSVVKNS1yTzY0UGJSMWZRVWNEWkhnOGJnU2Jrc0NRbDduOWxYekE4d0UiLCJkcSI6IkNxTlJKRXc1cEhXWi1xSGwtU09remdveGpfckNiY0JKdE1hMGRTOXpSZ1ptb1N0UkxZM1QyZ1ZPN3R4RzVERkxCNXFqbVdhYUhISWNlQW00U2lXVUliUEZDV0lOWG9IZ0UzaFhqbnVOLUthU2c3UzJRR21tY09BMWN3Z1BFX0ZxNEFlRGhncEJrYjJCeUs0Y0UzN044RmhJdG91OTB0TFp0YzhDWGx6Wm8zMCIsInFpIjoiZzRZb3Z5UnRWMVAtM0tnUnIzRHd6VWxrSFpReUJUS0szVzljOXRnOEhQS2dwT3hoaXpOU29YVjBQT0RLZmRLTmFvSEx5d3AxR3dDMWxueW1ORnNVVTRXMnhDa2FuMmJKMlVRTzh5bnEtNjlRZlY0MmtPcjhNQm5vNXQ5MVdXTjJwV2NSRnZVVFNya2VaZkZJY3RxcFVtY0hQNUN2SWc2Z2xnTXVCaWlVa0FnIiwicCI6IjFIQnNjOE5oT201TXVkVmZGYldldjE4akRuclcyZ25GOXNMV1JKemE0VFJYZVZZeVpDWDZQb0I4dFp1cmJTUklNbjNqTEZFMGFCOWFsXzYwZDdhRi1VdTl2VGtfSUxPMU15aVNTWmpyYjNvd0FxaTk4WjlUYWxBRHpXWWdXZjJIbTZ5VWp1YTcyMXkxOUtldHlrQmphdHhWTGtUMzZ1NExYY2dJNm1MSzlqayIsInEiOiIwX2tpSThGQ21qWGxaZ2hNTkI2cHBfZmZ5aW5BWHR2cmlNbllTNllPNTAwSHJCYnBHejRrNGNfNDJqQTlEekUxaXVqNkFvR2lyZWF5YU9fQ0NHVmM5UVItZm4wM3Noc2h6cTlkWTN0bmRYN2lYYzhkdmlUTl9pNjU5NDQyb19XaVBreG1QYURhMzFDdGxrcWZfNW45NlBwbWZ1Z2lJc1JYaWI4Wlp6bjh3ZDAiLCJrIjpudWxsLCJrZXlfaHNtIjpudWxsfQ=="; + String serverEncryptionKeyBase64 = "eyJraWQiOiIwMzZhOTQ2MS01NDAxLTQzNTItYjQ0Ni02ZWNmNGQyNmUwOGEiLCJrdHkiOiJSU0EiLCJrZXlfb3BzIjpudWxsLCJuIjoiaHlmZjlHVVZSRzJnQ1Z6MnhUUTAzYlA1dzVCS2FEenRMYmhHT0REeExJaDRVSGU5VWVpSWJiZ1FKd3lTMHZKWHNaRjVTRDRPamo2WlNOQXhwbkRYdVdXcHI4Yk0xWWFMaklVYldtUTc3ZVBWT0o5bVExak1DdnlSVkJ4RVNtQUo2MVdtTjhQZ012SDBhVjJ6SFZQSXpPS0ZCLVFGQkNkZjJWaEprYlRjcF9wd25wVGZnRVlTdzNWYXdyM0RfZExIWHFMWE9HRGRQUDM4NHluTS1LSEZqMmplZ3NjaThEek9XcmtNbVdoM2tYSHU4WVFwVnBsb0hpdkVjRGM1QkNXQ2Q2NlFHZ1hkcEFzSnJfNVN2SEhsLVZJOXM3UDN1dlNraExJRGRNYWZqWm1NTURRa1pselZZWXRMQk1iVDB2NmhRVVZSaTQ2RVNkQUNMNVE5aVpGR3dRIiwiZSI6IkFRQUIiLCJkIjoiREVLZ3ZUSENPUl9jcVp6R1FlTlhmRmtNS2lKWHJaY0JTT2x6YlR0N1ZUZlgtaXl5ZnRDaU41bV8xVnI5b3FjYkwxOXI2aEtfRFVZLWIyMTdZNGJPLXVGdkFDUF9oc3NhczVlTGdLcWhDUlptekNraGhMQjBhZmE1VkREd1BQTHpVMmJFbWtCcGdSV1R2MDhocFdKcFQ3U29ycXVQak8zcGN2VGdUNWhoZjlkRkZqbjlVUkxMWGltejlnLW9KaDdETVdvVnBkS2hnU1FFR0FUUGVFelBYZFlrd3pXYml2VGRoV3hiZ2pLQjE4Y3VNaDNrTU9TYXZzbl8tU3JTdjJLTW4xWjBLTldvbHFHN1JDaWZNelZlS29pcWtKLWVUZ0ttbGtHVU8tcksxT05uM1A3VUJSZG1mNjRaZjNISTVRdERQSXJCNURnRzBHUDNrVXZvZENQWU5RIiwiZHAiOiJrOTVGRTJpZDVMMGdwWTBwUGFyQjV6d3QtS2lvbG1FcTJlMjhVaVZiSHJYRmEwbVdsMjlrak5SUi10MTk0WUNwMFd5c2VHako3Qjd3a0U3TFM4TEszaHoxelUwLU9CM3VJdmdMbHZYNk05MHgtZF81S0p3WFB0eHk1ZVdYTndGMVg5Q1ZybUNZUGlKNDFoUXY5aE40b293aEJ4dnV2MldGTS1VRkZYbS03UDAiLCJkcSI6ImtLcmRtN0pkWl9SSkMtTjJBLUw3dEo1M3RfNjlweUZkYXdwS1RlNlNGeGNabkRHSGRUNDZXdDM3dzBFZ0tGdlRYWlVzXzB3M2doUDg4YVJBLUFDb1FqdUFReWkwVVNfZUlzUWRnQ21jZ2pHOU1uVWJXYW9LeEg0eGJNNUxmYlJCMDJRdGRnWkZKdm5nWkp3R0VLZjJOVVZwM2dTNXFEZmZIMllSUUpoSnZScyIsInFpIjoibVNEV2lvaDMyblRlRWdOTTNPZ09kWXBZbmhuMjdrVE1peGNNaElKeEdnWFFER0IxNmFzTjlaZ3dLdThIMVA1TkJfVG5CUHlWUmh6ZmtEd1dVM2hjc0lRMTFxbHFNbjdaaU1Vbm81NWtNNUZENzBsaXltZVNSc3AzVTZnNnVfOEc2MXhpWFdkeHZoLVFXaEhxQnZFdWE5aXdVcUxxbXZKTnNxT3phUFBjMGFZIiwicCI6Ino2NkFVbW0zYWNmZlJjNWdLQ015ajdVbTdKVURoRlBLXzJ2eTlzZ0RudzA0X0hOUFFwcG53ZVo0cTk3cE5GMG5MQ0phdWc2Yk0wMGhNQkV1U1FBdDA0UTFIcE1fcUxtd2YzMmpjOGViaTdBYnNJYVZiVk45T1VPUlJ6UVNHNkhzZERXMUx3SUFHazRZeDJ1WXlHdkpla1ZqVHVNQ2drLXA4SFFCeFBCX2ZtcyIsInEiOiJwcG05Sl9vc3pqdVNpNlJVdXFjS3gtajgxdmFNR1EtTFlwS0U3ZE5ydldrd2dOQUYzRU5pWmcxdEZCa3dQajFyaUNXVkV5NmpmZFR0aGZ0Rk9paURpLWRwOW9mYnppaVFTT3VjSXZVb1NFcGlDZ3Ewa2RPamZQVG03UVViWmxubk1iWkJ4SVZVUS12dksweVB2SHFmSFVLdEVic2NJZjh5UWVnMDBzUTBRb00iLCJrIjpudWxsLCJrZXlfaHNtIjpudWxsfQ=="; + String serverSignatureKeyBase64 = "eyJraWQiOiI0Yjg2NGRiZi02NGRkLTQ1Y2EtOGI2OS1jZmVjMDQ1NjRiNTAiLCJrdHkiOiJSU0EiLCJrZXlfb3BzIjpudWxsLCJuIjoib1hsOS1hd2xtODNFRUhrOEVpS3dFRUJLMmhPZVMzYnVQdjVDX2xqdW9TVHZGLVlwSUdoclZEZ1hjTEF4ZmFLT0ZKS0FTUUFJTWhDSlI2a2owWGdEend1NUdrMkNmQXFuS0RMc050MHVJZEZLMFprcmJHU01RNkRyUW8zUHRaTl9Ja2N6Yi1ZeVlLQ05aMXJKZTRmRjE5VlZlT05jNTkwcTM1M21CX3UtTDFPTWZtSGNnNTM5aHdBT3JqWjhjdXIzZkotSW1NOW9naFJXLVp2UE94eXJ0Mmpsak9NancycDgzN09kdUQ0UGx5NG02RmY0c0pDUFNwYjVUUDV3OWdzeFdxQVVucjlmLTYzanYyX2RZdXZVOUpBQnB2MEprQTRSeHp5MWpJQlJoemNMWFp2TnZDSllPOFlBaGpSOGJzSEpBa0FLMXVDRFhzeXhEUFRnS0VPNXFRIiwiZSI6IkFRQUIiLCJkIjoiRWRzTWFpSjJHaTk3d2RLV0tPODdCdUVGSmU1TGI4N2I4NDFNUFRINldVbHJRdnBKaV9MZ0EzVWNhbktoVm1JMlVlSU5XNFVzWXRUZlNWUlR5S0w3ME5aY0JxT1JqVVBrVGhhcmRqbXBFMFpBZnNMd1FWRXhEWDFxNW5ZbUJNOGxuTlhBdzF2eU1Dc3cxN183VGJTcTFQNGJNSDM3MVF2bzVNZGlHM25rQXZtTnB5VVFqX1VWeVJSM3dJaEUwNnJPV0VOem83VnVQdUZvMl9OZWZtZC1WcWRMMVNDS2lPS1hiMGNOd29nTHRrMV9BVWhNNXVWY1dEU0poVmhTTzFxcEJFOHlOQ2xTR25YdWtQYlp6N3lLTnJLRUc2djBiWEJXV3d3SmRlUnhoZ0pjMFI4blVYWi14ZDlnTXhwVWM0eFU2ZmNHU3k3WHpfUzBlcVRuNGRhOVBRIiwiZHAiOiJKZHc4Mm1SM1N6X1Y4Vk8ySlRiVXpLektHTEpicUx4LWhTcFRxSktZYm5qS3NPd1R0RG1NZkFGY1VBRzZ5enJlbC02ZW50dWd0Y0o1bVZGVnVKQW44Vm1Yd2VSeFNBN3hLdUJoYUtqOWdjRTh2UzlHc21nWjF5MGZYT0VNcjBmMUFXdlV1V3RqZFh0RHdtSDQyVU03QWJILXlFaGNwRlA5aVlMOC1sUVFYYzAiLCJkcSI6Ikp2X0R5RlIzdXFxNlBkSFBrSTNBcHpKVzNmTkdrSGM4aGhUU01wd1ZzcmYyTHdKMGh5dVc2aVFnc1RaS1RoUmpyMUFZMjE1VGJsVWd1OV9rd3dEb2tnZU5LZmZwam9VTFBUSGdMOEN3c0ZKQ3A5UTE1Wl9GSEZtQzBiM291bDIzMjY1bVVFMHJwZjRZZFZLX29DWVBuRUJ4T2t6MnN6bDA3VUtlNEJzMWVGTSIsInFpIjoiaFNUWnBMM2NUSUJGaFlGUkFCd1V5QU16eVJrWExhdVVHQjRZelJEY0hvQzBBMUNXZ3k4eU1GbW1ZUWVTNlFwNUZaemV3Vy1zUnhyTkZJSFZOZTVHOE81dnhQSUFpMXF5Sk8wRWJIRHpPT0NiYXpaX2pRRXZtS0dPWGRqN2NqMDdlM2Rkdkp2cFl6UF85cDVFVGVVbEE0Q1IzMjNjbjhaNzVCY0FCTkFCamljIiwicCI6IjdlVkRqLW1vSDVlUlNJdVl2VGF2aDk1a2tqTGRkOVNXUU9xcW0xLVo2N1VGTWtsQm83NDg2S0UzZElucFB3V3dwSHA5dEZ3VXBzajBqcUJfZTJnNmpSNjFPWDBDaEE0cTh0VkFGajlIc0QtVkpLdUR2MTZBc2ExbGF4TFc2NlRNb3pGakpFZVg4OHRvS0pjVDNNR0VIeVdwd2RVRlJQeGROVVpPeFhaU2F0cyIsInEiOiJyY05nZ2pCSDFIWmRlSDJ1NXZwbVA5czFXV2lPZ0lLTXIwQUFJUnVnUVdaRUdrRy0xTzBuRVdleEphQzRiQ21YbXBCYXM3UGpNSjYyQ0I4UGRBZGZQRDBLVF9sZ3l2ckIwWXpGejVpeUdUZk1QYnNTX0Rlci1WekVsZ212V214VURXZmk0Snh0MTJpZ0NqaE5VMWdDYUVDelBoV2lNYXkwb21pOTB2V0lXc3MiLCJrIjpudWxsLCJrZXlfaHNtIjpudWxsfQ=="; + + @Test + public void protectRequestEmptyKeysTest() throws Exception{ + HttpMessageSecurity messagesecurity = getMessageSecurityWithoutKeys(); + + Request request = getRequest(); + Request protectedRequest = messagesecurity.protectRequest(request); + + Assert.assertTrue(getRequestBody(protectedRequest).equals(getRequestBody(request))); + Assert.assertTrue(protectedRequest.method().equals(request.method())); + + Assert.assertTrue("Bearer Token".equals(protectedRequest.header("Authorization"))); + } + + @Test + public void unprotectRequestEmptyKeysTest() throws Exception{ + HttpMessageSecurity messagesecurity = new HttpMessageSecurity("Token", "", "", null, "", true); + + Request request = getRequest(); + Response response = getResponse(); + + Response unprotectedResponse = messagesecurity.unprotectResponse(response); + + Assert.assertTrue(response.body().equals(unprotectedResponse.body())); + } + + @Test + public void protectRequestTest() throws Exception{ + String expectedEncryptedRequestBody = new String(Base64.decodeBase64("eyJwcm90ZWN0ZWQiOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWpZME9UWTFaR05pTFRKbE5qUXROR0V5TkMxaVlXTXdMV1ExWWpjMFkySXhaamRqTkNJc0ltRjBJam9pVkc5clpXNGlMQ0owY3lJNk1Dd2ljQ0k2Ym5Wc2JDd2lkSGx3SWpvaVVHOVFJbjAiLCJwYXlsb2FkIjoiZXlKd2NtOTBaV04wWldRaU9pSmxlVXBvWWtkamFVOXBTbE5WTUVWMFZEQkdSbFZEU1hOSmJYUndXa05KTmtscVFYcE9iVVUxVGtSWmVFeFVWVEJOUkVWMFRrUk5NVTFwTVdsT1JGRXlURlJhYkZreVdUQmFSRWt5V2xSQk5GbFRTWE5KYlZaMVdYbEpOa2xyUlhoTmFtaEVVV3ROZEZOR1RYbE9WRmxwWmxFaUxDSmxibU55ZVhCMFpXUmZhMlY1SWpvaVlUSldOU0lzSW1sMklqb2lWa1ZXVkZaRVJYbE5lbEpWVWxaT1ZVMVVTWHBPUVNJc0ltTnBjR2hsY25SbGVIUWlPaUpsYmpGTGRYZ3pSSE40ZERNellqbEtaRlI2UzNweVEzcGhlVkpsWldoR2VqaGZiMVpoUzE5V1QwVnphMEpUV214a1N6WmFieTFsVDJGblNVaFNha3BKY1VacllXcDFWblYwU0ZkUFkwaE5jV0Z3UVdjMGJtaE9kV1kxYlhKcFIzbFVRbWgxYTJWNFUzWlZNeTFaY0dGMVF6RkhXbGhhUjI1dFp6SjFOazVZYVVaVWEwVlZUWEpNUVcwdE5GWkRiWEZtUlhRdFFtSjRZMXBIWVdKMVJtNXlWVGxIUlhWTk5sWmpSVFZvVUZSNWFGUjFZelZoYkU1S1NpMXBNMFpQTW05dFdGUm5iUzFuVXpSUVVYRTVaRjk0U0VaQlVrcHZRM2gxTVdkSFJVcHFZbG8xUlRkeVNGZ3dRak5yV2xKaE1uUlJabXBmV1d0MFFqVTFVbmMzWW1SVlIxZDNSa05wWlhaWE9GVmhjakpJYms1dVZrWnRhWFpmUWpFeGVsUnVhRVp4VTFkd2VtbFdVV1JRVmprNE0wMVRNR2N4U2sxYVdERktWbTlVTFcxMFJWODRMWGhxTlhOTVdVZFBkbmxGTm5JdFprUlRPRFZoUTFOUlNtRkRVMUJ0TkVWM1JIbGlOVVZNUVc5WGFXTjJWMFpsVWtVNFdVZG9jekIzWDFSYVdqZENPSFk0VUdKTE1uWnFiRW8wUlc1ME4yRm1kMHRKVkd0bVRrMTZUM1pyWWprM1JWVjRSVkZRWlVOSWFYZFVUbHBRY1dGalUwUktOMEpWV0d4cFlVcE9WSGRXUkhaSFEzVlVTVE0wZUhOdVNYUkhlVXREUldocFRXbDRVR3B2ZWpaSmRYcFBTMTk1V0RWWWNrbEZMVXRmVVVSdVFYcEhkVmhVTUdkWFRYWkZVSFZJWjJScVZYbDVWSFpJWDFOWGEwcDBVelZZUzJOZmFIZExRVGRpTTNsSVpUTm1lbGRTWDNCc05GZEhhbmgxWlZKbmNFd3dUSFpQV1doMWVqZERibE5hVlZFNVpHcHRiMUJCU0VkUlowbHFhWGM0YTA5S2FHNHRVbEZoVHpoRVlXdGtkMUJKVmxKc2RYSlBRbU5qU21kT2IybEhWR0pDY2pRM1VIQTNTVE5NWlZSb1YyNVJObmwwVGtWdk5YTktZVk5SWlU1aFUwODRPV3hQVWpGRVpIUk5SRTF6VDBWc1ZXZFNRbE5vUTJWWFZta3hNalJwTUdOZlUzbFVSV1l5UkRVeFpYVXRNbFY2V1MxSU4wVTJiWGREYmxWamEzVlBkRkE0Ums5NVJrUXpVM0YzWXpCSWRGZHhaMmRRTVc1MGRIUnZVVkpTU0hwTWJFTjZaazF4TTBOamNYVmtiV0UzWW1vMk5teEpablE0VkZoV1gxSnFTWFpHY0VORGQxRmhOR2gxZFdwR1JrZ3haRFpCSWl3aWRHRm5Jam9pWjJKU05WbEtkWGwwTkZZMWRsUk9lazFRV0RScWR5SjkiLCJzaWduYXR1cmUiOiJtdVhWcmN1TjUzanhYY0xmc0Q5MlF2YW43cm41UGhHZW9qdTJaSGtEX3E3YlpHVGU0R0NzRkZuNnRsdzRDTVhNcDZsQ3N6VmRyMkJadjVDeFZHbGFFMVluSUh2bkg2Y3JWMklFVERUMUhiZ3NjMHF4NUtGaHI2cklXUjhJdm91X001MGlFc2UzZDRyN19ZR3dxbDhyWFN6N2NPWXFHRE91bEZyY1FaZ2xwZU15TVdRS19nQXRJSjBlTUk3ZGk5ZG5fQ0pKLUhKUlNUWWJsNkF4czgzOFAtR3pfcV9HNXNtSldfVmN2bVRFVlhRNGliLWNjUlpxYklZNUxSYmpkZl9UaWJ0XzUwZndkT3h2OHZWY1MyQUlISHduWVM1bmhUSGFfZ1hvdmtSU1lJVEw2SXd0Q1Y0TzRuTm12cHFQcDNiLW5ndnl4a2VQbVgzRE1KZHp2aml4Y2cifQ==")); + HttpMessageSecurity messagesecurity = getMessageSecurityWithKeys(); + + Request request = getRequest(); + Request protectedRequest = messagesecurity.protectRequest(request); + + Assert.assertTrue(getRequestBody(protectedRequest).equals(expectedEncryptedRequestBody)); + Assert.assertTrue(protectedRequest.method().equals(request.method())); + + Assert.assertTrue("Bearer Token".equals(protectedRequest.header("Authorization"))); + } + + @Test + public void unprotectResponseTest() throws Exception{ + String expectedResponse = new String(Base64.decodeBase64("eyJraWQiOiJ0ZXN0IiwicmVrIjp7Imp3ayI6eyJraWQiOiIwMzZhOTQ2MS01NDAxLTQzNTItYjQ0Ni02ZWNmNGQyNmUwOGEiLCJrdHkiOiJSU0EiLCJrZXlfb3BzIjpbImVuY3J5cHQiLCJ3cmFwS2V5IiwidmVyaWZ5Il0sIm4iOiJoeWZmOUdVVlJHMmdDVnoyeFRRMDNiUDV3NUJLYUR6dExiaEdPRER4TEloNFVIZTlVZWlJYmJnUUp3eVMwdkpYc1pGNVNENE9qajZaU05BeHBuRFh1V1dwcjhiTTFZYUxqSVViV21RNzdlUFZPSjltUTFqTUN2eVJWQnhFU21BSjYxV21OOFBnTXZIMGFWMnpIVlBJek9LRkItUUZCQ2RmMlZoSmtiVGNwX3B3bnBUZmdFWVN3M1Zhd3IzRF9kTEhYcUxYT0dEZFBQMzg0eW5NLUtIRmoyamVnc2NpOER6T1dya01tV2gza1hIdThZUXBWcGxvSGl2RWNEYzVCQ1dDZDY2UUdnWGRwQXNKcl81U3ZISGwtVkk5czdQM3V2U2toTElEZE1hZmpabU1NRFFrWmx6VllZdExCTWJUMHY2aFFVVlJpNDZFU2RBQ0w1UTlpWkZHd1EiLCJlIjoiQVFBQiIsImQiOm51bGwsImRwIjpudWxsLCJkcSI6bnVsbCwicWkiOm51bGwsInAiOm51bGwsInEiOm51bGwsImsiOm51bGwsImtleV9oc20iOm51bGx9fX0=")); + HttpMessageSecurity messagesecurity = getMessageSecurityWithKeys(); + Response response = getResponse(); + + Response unprotectedResponse = messagesecurity.unprotectResponse(response); + + Assert.assertTrue(expectedResponse.equals(unprotectedResponse.body().string())); + } + + private HttpMessageSecurity getMessageSecurityWithoutKeys() throws Exception{ + return new HttpMessageSecurity("Token", "", "", "", "", true); + } + + private HttpMessageSecurity getMessageSecurityWithKeys() throws Exception{ + return new HttpMessageSecurity("Token", + new String(Base64.decodeBase64(clientEncryptionKeyBase64)), + new String(Base64.decodeBase64(clientSignatureKeyBase64)), + new String(Base64.decodeBase64(serverEncryptionKeyBase64)), + new String(Base64.decodeBase64(serverSignatureKeyBase64)), + true); + } + + private Request getRequest(){ + RequestBody requestBody = RequestBody.create(MediaType.parse("application/jose+json"), "{\"kid\":\"test\"}"); + return (new Request.Builder()).url("http://www.contoso.com").post(requestBody).build(); + } + + private Response getResponse(){ + String responseBodyString = new String(Base64.decodeBase64("eyJwcm90ZWN0ZWQiOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWpSaU9EWTBaR0ptTFRZMFpHUXRORFZqWVMwNFlqWTVMV05tWldNd05EVTJOR0kxTUNJc0ltRjBJam9pVkc5clpXNGlMQ0owY3lJNk1Dd2ljQ0k2Ym5Wc2JDd2lkSGx3SWpvaVVHOVFJbjAiLCJwYXlsb2FkIjoiZXlKd2NtOTBaV04wWldRaU9pSmxlVXBvWWtkamFVOXBTbE5WTUVWMFZEQkdSbFZEU1hOSmJYUndXa05KTmtscVdUQlBWRmt4V2tkT2FVeFVTbXhPYWxGMFRrZEZlVTVETVdsWlYwMTNURmRSTVZscVl6QlpNa2w0V21wa2FrNURTWE5KYlZaMVdYbEpOa2xyUlhoTmFtaEVVV3ROZEZOR1RYbE9WRmxwWmxFaUxDSmxibU55ZVhCMFpXUmZhMlY1SWpvaVFsVnNkVEJIWDJObldVSm9iVFYzUm5WaGEzZHViekEwUkZVd1kxTkRYemxVWjNwRGVsVlNRMWd5Y1VkdWRqRldaRTFRU0RVelpFcE1TbkZJT0ROc2IyWmplVTVSV0hGWWEwRlZkbVUxYVhVdFNGVlpXRmRwVmpOYVNsaGhWRVZRTUZKb2RHZHdaMkl3VUhGMFZtSlVibWRHU25VNVJ6Rm5VMWswTmxaTVdYaGtWek41ZGtsTFpFRmhRalV5Ums4M1MyOVlZVWw2T1ROblgxOHdjMnhuV1hSTlkxSjNkRm80VlZaTVpFVjNOemxXZUY5elMybGZNbVZyVm5VeFFYaE1iV0o2ZWxKeVNYQnplblJhUWpKWWNIWlRSak16VFRoVE1XSXRWVnBSU2s5QlVqWmpaQzE0UkVsRFYzVTRWbEJLZUVaalFWSlVaVlpHT1ZCaGNqbFBSMEpKV1ZOd1NXMXdTRlpYTUVWWE4yTkVSVVl6YWpCU2NFaEVRMko1YUZoeGFtVmpUMEZsVlV4MVRtaExOa0ZLYVhwTmF6Rldha3RFVldzM09HSlVhbkpSYkZOV1ZHWmxOamxTYVdGYVJsUXRabmhtYVhCQklpd2lhWFlpT2lKV1JWWlVWa1JGZVUxNlVsVlNWazVWVFZSSmVrNUJJaXdpWTJsd2FHVnlkR1Y0ZENJNkltVnVNVXQxZURORWMzaDBNek5pT1Vwa1ZIcExlbkpEZW1GNVVtVmxhRVo2T0Y5dlZtRkxYMVpQUlhWa2NXb3pkVGt3WWxWamFqVlllV2xyVVdGSFMyUXlZa0V3T0hsaWVuaHRUalZMVFVkbVRGSjBRbWMwVGpOMFNEQmhXRGxFWHpKSk4wdFZVRk5SY25GQ1dGTkpaSFZtV0RsaFdrUnZaRTl4ZW0xMWFWRmpkWFJUVWtWVFJtRkJUa2xTWHpCS2FsUkpORmhOVW1RMk5uQXdiVFJLVjA5TlluSmZkRlJ3VDNwVmJtbEhXRzloYUdZMU1sSk5kV3MxVlRCWFNrOU9aSGRxWlhwdll6bHdWM0JLTUdSTVZVVmlhVGhQVjJzMk9IVkdkemR3TFRWc1JIcFRSbGx4WVhOQ2FsaHFXSFJLV1c1alUzRnZUbTU0Y1VFMWVtTjBSSGxpUm5NNFMzSXRWSGRCYUU1S2JYQnJUVzVpYkZoTWVrczRVMGxZWkc1alZEbHJRWEJFWVZKWFQzWkNVa014ZVdaNlFUTmhhemd6VmpaSlFUZzRRMGt5WVRWcmMzSm9lakZIWTNKWllVVkRkWEY1ZFROMFNsZ3RMVVIyWlhSRWIwSlpkbDgzWlY5eWN6RnNWMVIzV0VOdk9FdG5MVVZzTTA1VFVFTnJjM2xFT1RWWFRYRkhSVWx6Y1V4aU1XVllWazEwWVd4aE5scGZYMHQyVTFSWVRVa3pZa0pVYkRoTFJITklNME5GTW5FNWNFdGxSbXBvTFROdVVuQnNibGcwYVdWcldsUjFRbWxrVDJaT1ozQktkRk13TTFSM05uVlJRbTB0WXpaWVRrUlNTR00xTUZjMFJ6WTFOemMxWDJJMmFFZGZjbmcxYkZSV2NYUTNaamRRTkZGeU1tRnFPSE5RTUdwaVJYWk1SRkJYWlhKYVdtNXpUak55T0VscmIwcFpPVTVLT0ZSelJuRXpSemMyVDE5U1gyVnJNRlZQY0Vob2VTMDFWR3B0UW1wTWFYSm1SMGRaZW5RNGJEWkRkVGd4YzBJdExVZG1SSEYwVkRNNVQxTTJaM2RvYWsxQlUxSjRORzQwYkRCVmRFbFNiMlpCWVdNd1IzWkNhVUZrV2xRMVIzcEVYekZZYUdSdGVGSnhNbmR1Vms0eE1XaDRSeTFTTUY5ZlFYQlNVVUY1WVdwaWNGQnFhMkYxWDE5ck5qVnFibTFWYWxGcGNXbHNjM1Z4UkZkR2JVWXlja1V0VlUwMFFXRkxSVlI2TUdWdFJtd3diakZ5WVRWRlNYVkpXRXczVFVjNVgybDZVMlZ2UlRaT1lWWnRkMnRHWnpKbFpqTnRNbk0xWTFKMlRGZ3hSeUlzSW5SaFp5STZJbUZIWTAwelVrWnJOR2xQVG5KZmVGUjBURkpQV21jaWZRIiwic2lnbmF0dXJlIjoiSXYzMzZ4Z1ZMVjNjOXpVb1RIcVRPd3Z6cHg2VTBySXpYaVRqS1Fxak8zSmZsbUJWczJ1OEw0STNDVFhSbGZuU0U5Y0plSXNuazR1Nmh1ZzhhakN0eHdVczBaUjVJREtPaDlfYjJoTG5vZEhQaE9Fb1dEMTBaWEJSZFlKb2dqVDd6cXhNSkd2NC1Mdmg5aGp5TE5BLUZ5TXd0dG9QVmQxdjRfOVlNQzNGczhUTHAyZTlrRHdreUxYUXpDYXN1ZkpRSGVybW82MDFJcXFfUVVZbTZnaWJCVXFMOWI4NEk3OHNOSVRLcWxkb0tGLXVKeHcxNzJRM2NMbEZycEJIWWhDalB2OFYtZnJHOGtMOVBhXzdaRjJBME4ycTNkR1ltMDAzWGo3VllmUDBkVU1rTFRnLUppakJNUzNnMDlqVTdLck5xRjlkUF9xejhjXzFjaG1JWFhxa3VRIn0=")); + + ResponseBody responseBody = ResponseBody.create(MediaType.parse("application/jose+json"), responseBodyString); + return (new Response.Builder()) + .header("content-type", "application/jose+json") + .body(responseBody) + .request(getRequest()) + .protocol(okhttp3.Protocol.HTTP_2) + .code(200) + .message("OK") + .build(); + } + + private String getRequestBody(Request request) throws Exception{ + Buffer buffer = new Buffer(); + request.body().writeTo(buffer); + return buffer.readUtf8(); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/ITManagedStorageAccountKey.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/ITManagedStorageAccountKey.java new file mode 100644 index 0000000000000..e490104a31063 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/ITManagedStorageAccountKey.java @@ -0,0 +1,516 @@ +package com.microsoft.azure.keyvault.test; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.security.InvalidKeyException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.microsoft.aad.adal4j.AuthenticationContext; +import com.microsoft.aad.adal4j.AuthenticationResult; +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.credentials.UserTokenCredentials; +import com.microsoft.azure.keyvault.KeyVaultClient; +import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; +import com.microsoft.azure.keyvault.models.DeletedStorageBundle; +import com.microsoft.azure.keyvault.models.SasDefinitionAttributes; +import com.microsoft.azure.keyvault.models.SasDefinitionBundle; +import com.microsoft.azure.keyvault.models.SasTokenType; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.StorageAccountAttributes; +import com.microsoft.azure.keyvault.models.StorageAccountItem; +import com.microsoft.azure.keyvault.models.StorageBundle; +import com.microsoft.azure.management.graphrbac.RoleDefinition; +import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; +import com.microsoft.azure.management.keyvault.Vault; +import com.microsoft.azure.management.keyvault.implementation.KeyVaultManager; +import com.microsoft.azure.management.resources.core.InterceptorManager; +import com.microsoft.azure.management.resources.core.TestBase; +import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import com.microsoft.azure.management.storage.StorageAccount; +import com.microsoft.azure.management.storage.implementation.StorageManager; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.azure.storage.CloudStorageAccount; +import com.microsoft.azure.storage.SharedAccessAccountPermissions; +import com.microsoft.azure.storage.SharedAccessAccountPolicy; +import com.microsoft.azure.storage.SharedAccessAccountResourceType; +import com.microsoft.azure.storage.SharedAccessAccountService; +import com.microsoft.azure.storage.StorageCredentials; +import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; +import com.microsoft.azure.storage.StorageException; +import com.microsoft.rest.LogLevel; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.interceptors.LoggingInterceptor; + +import okhttp3.Interceptor; +import resources.MockUserTokenCredentials; + +public class ITManagedStorageAccountKey { + + private static TestBase.TestMode testMode = null; + + KeyVaultManager keyVaultManager; + StorageManager storageManager; + GraphRbacManager graphRbacManager; + protected static KeyVaultClient keyVaultClient; + + protected static final Region VAULT_REGION = Region.US_WEST_CENTRAL; + + // This is the default client ID that works across all Azure services - leave in + // for testing. + protected static final String CLIENT_ID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"; + + protected static String MSAK_USER; + protected static String MSAK_PASSWORD; + protected static String RESOURCE_GROUP; + protected static String TENANT_ID; + protected static String SUBSCRIPTION_ID; + protected static String MSAK_USER_OID; + protected static RoleDefinition KEY_VAULT_ROLE; + + protected InterceptorManager interceptorManager = null; + + protected final static String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; + protected final static String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; + protected final static String ZERO_OID = "00000000-0000-0000-0000-000000000000"; + protected final static String ZERO_RESOURCE_GROUP = "rg-0"; + private static final String PLAYBACK_URI_BASE = "http://localhost:"; + protected static String playbackUri = null; + + @Rule + public TestName testName = new TestName(); + + @BeforeClass + public static void beforeClass() throws IOException { + initTestMode(); + initPlaybackUri(); + } + + @Before + public void beforeTests() throws Exception { + printThreadInfo(String.format("%s: %s", "beforeTest", testName.getMethodName())); + + interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); + + ServiceClientCredentials keyVaultCredentials = createTestCredentials(); + + // Due to the nature of the services, we have to use User Authentication for testing + // You must use a user with 2FA disabled for this to work. + + + if (isRecordMode()) { + // This needs to be set for playback. + RESOURCE_GROUP = System.getenv("msak.resourceGroup"); + + // These need to be set for recording. + MSAK_USER = System.getenv("msak.user"); + MSAK_PASSWORD = System.getenv("msak.password"); + MSAK_USER_OID = System.getenv("msak.useroid"); + TENANT_ID = System.getenv("arm.tenantid"); + SUBSCRIPTION_ID = System.getenv("arm.subscriptionId"); + + UserTokenCredentials credentials = new UserTokenCredentials(CLIENT_ID, TENANT_ID, MSAK_USER, MSAK_PASSWORD, + AzureEnvironment.AZURE); + Interceptor interceptor = interceptorManager.initInterceptor(); + Interceptor loggingInterceptor = new LoggingInterceptor(LogLevel.BODY_AND_HEADERS); + + RestClient keyVaultRestClient = new RestClient.Builder().withBaseUrl("https://{vaultBaseUrl}") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(keyVaultCredentials) + .withLogLevel(LogLevel.NONE).withNetworkInterceptor(loggingInterceptor) + .withNetworkInterceptor(interceptor).withInterceptor(new ResourceManagerThrottlingInterceptor()) + .build(); + + keyVaultClient = new KeyVaultClient(keyVaultRestClient); + credentials.withDefaultSubscriptionId(SUBSCRIPTION_ID); + + RestClient restClient = new RestClient.Builder().withBaseUrl("https://management.azure.com") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE).withReadTimeout(3, TimeUnit.MINUTES) + .withNetworkInterceptor(loggingInterceptor).withNetworkInterceptor(interceptor) + .withInterceptor(new ResourceManagerThrottlingInterceptor()).build(); + + String defaultSubscription = credentials.defaultSubscriptionId(); + interceptorManager.addTextReplacementRule(defaultSubscription, ZERO_SUBSCRIPTION); + interceptorManager.addTextReplacementRule(credentials.domain(), ZERO_TENANT); + interceptorManager.addTextReplacementRule("https://management.azure.com/", playbackUri + "/"); + interceptorManager.addTextReplacementRule("https://graph.windows.net/", playbackUri + "/"); + interceptorManager.addTextReplacementRule("vault.azure.net/", "vault.azure.net"); + interceptorManager.addTextReplacementRule(MSAK_USER_OID, ZERO_OID); + interceptorManager.addTextReplacementRule(RESOURCE_GROUP, ZERO_RESOURCE_GROUP); + initializeClients(restClient, defaultSubscription, credentials.domain()); + } else { + RESOURCE_GROUP = ZERO_RESOURCE_GROUP; + MSAK_USER_OID = ZERO_OID; + UserTokenCredentials credentials = new MockUserTokenCredentials(); + keyVaultClient = new KeyVaultClient(buildPlaybackRestClient(keyVaultCredentials, playbackUri )); + RestClient restClient = buildPlaybackRestClient(credentials, playbackUri ); + + initializeClients(restClient, ZERO_SUBSCRIPTION, ZERO_TENANT); + } + + KEY_VAULT_ROLE = getKeyVaultRole(); + + } + + @Test + public void testCrudOperationsForManagedStorageAccountKey() { + + String msak_UUID = null; + String storageAccountName = null; + String vaultName = null; + String fileName = System.getProperty("user.dir") + + "/src/test/java/com/microsoft/azure/keyvault/test/crudNames.json"; + + if (isRecordMode()) { + + msak_UUID = UUID.randomUUID().toString(); + storageAccountName = SdkContext.randomResourceName("sa", 15); + vaultName = SdkContext.randomResourceName("vault", 15); + JsonObject obj = new JsonObject(); + obj.addProperty("roleDefUUID", msak_UUID); + obj.addProperty("storageAccountName", storageAccountName); + obj.addProperty("vaultName", vaultName); + try { + BufferedWriter fileWriter = new BufferedWriter(new FileWriter(fileName)); + fileWriter.write(obj.toString()); + fileWriter.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + } else { + try { + Gson gson = new Gson(); + BufferedReader br = new BufferedReader(new FileReader(fileName)); + JsonObject obj = gson.fromJson(br, JsonObject.class); + msak_UUID = obj.get("roleDefUUID").getAsString(); + storageAccountName = obj.get("storageAccountName").getAsString(); + vaultName = obj.get("vaultName").getAsString(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + StorageAccount storageAccount = initStorageAccount(storageAccountName, msak_UUID); + + Vault vault = initVault(vaultName); + + String vaultUri = vault.vaultUri(); + + String activeKeyName = "key1"; + String regenerationPeriod = "P30D"; + StorageAccountAttributes attributes = new StorageAccountAttributes().withEnabled(true); + keyVaultClient.setStorageAccount(vaultUri, storageAccount.name(), storageAccount.id(), activeKeyName, true, + regenerationPeriod, attributes, null); + List msaList = keyVaultClient.getStorageAccounts(vaultUri); + Assert.assertEquals(1, msaList.size()); + + StorageBundle bundle = keyVaultClient.getStorageAccount(vaultUri, storageAccount.name()); + Assert.assertTrue(bundle.id().contains(storageAccount.name())); + Assert.assertEquals(activeKeyName, bundle.activeKeyName()); + Assert.assertEquals(regenerationPeriod, bundle.regenerationPeriod()); + Assert.assertTrue(bundle.autoRegenerateKey()); + + String newActiveKeyName = "key2"; + String newRegenerationPeriod = "P60D"; + keyVaultClient.updateStorageAccount(vaultUri, storageAccount.name(), newActiveKeyName, false, + newRegenerationPeriod, null, null); + StorageBundle updatedBundle = keyVaultClient.getStorageAccount(vaultUri, storageAccount.name()); + Assert.assertTrue(updatedBundle.id().contains(storageAccount.name())); + Assert.assertEquals(newActiveKeyName, updatedBundle.activeKeyName()); + Assert.assertEquals(newRegenerationPeriod, updatedBundle.regenerationPeriod()); + Assert.assertFalse(updatedBundle.autoRegenerateKey()); + + DeletedStorageBundle deletedBundle = keyVaultClient.deleteStorageAccount(vaultUri, storageAccount.name()); + Assert.assertTrue(deletedBundle.id().contains(storageAccount.name())); + } + + @Test + public void testSetAndGetSasDefinitionForManagedStorageAccountKey() + throws ParseException, URISyntaxException, StorageException, InvalidKeyException, IOException { + + String sas_UUID = null; + String storageAccountName = null; + String vaultName = null; + String fileName = System.getProperty("user.dir") + + "/src/test/java/com/microsoft/azure/keyvault/test/sasNames.json"; + + // Write names to file to save it + if (isRecordMode()) { + sas_UUID = UUID.randomUUID().toString(); + storageAccountName = SdkContext.randomResourceName("sa", 15); + vaultName = SdkContext.randomResourceName("vault", 15); + JsonObject obj = new JsonObject(); + obj.addProperty("roleDefUUID", sas_UUID); + obj.addProperty("storageAccountName", storageAccountName); + obj.addProperty("vaultName", vaultName); + + try { + BufferedWriter fileWriter = new BufferedWriter(new FileWriter(fileName)); + fileWriter.write(obj.toString()); + fileWriter.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + } else { + + try { + Gson gson = new Gson(); + BufferedReader br = new BufferedReader(new FileReader(fileName)); + JsonObject obj = gson.fromJson(br, JsonObject.class); + sas_UUID = obj.get("roleDefUUID").getAsString(); + storageAccountName = obj.get("storageAccountName").getAsString(); + vaultName = obj.get("vaultName").getAsString(); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + StorageAccount storageAccount = initStorageAccount(storageAccountName, sas_UUID); + Vault vault = initVault(vaultName); + String vaultUri = vault.vaultUri(); + + final SimpleDateFormat FORMATTER = new SimpleDateFormat("dd-MM-yyyy"); + + String activeKeyName = "key1"; + String regenerationPeriod = "P30D"; + StorageAccountAttributes storageAttributes = new StorageAccountAttributes().withEnabled(true); + keyVaultClient.setStorageAccount(vaultUri, storageAccount.name(), storageAccount.id(), activeKeyName, true, + regenerationPeriod, storageAttributes, null); + + StorageCredentials sas = new StorageCredentialsAccountAndKey(storageAccount.name(), "00000001"); + // Note that the key passed in is just a dummy key such that we can generate the + // correct signature for the template. + CloudStorageAccount account = new CloudStorageAccount(sas); + + // Create a new policy + SharedAccessAccountPolicy sharedAccessAccountPolicy = new SharedAccessAccountPolicy(); + sharedAccessAccountPolicy.setServices(EnumSet.of(SharedAccessAccountService.BLOB, + SharedAccessAccountService.FILE, SharedAccessAccountService.QUEUE, SharedAccessAccountService.TABLE)); + sharedAccessAccountPolicy + .setPermissions(EnumSet.of(SharedAccessAccountPermissions.ADD, SharedAccessAccountPermissions.CREATE, + SharedAccessAccountPermissions.DELETE, SharedAccessAccountPermissions.LIST, + SharedAccessAccountPermissions.PROCESS_MESSAGES, SharedAccessAccountPermissions.READ, + SharedAccessAccountPermissions.UPDATE, SharedAccessAccountPermissions.WRITE)); + sharedAccessAccountPolicy.setResourceTypes(EnumSet.of(SharedAccessAccountResourceType.CONTAINER, + SharedAccessAccountResourceType.OBJECT, SharedAccessAccountResourceType.SERVICE)); // all resources + // service, + // container, object + sharedAccessAccountPolicy.setSharedAccessExpiryTime(FORMATTER.parse("01-01-2020")); + + // Generate a signature based off of the policy and account. + String sasSignature = account.generateSharedAccessSignature(sharedAccessAccountPolicy); + + // Currently the key vault service cannot process the sr signature, so this + // needs to be manually removed. + sasSignature = sasSignature.substring(0, sasSignature.lastIndexOf("&")); + + String sasDefinitionName = "acctall"; + // Use the created template to create a sas definition in the vault. + SasDefinitionAttributes attributes = new SasDefinitionAttributes().withEnabled(true); + SasDefinitionBundle sasDefinition = keyVaultClient.setSasDefinition(vaultUri, storageAccount.name(), + sasDefinitionName, sasSignature, SasTokenType.ACCOUNT, "PT2H", attributes, null); + + // Grab the secretName from the full secretId (the trailing characters after the + // last slash) + String sasSecretId = sasDefinition.secretId(); + String secretName = sasSecretId.substring(sasSecretId.lastIndexOf("/")).substring(1); + SecretBundle acctSasToken = keyVaultClient.getSecret(vaultUri, secretName); + Assert.assertNotNull(acctSasToken); + + SasDefinitionBundle retrievedSasDefinition = keyVaultClient.getSasDefinition(vaultUri, storageAccount.name(), + sasDefinitionName); + Assert.assertEquals(sasDefinition.id(), retrievedSasDefinition.id()); + Assert.assertEquals(sasDefinition.secretId(), retrievedSasDefinition.secretId()); + Assert.assertEquals(sasDefinition.validityPeriod(), retrievedSasDefinition.validityPeriod()); + } + + @After + public void afterMethod() throws IOException { + interceptorManager.finalizeInterceptor(); + } + + // Creates a new storage account for use with this account + private StorageAccount initStorageAccount(final String storageAccountName, final String roleAccountUUID) { + StorageAccount storageAccount = storageManager.storageAccounts().define(storageAccountName) + .withRegion(VAULT_REGION).withExistingResourceGroup(RESOURCE_GROUP).create(); + + graphRbacManager.roleAssignments().define(roleAccountUUID).forObjectId("93c27d83-f79b-4cb2-8dd4-4aa716542e74") + .withRoleDefinition(KEY_VAULT_ROLE.id()).withScope(storageAccount.id()).create(); + + return storageAccount; + } + + private Vault initVault(final String VAULT_NAME) { + + Vault vault = keyVaultManager.vaults().define(VAULT_NAME).withRegion(VAULT_REGION) + .withExistingResourceGroup(RESOURCE_GROUP).defineAccessPolicy() + .forObjectId(MSAK_USER_OID).allowSecretAllPermissions() + .allowStorageAllPermissions().attach().withDeploymentDisabled().create(); + return vault; + } + + protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) + throws IOException { + + keyVaultManager = KeyVaultManager.authenticate(restClient, domain, defaultSubscription); + + storageManager = StorageManager.authenticate(restClient, defaultSubscription); + + graphRbacManager = GraphRbacManager.authenticate(restClient, domain); + + } + + // User Auth flow for acquiring token + private static AuthenticationResult getAccessToken(String authorization, String resource) throws Exception { + AuthenticationResult result = null; + ExecutorService service = null; + try { + service = Executors.newFixedThreadPool(1); + AuthenticationContext context = new AuthenticationContext(authorization, false, service); + Future future = null; + future = context.acquireToken(resource, CLIENT_ID, MSAK_USER, MSAK_PASSWORD, null); + result = future.get(); + } finally { + service.shutdown(); + } + + if (result == null) { + throw new RuntimeException("authentication result was null"); + } + return result; + } + + // Creates serviceClientCredentials based on the credentials passed in. + private static ServiceClientCredentials createTestCredentials() throws Exception { + return new KeyVaultCredentials() { + + @Override + public String doAuthenticate(String authorization, String resource, String scope) { + try { + + if (isRecordMode()) { + AuthenticationResult authResult = getAccessToken(authorization, resource); + return authResult.getAccessToken(); + } else { + return ""; + } + + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + }; + } + + private static void initPlaybackUri() throws IOException { + if (isPlaybackMode()) { + Properties mavenProps = new Properties(); + InputStream in = TestBase.class.getResourceAsStream("/maven.properties"); + if (in == null) { + throw new IOException( + "The file \"maven.properties\" has not been generated yet. Please execute \"mvn compile\" to generate the file."); + } + mavenProps.load(in); + String port = mavenProps.getProperty("playbackServerPort"); + // 11080 and 11081 needs to be in sync with values in jetty.xml file + playbackUri = PLAYBACK_URI_BASE + port; + } else { + playbackUri = PLAYBACK_URI_BASE + "1234"; + } + } + + private static void initTestMode() throws IOException { + String azureTestMode = System.getenv("AZURE_TEST_MODE"); + if (azureTestMode != null) { + if (azureTestMode.equalsIgnoreCase("Record")) { + testMode = TestBase.TestMode.RECORD; + } else if (azureTestMode.equalsIgnoreCase("Playback")) { + testMode = TestBase.TestMode.PLAYBACK; + } else { + throw new IOException("Unknown AZURE_TEST_MODE: " + azureTestMode); + } + } else { + testMode = TestBase.TestMode.PLAYBACK; + } + } + + public static boolean isPlaybackMode() { + if (testMode == null) + try { + initTestMode(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("Can't init test mode."); + } + return testMode == TestBase.TestMode.PLAYBACK; + } + + public static boolean isRecordMode() { + return !isPlaybackMode(); + } + + private static void printThreadInfo(String what) { + long id = Thread.currentThread().getId(); + String name = Thread.currentThread().getName(); + System.out.println(String.format("\n***\n*** [%s:%s] - %s\n***\n", name, id, what)); + } + + // find the role definition for "Storage Account Key Operator Service Role" + private RoleDefinition getKeyVaultRole() { + RoleDefinition keyVaultRole = null; + PagedList roleDefinitions = graphRbacManager.roleDefinitions().listByScope("\\"); + Iterator roleDefs = roleDefinitions.iterator(); + while (roleDefs.hasNext()) { + RoleDefinition definition = roleDefs.next(); + if (definition.roleName().equals("Storage Account Key Operator Service Role")) { + keyVaultRole = definition; + break; + } + } + return keyVaultRole; + } + + protected RestClient buildPlaybackRestClient(ServiceClientCredentials credentials, String baseUrl) + throws IOException { + return new RestClient.Builder().withBaseUrl(baseUrl) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE).withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) + .withNetworkInterceptor(interceptorManager.initInterceptor()) + .withInterceptor(new ResourceManagerThrottlingInterceptor()).build(); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyOperationsTest.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyOperationsTest.java new file mode 100644 index 0000000000000..3b99152d6137d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyOperationsTest.java @@ -0,0 +1,599 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.test; + +import java.math.BigInteger; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.MessageDigest; +import java.security.spec.KeySpec; +import java.security.spec.RSAPrivateCrtKeySpec; +import java.security.spec.RSAPublicKeySpec; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import javax.crypto.Cipher; + +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Test; + +import com.microsoft.azure.keyvault.models.KeyBundle; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.KeyIdentifier; +import com.microsoft.azure.keyvault.models.KeyItem; +import com.microsoft.azure.keyvault.models.KeyOperationResult; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.KeyVerifyResult; +import com.microsoft.azure.keyvault.requests.CreateKeyRequest; +import com.microsoft.azure.keyvault.requests.ImportKeyRequest; +import com.microsoft.azure.keyvault.requests.UpdateKeyRequest; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyItem; +import com.microsoft.azure.keyvault.models.KeyAttributes; +import com.microsoft.azure.keyvault.webkey.JsonWebKey; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyEncryptionAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyOperation; +import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; +import com.microsoft.azure.keyvault.webkey.JsonWebKeyType; + +public class KeyOperationsTest extends KeyVaultClientIntegrationTestBase { + + private static final String KEY_NAME = "javaKey"; + private static final int MAX_KEYS = 4; + private static final int PAGELIST_MAX_KEYS = 3; + + @Test + public void transparentAuthenticationForKeyOperationsTest() throws Exception { + + // Create a key on a vault. + { + Map tags = new HashMap(); + tags.put("foo", "baz"); + List keyOps = Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.DECRYPT); + Attributes attribute = new KeyAttributes() + .withEnabled(true) + .withExpires(new DateTime().withYear(2050).withMonthOfYear(1)) + .withNotBefore(new DateTime().withYear(2000).withMonthOfYear(1)); + + KeyBundle bundle = keyVaultClient.createKey(new CreateKeyRequest + .Builder(getVaultUri(), KEY_NAME, JsonWebKeyType.RSA) + .withAttributes(attribute) + .withKeyOperations(keyOps) + .withKeySize(2048) + .withTags(tags) + .build()); + + validateRsaKeyBundle(bundle, getVaultUri(), KEY_NAME, JsonWebKeyType.RSA, keyOps, attribute); + } + + // Create a key on a different vault. Key Vault Data Plane returns 401, + // which must be transparently handled by KeyVaultCredentials. + { + KeyBundle bundle = alternativeKeyVaultClient.createKey(new CreateKeyRequest.Builder(getSecondaryVaultUri(), KEY_NAME, JsonWebKeyType.RSA).build()); + validateRsaKeyBundle(bundle, getSecondaryVaultUri(), KEY_NAME, JsonWebKeyType.RSA, null, null); + } + + } + + @Test + public void importKeyOperationForKeyOperationsTest() throws Exception { + + KeyBundle keyBundle = new KeyBundle(); + JsonWebKey key = JsonWebKey.fromRSA(getTestKeyMaterial()); + + key.withKeyOps(Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.DECRYPT)); + + keyBundle.withKey(key); + + checkImportOperation(keyBundle, false); + checkImportOperation(keyBundle, true); + } + + private void checkImportOperation(KeyBundle keyBundle, boolean importToHardware) throws Exception { + Attributes attribute = new KeyAttributes() + .withEnabled(true) + .withExpires(new DateTime().withYear(2050).withMonthOfYear(1)) + .withNotBefore(new DateTime().withYear(2000).withMonthOfYear(1)); + + Map tags = new HashMap(); + tags.put("foo", "baz"); + + JsonWebKey importedJwk = keyBundle.key(); + KeyBundle importResultBundle = keyVaultClient.importKey( + new ImportKeyRequest + .Builder(getVaultUri(), KEY_NAME, keyBundle.key()) + .withHsm(importToHardware) + .withAttributes(attribute) + .withTags(tags) + .build()); + + validateRsaKeyBundle(importResultBundle, getVaultUri(), KEY_NAME, importToHardware ? JsonWebKeyType.RSA_HSM : JsonWebKeyType.RSA, importedJwk.keyOps(), attribute); + checkEncryptDecryptSequence(importedJwk, importResultBundle); + Assert.assertTrue(importResultBundle.key().isValid()); + } + + private void checkEncryptDecryptSequence(JsonWebKey importedKey, KeyBundle importedKeyBundle) throws Exception { + + // Test variables + byte[] plainText = new byte[100]; + new Random(0x1234567L).nextBytes(plainText); + byte[] cipherText; + + // Encrypt in the service. + { + KeyOperationResult result = keyVaultClient.encrypt(importedKeyBundle.key().kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, plainText); + cipherText = result.result(); + } + + // Decrypt in the client, notice OAEP algorithm instance to use. + { + Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding"); + cipher.init(Cipher.DECRYPT_MODE, importedKey.toRSA(true).getPrivate()); + + byte[] beforeEncrypt = plainText; + byte[] afterDecrypt = cipher.doFinal(cipherText); + Assert.assertArrayEquals(beforeEncrypt, afterDecrypt); + } + + // Encrypt in the client, using the service provided material. Also use + // standard padding. + { + Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + cipher.init(Cipher.ENCRYPT_MODE, importedKeyBundle.key().toRSA().getPublic()); + + cipherText = cipher.doFinal(plainText); + } + + // Decrypt in the service. + { + KeyOperationResult result = keyVaultClient.decrypt(importedKeyBundle.key().kid(), JsonWebKeyEncryptionAlgorithm.RSA1_5, cipherText); + + byte[] beforeEncrypt = plainText; + byte[] afterDecrypt = result.result(); + Assert.assertArrayEquals(beforeEncrypt, afterDecrypt); + } + } + + @Test + public void crudOperationsForKeyOperationsTest() throws Exception { + + KeyBundle createdBundle; + { + // Create key + createdBundle = keyVaultClient.createKey(new CreateKeyRequest.Builder(getVaultUri(), KEY_NAME, JsonWebKeyType.RSA).build()); + validateRsaKeyBundle(createdBundle, getVaultUri(), KEY_NAME, JsonWebKeyType.RSA, null, null); + } + + // Key identifier. + KeyIdentifier keyId = new KeyIdentifier(createdBundle.key().kid()); + + { + // Get key using kid WO version + KeyBundle readBundle = keyVaultClient.getKey(keyId.baseIdentifier()); + compareKeyBundles(createdBundle, readBundle); + } + + { + // Get key using full kid as defined in the bundle + KeyBundle readBundle = keyVaultClient.getKey(createdBundle.key().kid()); + compareKeyBundles(createdBundle, readBundle); + } + + { + // Get key using vault and key name. + KeyBundle readBundle = keyVaultClient.getKey(getVaultUri(), KEY_NAME); + compareKeyBundles(createdBundle, readBundle); + } + + { + // Get key using vault, key name and version. + KeyBundle readBundle = keyVaultClient.getKey(getVaultUri(), KEY_NAME, keyId.version()); + compareKeyBundles(createdBundle, readBundle); + } + + { + // Get key using vault, key name and a null version. + KeyBundle readBundle = keyVaultClient.getKey(getVaultUri(), KEY_NAME); + compareKeyBundles(createdBundle, readBundle); + } + + { + // Update key using the kid as defined in the bundle + + // First we create a bundle with the modified attributes. + createdBundle.attributes().withExpires(new DateTime() + .withMonthOfYear(2) + .withDayOfMonth(1) + .withYear(2050)); + List key_ops = Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.DECRYPT); + Map tags = new HashMap(); + tags.put("foo", "baz"); + createdBundle.key().withKeyOps(key_ops); + createdBundle.withTags(tags); + + // Perform the operation. + KeyBundle updatedBundle = keyVaultClient.updateKey( + new UpdateKeyRequest + .Builder(createdBundle.key().kid()) + .withKeyOperations(key_ops) + .withAttributes(createdBundle.attributes()) + .withTags(createdBundle.tags()) + .build()); + + compareKeyBundles(createdBundle, updatedBundle); + + // Subsequent operations must use the updated bundle for comparison. + createdBundle = updatedBundle; + } + + { + // Update key using vault and key name. + + // First we create a bundle with the modified attributes. + createdBundle.attributes().withNotBefore(new DateTime() + .withMonthOfYear(2) + .withDayOfMonth(1) + .withYear(2000)); + List key_ops = Arrays.asList(JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY); + createdBundle.key().withKeyOps(key_ops); + Map tags = new HashMap(); + tags.put("foo", "baz"); + createdBundle.withTags(tags); + + // Perform the operation. + KeyBundle updatedBundle = keyVaultClient.updateKey( + new UpdateKeyRequest + .Builder(getVaultUri(), KEY_NAME) + .withKeyOperations(key_ops) + .withAttributes(createdBundle.attributes()) + .withTags(createdBundle.tags()) + .build()); + + compareKeyBundles(createdBundle, updatedBundle); + } + + { + // Delete key + DeletedKeyBundle deleteBundle = keyVaultClient.deleteKey(getVaultUri(), KEY_NAME); + compareKeyBundles(createdBundle, deleteBundle); + pollOnKeyDeletion(getVaultUri(), KEY_NAME); + } + + { + // Expects a key not found + try { + keyVaultClient.getKey(keyId.baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error()); + Assert.assertEquals("KeyNotFound", e.body().error().code()); + } + } + + keyVaultClient.purgeDeletedKey(getVaultUri(), KEY_NAME); + SdkContext.sleep(40000); + } + + @Test + public void backupRestoreForKeyOperationsTest() throws Exception { + + KeyBundle createdBundle; + + // Creates a key + { + createdBundle = keyVaultClient.createKey( + new CreateKeyRequest.Builder(getVaultUri(), KEY_NAME, JsonWebKeyType.RSA) + .build()); + validateRsaKeyBundle(createdBundle, getVaultUri(), KEY_NAME, JsonWebKeyType.RSA, null, null); + } + + // Creates a backup of key. + byte[] keyBackup; + { + keyBackup = keyVaultClient.backupKey(getVaultUri(), KEY_NAME).value(); + SdkContext.sleep(20000); + } + + // Deletes the key. + { + keyVaultClient.deleteKey(getVaultUri(), KEY_NAME); + pollOnKeyDeletion(getVaultUri(), KEY_NAME); + } + + keyVaultClient.purgeDeletedKey(getVaultUri(), KEY_NAME); + SdkContext.sleep(40000); + + // Restores the key. + { + KeyBundle restoredBundle = keyVaultClient.restoreKey(getVaultUri(), keyBackup); + compareKeyBundles(createdBundle, restoredBundle); + } + + } + + @Test + public void listKeysForKeyOperationsTest() throws Exception { + + HashSet keys = new HashSet(); + for (int i = 0; i < MAX_KEYS; ++i) { + int failureCount = 0; + for (;;) { + try { + KeyBundle createdBundle = keyVaultClient.createKey(new CreateKeyRequest.Builder(getVaultUri(), KEY_NAME + i, JsonWebKeyType.RSA).build()); + KeyIdentifier kid = new KeyIdentifier(createdBundle.key().kid()); + keys.add(kid.baseIdentifier()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Waiting to avoid throttling"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listKeys(getVaultUri(), PAGELIST_MAX_KEYS); + Assert.assertTrue(PAGELIST_MAX_KEYS >= listResult.currentPage().items().size()); + + HashSet toDelete = new HashSet(); + + for (KeyItem item : listResult) { + if(item != null) { + KeyIdentifier id = new KeyIdentifier(item.kid()); + toDelete.add(id.name()); + keys.remove(item.kid()); + } + } + + Assert.assertEquals(0, keys.size()); + + for (String name : toDelete) { + try{ + DeletedKeyBundle deletedKey = keyVaultClient.deleteKey(getVaultUri(), name); + Assert.assertNotNull(deletedKey); + pollOnKeyDeletion(getVaultUri(), name); + } + catch(KeyVaultErrorException e){ + // Ignore forbidden exception for certificate keys that cannot be deleted + if(!e.body().error().code().equals("Forbidden")) + throw e; + } + } + + PagedList deletedListResult = keyVaultClient.getDeletedKeys(getVaultUri()); + for (DeletedKeyItem item : deletedListResult) { + if (item != null) { + KeyIdentifier id = new KeyIdentifier(item.kid()); + Assert.assertTrue(toDelete.contains(id.name())); + keyVaultClient.purgeDeletedKey(getVaultUri(), id.name()); + SdkContext.sleep(40000); + } + } + + } + + @Test + public void listKeyVersionsForKeyOperationsTest() throws Exception { + + HashSet keys = new HashSet(); + for (int i = 0; i < MAX_KEYS; ++i) { + int failureCount = 0; + for (;;) { + try { + KeyBundle createdBundle = keyVaultClient.createKey(new CreateKeyRequest.Builder(getVaultUri(), KEY_NAME, JsonWebKeyType.RSA).build()); + keys.add(createdBundle.key().kid()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Waiting to avoid throttling"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listKeyVersions(getVaultUri(), KEY_NAME, MAX_KEYS); + //TODO bug: Assert.assertTrue(PAGELIST_MAX_KEYS >= listResult.currentPage().getItems().size()); + + listResult = keyVaultClient.listKeyVersions(getVaultUri(), KEY_NAME); + + for (KeyItem item : listResult) { + if(item != null) { + keys.remove(item.kid()); + } + } + + Assert.assertEquals(0, keys.size()); + + keyVaultClient.deleteKey(getVaultUri(), KEY_NAME); + pollOnKeyDeletion(getVaultUri(), KEY_NAME); + + keyVaultClient.purgeDeletedKey(getVaultUri(), KEY_NAME); + SdkContext.sleep(40000); + } + + @Test + public void encryptDecryptOperationsForKeyOperationsTest() throws Exception { + + JsonWebKey testKey = importTestKey(); + KeyIdentifier keyId = new KeyIdentifier(testKey.kid()); + + // Test variables + byte[] plainText = new byte[100]; + new Random(0x1234567L).nextBytes(plainText); + byte[] cipherText; + + KeyOperationResult result; + + // encrypt and decrypt using kid WO version + { + result = keyVaultClient.encrypt(keyId.baseIdentifier(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, plainText); + cipherText = result.result(); + + result = keyVaultClient.decrypt(keyId.baseIdentifier(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, cipherText); + Assert.assertArrayEquals(plainText, result.result()); + } + + // encrypt and decrypt using full kid + { + result = keyVaultClient.encrypt(testKey.kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, plainText); + cipherText = result.result(); + + result = keyVaultClient.decrypt(testKey.kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, cipherText); + Assert.assertArrayEquals(plainText, result.result()); + } + } + + @Test + public void wrapUnwrapOperationsForKeyOperationsTest() throws Exception { + + JsonWebKey testKey = importTestKey(); + KeyIdentifier keyId = new KeyIdentifier(testKey.kid()); + + // Test variables + byte[] plainText = new byte[100]; + new Random(0x1234567L).nextBytes(plainText); + byte[] cipherText; + + KeyOperationResult result; + + // wrap and unwrap using kid WO version + { + result = keyVaultClient.wrapKey(keyId.baseIdentifier(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, plainText); + cipherText = result.result(); + + result = keyVaultClient.unwrapKey(keyId.baseIdentifier(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, cipherText); + Assert.assertArrayEquals(plainText, result.result()); + } + + // wrap and unwrap using full kid + { + result = keyVaultClient.wrapKey(testKey.kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, plainText); + cipherText = result.result(); + + result = keyVaultClient.unwrapKey(testKey.kid(), JsonWebKeyEncryptionAlgorithm.RSA_OAEP, cipherText); + Assert.assertArrayEquals(plainText, result.result()); + } + } + + @Test + public void signVerifyOperationsForKeyOperationsTest() throws Exception { + + JsonWebKey testKey = importTestKey(); + KeyIdentifier keyId = new KeyIdentifier(testKey.kid()); + + // Test variables + byte[] plainText = new byte[100]; + new Random(0x1234567L).nextBytes(plainText); + MessageDigest md = MessageDigest.getInstance("SHA-256"); + md.update(plainText); + byte[] digest = md.digest(); + byte[] signature; + + KeyOperationResult result; + KeyVerifyResult verifyResult; + + // Using kid WO version + { + result = keyVaultClient.sign(keyId.baseIdentifier(), JsonWebKeySignatureAlgorithm.RS256, digest); + signature = result.result(); + + verifyResult = keyVaultClient.verify(keyId.baseIdentifier(), JsonWebKeySignatureAlgorithm.RS256, digest, signature); + Assert.assertEquals(new Boolean(true), verifyResult.value()); + } + + // Using full kid + { + result = keyVaultClient.sign(testKey.kid(), JsonWebKeySignatureAlgorithm.RS256, digest); + signature = result.result(); + + verifyResult = keyVaultClient.verify(testKey.kid(), JsonWebKeySignatureAlgorithm.RS256, digest, signature); + Assert.assertEquals(new Boolean(true), verifyResult.value()); + + } + } + + private static JsonWebKey importTestKey() throws Exception { + + KeyBundle keyBundle = new KeyBundle(); + JsonWebKey key = JsonWebKey.fromRSA(getTestKeyMaterial()); + + key.withKty(JsonWebKeyType.RSA); + key.withKeyOps(Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.DECRYPT, JsonWebKeyOperation.SIGN, JsonWebKeyOperation.VERIFY, JsonWebKeyOperation.WRAP_KEY, JsonWebKeyOperation.UNWRAP_KEY)); + + keyBundle = keyVaultClient.importKey( + new ImportKeyRequest + .Builder(getVaultUri(), KEY_NAME, key) + .withHsm(false) + .build()); + + validateRsaKeyBundle(keyBundle, getVaultUri(), KEY_NAME, JsonWebKeyType.RSA, null, null); + + return keyBundle.key(); + } + + private static KeyPair getTestKeyMaterial() throws Exception { + return getWellKnownKey(); + } + + private static KeyPair getWellKnownKey() throws Exception { + BigInteger modulus = new BigInteger("27266783713040163753473734334021230592631652450892850648620119914958066181400432364213298181846462385257448168605902438305568194683691563208578540343969522651422088760509452879461613852042845039552547834002168737350264189810815735922734447830725099163869215360401162450008673869707774119785881115044406101346450911054819448375712432746968301739007624952483347278954755460152795801894283389540036131881712321193750961817346255102052653789197325341350920441746054233522546543768770643593655942246891652634114922277138937273034902434321431672058220631825053788262810480543541597284376261438324665363067125951152574540779"); + BigInteger publicExponent = new BigInteger("65537"); + BigInteger privateExponent = new BigInteger("10466613941269075477152428927796086150095892102279802916937552172064636326433780566497000814207416485739683286961848843255766652023400959086290344987308562817062506476465756840999981989957456897020361717197805192876094362315496459535960304928171129585813477132331538577519084006595335055487028872410579127692209642938724850603554885478763205394868103298473476811627231543504190652483290944218004086457805431824328448422034887148115990501701345535825110962804471270499590234116100216841170344686381902328362376624405803648588830575558058257742073963036264273582756620469659464278207233345784355220317478103481872995809"); + BigInteger primeP = new BigInteger("175002941104568842715096339107566771592009112128184231961529953978142750732317724951747797764638217287618769007295505214923187971350518217670604044004381362495186864051394404165602744235299100790551775147322153206730562450301874236875459336154569893255570576967036237661594595803204808064127845257496057219227"); + BigInteger primeQ = new BigInteger("155807574095269324897144428622185380283967159190626345335083690114147315509962698765044950001909553861571493035240542031420213144237033208612132704562174772894369053916729901982420535940939821673277140180113593951522522222348910536202664252481405241042414183668723338300649954708432681241621374644926879028977"); + BigInteger primeExponentP = new BigInteger("79745606804504995938838168837578376593737280079895233277372027184693457251170125851946171360348440134236338520742068873132216695552312068793428432338173016914968041076503997528137698610601222912385953171485249299873377130717231063522112968474603281996190849604705284061306758152904594168593526874435238915345"); + BigInteger primeExponentQ = new BigInteger("80619964983821018303966686284189517841976445905569830731617605558094658227540855971763115484608005874540349730961777634427740786642996065386667564038755340092176159839025706183161615488856833433976243963682074011475658804676349317075370362785860401437192843468423594688700132964854367053490737073471709030801"); + BigInteger crtCoefficient = new BigInteger("2157818511040667226980891229484210846757728661751992467240662009652654684725325675037512595031058612950802328971801913498711880111052682274056041470625863586779333188842602381844572406517251106159327934511268610438516820278066686225397795046020275055545005189953702783748235257613991379770525910232674719428"); + + KeySpec publicKeySpec = new RSAPublicKeySpec(modulus, publicExponent); + KeySpec privateKeySpec = new RSAPrivateCrtKeySpec(modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + + return new KeyPair(keyFactory.generatePublic(publicKeySpec), keyFactory.generatePrivate(privateKeySpec)); + } + + private static void validateRsaKeyBundle(KeyBundle bundle, String vault, String keyName, JsonWebKeyType kty, List key_ops, Attributes attributes) throws Exception { + String prefix = vault + "/keys/" + keyName + "/"; + String kid = bundle.key().kid(); + Assert.assertTrue( + String.format("\"kid\" should start with \"%s\", but instead the value is \"%s\".", prefix, kid), + kid.startsWith(prefix)); + Assert.assertEquals(kty, bundle.key().kty()); + Assert.assertNotNull("\"n\" should not be null.", bundle.key().n()); + Assert.assertNotNull("\"e\" should not be null.", bundle.key().e()); + if (key_ops != null) { + Assert.assertTrue(key_ops.equals(bundle.key().keyOps())); + } + Assert.assertNotNull("\"created\" should not be null.", bundle.attributes().created()); + Assert.assertNotNull("\"updated\" should not be null.", bundle.attributes().updated()); + + Assert.assertTrue(bundle.managed() == null || bundle.managed() == false); + Assert.assertTrue(bundle.key().isValid()); + } + + private void compareKeyBundles(KeyBundle expected, KeyBundle actual) { + Assert.assertTrue(expected.key().toString().equals(actual.key().toString())); + Assert.assertEquals(expected.attributes().enabled(), actual.attributes().enabled()); + if(expected.tags() != null || actual.tags() != null) + Assert.assertTrue(expected.tags().equals(actual.tags())); + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyVaultClientIntegrationTestBase.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyVaultClientIntegrationTestBase.java new file mode 100644 index 0000000000000..8b0a40e74dd69 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/KeyVaultClientIntegrationTestBase.java @@ -0,0 +1,371 @@ +package com.microsoft.azure.keyvault.test; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.rules.TestName; + +import com.microsoft.aad.adal4j.AuthenticationContext; +import com.microsoft.aad.adal4j.AuthenticationResult; +import com.microsoft.aad.adal4j.ClientCredential; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.keyvault.KeyVaultClient; +import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.DeletedCertificateBundle; +import com.microsoft.azure.keyvault.models.DeletedKeyBundle; +import com.microsoft.azure.keyvault.models.DeletedSecretBundle; +import com.microsoft.azure.management.resources.core.InterceptorManager; +import com.microsoft.azure.management.resources.core.TestBase; +import com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor; +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.LogLevel; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.interceptors.LoggingInterceptor; + +public class KeyVaultClientIntegrationTestBase { + + private static TestBase.TestMode testMode = null; + private PrintStream out; + + protected enum RunCondition { + MOCK_ONLY, LIVE_ONLY, BOTH + } + + protected static KeyVaultClient keyVaultClient; + protected static KeyVaultClient alternativeKeyVaultClient; + + protected final static String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; + protected final static String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; + private static final String PLAYBACK_URI_BASE = "http://localhost:"; + protected static String playbackUri = null; + protected static String alternativePlaybackUri = null; + + private final RunCondition runCondition; + + protected KeyVaultClientIntegrationTestBase() { + this(RunCondition.BOTH); + } + + protected KeyVaultClientIntegrationTestBase(RunCondition runCondition) { + this.runCondition = runCondition; + } + + /** + * Primary vault URI, used for keys and secrets tests. + */ + public static String getVaultUri() { + return getLiveVaultUri1(); + } + + /** + * Secondary vault URI, used to verify ability to transparently authenticate + * against a different resource. + */ + public static String getSecondaryVaultUri() { + return getLiveVaultUri2(); + } + + private static String getLiveVaultUri1() { + return getenvOrDefault("KEYVAULT_VAULTURI", "https://javasdktestvault.vault.azure.net"); + } + + private static String getLiveVaultUri2() { + return getenvOrDefault("KEYVAULT_VAULTURI_ALT", "https://javasdktestvault2.vault.azure.net"); + } + + private static String getenvOrDefault(String varName, String defValue) { + String value = System.getenv(varName); + return value != null ? value : defValue; + } + + protected static void compareAttributes(Attributes expectedAttributes, Attributes actualAttribute) { + if (expectedAttributes != null) { + Assert.assertEquals(expectedAttributes.enabled(), actualAttribute.enabled()); + Assert.assertEquals(expectedAttributes.expires(), actualAttribute.expires()); + Assert.assertEquals(expectedAttributes.notBefore(), actualAttribute.notBefore()); + } + } + + private static AuthenticationResult getAccessToken(String authorization, String resource) throws Exception { + + String clientId = System.getenv("ARM_CLIENTID"); + + if (clientId == null) { + throw new Exception("Please provide ARM_CLIENTID in the environment settings."); + } + + String clientKey = System.getenv("ARM_CLIENTKEY"); + String username = System.getenv("arm.username"); + String password = System.getenv("arm.password"); + + AuthenticationResult result = null; + ExecutorService service = null; + try { + service = Executors.newFixedThreadPool(1); + AuthenticationContext context = new AuthenticationContext(authorization, false, service); + + Future future = null; + + if (clientKey != null && password == null) { + ClientCredential credentials = new ClientCredential(clientId, clientKey); + future = context.acquireToken(resource, credentials, null); + } + + if (password != null && clientKey == null) { + future = context.acquireToken(resource, clientId, username, password, null); + } + + if (future == null) { + throw new Exception( + "Missing or ambiguous credentials - please inform exactly one of arm.clientkey or arm.password in the environment settings."); + } + + result = future.get(); + } finally { + service.shutdown(); + } + + if (result == null) { + throw new RuntimeException("authentication result was null"); + } + return result; + } + + private static ServiceClientCredentials createTestCredentials() throws Exception { + return new KeyVaultCredentials() { + + @Override + public String doAuthenticate(String authorization, String resource, String scope) { + try { + + if (isRecordMode()) { + AuthenticationResult authResult = getAccessToken(authorization, resource); + return authResult.getAccessToken(); + } else { + return ""; + } + + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + }; + } + + public static String generateRandomResourceName(String prefix, int maxLen) { + return SdkContext.randomResourceName(prefix, maxLen); + } + + private String shouldCancelTest(boolean isPlaybackMode) { + // Determine whether to run the test based on the condition the test has been + // configured with + switch (this.runCondition) { + case MOCK_ONLY: + return (!isPlaybackMode) ? "Test configured to run only as mocked, not live." : null; + case LIVE_ONLY: + return (isPlaybackMode) ? "Test configured to run only as live, not mocked." : null; + default: + return null; + } + } + + private static void initTestMode() throws IOException { + String azureTestMode = System.getenv("AZURE_TEST_MODE"); + if (azureTestMode != null) { + if (azureTestMode.equalsIgnoreCase("Record")) { + testMode = TestBase.TestMode.RECORD; + } else if (azureTestMode.equalsIgnoreCase("Playback")) { + testMode = TestBase.TestMode.PLAYBACK; + } else { + throw new IOException("Unknown AZURE_TEST_MODE: " + azureTestMode); + } + } else { + // System.out.print("Environment variable 'AZURE_TEST_MODE' has not been set + // yet. Using 'Playback' mode."); + testMode = TestBase.TestMode.PLAYBACK; + } + } + + private static void initPlaybackUri() throws IOException { + if (isPlaybackMode()) { + Properties mavenProps = new Properties(); + InputStream in = TestBase.class.getResourceAsStream("/maven.properties"); + if (in == null) { + throw new IOException( + "The file \"maven.properties\" has not been generated yet. Please execute \"mvn compile\" to generate the file."); + } + mavenProps.load(in); + String port = mavenProps.getProperty("playbackServerPort"); + + // 11080 and 11081 needs to be in sync with values in jetty.xml file + playbackUri = PLAYBACK_URI_BASE + "11080"; + alternativePlaybackUri = PLAYBACK_URI_BASE + "11081"; + } else { + playbackUri = PLAYBACK_URI_BASE + "1234"; + } + } + + public static boolean isPlaybackMode() { + if (testMode == null) + try { + initTestMode(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("Can't init test mode."); + } + return testMode == TestBase.TestMode.PLAYBACK; + } + + public static boolean isRecordMode() { + return !isPlaybackMode(); + } + + private static void printThreadInfo(String what) { + long id = Thread.currentThread().getId(); + String name = Thread.currentThread().getName(); + System.out.println(String.format("\n***\n*** [%s:%s] - %s\n***\n", name, id, what)); + } + + @Rule + public TestName testName = new TestName(); + + protected InterceptorManager interceptorManager = null; + + @BeforeClass + public static void beforeClass() throws IOException { + printThreadInfo("beforeclass"); + initTestMode(); + initPlaybackUri(); + } + + + + @Before + public void beforeMethod() throws Exception { + printThreadInfo(String.format("%s: %s", "beforeTest", testName.getMethodName())); + final String skipMessage = shouldCancelTest(isPlaybackMode()); + Assume.assumeTrue(skipMessage, skipMessage == null); + + interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); + + RestClient restClient; + String defaultSubscription; + ServiceClientCredentials credentials = createTestCredentials(); + + if (isRecordMode()) { + + restClient = buildRestClient(new RestClient.Builder().withBaseUrl("https://{vaultBaseUrl}") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE) + .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) + .withNetworkInterceptor(interceptorManager.initInterceptor()) + .withInterceptor(new ResourceManagerThrottlingInterceptor())); + + interceptorManager.addTextReplacementRule("https://management.azure.com/", playbackUri + "/"); + interceptorManager.addTextReplacementRule("https://graph.windows.net/", playbackUri + "/"); + + keyVaultClient = new KeyVaultClient(restClient); + alternativeKeyVaultClient = keyVaultClient; + } else { // is Playback Mode + defaultSubscription = ZERO_SUBSCRIPTION; + + out = System.out; + System.setOut(new PrintStream(new OutputStream() { + public void write(int b) { + // DO NOTHING + } + })); + + keyVaultClient = new KeyVaultClient(buildPlaybackRestClient(credentials, playbackUri + "/")); + alternativeKeyVaultClient = new KeyVaultClient(buildPlaybackRestClient(credentials, alternativePlaybackUri + "/")); + } + + } + + protected static DeletedCertificateBundle pollOnCertificateDeletion(String vaultBaseUrl, String certificateName) + throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 21) { + DeletedCertificateBundle certificateBundle = keyVaultClient.getDeletedCertificate(vaultBaseUrl, + certificateName); + if (certificateBundle == null) { + SdkContext.sleep(10000); + pendingPollCount += 1; + continue; + } else { + return certificateBundle; + } + } + throw new Exception("Deleting certificate delayed"); + } + + protected static DeletedKeyBundle pollOnKeyDeletion(String vaultBaseUrl, String certificateName) throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 21) { + DeletedKeyBundle deletedKeyBundle = keyVaultClient.getDeletedKey(vaultBaseUrl, certificateName); + if (deletedKeyBundle == null) { + SdkContext.sleep(10000); + pendingPollCount += 1; + continue; + } else { + return deletedKeyBundle; + } + } + throw new Exception("Deleting key delayed"); + } + + protected static DeletedSecretBundle pollOnSecretDeletion(String vaultBaseUrl, String secretName) throws Exception { + int pendingPollCount = 0; + while (pendingPollCount < 50) { + DeletedSecretBundle deletedSecretBundle = keyVaultClient.getDeletedSecret(vaultBaseUrl, secretName); + if (deletedSecretBundle == null) { + SdkContext.sleep(10000); + pendingPollCount += 1; + continue; + } else { + return deletedSecretBundle; + } + } + throw new Exception("Deleting secret delayed"); + } + + @After + public void afterMethod() throws IOException { + + if (shouldCancelTest(isPlaybackMode()) != null) { + return; + } + + interceptorManager.finalizeInterceptor(); + } + + protected RestClient buildRestClient(RestClient.Builder builder) { + return builder.build(); + } + + protected RestClient buildPlaybackRestClient(ServiceClientCredentials credentials, String baseUrl) throws IOException { + return buildRestClient(new RestClient.Builder().withBaseUrl(baseUrl) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) + .withLogLevel(LogLevel.NONE) + .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) + .withNetworkInterceptor(interceptorManager.initInterceptor()) + .withInterceptor(new ResourceManagerThrottlingInterceptor())); + } +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/SecretOperationsTest.java b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/SecretOperationsTest.java new file mode 100644 index 0000000000000..cb9677dbe186e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/SecretOperationsTest.java @@ -0,0 +1,327 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.keyvault.test; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.keyvault.SecretIdentifier; +import com.microsoft.azure.keyvault.models.Attributes; +import com.microsoft.azure.keyvault.models.DeletedSecretBundle; +import com.microsoft.azure.keyvault.models.DeletionRecoveryLevel; +import com.microsoft.azure.keyvault.models.KeyVaultError; +import com.microsoft.azure.keyvault.models.KeyVaultErrorException; +import com.microsoft.azure.keyvault.models.SecretAttributes; +import com.microsoft.azure.keyvault.models.SecretBundle; +import com.microsoft.azure.keyvault.models.SecretItem; +import com.microsoft.azure.keyvault.requests.SetSecretRequest; +import com.microsoft.azure.keyvault.requests.UpdateSecretRequest; + +public class SecretOperationsTest extends KeyVaultClientIntegrationTestBase { + + private static final String SECRET_NAME = "javaSecret"; + private static final String CRUD_SECRET_NAME = "crudSecret"; + private static final String SECRET_VALUE = "Chocolate is hidden in the toothpaste cabinet"; + private static final int MAX_SECRETS = 4; + private static final int PAGELIST_MAX_SECRETS = 3; + + @Test + public void transparentAuthenticationForSecretOperationsTest() throws Exception { + // Create a secret on a vault. + { + Attributes attributes = new SecretAttributes().withEnabled(true) + .withExpires(new DateTime().withYear(2050).withMonthOfYear(1)) + .withNotBefore(new DateTime().withYear(2000).withMonthOfYear(1)); + Map tags = new HashMap(); + tags.put("foo", "baz"); + String contentType = "contentType"; + + SecretBundle secret = keyVaultClient + .setSecret(new SetSecretRequest.Builder(getVaultUri(), SECRET_NAME, SECRET_VALUE) + .withAttributes(attributes).withContentType(contentType).withTags(tags).build()); + validateSecret(secret, getVaultUri(), SECRET_NAME, SECRET_VALUE, contentType, attributes); + } + + // Create a secret on a different vault. Secret Vault Data Plane returns + // 401, which must be transparently handled by KeyVaultCredentials. + { + SecretBundle secret = alternativeKeyVaultClient + .setSecret(new SetSecretRequest.Builder(getSecondaryVaultUri(), SECRET_NAME, SECRET_VALUE).build()); + validateSecret(secret, getSecondaryVaultUri(), SECRET_NAME, SECRET_VALUE, null, null); + } + + } + + @Test + public void deserializeWithExtraFieldTestForSecretOperationsTest() throws Exception { + String content = "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Secret not found: javaSecret\",\"noneexisting\":true}}"; + KeyVaultError error = keyVaultClient.serializerAdapter().deserialize(content, KeyVaultError.class); + Assert.assertEquals(error.error().message(), "Secret not found: javaSecret"); + Assert.assertEquals(error.error().code(), "SecretNotFound"); + } + + @Test + // verifies the inner error on disabled secret + public void disabledSecretGetForSecretOperationsTest() throws Exception { + + String secretName = "disabledsecret"; + SecretBundle secret = keyVaultClient + .setSecret(new SetSecretRequest.Builder(getVaultUri(), secretName, SECRET_VALUE) + .withAttributes(new SecretAttributes().withEnabled(false)).build()); + try { + keyVaultClient.getSecret(secret.id()); + + Assert.fail("Should throw exception for disabled secret."); + } catch (KeyVaultErrorException e) { + Assert.assertEquals(e.body().error().code(), "Forbidden"); + Assert.assertNotNull(e.body().error().message()); + Assert.assertNotNull(e.body().error().innerError()); + Assert.assertEquals(e.body().error().innerError().code(), "SecretDisabled"); + } catch (Exception e) { + Assert.fail("Should throw KeyVaultErrorException for disabled secret."); + } + + keyVaultClient.deleteSecret(getVaultUri(), secretName); + // Polling on secret is disabled. + SdkContext.sleep(40000); + keyVaultClient.purgeDeletedSecret(getVaultUri(), secretName); + } + + @Test + public void crudOperationsForSecretOperationsTest() throws Exception { + SecretBundle secret; + { + // Create secret + secret = keyVaultClient + .setSecret(new SetSecretRequest.Builder(getVaultUri(), CRUD_SECRET_NAME, SECRET_VALUE).build()); + validateSecret(secret, getVaultUri(), CRUD_SECRET_NAME, SECRET_VALUE, null, null); + + } + + // Secret identifier. + SecretIdentifier secretId = new SecretIdentifier(secret.id()); + + { + // Get secret using kid WO version + SecretBundle readBundle = keyVaultClient.getSecret(secretId.baseIdentifier()); + compareSecrets(secret, readBundle); + } + + { + // Get secret using full kid as defined in the bundle + SecretBundle readBundle = keyVaultClient.getSecret(secret.id()); + compareSecrets(secret, readBundle); + } + + { + // Get secret using vault and secret name. + SecretBundle readBundle = keyVaultClient.getSecret(getVaultUri(), CRUD_SECRET_NAME); + compareSecrets(secret, readBundle); + } + + { + // Get secret using vault, secret name and version. + SecretBundle readBundle = keyVaultClient.getSecret(getVaultUri(), CRUD_SECRET_NAME, secretId.version()); + compareSecrets(secret, readBundle); + } + + { + secret.attributes().withExpires(new DateTime().withMonthOfYear(2).withDayOfMonth(1).withYear(2050)); + Map tags = new HashMap(); + tags.put("foo", "baz"); + secret.withTags(tags).withContentType("application/html").withValue(null); // The value doesn't get updated + + // Update secret using the kid as defined in the bundle + SecretBundle updatedSecret = keyVaultClient + .updateSecret(new UpdateSecretRequest.Builder(secret.id()).withContentType(secret.contentType()) + .withAttributes(secret.attributes()).withTags(secret.tags()).build()); + compareSecrets(secret, updatedSecret); + + // Subsequent operations must use the updated bundle for comparison. + secret = updatedSecret; + } + + { + // Update secret using vault and secret name. + + secret.attributes().withNotBefore(new DateTime().withMonthOfYear(2).withDayOfMonth(1).withYear(2000)); + Map tags = new HashMap(); + tags.put("rex", "woof"); + secret.withTags(tags).withContentType("application/html"); + + // Perform the operation. + SecretBundle updatedSecret = keyVaultClient + .updateSecret(new UpdateSecretRequest.Builder(getVaultUri(), CRUD_SECRET_NAME) + .withVersion(secret.secretIdentifier().version()).withContentType(secret.contentType()) + .withAttributes(secret.attributes()).withTags(secret.tags()).build()); + + compareSecrets(secret, updatedSecret); + validateSecret(updatedSecret, secret.secretIdentifier().vault(), secret.secretIdentifier().name(), null, + secret.contentType(), secret.attributes()); + } + + { + // Delete secret + SecretBundle deleteBundle = keyVaultClient.deleteSecret(getVaultUri(), CRUD_SECRET_NAME); + pollOnSecretDeletion(getVaultUri(), CRUD_SECRET_NAME); + compareSecrets(secret, deleteBundle); + } + + { + // Expects a secret not found + try { + keyVaultClient.getSecret(secretId.baseIdentifier()); + } catch (KeyVaultErrorException e) { + Assert.assertNotNull(e.body().error().code()); + Assert.assertEquals("SecretNotFound", e.body().error().code()); + } + } + + { + + // Purge secret + keyVaultClient.purgeDeletedSecret(getVaultUri(), CRUD_SECRET_NAME); + + } + } + + @Test + public void listSecretsForSecretOperationsTest() throws Exception { + HashSet secrets = new HashSet(); + for (int i = 0; i < MAX_SECRETS; ++i) { + int failureCount = 0; + for (;;) { + try { + SecretBundle secret = keyVaultClient.setSecret( + new SetSecretRequest.Builder(getVaultUri(), SECRET_NAME + i, SECRET_VALUE).build()); + SecretIdentifier id = new SecretIdentifier(secret.id()); + secrets.add(id.baseIdentifier()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Waiting to avoid throttling"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listSecrets(getVaultUri(), PAGELIST_MAX_SECRETS); + Assert.assertTrue(PAGELIST_MAX_SECRETS >= listResult.currentPage().items().size()); + + HashSet toDelete = new HashSet(); + + for (SecretItem item : listResult) { + if (item != null) { + SecretIdentifier id = new SecretIdentifier(item.id()); + toDelete.add(id.name()); + secrets.remove(item.id()); + } + } + + Assert.assertEquals(0, secrets.size()); + + for (String secretName : toDelete) { + try { + System.out.println("Deleting next secret:" + secretName); + + keyVaultClient.deleteSecret(getVaultUri(), secretName); + DeletedSecretBundle deletedSecretBundle = pollOnSecretDeletion(getVaultUri(), secretName); + Assert.assertNotNull(deletedSecretBundle); + keyVaultClient.purgeDeletedSecret(getVaultUri(), secretName); + SdkContext.sleep(20000); + } catch (KeyVaultErrorException e) { + // Ignore forbidden exception for certificate secrets that cannot be deleted + if (!e.body().error().code().equals("Forbidden")) + throw e; + } + } + } + + @Test + public void listSecretVersionsForSecretOperationsTest() throws Exception { + final String listVersionSecretName = "javaSecretVersions"; + HashSet secrets = new HashSet(); + for (int i = 0; i < MAX_SECRETS; ++i) { + int failureCount = 0; + for (;;) { + try { + SecretBundle secret = keyVaultClient + .setSecret(new SetSecretRequest.Builder(getVaultUri(), listVersionSecretName, SECRET_VALUE).build()); + secrets.add(secret.id()); + break; + } catch (KeyVaultErrorException e) { + ++failureCount; + if (e.body().error().code().equals("Throttled")) { + System.out.println("Throttled!"); + SdkContext.sleep(failureCount * 1500); + continue; + } + throw e; + } + } + } + + PagedList listResult = keyVaultClient.listSecretVersions(getVaultUri(), listVersionSecretName, + PAGELIST_MAX_SECRETS); + Assert.assertTrue(PAGELIST_MAX_SECRETS >= listResult.currentPage().items().size()); + + listResult = keyVaultClient.listSecretVersions(getVaultUri(), listVersionSecretName); + for (SecretItem item : listResult) { + if (item != null) { + secrets.remove(item.id()); + } + } + + Assert.assertEquals(0, secrets.size()); + + keyVaultClient.deleteSecret(getVaultUri(), listVersionSecretName); + pollOnSecretDeletion(getVaultUri(), listVersionSecretName); + keyVaultClient.purgeDeletedSecret(getVaultUri(), listVersionSecretName); + + } + + private static void validateSecret(SecretBundle secret, String vault, String name, String value, String contentType, + Attributes attributes) throws Exception { + String prefix = vault + "/secrets/" + name + "/"; + String id = secret.id(); + Assert.assertTrue( // + String.format("\"id\" should start with \"%s\", but instead the value is \"%s\".", prefix, id), // + id.startsWith(prefix)); + Assert.assertEquals(value, secret.value()); + if (contentType != null) { + Assert.assertEquals(contentType, secret.contentType()); + } + Assert.assertNotNull("\"created\" should not be null.", secret.attributes().created()); + Assert.assertNotNull("\"updated\" should not be null.", secret.attributes().updated()); + DeletionRecoveryLevel deletionRecoveryLevel = secret.attributes().recoveryLevel(); + Assert.assertNotNull(deletionRecoveryLevel); + + Assert.assertTrue(secret.managed() == null || secret.managed() == false); + } + + private void compareSecrets(SecretBundle expected, SecretBundle actual) { + Assert.assertEquals(expected.contentType(), actual.contentType()); + Assert.assertEquals(expected.id(), actual.id()); + Assert.assertEquals(expected.value(), actual.value()); + Assert.assertEquals(expected.attributes().enabled(), actual.attributes().enabled()); + if (expected.tags() != null || actual.tags() != null) + Assert.assertTrue(expected.tags().equals(actual.tags())); + + } + +} diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/crudNames.json b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/crudNames.json new file mode 100644 index 0000000000000..2f3ee5367e8ca --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/crudNames.json @@ -0,0 +1 @@ +{"roleDefUUID":"4a9d964f-b76c-4e33-9d89-bf6f3a3d220b","storageAccountName":"sa22c29322de","vaultName":"vault815130495"} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/sasNames.json b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/sasNames.json new file mode 100644 index 0000000000000..619b40963e2d1 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/sasNames.json @@ -0,0 +1 @@ +{"roleDefUUID":"8a6fc5ba-7601-4071-954a-adbce7cae7ae","storageAccountName":"sabc0663752a","vaultName":"vaultff052787b"} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/src/test/java/resources/MockUserTokenCredentials.java b/keyvault/data-plane/azure-keyvault/src/test/java/resources/MockUserTokenCredentials.java new file mode 100644 index 0000000000000..c3df3c8967772 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/src/test/java/resources/MockUserTokenCredentials.java @@ -0,0 +1,58 @@ +package resources; + +import java.io.IOException; +import java.util.Date; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.credentials.UserTokenCredentials; +import com.microsoft.aad.adal4j.AuthenticationResult; + + + +public class MockUserTokenCredentials extends UserTokenCredentials { + + private AuthenticationResult authenticationResult; + + + public MockUserTokenCredentials(String clientId, String domain, String username, String password, + AzureEnvironment environment) { + super(clientId, domain, username, password, environment); + } + + public MockUserTokenCredentials() { + this("","","","", AzureEnvironment.AZURE); + } + @Override + public String getToken(String resource) throws IOException { + if (authenticationResult != null + && authenticationResult.getExpiresOnDate().before(new Date())) { + acquireAccessTokenFromRefreshToken(); + } else { + acquireAccessToken(); + } + return authenticationResult.getAccessToken(); + } + + private void acquireAccessToken() throws IOException { + this.authenticationResult = new AuthenticationResult( + null, + "token1", + "refresh", + 1, + null, + null, + false); + } + + private void acquireAccessTokenFromRefreshToken() throws IOException { + this.authenticationResult = new AuthenticationResult( + null, + "token2", + "refresh", + 1, + null, + null, + false); + } +} + diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/backupRestoreForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/backupRestoreForKeyOperationsTest.json new file mode 100644 index 0000000000000..2c549c9a81b54 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/backupRestoreForKeyOperationsTest.json @@ -0,0 +1,218 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:34 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "57e60b39-02e2-46c7-aadf-f3a3459300ef", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:35 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7feec002-d95b-43ba-ba07-d7e44fbd4ba2", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/455c7272682d4de689881f179e63e20b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"qku3i9yaW1__0KD9WU8RYfR8BNea95TPuoEYwMQwp6iiPjS7UeVJIkbRskI_9A9S54xK-t8eZbCNGnTgEF4fFWu6s1CSxnAx3iOvxwpoB5nxgMWuMIHsjUfDbGGqHLrf7wH_nFpXyt_W5PqR095ujz4967fOoVwY04SXa3tTxGAxRve4sABMi5sZ2lT1sSaf-ItwEjs9ntCL5eV4PYAF4xzqUgWxZc0pjUegCqnfNDnmTGM88t7TH72EqjCoB2tkcSoETer107aGteEmzGOEERFVFVvzyrSRsoiBmvCjsYkyv4gnicnE1-tZeW6-7GU5cxMm_f-RMGJwdsgH6yZVxQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955815,\"updated\":1529955815,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/backup?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:36 GMT", + "content-length" : "22526", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5cbbda8e-3ad4-4927-b94a-7ff4f250137e", + "Body" : "{\"value\":\"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLm9Vb2R2SzNWQktHZkJNVzVmWWNfWHdLZktseEYyUVM0UjdjSVhpVlQxWnV2MkVaNWllNEV1b0FxdFM5Uk1HOGZnX2hHQ183dktuQkM0S1R0X0l5c3NSWS1MX2szemZ4dFkyTW05Mmx0cjI5NHJta0xDZ2lRU0hreDJVSDdZWF90S29hTlB1VmdoUjNNUG5halotSmhGeXpIZ3ZQTlNLSmFuWUhqdTViM29ld1hha1B2NDhQeEFFUGxnTTBURVhMS3Mwc3hkZVBVX20xZ3Z6cW80WlZ3X3VTNVdqSi1UTGVjUEhQYmVJS2oxaTg5dkZCWDlFMGd1VEVSZHlreWxHTHFFcjJpVjlDTFNZdC1VUGUyTnFnMVFHWDZmNmdPeGZFR0h0TUFqOHpxbjUtNTVWWXBmUUxZV2hGWHJ1WWw4VXY0R1pKUGlaNGJFeGhROEo0eWp1Y2xoQS5NRlhVMWJOeFVIaXA0QmIwelV5M3dBLkdual82aTEyemROVTJmeXptdFhJRm5SSm9ZbHpnNDRWcmtPSUotYmhsakRSV2QyUmRSRlRLeVNSZmc5NHQ1THRONlpHMG1sdW5ZNUZBVDBwMm9uTVMwVHZmWVdldHFOTFZqa2wzZ2s1a3VLc3hXN0lWN0lzcGQxZ2cwNGpIU2FpNXFmUEVpak5sMzZMODlROWhHeXh5QjJuLVNxWDNKWUFMRVdjWGFhYlBwSnlmWEI2SC1oaUVpZG1LanZQMXQ0TFNUbm94am5vaUNzNC1mclhGTmdYZlE4MTJGeVAzUHMzdGdCNzhoT1VoSVdrdFBsMDM4T2o5dWRaR1dJZUNwbDVma0V3TWdFdzhQZ2NUb1Y5XzVjUHlvcmZOUWE0dHZROUNwSnB3Rk0zal9MbWxMWkUtV3AtSEp5LWFDM2JxMHVnYzFMV19BcHdLWklWanJpRG5xdExBMDF4aEJRN0k1ZEEwb3NvQXJHT3RuaTZCUDdWUlZ0Zzh5U2NCMFR5SGxwcVpLWE8zdzRCcTJLbVFxZHptZUN2ZkVyR0pUMVRIa1N0T1NMcWhnU2RFMlVsZDVCa2FIaXh1WGdDcjd0VzZOTzJkbHJrOERBcjVRajJjMUE5M2J6bWplVXhHRW11bUZ2dk5mT3oyTXQzZHRnamFrXzNyRWd5T0dRRGZsekE2RWo2UC12TWwzaVo5WGQ4NVU3TDRjR2lmZEllN3lZMDhmRzlzc0NvcDZHZFN4dXN4Y1pIQVdGT1EwRHZzSm9aNTFON2p1emhJMlNJbGVRcWR3dC1uSEoyUlNydC1fZEpJbXY2S0ZWdVJWMHlqX3dFVWNqUzFQelh4WldJTjRvUnFhQm5VaGVkNF85TjBLR3NNNVRPRGx3d1Z6MXhIMkgxYThUb3FRb1BuUzNkazdRUmEzZi10RFVWQnZiWnlkTWZlNkhzOGhuSHJoclA1eURpQ0JUQzFFMXFTOVB2ZlJsX2FnejUtS2tvaDFqengzdTBuODJJZWQxU0h0cy0zV0IxVDlLWmdKUTlHUzhEM0o3TWxodEU3T2Jodm1TalNzOGFlWjJCMkhYYzJLV0QtRGYzWlUtUF9PdmVudnRFQ0lxalpxa3V4WkM3WDdERG9VaHJYT2lRdVRaZzgxRnhMeklxTGJQWDNMQkJOU25tNTVhaFR0Y1FQRk1oQUFvblhxUVlYNnRLd2szdS1PeHB2aDZLbXVyODBHeHdtUVlITVV1ZG5vYjFMWDF1N0d1WUVoSWhRWE5CVjVuU3AyNjh1eDBLNE90Z2lJbGNXV1dVcFFXQXJCeHIxVTVJU2VSUVFmRm9YZ3ZoN3Byc2VSeHZYZGhoOWF4Y3FFaVN4OFpDTk8zTjZ6eXRXZXpTNlJTQTlianFncWhJSFVSeHdLMkJhQzEtUFl4eDVQSGFWaFNLb3UyS3JFR0t4NElZRFEwOVVIR3BiSG9jV1dfdkZqSUxYZlJPYVYtWVVnZlJzVGI0dTE5T1p4bklrR2pUaHZPWXgzVVZnNFBETjd2dzZtb1cwYkVqRmNoRHZZWklxS1R1clQzNHRNSld4b0RFLU9vZnM5RkxYVHR1LUo4cWF3Y0lFU1BXRWliS2RRaGpYMF95eTFiaFB6bmVEcVhUUngwNG16U05yMFlEZHlvWHk2aEdWb20xR0VpcG51NTBvcXBaNXc0Rm5OZm1nMFNBdDY5Rk4yVnFjZXlpX3BLMXFwWFQtWThqY0kwVGhacjE4NDNHSXZYaUp4cUg4YmpYR1ZjUlJRQ0xjTHJNM3doUENXdkpITTh1aVdGMVpVa3gzN3F6ZUdSUzBZVFRvYmlsM3B6b01GRnRLT3BtWjYwZG90OFRQa1VtaGM5WFJWNzVJOGlpQ2FZMkwyYzdFMWREOXhPNXc4UG0wSTdmS1E0cWlGT2tyZ3VwSWZPT3p3RENqc0JHdEtWUm0ySjkwdWFLMkZxVnM1U2g2dlhmWFB4T1R1Tms0NDhQeWZ3OVJLaUxtU1h5VXZSVVZSLWVyOVVqMldxRzFyLXlMMjVmWGZiSFFwWGI1bGZhQ0U0X3YtX0lJNHV1bVBLMmVWT0xCNjJ3NGNlRDUyRHM3RGU0aEQtU181UTJmd21LR2xHQ3U2R0wzTWVQXy1GOUZWNVk5WE8zd1MwQmZtd1VNaHpHcVl6cUZQUER3QVk2NXF5SzYwS3VKOHZqbWhEMzlqTTAxR1pNRFdSYm80aGlXS1JRU2k0dFAwMERwVWItYjNHRWlmRFQ3N3hfN3czTDJhWXJ5cWtsY2NCSFltNTFadEdkeDgzd3psRmxDSFZ2S1hiSUJNSzQ2aWhZbTJfQVJUbUE1WHNjSUliRHdqcDRLdGlmdWd5cVRtR1JReFJkazlYTXNxN2V3aGVFbE1TQ1FtVVFMeElFeFpEVFlGUElkX0RTTDhVZks1R0czc3NQY2RWc2dZVkFTbDI1SHEzcXhmbU1xS3BLc1ZrYm1TNm85aWxTT2hhUUZSWEFsM09TeTdOOUdWQ0U0N29GYzFsX2psSk1TX1RmS2lvdVJGQjgycDRULVRlNjN3UEJiYVhoY29pY281bzdZSW41elBuQTA4U2tKQlN6bnJkQndqb2FZQkstTkdreHRsWVVVbGdSUFZaRkVtVVozTFhzanFJMmJzMi1OUHZtV3lrcTJ5T1RnMlJ4cEVTZk43VXV5RTZiM29NRThVREV3WlZhLUlqa2tueF9Odno4RHhJSVVJZjFuUW5HbnE3bVFxN0p0NW1DQmw0U25aQXh6SmNkTzRjRDVNekdfaldrMUNuMDYycjVKZTJuTGhWUk5DVVhISUpDV3VjdlpZa1dMaUZmeVNQOG1YN2Z2cjBXLThFWEFXTGVYT3d1anhkaHR5aTVKblBlTGpSc3VGbmtJT3psVjBsczNKaTNaX3VxeFBMSUJ2TkJZM3JMQ2I5SG5oWWtqcXVQbjJyVWtpdk9vTTE2UVc2N0R3azltTXFjcjFrT0dTUXZuQmxKNGc5bWtKR1M1RW1Gd0JLRnVESG1yNDF6bF9ncHE5NWJsTjh3bWZ3UEZfRzRvODFBWXZRcmY3YmlzbGJKdll1R21yNEVvdzkwQy1xTU84VVRCdEtRQVYyMkNNMHpXcUdCYm9fa1B4eEl3aDFWekNlNllFb0FWdjBQNFpsbVpWTFdNYi0wcnR3Y1psVzVJV0o1VGVmMV96Mk9lTlV3dFlKSGNEem5YbERQbGpEdTAzU09pa1dSVXhnY3NHMkhCLUtlOXhCWUhtcVlBOENaalFWeC1mUVZsV0txRWU4R2FXbzdmejZQSmRZWFdEOFBmeHo2VEhRbi1Ma0VzdEpLX0h4clJUM1Rqb0NZQkxvRkRvTjl4LU9pWm1SSWh5Q3NRVTN2UnM4ek1IT1NaYUkyZnlyQ3ZNSnlWSjVyNmpfTmpsR1VpQVV6YnZISEFjN2M1RFhNTzlyaUc2cW12YTdPUm9KOFFfc1N3eVVTbkg4VGRCQnJiaFNKWWd3WGRQWUlSRVBka0MxQzQtVXo5dzR1c0FLbXpGc2dLSDBGTUtHeXhlUnJxWmoxdFJiVFlQS0hNNzVTWlB1eG9LRlYtSkZ5TTVDTGE4OWNvTmJXUVZTaHFhbTFEcWNISS1aYjhOT3pPYkw2V0Q1NG9KYlhBTXFXMk1UOVNDMHl5aHM4aXZINi16VURxRmhmY2JYTjRtUlhIdndLQllkREZ0cTg5MkdiOUpCbWh4M2N4U0xRN3RtNlVFcERRdjJzci00ODY2WkxYb2phbmpWeVJfOXczYVY4OS1aTlpDcHdyMm5wVkdlWVVWbmthVFI3c1ZwQ0dybGdhdHplU3p0dEJqamJWLTJ1OURQbDFKVjJwMV83OTlSQk5saVpnT1VzT2F2NklKcGxXZjM0ZFRwZzhkNlVhWnFILXVZbXR4X1R3UXJCN0ktUG5fX3JkN0NBd0U1QzhzY0hyaWdNM2NlUzhGRzFCSWxRVUVoLThJSEpQWWJ1WWJMMG1xdjFSSjlpaF80ZEZIVFhwaW1CaldtUlFtNEZCUlNfM2RrWWV6alZmOV8tX1ZEcDM4QzBWSmV3Z3E5NTZhQ2JkNHV6UmVla0xwY1J6cE1VRE95dXB1R0ZpdDlfaGNuUVU5ZjNiOEF0c2xEcU1UNlE5eFh5Vkc5c1NURkh0YnNRQVFsSTFEcDl6cXZlZnJocEQtc2FDalpFcTdlRDROY0kyakFtSFlSTWJTcjlULU9LSzVjWnU1eWViUFhwUWtVbnVfM0VZdVY0YVg4TEZIdkVPZDZoRjdGbU9DNzFVWUstWXpyZXRLQm1XZ2FLVmladWpUZmNYZ29qbGM1S3l6eTNlekZZcWtLa1NjWE5FVkR1cnUxb0J2TnBjSTNGd0M3dGRjQmJidnhxQS1FV3pabmpWd1FkazBNY0FVQjNYNk9ITFhaTHVRVU1ZdzZxZFZrNjRPRVk5NTd6YWdNS2FFc3o5VXg3SnRwdkU5RmdwZTcwa0NtT294NEs4aVphTzB6eXUtRElyS2VCbkQ1ZzBaQ3ZTUzVSS1VYbnVldXB2X0RuSVJWTDd2MWZ3R2NZNDFWU1cxa0JsejN4RFBDd2s5WUx6ZTV2b1E2bkVGazhUR0R6Q0otQmdJdmF6QzF3M3VkM0w4MUZpdzZzemxVVnB0aWZSWEN4NUhnOEhsR1JvOEU5ZEtVM1RyUVBPV2k3WmtMYUlFcjQ4SlQwRktRbzJFX2poc2xXYlVkdWlTV0V4eTJhaWc3RF9vbGs1M0VsdjQwaTRDYkN3Nm5ndm5BUHBfZ3ZOenhzRDgtUWxKS1N2eGljRFdPT1g0Z25TcS1kWVFlUVdZVDVscGVOREhPbnliN0o2U1Mtck10X2NnTExHWWhBZFRrb21xcVZkSkhkcUNQcjRyTmV2YWRRWlNFbG14N2tZcDlnTkd4SkJGbjJsUkVVSVNPWkhjSHl0QUlrbEN6YTBvSC1vdnJBQmtEck1yMjNwcWpjUVUzWUtELWxjOXpIM0N2a2tEc194SG81TnJkQ1g3UkpadUp3X09ZSGQyenpoR3dRRnVjQVF5OTA4OXNsYkhFTUdneGpJWk8ySmlGSEFPOFJTQ1ZSTWtvUFlrYnpqQm5ScW9xM2p1YW9qM0E0WnZNdkhWaUc2d1RXMzV0RkVBMUMzd1lNalhwRzdVRm5WQW9Ib1RfZXAyUmhnMzN3ZjNXT3BKWWtHQ1FUQjF2ZHlZVk55ZWF0ZXJ4UmxMdUl4QURjdjJKQWJ0dDRteU44QVRFRFN5Njg1V2U2U0RsekZQamR0dlFtVkkwU0hSVjJBbXNpVFVURXF1WTdDWlludnI3UE9jVFFBUWN6TjNyeUltdTVFLU14V2VBWmNGTVRhQ3V1czNzdV9sNmk5R3FGa2R5eFF4TnBVcVh3OXVEbnp0NmxFLVZ0ZDZNa0NORUpyNGExRHNQYVUzRVhQMG5LeGh2el92U1lSVGhXN1ZCTjJycFcxRVo4R0ttbWoxRXhrN2dtOWdpZ18xQzhwdHNYVVY1cFVtZnNra0dCRkpid2pNai1GdG1ORkQ5Sml4emFGR0RPdFRUZXBvSXNVX1VZZXFlYnNfWUpDbXdfZHdxYV9ySkYxc1J5S25UV25HdVdLMGFpWDhIT3dObEhFRG1nbDBxVW9sUVhkakRfcW5iWkpMX0FOaHFoZS0zaDMwYlVGM0JBbTZKLUpCYXpDSHFrb19PQ0YtN2VHLURaUW9wQTVCMHpaWFo0N0I1MzA1OWdvSnlfdjk3T1lrMU8xRkJyR1JWdmQzRUxPczJJWlZZaktsVUNLbGZDSjZId2dWcmJNdUFNVDZXUzlkdGwwb2Z4THJ4QkxYdUY5eVdCeXBOd2dpZjlHOHIyM1NwWWF1OUNObGEyQnBSN1VCSFQzeVMzU2hQV1FkWC1DRWFqVzg2MElmUFM2bXB0NEpqNjdHWFlmVFE5eTF4LXUzVGg1UWxpMW51ZDRYTThhLUhTdmRzTEdJdjZKS0I4Nm16NGR6MEJ0OHl3djZTc3NxYU15UTU1anpXWVhPQnlIRFlmX3lZVXFVS3lRVlR3Mlp4cU1lcG1xUVdBWXd3NXhRcDFFZXhfekw3Uzl6SFE0YzQ2YkJBN2FSeTl0OWhjX3FDSU9kX3oxNGNzVUJnX3R0SUxxZ0h0VVQ1MU85bG5kM3FVR1ZZVDRpTTdsZWhNTzA2bWNUMmg0S1V3RWRKdHJlM1RsMWhDeU9uWGZXTTNwQVNKbHR5RkNwVV9uVmVMZ2RyNEhCY2NKcXZMV3NkQnVWQnJnQzUyZnZKRkQtbDBBa3VIcnQtMW02U00waXRSemE2cGRSaFdKYlVCSlEtaFpLamxWdnY2STBMTkZxcV9hOFpRS1YzOU9zNFpVWll4ZHRTS0VWd1N5dGplRkg5NlgtU3I4Sjk0RGJxUWc2Zi1PMzk0ZFdTM28zT1NTSU93MHh6OWpOaFNlaEEyalBWYWZha05GcGxLTzJUVVlSMHdRZTR3S0ppeTRvbndkal9qZWNwU2tIYlN2Q2MtX3dPVlJoeXhiRzlqc0FycnV1ZWJ2SUJpakM4Y3J5OHlOSDNGNVFHc1czTG5tS1lDVXJiTlYzbVZrSnJFU2pjaUJTYlVvc3RXUUxBUEpLeF9lMGJ4SWNsSWUxTUwweFRrZTk1NmplLTBBdWFpb2tnWDJ0UVN5Si1vSmpTSjF4Zk9OeTIwSi1lYjczQ3Z1eWFSdGVmOG82RFNub1JCZEVlbThBSHdKQjZQNC0wVy15TkE2cFE5LTg3Vm9ERlIxdkNXRXRBX2lwbXNBS3I4MnBJUm9XZnpRWEVOYzZTbnhtWlpZQVpSbjVXc2VBQ2JBckFwdUh2c0ZLbV9nX2xDWnpsbUhubjN2bkh3b0lJWlVZRjVyWnlwV1djaEItR0U1dklLTDIxdXN2dEpWTURQYzhCSkxJTWtvemJvS1VJeklVUTNqNzA1b0I0WVNPVW5Lb1J4bzNBNE9VUzVVczh5eEpnQUNhQ1pYbmN6SDF3OVB6Y0dBV0hTNmtfU2l0UmViOGZyaDRIaVU3aFRoTnNDWGlYOFNnNzg4TnpkSjhabFg3X1pGd2RFZm9UbGY2cU9abkFGd0IwUVJmRjhtVTM1SXZLRkdCbktoTU92V19melRHQUVSYjl0c1RkOEVPN00wandqc01SMDRzWW1DUnVBMk9teHBwVXJPa2hSZ2t0ekxPei1PMV9PVlJKSWs4c2hRWmpyekpxTmVyNHdqdkhvWUZGSGJWYmswaV9zZksyb29nX2lBY2lGejdGZlB5aUIxWmJvYU9leWRLQVlROHRZU3FEYzRUYmRmNDFCeEd1b0J0emxoZS1MVk5BZkdOcWxHZnhpcXNwU2dsQTByNWk3Wk9qZmxWQnhIYl8zVWFKbVYwaTJOUWotYVc0MkFRUTdyNmFpYzUxOVp6ak4wNUFHUXBVdkppbk1PM3ZEc2dxZ1o2ZWVmUzQ5elNEaXJsRmNHQ083Qzh1bG1sWkVfdnVxUWNlWHZ1X3V1WmQ4dklfU3IwamkwMGgwVzdvcURBVHBuaGk2YjBFejZkYnR0NjRlcTExV3BGQW1LeWJ2WXR0RlFseXUtQm5PQXN0S0xaaE5NdDF6NzlpbXpYYXBDN3FRaloySUk5Y1F3SENhazlrS1ZBOXdjbVlEWG5ZbFI2ZF9BbE03d3NuY3RFVkdjcmxtZkZwZkIyOVhMYlN6aVlwN3FueTg1cFBoX25KY2RsUHdnYUZYX1JYQXVDNjNfQUd2WENjdFFSX19FUkJoUmt3VEdkZ2g0NWZpM3RocTJrSXB0ZFliMHJodkJYZmo5UTZsVDBhd3dNcnNaQjJLZXhpR3h1eW1DVVN3RHJWSGhBa3J1Vk03OWtYTnkwNFhfTjVNSzE5SnA0cTBCNUVlR3E4MUFDaHNPdTdkdlRfNEFBbUFuVkJkSE1Hd2Q2V28xOHVWTXRCdkVhR0dFdTJrTlhtOXNkellnSm9CUDE3bXNJWGRQbVBiWFdzamI2bTI4b0g1RERiNGFlSzZPRDRxMG9HU2JTZllKMlVYcVlyQWxhb3FuenY1MnNaMHREWWFsRTR6ZHZfb2hCZUQ5Q3RMcjB3cEloUnMzWm84ekQzT2RLTHdMYkY5bGNYZTBSRmF2bElhMDJfZUNaYng4WEZYdXNzYWVxdFRWOXphaXJmdkUtWXB6d3hGWVVwQUI5TG9oUmkwSVV1Sks5M0FmcnhYVC1mbHlrZjhkSmxLTjRTQzNZdlRaN0tRblFVNUJKbE11aDdWb1lrUnRzSjd2MG9wcGJVNUNJWHhIVC12ZWFqbWh1VXZxcmJNejVOZkFnUy1hX1hQWnc4Q3V4NzVyd2pKQlIzMTNwMUJqOHZYMWkxT2t1amRBR08tQ2Z1ckNaV2dXUmpUMEw1NzlxaXJVVmR2UEpEN2RMNE9pR2dNV1JLQklIRlk1OXdNSi1oaU1WWFpJb2ZyZmZNVzA5UXFGOEVwTm9rRWs4TkNpZC1iTXVhRzdfeXlwMVh6bzIwbGRSOERoa01MYzl0dVJqSkV1QTNwV2pEdHE1eGlnWXJjVkhUUzJBbW1RSUdpNVUzNXVUUUo0ZVdzbnJINThraGlhcGYxV3JjalVNTFVJdE5JVG5xMDdvVVpmTmNHN1NrNDN3RWhtWER0TnJNUmh6YjBNOHlZUkk2UnUzVmZ0WFNPazcxYUpHWDd1dC1tU004TnBLUTBuOEFjSDYzR3pQVUFKYXBmZXRtWE5ndWlkN2ZhVjlaN180d1RxemIzQ2pBTWtoMzhOU3BpNzdBMlNOOTJWMndZbmxWLUotRDRsZ3RvTWJpZGl4Sm9JN2IyX2h3dUVQUzJldEZ4SUtrRGFTbTJ5bW9zaUpQOFh5cFJSeU5ZaVc2a2FBc1pEYUZibUczd2JKQnAzdTJmWk0xOV9ERnZ0SWpoU1o4NVZHSHdQNzFKTGJUZmhmNVVWbTdxZ3F2X0JlNnRuaWdFY19QZ2prZVFOcG5vS0VaQ3RIcEo3UHJDZVdJQU5BTGZhQmR0MG1JTTJHWGxGVmJaUDZJZzc4VzhyVEdsN3ZuS24yRmg0RjJBWXl0azFXbzJzU1piaWVPMGhENTdnSHg5YmZKQldSSHA0OHJHZlZKRWtfeWhqY3BfNEczTWNTZmo4MmRGbWp4VTBfck5EdVRpbFNiT292T3RUdzVNS2JrelJWS2J3VTJnN0Zpc2lSa292b3RNQnhQN1pKekpwM3d0WjdpQ1ppSEZ2WWVyXzNnNHVaaUhOT09uU21pN0RaMXVCN3JBYU1LVF95dGtVS1ZpbmpyVldYN0F6bDhoQVpsYnBUUDlKOUpyd0prb1BwcDR1Z3hvUWN3SUw3dkMySmo1TkE1aHhrMTI1eXFtbkJaWXBlbTJQcFRUMGpJYVZVRnMzTHRfMkNUZktwMk5KZzlWTjQ4UjdzN2lvTzRFajFaRHVoeGxuN0pTSTVUMWdDZHNzV0JWREJXaGU0TXRUYjVLMUlqdzk0LVVJYWhfd09BRG1CdzE2ZlNqN2JfRmFCeUYxWEx2STVLdTlUZk55bEpOazFfRmVqXzhGSjdrVmwxd1NyTEZEZGRKUjZadTlKeUktbDUyZFQ3Q21Ic0ppNW82dkNZZVllYTBKdFZjUTlXdUFSZUZiTzRZX1ItdlVNaFBRVV9IX2IwSnc2ZWpzUHBpRHhJY0ctVFN2UnU4ajRab3ZnZ3FkQ3RINC03Wkh4VkVob0RoZ28zbVZHRkpZY3Zudk5rLXhxLTBIZUtfWlFEcVBlblNLSzVxOUJTMm5FZGhiVFBaQlNuNkdPMEJkMlB4UkF1UW5PR2FWWmY5OEw2UXhKQUZKdktYSElBXzA5cGtRcG9CX1BOMVNPLUFKUEswUnd1T2lBNTVPcVUxSERHRnp5TzVleElxV055bUFod3pwcTE4X1dGQUlUYUx2bmMtSFhCbDV4cWItT0N6MWdQNXlnVDZybDZabW1RRVVyUG5RVmMxajFaRThXUDN1bmppLU03VUJCaW5rUERLaWEzbkh0VkNYR1duN2ZuN1FEY3ZBd1V5NkRtS1BqRGNDa2JtQTJmcUpGSGhpMjJPRF9lOXBlb01mT3AwUnhfcE9IZHVneUlNamdfWmYwVDBJY2xNTkdhVnlqWm5ScW03U2M5eE5hQnMydmJzQTNGOXh3X0R4Q1dGS3NMZmIxczI0ZWZhMjVEUGtReTY1N1p2QlJOVHl3bFhEYTMyRmVXVHZtbjRCcFpPZnpZUFV4Uk5mRFBqbXpTanl5YkNJNUN2R2ZfTmN4ajJUX09ldzY0MDczczlrTC0zbHM1aTIyb1lkeElCMVVMQnJCZU5NOElBSkFNM2tFckJzOGxTTUNmZi05X2l3bTV4V05NY1p5UlJMY3hfN3dwbk5teHdRZlNWQUpkUG1SVW8xWXZ6cVpzNHR6RXlYUXN2a2ZHdUp0S3RNZXl2ZjFYTVVLcklYNFpkaWlOc1BuTHZIUGpSNnpnMnZReWQ3cUZBcDR4enFmd2FqYmJJc3ZkT011b19nQTFqSXNQLWdfOGZKMm03a0x3dkZXZGxFNWZfSU9qbElFZ203cTBoU2lhMHU4UTFmX2Q0end2RlZLZTRHZE1JaTNnS2tYR1kxVFN1QnFJUFB0bGc0TUJMT1QzckpzeURKcEpuQlBsSGNQQmRwYmdOX3NYdFFxYWxEOUVoaThmM01ZQzFISlFuZER2b3V2NXRUc3RfOHpYR0NEc1p2Ui1jclJkRlg1djZMcHEzRzluTzlodTREaTVZbXRmODk1dXMzN19CaU84SkdvOXRuRFR6UWxUaHJsS2xzeThoSTBCeFJLVnNteFpHZmpOUllxSFRpSEtkckxXNlY3Q01pVTB6UGtsTk5rd1JOZDU0RkRDcnZzZTZ5NTlVT082R1dMNE12Z0xlYTFWSk5vVDJuMTRmNmdjN25leFFWclhvb1ltakxGUndLMnY0SkpzVENyYVFaRk5Cb1RVcHFZOEo2S3JOajVnS0tyMTRJOEVOb0tQZ01GWDZIQ0JMWEMzMjloaHE2LTRJQ01iMjNrZEFfaVBmcFg4Smc0OGJsZ2FyRUtmd3dhZEszS0M0S1QwVDFETlFFYkV2N0w5VnVFYkNRY2g5eEtwNWdEcGNZa2Y0UmpNaFpnSndFSEVuNVdzNXlwT0RLOEdEcU1qLUthYURqMUUzNkV3dWpITUt1bzNfdUIyRGVqc3U5N1U2S0wxdUV3MWhRSWpTRnc1TkZWbEVUX0luZFB3TGtEQ2JLMEp3U1pSSDV5Sm1iQlA4aDdUaUIyNW9CRFRUNFN5bEh0UWdLRlpHTF9TM1E0T3dMSE15OXUyZUIwVllObldGbWoxVU9IRG1kWF8yMVBHbVVhOGNzTFI0czd3N2didFIyZkFjUUVYMUEzV0pDc2tSUFU0WlVYRGpjT2VzTm83N2FBT3ozbGYwZE9zSkNRTEw2SEVRZFVjNmJiVzFnSTg2a292QnB5TXFUaklBb1kzZ1dKWF9jOGVGQU9hSlFka2xIRGV0RTVfMzZxV05TVzRsYTZES1loR3hQQVI4Z0d3VzhHS1FITWtlcnlGT0N5VjhMZkttLU1uTWpwV2FGN3FlV3MtQmo1eEREekN6X1F5bzVCRE1VTFBWaTVYLVVtcVNpd0wwMDE5SHFZY0IxZlRYVzF5M2lHd3dSdDFUU3JsaFlFMkdDMXNOakVXTUVOUklQUHN2aU15dlRDRTBYa05xSUtfRTdNa0pGRUFxaGZLNzlDVFUwQVFKRTdrRW12N2prb3Vic1JlWHk1cUlXVnlXR2tFXzBMVkFtM29RTVIzTmFRWTFxSklNNWtCcVg3TVBnMVQzNTFYU2pzVG9PN2p4VmhoWUk1SjhnNHphU25WRW5LbDhvRTZGYVg2WGc3bVlwUWR1ZzM4VTd4c0Y5emNXUUJqOXJXTVpXbndWWEw0M3NIMkFld09rUEM0V0dVOWFGRjd4SmpCTGN4aDR0T0RVZFp5Nlh0Nk5fMHA5bDZaRXNUSFNYZ2lSUE5KenhVQVNOYXhRcV9ZZkpKMGhrZmplZHVhczU5V1ZKWDJOYmpGbGhiZGUxWVN1Rm9nME1LVF9uODE1XzB4VTdLb1dteHNGUW9BWXVtZGhzTkZuWkJwSXkzby1NcGNDNTRXNjBUWV83Q1hYaVZCVjhXQ0x3NnBGOUVOZFRCY2JLX2tuZEZmcFpxMVlieVppZEl0T3lVTjhCZEVUZE5PVElyekwzT2h0X0pPb2JvU25UTWdFMk4ySHM5YWhfd1RkOWNBT3p1di0xRkNOU1ljaG45a184NHV6dk9sYkRBb2NwRFFUb3VyeDBrRVJzdEN5R1VFMVAyS25DWUsxcjNWY2VXakYxc3JmSFRGd1N5b1JjQVo5aXEyelV6QmFsNVJLZ3dtZ3VBMTlOTXNYTWk5bVdab002bmJBOWFNMTVnblFmczJXM25aT1FwaldPREdsaUo3SEJNc1g4cWpCd0JwR2tGY3NNMmsxWlZWOHFHSmVGYmh2RVZLQ2x0a0tENmdNcDZlX2l6UmFKeWRBZGN0ZUJkQVgwN2pINVYtOVhyZTJSdmpXck9iU1Y0S21kRkF3WXpRcm85R3hpLUJNMm4yakp2cElkWFBoME02RVZtd1FQbERmNUo0SGkzRGRUa1ZvRDhfSFY1dkxiMllMQzRiYk44Vk9FS19LV0I0Mi12MmNLVUlReXJQME1sek5icDFFSFBnb0JGdFVaYjhwdUxFQ25kU2paQ0lOaEhZNk1udld2N0h0SFFEUmFIQzlYSmFidXFBR21UNUV5dThYdWdCVjRvX1NtN191bTV3WGdlRy0wOEI0ZElUOFhGYVZjdzhubFcxbzNrYUo3UkZuZi1TeFotMU8yd3VxWFFlai1CNFN0QmFZYlJVbXo4djRWTnVRMW1OOG1xMUFLcHBSU2tsRjNmZjRYY2xNTWRRWFdrV3NXYm1Zbldxb3Q0MHV4eWVlRTZ3Yng5TldDU1htYTdNYko1bUp4ekNaeHpKYVdkYzNBbTl1Y2ZzR3lsaFNRNkRUYXVQV2tKaFRWS1VJRUQzOEJ2LWZDYl95T20wemZkZ2xFZ1c0N3JuME5uQWFEZmIwQWgxa0tiVWhKZWluNGZrOVZQZ1YwbW5lZThQeUN1UmxWMkxYNWJ3ZXNMZ2E0aWVUU0Q2R29kWWZzXzNmNHFDeTlBMGdsbF9qTllleFJWaHgxSFlfc0MxSXNaSnJNTlhvaG1wNWVnZndQZnhDazNuVFlHbVBabUtDcG9IUlRHbHg4NVlMRzk4WDZjdUhERVJCX2RSQjdjTDFGdzVRMEl0YzktdXZLS2ZWTlVzOS1QSTZuQ2FlTUNZQ1VkNkxDUWRVUlJ2NmpaX3N1VFozT3k0bU5NejFMTUduTGxSNnBSbWM3ZmtjNnFxSURUb18tM3NtNF93YUdkbEU4OFRLY3dUVC10R0RBeHhFcnVwQXJPU1QxYzdMMktyWjc5TmZqSVN0NkhuMFdWY2dKNHhXZkZvbmRLa01hb1VPNkpVTkNaeExyaHhUUFlfam9GeWNuYVFxNDNHZU52MGRRYjMzWVpvUmU4UW1tVnUxRURVemNwOWFqSzkwUUg3RTRTZE5uaU5IOUc1c2VtVmZkdFMtOEQ5NEJURURPN193Wm0ycW1QaGhtemI1RHVFcDhsd252dEVmaEVmSlYwRkNRQndQOXRUQmFHajRCVFhBdnNQdkttSGZTRFR6MTlkclZnT1RHSWlkNXEyaGU4VzA0MTlzWFJVNFZFWGNydEpVdFBqdDdib293cEppMHlfQVlUc3VwXzNIZnJCYnE5M0x6QlhSSUkzTUNmYjlxRlEycS0zRDA3V0Jpclp4bk9tTWtOQ0tGM3Y3UUdadEE5TWVWTjBWbDRncDQ5bVBKNFp2RkpPajlhRHNOX2V3RWl6UTdHVERXcGVzYWJFUXlnNk9ibUpTUjNUaUZDSC14T3VqeGRNT0c3RmFSTFN3N19iazJVazRTQmRmX3FnbEUzNlY5bHAzR2oxNklpZ0xvNDRNNmw3dFZ2d3M0dU83bDMzU3N3TE50VzcteTZBYk1teDNQek5PUi05SFNHU01KYzd3aWtKUlgxdVRmQkVFVG9pRTROWHNyeUx0QldUcnhIcjdJTVUtNHE5blhiYUQ5Mjd4NmhXUG92VjloVEd2ZTlUOXlIalBTU3ZQZFNOQmlEVDVQalk1UVYzTU44NDFqX1I1Zm1UVDNOaWhwY0c0Qm14eEJXcnlQR283cGI1cHg0YUxQRkpLeFgzaHJUR1NRYkhpb0xBM3hpMndxMWYtZm5rWWNaYzVxTUEwcGhXM3NqcUlmX0U0MWRwQ0lHR3F5dUJQZ1JhV0JEMEJHVEdEaWhKbTBiVHFaUzhvVWg3eFZxQzdlRXlST0JzZWFWLWdLTHpGZVZTNlN6VFIyWTRZSUc4dlpnYS1oSThFdms0THI2X0tTakdrM2c4SnZzU2VQTmxDNW9BZXJvZFp3bTBheEpfeVdoenZoLVVNcUJHcy1wM3ZvX3ZqNUFvSk5oSUdGbUpieGlhQm9RMWYwcENYQUdRTGlCMFpxVkRpS3BIR0JGTnlzTm5LazNqdjE3Uld4VWktMHdxVXFrenJxNnB4Tkg5enhhYi1XMjlnakdsbjQ1bnIyWjctMHIxb2o1TEdYdXQ0WTM2TE0wN0VfZjVDQ2wyVlhOUGRmTGxVWThqLVo4a1RBUWtpSzFocWV2X2p3dnctNTVUNGhDNU14Ykg2TGFGblJvOGlSZG4yUE8zN2RUSzFvV0k3cDJnaGZLcXBVdkUxaVFYZ19RX2FTZnpVVjd5cWhPNU5iams2b1dUNnUyT1Bwa2Y1U3JUamRodGJmX0lMdVlvZU9NTGVSYjZYZFcyNFh5Q0tJTVBhX2dLeXFuMjZXSl9DSC02TWNzUmlyb2QwUXBsaTAtdlh3OUFkY3JMWExiZ254cU12NmV5V2VPVFVOZHMxejZnelJoc2pwbWEtdERROW8wSVEwdjFDWUQzb3Fxd2YtOUJKMG15OWdOZ0VmZ2lZajJQWVdwM19CM3hkZHVZeS1MVUFrU0s4NE9RXy14ZXRjZk9yZDdRR1h2cGtna3NPWTRVQXptNFZfNk9FNHRfMHl6SXRabmRsVnJoRF8xOHFjS29uUW1WR0d5b213Vk9MLU9MYzFBdkVaQk8tYnE4OWRBR1V4OERSZFBfcm5Iam9VOEItUkxVb3ZBb2lLaEdlT0RvVTJRUUZkRGJKZV92SlVmQ3BmOEExbzduTU81QTM3NDJmNFNKRVlKYW1wSVJpQ0h3MFJ1MGp4bGZoUnVaa3dXZFhQcnZzSlcxMGFKckRPZ2ItcTZZSXNaakZ6cmRBMWw1eTRBdy1mVm9RNXpTcG5BZGw0YmVtdGF6YXdHSVFLZ0Y3RklYeXU2dzNFRzZZSEkwYm5rY2JMU19WZHhVb3piT3RCdUxfUlNGNVI4VVdzMjVLMnlWOXFRcG9DYzZnRHdsUFJtZ0VRSkR4NDZDeEhOeXl0TzNYZ1FEUVZnLVR1UXpKdXc2eHFMdnBYM2xDTk5HQTl3UmxqbGVhX1l1MkQ2d240TVlZamc1dWZfWlRmckllOEFmaHNQNjc2ZHZObGJlMC1IUkNUc2otQVJUMVRFM2lsSUNpM09iWFU3dDlac2RKdlZYeW8yZnJURWxLR0VmXzF0UUlSMDc3VkxzSktmZzMxVUNCNEFjM2xkNU13OUc0eW5lVjZKeHpDNU94b0lYTm14NWhBX2RfTHVrakpRNnRndUMxMjRPZWdEaHcxcVJta3dQZklGc1E4Z0VQSE1wNERraEJwUHJ4MlBSb3U2TTJHU050V2Q4ZHBtQjJSNzNHcGdoTlBWM3FvVGw3bUxnMVJCTHhUcE5Za2t1TVRGMEZMZTVlM3k4cnA5S3hfNlNaanZxTjRuRDJqWkZmLVhmUEZnanBxQl9VYzJfV3ZYTHFSV0lnOHFOendjN0M0anJta09QaXdTeEk3dTJhQ1JiTFF2NUNVcTJ5THY4YXBoeFU0Y2tmbEU5SmVyZFVFdmFhMWhJSnUxREUwVGM1UGJkeUlCN0RRb29ka0hpX2FSSl9HUXhDNzBwWG5UNXhZZ0sxX3NZcFI4UVpLc0NmTzh6X3hrRl9lQWxTOFI0aUhHdUJmLUtFYWpUSWJ0RWlWTGhuVF9fUGg0U0l6dHc1LU1WS2czNTZuUWIxZlY3LUNNQkh6X1BwZk96UUZoMTBRYzZaU1lSd0Y1R2h4OHVjWTNacDVQbG0xS0pBRkpXN3hSQnF5NUItZWhqZkg2Z2llS3EtN3pFVi1rc2hyVjdMUXo4SmEyajY2VFBUVkQzT1E5MGxrNjh1amtSajkwUVZjVUpQRFliRzIyQ1hPN0c5bHBOYTBIQmtYRm5aMFpVNzVkenpnTzduM0VmT2tLdzl4WFRJNEFMclBobTB1Mnd2X1ZWUERNY0RPdGR4ekloYXN3Z2hkN2U1ZlY3Uy03Z3FaekUzTkVwODVQcnR2Wi01cFRQM2pIZE9idzRYRHZiMzAwa19ZSzdEaXVIYXdFbGtqRU45Q0VKdXhjU2dNempqd3FDTUFpRUpleEFTakNoQk5rVzdUclA0cDVFc1U2YWZadzl4amw2OGRuTmprWFRaQUYtdm1tZkNaMFF6NDJYTW5kcW9uREc5Y0pPS1FwS3dUNG9aRnJhVUhxVXVHM3ZpN3pPWVlzTV9tSXdwWFU4bGRFODA4MFY2WmxscU9VTHJjUklGXzkwU0ZsLVBUbmd1aXV4MDhTZXQ1U1JoMmFLVUNJMFRidHVzT2p6MFM1QWtnUjBCN1A3ZlJPZ1FaWnU5T3h6NlVENnFyVUd5N2dZTklsZmFxNTRhdGRtSUNGX2VKMHpPT0dRbUlqVDFXWTIzODNiWHhtZ19xVUlxU2pwY2thenRpQ18zek94N0NUSndHYllzVmtyTXRzekJLcG9Dc3RFeXEyel9Fa3RaUzNCYlhBTTFhWDRwMklfSHVCdm5EWW1Wa2NuaGprSVBjYlpobmJ0SGY5ZzVJSUJMNzE0STBvVWFaLXJ3TDQwWE44NUpCck15UkZxVmxDdHk1Y2lXWE1oWXZlbWxrTzJ4clNQUlRJOUdqbENhNFo4d2RpcjlYZDRLQ0Q5bnZhUG5rNGp3VWJaMTVDUTQtaGZIby03TWlicjgyR2RvbThWNms0TU0tdGNWX2xVbXdoejFYNkxhWEczZWhCVXllR19JMU9XVnRNbE1aM0M5Q1l6VFc5YldHZzdvdlJwV2FfZEhRWktlY0ZrTjYzZmFWMWU2NURqdExsWjVhUWM0NzZtYnRhdTgzUk8zcTFWUTRpcU5JVG9CQVoxOTRrZWlmQ3pnSlZmZk1FTzdxSk1xNTZUUmpFbFI5WmYyXzQ2aWFXb0tsbGFfZjRNTnJ2UTBQcFVtWkNiTUlHNTdiTzhweW1FTDRrLVpXVWZ4bWNmMEp3VWhpeVlSeXY3S3hIVW9mSF9wQks1bmZITmc5Wm1OX1JYa3MyUklkSWN0RkhRVnh2QUVacXJaZEk2WUVodUxGWnhqOEpwTUkzWG5aVlZnalhTekl6MUFZTl9SWVpRaVhzdmpuejVLckwxQlg2YjVvX1phSGg2LU82NWtHdEx1WXBjNk5fUUI3RERaRU1TaS1NcVJEaVNPWDcyeFRmNXlWTG9DVGdyN0JzWnRCTG01MzR2RDZweHFrUzVnSFFvVlozeFVCTDZ3T29WdUY2N3lJZ2x0WlNWdXJJTnlxOFFkalBGbnhkQmNHVjVvQTZMUzVTSWlOMWhUcGZGU0o3R0prLXRiUFNsdnU1RHotTDNrU2pGYzR2V3FpdzJPbU9KTllaMGRzRDdsYlhNdEJ1Mk5WVHZrS2Vtb0FQVjJtTklFamhtbkZTaldIV093a3d3QjZWRll2WHFNZEFZUEVTUWxmTEVwTDZMaTMxM2tOanlONk44Y0RUZXVHWDZKSGF0ZjVsRER1V3FYVnpRNXNwdEZta2ZaNkdITkFHV3k1bzNGYlFkY2REN3NfN2duS0dhLW9fX01RbE05dVc2YnJQZFhEMnI5c0lzTHlfcjNGR1RCZmN1S001QVZjYks2QzI3Z3pZY3d4ZWFsZVJ2dVRsbVV3WXlvSVJveWplb09Sb2RHVVFWS2FQU21ha2g0ajNwLTlud25rczNLUkx4NGxVNTNidkNhMHpkVUdSUGRSZHIyV1IxZ2VrSEhxbFdDc3FSUmVLNWNKYjBxa0hSMEhURXY4ZzMwU2NvRDZ0MGd2LVBMWGs1cmxQWU12emp0VU9qY05McDg2V283dXR4enJrdkVUbmdXUGNjaUJkSkVqMUNKaEE3aTBsMWlPZDQ1MEEzWTNCSURhUXVVam5pVFdRLWotcDlFRlRRX0tPNU5na0xldWtoZ1pQWWh6bTQxY2dxUmtOc3kxcmxpY0l3MzllalVNSWl2aHljVlRPbGlyaHJJMzQxVUtCSlYweXRocVRfWTJvRjVyM09vRDRKR0RsYlBIejBjRE00ckNWU3p2S0pJRmV2VnFWZTZUQXBsUUNiYlRSVWlLclA3TlNZMlJsckJEaEY4ZG0wMmtnOFB5aVBqZjRtSGRzZC1RLUtTd1otWUE1SWljZTVnb0lZd1hLS1JMWDRjTy1BUGdib3NwbWpCX0daQ1A1dWkwcDVuY2lqUm1Nb29LZHhLTm85UjdtTFpyeGg3TUlpVVd5RkZmZ3ROUkhUcjBMYVpnd19OUEZ2V3hEc1VqSGxRbWZXN09vdHU0aWJnVUwwMi1vTmJ1bm1hUlNUcWZuUlVRTi1aOE9wbnVoN1FPanl0aGdiX2w2a3lGNmNwYThMLXk2T0RsS1BrYmNDVVpyZUhGdGlTRlc1NWl5Mm1xMEFNSUlJN3F0Z2syMEFpUXVMZjQ3UzNpeWhaS05qaHJocmRteG1QWUFUV2JoYnBuaTlOSS1HU25rSzhCUnhaV0hvOFVGSmJ6RlRKWTM5clI5NFRmVDktaTBYeXRBUjhuLTByS1NqV2Z4NjJWRHlXc3I0b1V0S1hTSmo2NjRma1R1dVRiWURkbVV3QVIyRi1MWmlpMFFzWENYY2JDZzZfclVYSy12ZWhqSDJOZ0hoSHVLbTBiV1ZZX2EwaHdPaFhJcVN1cEVPRFJOd2VmN3k1WllwZUthd2d5M1pJOURnMVNDR2R5NFNYRHJmSVl6QTFDRGdiQlh3QTBuTXU1Uzk3VXk5RE9tRkJuelhiQnBtd0NZeEtyWGp5NFNSRmVtQjFXckRJdGlYcHU2SE9PbnVELTFGUldkXzFpRUI1ODFlZFp1SE11Vkl1WFdtSHpqT3ZOVHBmUjBhUDN3NGxoalJ5dElXRU5DQUs5OHlidUdPVDhTNTk1U3VFdG8wR3E0RVRmNVh3aVBtY2JMOTlpb1VlWGU0d1lUSnFvTTJ1c1lvdy1IbWpnRXFBZDQzVUVLWF9GVXBzb1VtMEVvOVZldjVaY3pTWlBoNzEtdC1NZVl0NU5qSndmdmYwYzVwMU5LS190OGhEVW5wRlZHeF80LVYzTFF5VFNZazBTZWRfRlFMYUwtekNFSHFZQmEtUFplYU9xS1QzdUQ1OGJtZEd0Q04yRXRJNXI2bk9lTmVJNTJpZ0FJZmhjMDVfNDQxVUY3YklyelV4Ti00UEpkRmZRU1Y5aVNfWDNWOHJtamNaQ0Fycm9yeUtBRjkyYjkyQ3ltalE2VnVfRHhkNmR5Z2RVNDhQZGFYajRIcWd5c3hydmtlNGZ5eC1WbUhQYWZndHpFbUZ0VEFBUmlnUzlicTZjMy0xWEZBWFpjZHUzQWRXY3FCbWNfNGF6OExncmlnQ01Vc2k3Z1k2cE44dUNUTkhPbWFnVmR5cllTSVJKYWRBQnN4YUp2Z0x0eTN3UXJpektWMVZEcUt6dEpYclY0OHRIT1lkcnA5RlhsSXQxcXVSZk1uRDdQMEQ5QWFLaEhMS3NmRUZ6cjJfR0poRkFLdXBXRmt6ZWx3SC1jdi12X2ItVm9NaUFjUnRRZk1BQ2FXY284WE1WQkdhdURvNjU4RktPYUFRajJDMEFBREJkVVVwNlRzSTZ5MnRneXBYdTlIbzJ3TURoVTN2YTlUUDlUaWU5cC1URTVBSVBWNmxFQ21qMDAtTTVmSmdfWm9oVlkxSHprMy16bVUzRWhKOU1oVHNvVWlZUWM1cWxkWWFiV3pJSFZabWVFclQxc1NuZGd0R2MzNEF3d1NZNEZpSlJtd0lUcy1OTGtNMGpFZ1FkSFRabUtBaWtBQ0FIZWNQSEFlUFFiZ1BseWNUMl9JdkFGRlFvcVh6dkQ0Si1QdUFNVWNEUlN3U0VjRTVKeUZ0dDZYQXIwd1B5YmtxaFphLWJjX19kMG0xek4xWHR1NEpMcG8yUEp0aHJpZlMwT2JCTlJhU25WSmpXY0ozQUhVd0t2aWd2T0JRR1FHdi1vSkVVLWNPQ05zUEdsMC1LanpjUmRfMF96bWZ0VDRPLXV5eUVxMk1RVEJBbTlCLVVodE5lbGR5Wm5TMVZsWUF0NUJBeFJHNmItMHZ0ZXVyN181bl9hMmNaVTktX0xjbXNQd1VCenB5bXhidzlFQ2VtLXA2bEpZTnpUdXQ2UVkwVHNvdFRWLVF5RVpjbHpPMTFuNy0tWDhOZG82UmtEZ1h4NmRueVJqb3B4ZHh1Q2xJY0l0SDhVOGlwYTZXeGJsTEdDbjVrNmNweHo3ai03bTRHR20ySld6Y2lTa2pLdkk1cFRfaHBxSUlxcWU5QmIzQ0xOR084Yk50Z3l4VHlYbUJpQkNUTVBzYjZaNnlCY3owR2NiYjI2MVNQTGRCWnVGR2JFTzV3N0EzaW5xbXp6cFpGUEt2MDlBbXBrM1owbjJaaWlMX1YxcU5XUDAzQlR4blFBaFVPZjAybEN0dEtKTld3V1BDbkhRdE5LenNNY3BwN3o2T1NUZkNESTJ4V1VhRkF1V3ZNczdWQnhKQ1BTdGxzXzFqMXpvQWtkRHRKTEFTNjc2LUVQRUhRSnJlNVpfNWlqb29XSzRzLXRGalZqWC1xdkoyWFBGaWlXSlVucl90RXZzSEc0Y0h4SVFIcDlESkVBNDRNZTVLQ1JCYjQ5NG5VM25RUE9OWWhPWG1aVEhlbTNjUXFDNnJxTGE1QThoTG1pX1VoamlfVUs5YlJIU00xWHFsMkpqUzFkcWI5eTFNRGRhSnNOd0Q3TllGSnpyaVlDSy1QREFDRElXanlSdjhzcG94ek53ZjY3cktObHRvYkhjQk9YaktZWWVjM3R1ekwwUmVxR0lzWFJWOEw2TndNNTliRWgwQ2FDOGZhbV9Wd3lRNy02MlVTcWRFYl9kdWdOWjlyU2xCd05UYzAxRnp5N1A2cjk3Q2x4azZCbm5FVHFZanpaVUpweXE2RmtKMHNhNXgwcUNOaXI0UTBqZ3pCQzIyUG9NQVhxMm9aS2VtNXg0aGxncUY4VlpNZXVmMlpkTVZXWXduUzdZWmRWNlBaYnRMZ3d1eU10aWotbXFJMVVTQmN6cVF6cFVpUTRTWHo4aWtnbDZKU2hMUVJVM2dDVWFRT1ZiVWVsRnFDYUZhX2t3YXJZbkJKRzRrQ2t0RTNrSkM0TUwzdzNuUDcyMXNCUkxMQjNiWC12blgtMlExRWViUUhXY25VZ0l6ME1lMmdNQ21CMUVuLVJQSUdlU2RweU9RN2xRN3daeWlnLUtIWS1JSVhfOVV5dE1qRF85SXc2azJBQW1oUXQ5MHpqN013amViTERNTlJ4M1d0V08tazUxUUVmbm96WjJrVmZ3Yi1IX2wtdGhKNk1IMG9tQUpCNHpxUUEuMzBEWlotQUR2SzBpMXUwRjBuY0VfQQ\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:59 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a5a05b7a-4261-465b-8196-a0c2e9bfd445", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529955839,\"scheduledPurgeDate\":1537731839,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/455c7272682d4de689881f179e63e20b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"qku3i9yaW1__0KD9WU8RYfR8BNea95TPuoEYwMQwp6iiPjS7UeVJIkbRskI_9A9S54xK-t8eZbCNGnTgEF4fFWu6s1CSxnAx3iOvxwpoB5nxgMWuMIHsjUfDbGGqHLrf7wH_nFpXyt_W5PqR095ujz4967fOoVwY04SXa3tTxGAxRve4sABMi5sZ2lT1sSaf-ItwEjs9ntCL5eV4PYAF4xzqUgWxZc0pjUegCqnfNDnmTGM88t7TH72EqjCoB2tkcSoETer107aGteEmzGOEERFVFVvzyrSRsoiBmvCjsYkyv4gnicnE1-tZeW6-7GU5cxMm_f-RMGJwdsgH6yZVxQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955815,\"updated\":1529955815,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:44:00 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a16605f1-d5e7-45f9-a172-7720a2928bec", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:44:15 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "56c0a533-9b4d-4046-ab33-c117b2aa058f", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529955839,\"scheduledPurgeDate\":1537731839,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/455c7272682d4de689881f179e63e20b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"qku3i9yaW1__0KD9WU8RYfR8BNea95TPuoEYwMQwp6iiPjS7UeVJIkbRskI_9A9S54xK-t8eZbCNGnTgEF4fFWu6s1CSxnAx3iOvxwpoB5nxgMWuMIHsjUfDbGGqHLrf7wH_nFpXyt_W5PqR095ujz4967fOoVwY04SXa3tTxGAxRve4sABMi5sZ2lT1sSaf-ItwEjs9ntCL5eV4PYAF4xzqUgWxZc0pjUegCqnfNDnmTGM88t7TH72EqjCoB2tkcSoETer107aGteEmzGOEERFVFVvzyrSRsoiBmvCjsYkyv4gnicnE1-tZeW6-7GU5cxMm_f-RMGJwdsgH6yZVxQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955815,\"updated\":1529955815,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:44:17 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c60a52e1-d704-4a02-bcf9-c92f3f21ccb2", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/restore?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:44:59 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "36f35fa3-2f4a-4a9c-a7c2-ba32e1d6e430", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/455c7272682d4de689881f179e63e20b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"qku3i9yaW1__0KD9WU8RYfR8BNea95TPuoEYwMQwp6iiPjS7UeVJIkbRskI_9A9S54xK-t8eZbCNGnTgEF4fFWu6s1CSxnAx3iOvxwpoB5nxgMWuMIHsjUfDbGGqHLrf7wH_nFpXyt_W5PqR095ujz4967fOoVwY04SXa3tTxGAxRve4sABMi5sZ2lT1sSaf-ItwEjs9ntCL5eV4PYAF4xzqUgWxZc0pjUegCqnfNDnmTGM88t7TH72EqjCoB2tkcSoETer107aGteEmzGOEERFVFVvzyrSRsoiBmvCjsYkyv4gnicnE1-tZeW6-7GU5cxMm_f-RMGJwdsgH6yZVxQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955815,\"updated\":1529955815,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncForAsyncOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncForAsyncOperationsTest.json new file mode 100644 index 0000000000000..a755f2e37a0c4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncForAsyncOperationsTest.json @@ -0,0 +1,489 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:35 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "32c0e835-6639-407a-887b-55d7a99cfe02", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:42 GMT", + "content-length" : "1313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending?api-version=7.0&request_id=1467d262e27646ba81aeb6788a2e2836", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "35e4c58b-ec7b-46b0-a726-021af68a174b", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQad3jP4PkyVlCQcKvtvXDlttXZi2AkgKRNvBPJ27zSUVyydlRdx6VWkQ+1D5XfHkPqDJEDtLa6wbeEc45F5kyUltSLBHSGxR30wyZoJQ6dOyTK1SfB27gjgubyGvuCXhSDTRDXQrMUzOyrKfCnAtrpeWG66ZQMgs0+eK3jKhBYXvntvH4bzO/DgwXmsgCcxF5Hm0EnS97OJKoTGIui9xqRJb75h2hd0T8iH1z6gSrVscZopSW44Wa5TRAwg2sXUWmVJ8pRUjhFNi/KnNqpHok2YA4O4tP0SRicVKD0QF49PPMfZbLGnOZC/nX1lHXu6xwf8DCn5VWDr9InlbUP4jXAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAXNgndkYMb6pkEIfdQc368g43LlJ2EGkcUD5nWrpmlh4w5o8CFHp7NrM4dyAiuryKLz132pS2EcKllc25sBS0zs6LUpnSaDflku+17TuQ+yTU5/2UOFcar9i5Kzrh3WVCcvjgx5ke1WpGLzzxg65k8UKCOYt2/eCyuQT5JtO+r4/lmmPYDcHjGnsuQ17CdJk799dET7myR36EV0MXQ2Y3HUYEpmHFyGNLtXCvkBuVqcKmX55N+PuLZoh8XTSEdCuOasgjVMXMt/Tnui7Xtz5+ygH9uXPDV0MfaTkbEXTTDn6vEpbBH0O5w71NmqY21yNRF4kv6eCxi9qaifjWbaFD+Q==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"1467d262e27646ba81aeb6788a2e2836\"}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:43 GMT", + "content-length" : "1313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5ded8260-502c-4716-ae66-712a52ba9a63", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQad3jP4PkyVlCQcKvtvXDlttXZi2AkgKRNvBPJ27zSUVyydlRdx6VWkQ+1D5XfHkPqDJEDtLa6wbeEc45F5kyUltSLBHSGxR30wyZoJQ6dOyTK1SfB27gjgubyGvuCXhSDTRDXQrMUzOyrKfCnAtrpeWG66ZQMgs0+eK3jKhBYXvntvH4bzO/DgwXmsgCcxF5Hm0EnS97OJKoTGIui9xqRJb75h2hd0T8iH1z6gSrVscZopSW44Wa5TRAwg2sXUWmVJ8pRUjhFNi/KnNqpHok2YA4O4tP0SRicVKD0QF49PPMfZbLGnOZC/nX1lHXu6xwf8DCn5VWDr9InlbUP4jXAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAXNgndkYMb6pkEIfdQc368g43LlJ2EGkcUD5nWrpmlh4w5o8CFHp7NrM4dyAiuryKLz132pS2EcKllc25sBS0zs6LUpnSaDflku+17TuQ+yTU5/2UOFcar9i5Kzrh3WVCcvjgx5ke1WpGLzzxg65k8UKCOYt2/eCyuQT5JtO+r4/lmmPYDcHjGnsuQ17CdJk799dET7myR36EV0MXQ2Y3HUYEpmHFyGNLtXCvkBuVqcKmX55N+PuLZoh8XTSEdCuOasgjVMXMt/Tnui7Xtz5+ygH9uXPDV0MfaTkbEXTTDn6vEpbBH0O5w71NmqY21yNRF4kv6eCxi9qaifjWbaFD+Q==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"1467d262e27646ba81aeb6788a2e2836\"}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:44 GMT", + "content-length" : "1015", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "722fe63c-c416-430b-a3b2-75ca509a3412", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/4f2513eef39f4a93a425f1e35ab20d8d\",\"attributes\":{\"enabled\":false,\"nbf\":1529954381,\"exp\":1561490981,\"created\":1529954982,\"updated\":1529954985,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"tag1\":\"foo\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954985}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:48 GMT", + "content-length" : "620", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a6be14d2-da59-49aa-b2e7-fdd56a72cbfb", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954988}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:49 GMT", + "content-length" : "620", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "075c16f3-2251-4f88-b68a-be34168aeb4e", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954988}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:50 GMT", + "content-length" : "1313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "33b58829-6c12-48b6-b70f-8b4a12b23ed8", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQad3jP4PkyVlCQcKvtvXDlttXZi2AkgKRNvBPJ27zSUVyydlRdx6VWkQ+1D5XfHkPqDJEDtLa6wbeEc45F5kyUltSLBHSGxR30wyZoJQ6dOyTK1SfB27gjgubyGvuCXhSDTRDXQrMUzOyrKfCnAtrpeWG66ZQMgs0+eK3jKhBYXvntvH4bzO/DgwXmsgCcxF5Hm0EnS97OJKoTGIui9xqRJb75h2hd0T8iH1z6gSrVscZopSW44Wa5TRAwg2sXUWmVJ8pRUjhFNi/KnNqpHok2YA4O4tP0SRicVKD0QF49PPMfZbLGnOZC/nX1lHXu6xwf8DCn5VWDr9InlbUP4jXAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAXNgndkYMb6pkEIfdQc368g43LlJ2EGkcUD5nWrpmlh4w5o8CFHp7NrM4dyAiuryKLz132pS2EcKllc25sBS0zs6LUpnSaDflku+17TuQ+yTU5/2UOFcar9i5Kzrh3WVCcvjgx5ke1WpGLzzxg65k8UKCOYt2/eCyuQT5JtO+r4/lmmPYDcHjGnsuQ17CdJk799dET7myR36EV0MXQ2Y3HUYEpmHFyGNLtXCvkBuVqcKmX55N+PuLZoh8XTSEdCuOasgjVMXMt/Tnui7Xtz5+ygH9uXPDV0MfaTkbEXTTDn6vEpbBH0O5w71NmqY21yNRF4kv6eCxi9qaifjWbaFD+Q==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"1467d262e27646ba81aeb6788a2e2836\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:53 GMT", + "content-length" : "2374", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dcf5ad7b-d84d-422e-948a-c11ff985d02e", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"x5t\":\"UBe7YKmzM8Ch8p9KqhB8SPrwDdM\",\"cer\":\"MIIDRDCCAiygAwIBAgIQZCRvTHNcT5iFZGiCQhlTyzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUxOTE5NTFaFw0xOTA2MjUxOTI5NTFaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Gnd4z+D5MlZQkHCr7b1w5bbV2YtgJICkTbwTydu80lFcsnZUXcelVpEPtQ+V3x5D6gyRA7S2usG3hHOOReZMlJbUiwR0hsUd9MMmaCUOnTskytUnwdu4I4Lm8hr7gl4Ug00Q10KzFMzsqynwpwLa6XlhuumUDILNPnit4yoQWF757bx+G8zvw4MF5rIAnMReR5tBJ0veziSqExiLovcakSW++YdoXdE/Ih9c+oEq1bHGaKUluOFmuU0QMINrF1FplSfKUVI4RTYvypzaqR6JNmAODuLT9EkYnFSg9EBePTzzH2WyxpzmQv519ZR17uscH/Awp+VVg6/SJ5W1D+I1wIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUx9BFWEOHHtKR3C9HWKNDv+oJLs4wHQYDVR0OBBYEFMfQRVhDhx7SkdwvR1ijQ7/qCS7OMA0GCSqGSIb3DQEBCwUAA4IBAQClzKpxj4+uVfOv4FhCVS5pGNdZ1TxEdjaOKQ0xVdInJ8AgjZL9miUDcF4yAOfyqO93hu8Rtjw+sIQmuIsOw3LaDr3RgOB2bJAlxxy8iHWTpXug5lQS4zkOoH6DwV4rnYtDVZkYwSgnXVgH14bmmMfcYJJpjHdZnTxiRTlXTlW4+0qoyCyHfUBoIIL2FXOxdW2C8mhGB9mWOQIo+/cuD329F3e4xuPHHFx8PXNwEnZc8YiqCdcxnG9xcvf3ToGAnvMteEE5zwWFVmsCjCC0CCBEUDhHJGKr9qQBiuj3GK0IqHqDIVMAMyVAeu7RlWDezdl10E1JS7RGuA/5TqqA4CPt\",\"attributes\":{\"enabled\":true,\"nbf\":1529954391,\"exp\":1561490991,\"created\":1529954991,\"updated\":1529954991,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954988}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:56 GMT", + "content-length" : "924", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/pkcs10; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cee7ef82-32b7-4d06-9da3-708c7fdff1b7", + "Body" : "MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQad3jP4PkyVlCQcKvtvXDlttXZi2AkgKRNvBPJ27zSUVyydlRdx6VWkQ+1D5XfHkPqDJEDtLa6wbeEc45F5kyUltSLBHSGxR30wyZoJQ6dOyTK1SfB27gjgubyGvuCXhSDTRDXQrMUzOyrKfCnAtrpeWG66ZQMgs0+eK3jKhBYXvntvH4bzO/DgwXmsgCcxF5Hm0EnS97OJKoTGIui9xqRJb75h2hd0T8iH1z6gSrVscZopSW44Wa5TRAwg2sXUWmVJ8pRUjhFNi/KnNqpHok2YA4O4tP0SRicVKD0QF49PPMfZbLGnOZC/nX1lHXu6xwf8DCn5VWDr9InlbUP4jXAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAXNgndkYMb6pkEIfdQc368g43LlJ2EGkcUD5nWrpmlh4w5o8CFHp7NrM4dyAiuryKLz132pS2EcKllc25sBS0zs6LUpnSaDflku+17TuQ+yTU5/2UOFcar9i5Kzrh3WVCcvjgx5ke1WpGLzzxg65k8UKCOYt2/eCyuQT5JtO+r4/lmmPYDcHjGnsuQ17CdJk799dET7myR36EV0MXQ2Y3HUYEpmHFyGNLtXCvkBuVqcKmX55N+PuLZoh8XTSEdCuOasgjVMXMt/Tnui7Xtz5+ygH9uXPDV0MfaTkbEXTTDn6vEpbBH0O5w71NmqY21yNRF4kv6eCxi9qaifjWbaFD+Q==" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:57 GMT", + "content-length" : "252", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "648d9c96-9cfe-4fd0-8edc-11ce4a9d72b1", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate\",\"x5t\":\"UBe7YKmzM8Ch8p9KqhB8SPrwDdM\",\"attributes\":{\"enabled\":true,\"nbf\":1529954391,\"exp\":1561490991,\"created\":1529954991,\"updated\":1529954991}}],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/versions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:59 GMT", + "content-length" : "285", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5da85fe1-4055-455e-b4c8-d6002ef97e72", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"x5t\":\"UBe7YKmzM8Ch8p9KqhB8SPrwDdM\",\"attributes\":{\"enabled\":true,\"nbf\":1529954391,\"exp\":1561490991,\"created\":1529954991,\"updated\":1529954991}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:02 GMT", + "content-length" : "1233", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "045bbcee-8c97-4ff5-a7fd-c0dff11302aa", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQad3jP4PkyVlCQcKvtvXDlttXZi2AkgKRNvBPJ27zSUVyydlRdx6VWkQ+1D5XfHkPqDJEDtLa6wbeEc45F5kyUltSLBHSGxR30wyZoJQ6dOyTK1SfB27gjgubyGvuCXhSDTRDXQrMUzOyrKfCnAtrpeWG66ZQMgs0+eK3jKhBYXvntvH4bzO/DgwXmsgCcxF5Hm0EnS97OJKoTGIui9xqRJb75h2hd0T8iH1z6gSrVscZopSW44Wa5TRAwg2sXUWmVJ8pRUjhFNi/KnNqpHok2YA4O4tP0SRicVKD0QF49PPMfZbLGnOZC/nX1lHXu6xwf8DCn5VWDr9InlbUP4jXAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAXNgndkYMb6pkEIfdQc368g43LlJ2EGkcUD5nWrpmlh4w5o8CFHp7NrM4dyAiuryKLz132pS2EcKllc25sBS0zs6LUpnSaDflku+17TuQ+yTU5/2UOFcar9i5Kzrh3WVCcvjgx5ke1WpGLzzxg65k8UKCOYt2/eCyuQT5JtO+r4/lmmPYDcHjGnsuQ17CdJk799dET7myR36EV0MXQ2Y3HUYEpmHFyGNLtXCvkBuVqcKmX55N+PuLZoh8XTSEdCuOasgjVMXMt/Tnui7Xtz5+ygH9uXPDV0MfaTkbEXTTDn6vEpbBH0O5w71NmqY21yNRF4kv6eCxi9qaifjWbaFD+Q==\",\"cancellation_requested\":false,\"status\":\"completed\",\"target\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate\",\"request_id\":\"1467d262e27646ba81aeb6788a2e2836\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:04 GMT", + "content-length" : "2426", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "233e726b-4b4a-43b8-b3e3-e716d6ba706b", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate\",\"deletedDate\":1529955004,\"scheduledPurgeDate\":1537731004,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"x5t\":\"UBe7YKmzM8Ch8p9KqhB8SPrwDdM\",\"cer\":\"MIIDRDCCAiygAwIBAgIQZCRvTHNcT5iFZGiCQhlTyzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUxOTE5NTFaFw0xOTA2MjUxOTI5NTFaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Gnd4z+D5MlZQkHCr7b1w5bbV2YtgJICkTbwTydu80lFcsnZUXcelVpEPtQ+V3x5D6gyRA7S2usG3hHOOReZMlJbUiwR0hsUd9MMmaCUOnTskytUnwdu4I4Lm8hr7gl4Ug00Q10KzFMzsqynwpwLa6XlhuumUDILNPnit4yoQWF757bx+G8zvw4MF5rIAnMReR5tBJ0veziSqExiLovcakSW++YdoXdE/Ih9c+oEq1bHGaKUluOFmuU0QMINrF1FplSfKUVI4RTYvypzaqR6JNmAODuLT9EkYnFSg9EBePTzzH2WyxpzmQv519ZR17uscH/Awp+VVg6/SJ5W1D+I1wIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUx9BFWEOHHtKR3C9HWKNDv+oJLs4wHQYDVR0OBBYEFMfQRVhDhx7SkdwvR1ijQ7/qCS7OMA0GCSqGSIb3DQEBCwUAA4IBAQClzKpxj4+uVfOv4FhCVS5pGNdZ1TxEdjaOKQ0xVdInJ8AgjZL9miUDcF4yAOfyqO93hu8Rtjw+sIQmuIsOw3LaDr3RgOB2bJAlxxy8iHWTpXug5lQS4zkOoH6DwV4rnYtDVZkYwSgnXVgH14bmmMfcYJJpjHdZnTxiRTlXTlW4+0qoyCyHfUBoIIL2FXOxdW2C8mhGB9mWOQIo+/cuD329F3e4xuPHHFx8PXNwEnZc8YiqCdcxnG9xcvf3ToGAnvMteEE5zwWFVmsCjCC0CCBEUDhHJGKr9qQBiuj3GK0IqHqDIVMAMyVAeu7RlWDezdl10E1JS7RGuA/5TqqA4CPt\",\"attributes\":{\"enabled\":true,\"nbf\":1529954391,\"exp\":1561490991,\"created\":1529954991,\"updated\":1529954991,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954988}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:05 GMT", + "content-length" : "97", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1b521d2d-b078-4fcc-974c-f70055f9189d", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: myCertificate\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:16 GMT", + "content-length" : "97", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "712aa30b-8540-4cb6-a104-2268a302965f", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: myCertificate\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:29 GMT", + "content-length" : "2426", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ea9d63bb-4f19-420b-a52a-bffe142fab53", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate\",\"deletedDate\":1529955004,\"scheduledPurgeDate\":1537731004,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/myCertificate/d2eb02574c6748c1abda7a54b60119f1\",\"x5t\":\"UBe7YKmzM8Ch8p9KqhB8SPrwDdM\",\"cer\":\"MIIDRDCCAiygAwIBAgIQZCRvTHNcT5iFZGiCQhlTyzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUxOTE5NTFaFw0xOTA2MjUxOTI5NTFaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Gnd4z+D5MlZQkHCr7b1w5bbV2YtgJICkTbwTydu80lFcsnZUXcelVpEPtQ+V3x5D6gyRA7S2usG3hHOOReZMlJbUiwR0hsUd9MMmaCUOnTskytUnwdu4I4Lm8hr7gl4Ug00Q10KzFMzsqynwpwLa6XlhuumUDILNPnit4yoQWF757bx+G8zvw4MF5rIAnMReR5tBJ0veziSqExiLovcakSW++YdoXdE/Ih9c+oEq1bHGaKUluOFmuU0QMINrF1FplSfKUVI4RTYvypzaqR6JNmAODuLT9EkYnFSg9EBePTzzH2WyxpzmQv519ZR17uscH/Awp+VVg6/SJ5W1D+I1wIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUx9BFWEOHHtKR3C9HWKNDv+oJLs4wHQYDVR0OBBYEFMfQRVhDhx7SkdwvR1ijQ7/qCS7OMA0GCSqGSIb3DQEBCwUAA4IBAQClzKpxj4+uVfOv4FhCVS5pGNdZ1TxEdjaOKQ0xVdInJ8AgjZL9miUDcF4yAOfyqO93hu8Rtjw+sIQmuIsOw3LaDr3RgOB2bJAlxxy8iHWTpXug5lQS4zkOoH6DwV4rnYtDVZkYwSgnXVgH14bmmMfcYJJpjHdZnTxiRTlXTlW4+0qoyCyHfUBoIIL2FXOxdW2C8mhGB9mWOQIo+/cuD329F3e4xuPHHFx8PXNwEnZc8YiqCdcxnG9xcvf3ToGAnvMteEE5zwWFVmsCjCC0CCBEUDhHJGKr9qQBiuj3GK0IqHqDIVMAMyVAeu7RlWDezdl10E1JS7RGuA/5TqqA4CPt\",\"attributes\":{\"enabled\":true,\"nbf\":1529954391,\"exp\":1561490991,\"created\":1529954991,\"updated\":1529954991,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529954982,\"updated\":1529954988}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:37 GMT", + "content-length" : "89", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "71adc8be-0088-40a2-b46a-97d4192b8c37", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: myCertificate\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/myCertificate?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:30:40 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a4fc2643-26b5-47bb-95a4-68311c3cec63", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncRequestCancellationForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncRequestCancellationForCertificateOperationsTest.json new file mode 100644 index 0000000000000..e323eb3c84ec9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateAsyncRequestCancellationForCertificateOperationsTest.json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:58 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5351a8c5-bdce-465d-ab54-04e60aae578d", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:01 GMT", + "content-length" : "1329", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending?api-version=7.0&request_id=5fd27ff464e440b880191b17f62387e2", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "135f5fe0-dbd8-41db-9bbd-7b68a37f195a", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkUN7Pu25zX3CLYfNr6SaEoPsOF3bDCoZPY2fzrCdh9YHQoHIW65IHt/whilCxxWrD02Lil/BRI8cHwCs6/adDbLSgnn/qUdh05ty2a+1TTO35NG1E5G6qbBjlCnNlpka+y84txCkJkrcUZMvcZ3QvlWeUOCfW8WG6JxK9DDgzUPMCZSUfQR7wizjAo8ZRrcurPqW8H4k6I2rJEuCKy42mDRM/AGrIaDUEW5s2U0UZYM4g0rHlwRyzbgUY8mC626Oj1L5AVPaLnyDD91mqVWkluetD6DgEgU1bMYK3H25FOdMVq8ii9KMBl33ISI/3ucPmjCZiFea6dz85xdIaq3+/AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAms1n8wT+ebkVLsdsIqYlbfARJveensdkzli74jYOEK3WjMVrb74KNTYvvxSXlqchkfGM7CKK55ziLtFv5UnTYNRsOk+MAyhvDXFpjOi660go2c2z2L7iOhwUKivwa1lKGVyrrsA2G/AAhzsVhxM8/czqhcfSQjOoYQVhrLLTbV3JD59DU17VgrduLrsLhZmuGIU5T1z6o3AYjyPOJzf+KB1EYCQZC6ZsG0I6atGsyDQAXnx8i4Y2TUN3c3DH97u4A8HLhWM1YwIhXK/0xzNJ/q0bj23lRUSw7dAzyQenove5BJpBcF8Zlu2OL3fkfa/CPHHNcAGLCsAFIIHoX7+/7g==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"5fd27ff464e440b880191b17f62387e2\"}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:03 GMT", + "content-length" : "1328", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "010213a5-1054-4791-a9d4-549e005bbb85", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkUN7Pu25zX3CLYfNr6SaEoPsOF3bDCoZPY2fzrCdh9YHQoHIW65IHt/whilCxxWrD02Lil/BRI8cHwCs6/adDbLSgnn/qUdh05ty2a+1TTO35NG1E5G6qbBjlCnNlpka+y84txCkJkrcUZMvcZ3QvlWeUOCfW8WG6JxK9DDgzUPMCZSUfQR7wizjAo8ZRrcurPqW8H4k6I2rJEuCKy42mDRM/AGrIaDUEW5s2U0UZYM4g0rHlwRyzbgUY8mC626Oj1L5AVPaLnyDD91mqVWkluetD6DgEgU1bMYK3H25FOdMVq8ii9KMBl33ISI/3ucPmjCZiFea6dz85xdIaq3+/AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAms1n8wT+ebkVLsdsIqYlbfARJveensdkzli74jYOEK3WjMVrb74KNTYvvxSXlqchkfGM7CKK55ziLtFv5UnTYNRsOk+MAyhvDXFpjOi660go2c2z2L7iOhwUKivwa1lKGVyrrsA2G/AAhzsVhxM8/czqhcfSQjOoYQVhrLLTbV3JD59DU17VgrduLrsLhZmuGIU5T1z6o3AYjyPOJzf+KB1EYCQZC6ZsG0I6atGsyDQAXnx8i4Y2TUN3c3DH97u4A8HLhWM1YwIhXK/0xzNJ/q0bj23lRUSw7dAzyQenove5BJpBcF8Zlu2OL3fkfa/CPHHNcAGLCsAFIIHoX7+/7g==\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"5fd27ff464e440b880191b17f62387e2\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:04 GMT", + "content-length" : "1328", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6553df4e-e9da-4e9f-8fee-60d31abe85da", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkUN7Pu25zX3CLYfNr6SaEoPsOF3bDCoZPY2fzrCdh9YHQoHIW65IHt/whilCxxWrD02Lil/BRI8cHwCs6/adDbLSgnn/qUdh05ty2a+1TTO35NG1E5G6qbBjlCnNlpka+y84txCkJkrcUZMvcZ3QvlWeUOCfW8WG6JxK9DDgzUPMCZSUfQR7wizjAo8ZRrcurPqW8H4k6I2rJEuCKy42mDRM/AGrIaDUEW5s2U0UZYM4g0rHlwRyzbgUY8mC626Oj1L5AVPaLnyDD91mqVWkluetD6DgEgU1bMYK3H25FOdMVq8ii9KMBl33ISI/3ucPmjCZiFea6dz85xdIaq3+/AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAms1n8wT+ebkVLsdsIqYlbfARJveensdkzli74jYOEK3WjMVrb74KNTYvvxSXlqchkfGM7CKK55ziLtFv5UnTYNRsOk+MAyhvDXFpjOi660go2c2z2L7iOhwUKivwa1lKGVyrrsA2G/AAhzsVhxM8/czqhcfSQjOoYQVhrLLTbV3JD59DU17VgrduLrsLhZmuGIU5T1z6o3AYjyPOJzf+KB1EYCQZC6ZsG0I6atGsyDQAXnx8i4Y2TUN3c3DH97u4A8HLhWM1YwIhXK/0xzNJ/q0bj23lRUSw7dAzyQenove5BJpBcF8Zlu2OL3fkfa/CPHHNcAGLCsAFIIHoX7+/7g==\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"5fd27ff464e440b880191b17f62387e2\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:07 GMT", + "content-length" : "1093", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "26de549b-9309-433a-8127-03c23a8d1028", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/cancellationRequestedCertJava\",\"deletedDate\":1529959207,\"scheduledPurgeDate\":1537735207,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/ec43c646fad24543adca8f0eddd4e75a\",\"attributes\":{\"enabled\":false,\"nbf\":1529958600,\"exp\":1561495200,\"created\":1529959200,\"updated\":1529959200,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959200,\"updated\":1529959200}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/cancellationRequestedCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:08 GMT", + "content-length" : "1093", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2eee95c6-f87d-4286-bc17-e25ef25c97fa", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/cancellationRequestedCertJava\",\"deletedDate\":1529959207,\"scheduledPurgeDate\":1537735207,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/ec43c646fad24543adca8f0eddd4e75a\",\"attributes\":{\"enabled\":false,\"nbf\":1529958600,\"exp\":1561495200,\"created\":1529959200,\"updated\":1529959200,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/cancellationRequestedCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959200,\"updated\":1529959200}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/cancellationRequestedCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:10 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c4a6cc0a-d890-478e-9783-886db39b3e7a", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateContactsAsyncForAsyncOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateContactsAsyncForAsyncOperationsTest.json new file mode 100644 index 0000000000000..69b99a84c0e2a --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateContactsAsyncForAsyncOperationsTest.json @@ -0,0 +1,112 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:29 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "96be081b-b364-4da7-a0e7-98390b60f625", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:30 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f1b65530-4bcd-4781-81e1-fc80fee38ced", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:32 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "97752a4d-b6af-4f1b-94f4-57eabeaa25ba", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:29:35 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "74e8788f-f8ae-4ca3-9858-a8a08509bdad", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateUpdateForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateUpdateForCertificateOperationsTest.json new file mode 100644 index 0000000000000..228c1035b399d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/certificateUpdateForCertificateOperationsTest.json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:57 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1c0f180e-8fc8-4b01-bf0c-674edf3a2726", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:59 GMT", + "content-length" : "1846", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6ddfe168-02d6-4896-a4bb-59337ce00dd8", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959439,\"updated\":1529959439,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959439}}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:04 GMT", + "content-length" : "1857", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2e7c1edc-3a68-414f-8e38-592da1e3c814", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":false,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959439,\"updated\":1529959443,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959443}}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:04 GMT", + "content-length" : "543", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "19e3be22-b431-44d1-9ec3-1dacfd8cecce", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959444}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:05 GMT", + "content-length" : "543", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d3b902f5-7124-4cf1-a90b-1582b976be2a", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959444}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:07 GMT", + "content-length" : "2008", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dbb2533d-6c01-43c9-af87-7b7424283af9", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/updateCertJava\",\"deletedDate\":1529959448,\"scheduledPurgeDate\":1537735448,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":false,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959439,\"updated\":1529959443,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959444}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/updateCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:11 GMT", + "content-length" : "98", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "520cee15-0bfc-4dca-a0e7-583918b058c8", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: updateCertJava\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/updateCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:26 GMT", + "content-length" : "2008", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "09e963f8-0b3f-4030-bac1-3a3eb6c13051", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/updateCertJava\",\"deletedDate\":1529959448,\"scheduledPurgeDate\":1537735448,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/updateCertJava/bb3cf8c557484b1ebe49faf2055a79e7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":false,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959439,\"updated\":1529959443,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/updateCertJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959439,\"updated\":1529959444}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/updateCertJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:27 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c993d50f-2705-4ccd-a3b4-0faa869428ec", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/contactsCrudOperationsForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/contactsCrudOperationsForCertificateOperationsTest.json new file mode 100644 index 0000000000000..a558770185bdb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/contactsCrudOperationsForCertificateOperationsTest.json @@ -0,0 +1,139 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:36 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3a9e62b3-9eb2-4e0a-83b4-f0d7d866458e", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:38 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "71647de1-9e7b-4cb9-8503-aa4742d142b8", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:40 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7c8a9dba-0bec-48a9-ad19-32d0e949c3a2", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:41 GMT", + "content-length" : "222", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bc7f8028-5de7-47c5-b453-11bc2bfcc263", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"james@contoso.com\",\"name\":\"James\",\"phone\":\"7777777777\"},{\"email\":\"ethan@contoso.com\",\"name\":\"Ethan\",\"phone\":\"8888888888\"}]}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/contacts?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:42 GMT", + "content-length" : "68", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "792676a7-7804-4060-a0fd-9a751b948e4a", + "Body" : "{\"error\":{\"code\":\"ContactsNotFound\",\"message\":\"Contacts not found\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePemForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePemForCertificateOperationsTest.json new file mode 100644 index 0000000000000..cfeb210f21025 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePemForCertificateOperationsTest.json @@ -0,0 +1,327 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:31 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "755623ea-d062-4f7c-87c8-23855768d11b", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:33 GMT", + "content-length" : "373", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b53df449-465f-47e2-a4e6-3dd07533aff6", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account1\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1504827186,\"updated\":1529959233}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:36 GMT", + "content-length" : "1333", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending?api-version=7.0&request_id=aeb22ac0750842a9863f43d049e1db6b", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8447519b-1e3b-44e9-9c01-ab69fcd2baea", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\",\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"csr\":\"MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLVGVzdEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfLyLmwub/RyG0Y2o+r2h3kCgCGg7xwYIpq1WmJrk7aVveIOkcumLePB2f9LSDzQVU6NqN7OwsEbhPVu8dDa+nsiCuy/fUWfHP7rAgxh8p0UOhD0vQBhweN9pc3MDsY7hbGRQi6zOSwna9G+/kZ0B05cAJsk4g8GF4oXebcf2FIG6ljFFy391r3mV8Upgn3YTsS3B5DmHcEiykZWP6tUf8E40MAZEbWvIBk0KkTJBr3tbP8MpVANmMwP9Kcs/RiYosCog3IBZyaTVGg6PMowELdo4gzeuWGmGeWQXvBcQJ2iipgydsu+FJ5WGvR/K3SEeOT+KOZM79fD/XDSRhW5QJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAaPcBGmIu56jitaASVjE7OlTxSlwkMKrqZZZbEzyosmTuYGH7MvScFaDxVB9KkqfmPE1/8FTjvU6b1nmJ/Af9Ne4JUjekS2Q+B7snXCaVtZHoEIkSYGA0OVGjFQrtIb2ZjlbCA9ZX393JvL+zQzf1/EBH9nz1EmJER3lJ5LAbKGB84O616RRy7t6Wnk+GNJUhxZL1GEC+efszp6LRHaCwlA//8Yo+7HwpRWUqSFtpt8XZBMQl32MEOhN9LlEXnhj4AMyQwJEE0+34BPuxPKBqwwo58P3kFW5ahq9BGHoSSkimtotR1J17OdAfLlVCH1mugUMJlxmz8Ie3DG3LURPFwA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"aeb22ac0750842a9863f43d049e1db6b\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:38 GMT", + "content-length" : "1333", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1eef2807-236e-49f3-8b5e-366bae854074", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\",\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"csr\":\"MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLVGVzdEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfLyLmwub/RyG0Y2o+r2h3kCgCGg7xwYIpq1WmJrk7aVveIOkcumLePB2f9LSDzQVU6NqN7OwsEbhPVu8dDa+nsiCuy/fUWfHP7rAgxh8p0UOhD0vQBhweN9pc3MDsY7hbGRQi6zOSwna9G+/kZ0B05cAJsk4g8GF4oXebcf2FIG6ljFFy391r3mV8Upgn3YTsS3B5DmHcEiykZWP6tUf8E40MAZEbWvIBk0KkTJBr3tbP8MpVANmMwP9Kcs/RiYosCog3IBZyaTVGg6PMowELdo4gzeuWGmGeWQXvBcQJ2iipgydsu+FJ5WGvR/K3SEeOT+KOZM79fD/XDSRhW5QJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAaPcBGmIu56jitaASVjE7OlTxSlwkMKrqZZZbEzyosmTuYGH7MvScFaDxVB9KkqfmPE1/8FTjvU6b1nmJ/Af9Ne4JUjekS2Q+B7snXCaVtZHoEIkSYGA0OVGjFQrtIb2ZjlbCA9ZX393JvL+zQzf1/EBH9nz1EmJER3lJ5LAbKGB84O616RRy7t6Wnk+GNJUhxZL1GEC+efszp6LRHaCwlA//8Yo+7HwpRWUqSFtpt8XZBMQl32MEOhN9LlEXnhj4AMyQwJEE0+34BPuxPKBqwwo58P3kFW5ahq9BGHoSSkimtotR1J17OdAfLlVCH1mugUMJlxmz8Ie3DG3LURPFwA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"aeb22ac0750842a9863f43d049e1db6b\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:50 GMT", + "content-length" : "1257", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cc2e9ada-e89b-4fdd-ad5d-896618980677", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\",\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"csr\":\"MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLVGVzdEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfLyLmwub/RyG0Y2o+r2h3kCgCGg7xwYIpq1WmJrk7aVveIOkcumLePB2f9LSDzQVU6NqN7OwsEbhPVu8dDa+nsiCuy/fUWfHP7rAgxh8p0UOhD0vQBhweN9pc3MDsY7hbGRQi6zOSwna9G+/kZ0B05cAJsk4g8GF4oXebcf2FIG6ljFFy391r3mV8Upgn3YTsS3B5DmHcEiykZWP6tUf8E40MAZEbWvIBk0KkTJBr3tbP8MpVANmMwP9Kcs/RiYosCog3IBZyaTVGg6PMowELdo4gzeuWGmGeWQXvBcQJ2iipgydsu+FJ5WGvR/K3SEeOT+KOZM79fD/XDSRhW5QJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAaPcBGmIu56jitaASVjE7OlTxSlwkMKrqZZZbEzyosmTuYGH7MvScFaDxVB9KkqfmPE1/8FTjvU6b1nmJ/Af9Ne4JUjekS2Q+B7snXCaVtZHoEIkSYGA0OVGjFQrtIb2ZjlbCA9ZX393JvL+zQzf1/EBH9nz1EmJER3lJ5LAbKGB84O616RRy7t6Wnk+GNJUhxZL1GEC+efszp6LRHaCwlA//8Yo+7HwpRWUqSFtpt8XZBMQl32MEOhN9LlEXnhj4AMyQwJEE0+34BPuxPKBqwwo58P3kFW5ahq9BGHoSSkimtotR1J17OdAfLlVCH1mugUMJlxmz8Ie3DG3LURPFwA==\",\"cancellation_requested\":false,\"status\":\"completed\",\"target\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem\",\"request_id\":\"aeb22ac0750842a9863f43d049e1db6b\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:51 GMT", + "content-length" : "2391", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "62912587-ca4a-4a2e-95ce-68b69b4d2ea7", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"x5t\":\"bSPb4FA82jMarzsvK3yqMUB93GU\",\"cer\":\"MIIDMjCCAhqgAwIBAgIQf9T9DmA9QcGhQXvCLtWQAjANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDEwtUZXN0SmF2YVBlbTAeFw0xODA2MjUyMDMwMzlaFw0xOTA2MjUyMDQwMzlaMBYxFDASBgNVBAMTC1Rlc3RKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAny8i5sLm/0chtGNqPq9od5AoAhoO8cGCKatVpia5O2lb3iDpHLpi3jwdn/S0g80FVOjajezsLBG4T1bvHQ2vp7Igrsv31Fnxz+6wIMYfKdFDoQ9L0AYcHjfaXNzA7GO4WxkUIuszksJ2vRvv5GdAdOXACbJOIPBheKF3m3H9hSBupYxRct/da95lfFKYJ92E7EtweQ5h3BIspGVj+rVH/BONDAGRG1ryAZNCpEyQa97Wz/DKVQDZjMD/SnLP0YmKLAqINyAWcmk1RoOjzKMBC3aOIM3rlhphnlkF7wXECdooqYMnbLvhSeVhr0fyt0hHjk/ijmTO/Xw/1w0kYVuUCQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAU0lTOOFbZLp5QEKOHDHWliSUn8iAwHQYDVR0OBBYEFG7fj9k7AGS/LOdkE307A+h2HC7vMA0GCSqGSIb3DQEBCwUAA4IBAQBt+a2vMq0BTLah3qJXwuRVYRGm5wmTsMAuehRZeeYegO8lkCVc3xmwj3jQO6EV8th466EhAyjUc2g4yvrGhXJ4czRDKI7ZWSkfcS4YzMs4tMihg81pRo/pyziLcdy9kBebLLoCZ4P7OGy/fI26COi+uTUonfn1S4rMc6HqCR1i0L+rHvubyNOn4zh3D7ZlOJsPg4uQ5riktpNcvBRIbRDXMTjqOcJBFgsodkcZNhcO0K8UodY/nM2NicKkImso6sNrzZqHKDSEvqsKBx7f1cTXIKbdM6XxbxfTPLuCLldxkVkztzYJ2Jx5IX9fNZXV3JIMdE3gtczm3ZSCu9mF8zB4\",\"attributes\":{\"enabled\":true,\"nbf\":1529958639,\"exp\":1561495239,\"created\":1529959239,\"updated\":1529959239,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=TestJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529959236,\"updated\":1529959236}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:52 GMT", + "content-length" : "3356", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b78599a4-3a75-4eb8-ad96-b548325c6de6", + "Body" : "{\"value\":\"-----BEGIN PRIVATE KEY-----\\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCfLyLmwub/RyG0\\nY2o+r2h3kCgCGg7xwYIpq1WmJrk7aVveIOkcumLePB2f9LSDzQVU6NqN7OwsEbhP\\nVu8dDa+nsiCuy/fUWfHP7rAgxh8p0UOhD0vQBhweN9pc3MDsY7hbGRQi6zOSwna9\\nG+/kZ0B05cAJsk4g8GF4oXebcf2FIG6ljFFy391r3mV8Upgn3YTsS3B5DmHcEiyk\\nZWP6tUf8E40MAZEbWvIBk0KkTJBr3tbP8MpVANmMwP9Kcs/RiYosCog3IBZyaTVG\\ng6PMowELdo4gzeuWGmGeWQXvBcQJ2iipgydsu+FJ5WGvR/K3SEeOT+KOZM79fD/X\\nDSRhW5QJAgMBAAECggEASqHYbLXLhLtOX5tOuEYYJhp1z4p1ID64Lp4wYV59cQ/0\\nLQBkGv5+FTC9OP4LVlIc4lLsCSegEQdb0QLyx73fcbHPpfRmZO6os3L2q98HxFzj\\nJtObmVQMAdTw8aHkZ9BXIorvCHIas3+uGPrMrdsE+umu8DzjaYkaQer+P2ih0rSF\\nEJu6kA2rXoVQwxlEOIEY/Cd7aFvnJdySePDc9b75n+Jyofl+RYvndpo+66xwY75O\\nAsfnppYwy8iG0bwC5D1DUyyx97qWxf7hIhm1K11BXfGoCzSeaRQJ+uQA/SjJvrjC\\ntjjxtyhVtxBJxfL9H8k+D5Mgyi+DR6tkSKVwuKJagwKBgQDCna55QZmNDZHE4GQs\\n7yc0MB7UvmGkEhciX0R9tRo8WwlFQ8cWCExGv7Z44YWp85E6ipsNijbYQyEDwT5w\\nIt3JbspyLzaAlTCY0oplSBu79I1xhaKbQfXFXaLbNX1nCxRwMTLZvdjvOtKwyMf4\\n6DxJEqy5yZISNmzPooOLmrBkdwKBgQDRZIC7zfGZY4nQ9TqWag/DYSkTQVbq9NYd\\nsNlIOrvF3abXzFOXDkHBAKubTxCq32itdlq6iMvI6HfBwz5kNEqV3ZKPIHLNXCsC\\nP5HBahWpruc6mdbFuinb2BV38+9GjuZvX4JhgMu8HwLjK83L1kivyePZ0gfGxzJD\\nwHbfaARrfwKBgACJmPLCyJ7IG8/0YrJxEqWlQGCMCg7+8ctpgfHq7yCdi8ACOOmJ\\nqlRDsUhSLyFSB+OmgFkgOZiNTukIvphmsEAfKzX3hWoDf3fclP9EnLb/LOjUWqed\\nHgWmhY2fbzI6qJrKt/479P5sJirQ0ySP16LIB2wX72xXdCN6qmxXSAdvAoGAT9wX\\n6Qizoz++WS6eKK3M00RkKQ7beoLkgrBnPlAAO4e80UMBgnQSieyahoJSJglM4BNq\\nqQfxSO+4dPLlAcybwaqe8e17O21yjcn26iBuoKevUr9HlWPaARnZnkUvteZcZo+z\\np0I68cWWEVQsihhw4nKKbxHWm25vcj2eWLhQLzsCgYBzVkwqxpHKbrFRbwaA2mvy\\nTG+YcQ2BAxwDoTNMoTxd6Dpr7gJrMp0TP44D/GT1epQ5y/RIXidD9NEGHtNLNdyl\\nED5qpkf7KcJWX5bayv4J4GO69bKJ6Zc0s0AY407poT6YkocR6g5eooWhAnwy9+wu\\nOjGDOjclflakD2ZT72JpEQ==\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIIDMjCCAhqgAwIBAgIQf9T9DmA9QcGhQXvCLtWQAjANBgkqhkiG9w0BAQsFADAW\\nMRQwEgYDVQQDEwtUZXN0SmF2YVBlbTAeFw0xODA2MjUyMDMwMzlaFw0xOTA2MjUy\\nMDQwMzlaMBYxFDASBgNVBAMTC1Rlc3RKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEF\\nAAOCAQ8AMIIBCgKCAQEAny8i5sLm/0chtGNqPq9od5AoAhoO8cGCKatVpia5O2lb\\n3iDpHLpi3jwdn/S0g80FVOjajezsLBG4T1bvHQ2vp7Igrsv31Fnxz+6wIMYfKdFD\\noQ9L0AYcHjfaXNzA7GO4WxkUIuszksJ2vRvv5GdAdOXACbJOIPBheKF3m3H9hSBu\\npYxRct/da95lfFKYJ92E7EtweQ5h3BIspGVj+rVH/BONDAGRG1ryAZNCpEyQa97W\\nz/DKVQDZjMD/SnLP0YmKLAqINyAWcmk1RoOjzKMBC3aOIM3rlhphnlkF7wXECdoo\\nqYMnbLvhSeVhr0fyt0hHjk/ijmTO/Xw/1w0kYVuUCQIDAQABo3wwejAOBgNVHQ8B\\nAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH\\nAwIwHwYDVR0jBBgwFoAU0lTOOFbZLp5QEKOHDHWliSUn8iAwHQYDVR0OBBYEFG7f\\nj9k7AGS/LOdkE307A+h2HC7vMA0GCSqGSIb3DQEBCwUAA4IBAQBt+a2vMq0BTLah\\n3qJXwuRVYRGm5wmTsMAuehRZeeYegO8lkCVc3xmwj3jQO6EV8th466EhAyjUc2g4\\nyvrGhXJ4czRDKI7ZWSkfcS4YzMs4tMihg81pRo/pyziLcdy9kBebLLoCZ4P7OGy/\\nfI26COi+uTUonfn1S4rMc6HqCR1i0L+rHvubyNOn4zh3D7ZlOJsPg4uQ5riktpNc\\nvBRIbRDXMTjqOcJBFgsodkcZNhcO0K8UodY/nM2NicKkImso6sNrzZqHKDSEvqsK\\nBx7f1cTXIKbdM6XxbxfTPLuCLldxkVkztzYJ2Jx5IX9fNZXV3JIMdE3gtczm3ZSC\\nu9mF8zB4\\n-----END CERTIFICATE-----\\n\",\"contentType\":\"application/x-pem-file\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1529958639,\"exp\":1561495239,\"created\":1529959239,\"updated\":1529959239,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:53 GMT", + "content-length" : "2548", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "aa33ad02-0c89-4b6b-8caf-0e9f7ca31971", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPem\",\"deletedDate\":1529959253,\"scheduledPurgeDate\":1537735253,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"x5t\":\"bSPb4FA82jMarzsvK3yqMUB93GU\",\"cer\":\"MIIDMjCCAhqgAwIBAgIQf9T9DmA9QcGhQXvCLtWQAjANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDEwtUZXN0SmF2YVBlbTAeFw0xODA2MjUyMDMwMzlaFw0xOTA2MjUyMDQwMzlaMBYxFDASBgNVBAMTC1Rlc3RKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAny8i5sLm/0chtGNqPq9od5AoAhoO8cGCKatVpia5O2lb3iDpHLpi3jwdn/S0g80FVOjajezsLBG4T1bvHQ2vp7Igrsv31Fnxz+6wIMYfKdFDoQ9L0AYcHjfaXNzA7GO4WxkUIuszksJ2vRvv5GdAdOXACbJOIPBheKF3m3H9hSBupYxRct/da95lfFKYJ92E7EtweQ5h3BIspGVj+rVH/BONDAGRG1ryAZNCpEyQa97Wz/DKVQDZjMD/SnLP0YmKLAqINyAWcmk1RoOjzKMBC3aOIM3rlhphnlkF7wXECdooqYMnbLvhSeVhr0fyt0hHjk/ijmTO/Xw/1w0kYVuUCQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAU0lTOOFbZLp5QEKOHDHWliSUn8iAwHQYDVR0OBBYEFG7fj9k7AGS/LOdkE307A+h2HC7vMA0GCSqGSIb3DQEBCwUAA4IBAQBt+a2vMq0BTLah3qJXwuRVYRGm5wmTsMAuehRZeeYegO8lkCVc3xmwj3jQO6EV8th466EhAyjUc2g4yvrGhXJ4czRDKI7ZWSkfcS4YzMs4tMihg81pRo/pyziLcdy9kBebLLoCZ4P7OGy/fI26COi+uTUonfn1S4rMc6HqCR1i0L+rHvubyNOn4zh3D7ZlOJsPg4uQ5riktpNcvBRIbRDXMTjqOcJBFgsodkcZNhcO0K8UodY/nM2NicKkImso6sNrzZqHKDSEvqsKBx7f1cTXIKbdM6XxbxfTPLuCLldxkVkztzYJ2Jx5IX9fNZXV3JIMdE3gtczm3ZSCu9mF8zB4\",\"attributes\":{\"enabled\":true,\"nbf\":1529958639,\"exp\":1561495239,\"created\":1529959239,\"updated\":1529959239,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=TestJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529959236,\"updated\":1529959236}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:53 GMT", + "content-length" : "93", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "21ebe23b-bc66-40eb-9c24-6f8f6a30dd49", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: createTestJavaPem\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:40:54 GMT", + "content-length" : "101", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "da03ee97-601a-4aac-9896-9da2d9ef0ac5", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: createTestJavaPem\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:06 GMT", + "content-length" : "2548", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4fd4d8d3-2674-4a03-8c88-e24ec6073aaa", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPem\",\"deletedDate\":1529959253,\"scheduledPurgeDate\":1537735253,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPem/88bcd3f302bd46c58b18ba87b594bdf7\",\"x5t\":\"bSPb4FA82jMarzsvK3yqMUB93GU\",\"cer\":\"MIIDMjCCAhqgAwIBAgIQf9T9DmA9QcGhQXvCLtWQAjANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDEwtUZXN0SmF2YVBlbTAeFw0xODA2MjUyMDMwMzlaFw0xOTA2MjUyMDQwMzlaMBYxFDASBgNVBAMTC1Rlc3RKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAny8i5sLm/0chtGNqPq9od5AoAhoO8cGCKatVpia5O2lb3iDpHLpi3jwdn/S0g80FVOjajezsLBG4T1bvHQ2vp7Igrsv31Fnxz+6wIMYfKdFDoQ9L0AYcHjfaXNzA7GO4WxkUIuszksJ2vRvv5GdAdOXACbJOIPBheKF3m3H9hSBupYxRct/da95lfFKYJ92E7EtweQ5h3BIspGVj+rVH/BONDAGRG1ryAZNCpEyQa97Wz/DKVQDZjMD/SnLP0YmKLAqINyAWcmk1RoOjzKMBC3aOIM3rlhphnlkF7wXECdooqYMnbLvhSeVhr0fyt0hHjk/ijmTO/Xw/1w0kYVuUCQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAU0lTOOFbZLp5QEKOHDHWliSUn8iAwHQYDVR0OBBYEFG7fj9k7AGS/LOdkE307A+h2HC7vMA0GCSqGSIb3DQEBCwUAA4IBAQBt+a2vMq0BTLah3qJXwuRVYRGm5wmTsMAuehRZeeYegO8lkCVc3xmwj3jQO6EV8th466EhAyjUc2g4yvrGhXJ4czRDKI7ZWSkfcS4YzMs4tMihg81pRo/pyziLcdy9kBebLLoCZ4P7OGy/fI26COi+uTUonfn1S4rMc6HqCR1i0L+rHvubyNOn4zh3D7ZlOJsPg4uQ5riktpNcvBRIbRDXMTjqOcJBFgsodkcZNhcO0K8UodY/nM2NicKkImso6sNrzZqHKDSEvqsKBx7f1cTXIKbdM6XxbxfTPLuCLldxkVkztzYJ2Jx5IX9fNZXV3JIMdE3gtczm3ZSCu9mF8zB4\",\"attributes\":{\"enabled\":true,\"nbf\":1529958639,\"exp\":1561495239,\"created\":1529959239,\"updated\":1529959239,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=TestJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPemIssuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529959236,\"updated\":1529959236}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPem/pending\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:07 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "fe1bc27a-ba1b-4f23-a91b-ce27339b5aaa", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePkcs12ForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePkcs12ForCertificateOperationsTest.json new file mode 100644 index 0000000000000..a569a17af63c3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCertificatePkcs12ForCertificateOperationsTest.json @@ -0,0 +1,354 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:24 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e74fdd92-8f59-4a9e-b169-ceb6156be7f8", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:27 GMT", + "content-length" : "376", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d7bbf3cd-359b-4495-b8ea-b1686ec58487", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account1\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1504827149,\"updated\":1529958987}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:31 GMT", + "content-length" : "1343", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending?api-version=7.0&request_id=c15f4a8bbfe549c390bb16ab09dbcfa1", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "73f57557-30d8-4637-95e5-c12cb78e78b7", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\",\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"csr\":\"MIICqTCCAZECAQAwGTEXMBUGA1UEAxMOVGVzdEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4q86mx/vht2JI+A13YuyiOf/nO/LV4JQrG7XjoDMD9q+P2MHDuaHJz3FfzLwspSVIeCELCYyBNHQp1NctCg/Js9HoBpQ08xbs/4y6v4HbunkTg5jeORC1m+sh9WbK0HHZM5psNR9SYoeV0LsGk0dcqEyRXzU8WhoxiYDeZM4S6zCKtmvmPNQtRgjOmOoYF7E/P89wnvHs9rAhvvPA2lBfplhTC2xeRqXiARoctcUykbkTkpQ2KCWVzIm9thSBdZhIlOYAujVpZINBlxvrd2NKbZn8ITsXrNiDxdMOzvPX/FERaxO2EGswZv+KVWh3merYM9Fa+ezj8th2xIZBpQN1AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnK3UrFe7Lw/CVLjbaVEzyFuyruCJ1xJl0j6wD4wivt2dHS1gHYYCRQfIfAYF5/s7rMNjJB4ZG+DKuAoIXfjwb3eMC04Fr5Da9qDrn6H9s/Y65zkx1M445aeB27/BndvzYPyou6OKfmXmSfFIxgL5Bl6lA7YtF9nYwtI3+TahDDEM6X4A29SJAsIH5COwrLlmYA0x4ZtmsQWOMEynKhU4GU/UMb7lDmBJLSYAPe6NDmWUxF0QGuF99PfERkAXFfITWiTGml/6jS2G1vvgmdZUMHVwbegoSqENjVATJy9fbUMS39mhyRXHS0BUUEnfkQbTRuTHXkV4rQNV0h1hcshpCA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"c15f4a8bbfe549c390bb16ab09dbcfa1\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:32 GMT", + "content-length" : "1343", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1ba56c71-bea9-4c1f-8b81-74aebe65db0d", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\",\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"csr\":\"MIICqTCCAZECAQAwGTEXMBUGA1UEAxMOVGVzdEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4q86mx/vht2JI+A13YuyiOf/nO/LV4JQrG7XjoDMD9q+P2MHDuaHJz3FfzLwspSVIeCELCYyBNHQp1NctCg/Js9HoBpQ08xbs/4y6v4HbunkTg5jeORC1m+sh9WbK0HHZM5psNR9SYoeV0LsGk0dcqEyRXzU8WhoxiYDeZM4S6zCKtmvmPNQtRgjOmOoYF7E/P89wnvHs9rAhvvPA2lBfplhTC2xeRqXiARoctcUykbkTkpQ2KCWVzIm9thSBdZhIlOYAujVpZINBlxvrd2NKbZn8ITsXrNiDxdMOzvPX/FERaxO2EGswZv+KVWh3merYM9Fa+ezj8th2xIZBpQN1AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnK3UrFe7Lw/CVLjbaVEzyFuyruCJ1xJl0j6wD4wivt2dHS1gHYYCRQfIfAYF5/s7rMNjJB4ZG+DKuAoIXfjwb3eMC04Fr5Da9qDrn6H9s/Y65zkx1M445aeB27/BndvzYPyou6OKfmXmSfFIxgL5Bl6lA7YtF9nYwtI3+TahDDEM6X4A29SJAsIH5COwrLlmYA0x4ZtmsQWOMEynKhU4GU/UMb7lDmBJLSYAPe6NDmWUxF0QGuF99PfERkAXFfITWiTGml/6jS2G1vvgmdZUMHVwbegoSqENjVATJy9fbUMS39mhyRXHS0BUUEnfkQbTRuTHXkV4rQNV0h1hcshpCA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"c15f4a8bbfe549c390bb16ab09dbcfa1\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:44 GMT", + "content-length" : "1343", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "93d4d57d-5cd5-43ae-ad29-4856fcc43d52", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\",\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"csr\":\"MIICqTCCAZECAQAwGTEXMBUGA1UEAxMOVGVzdEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4q86mx/vht2JI+A13YuyiOf/nO/LV4JQrG7XjoDMD9q+P2MHDuaHJz3FfzLwspSVIeCELCYyBNHQp1NctCg/Js9HoBpQ08xbs/4y6v4HbunkTg5jeORC1m+sh9WbK0HHZM5psNR9SYoeV0LsGk0dcqEyRXzU8WhoxiYDeZM4S6zCKtmvmPNQtRgjOmOoYF7E/P89wnvHs9rAhvvPA2lBfplhTC2xeRqXiARoctcUykbkTkpQ2KCWVzIm9thSBdZhIlOYAujVpZINBlxvrd2NKbZn8ITsXrNiDxdMOzvPX/FERaxO2EGswZv+KVWh3merYM9Fa+ezj8th2xIZBpQN1AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnK3UrFe7Lw/CVLjbaVEzyFuyruCJ1xJl0j6wD4wivt2dHS1gHYYCRQfIfAYF5/s7rMNjJB4ZG+DKuAoIXfjwb3eMC04Fr5Da9qDrn6H9s/Y65zkx1M445aeB27/BndvzYPyou6OKfmXmSfFIxgL5Bl6lA7YtF9nYwtI3+TahDDEM6X4A29SJAsIH5COwrLlmYA0x4ZtmsQWOMEynKhU4GU/UMb7lDmBJLSYAPe6NDmWUxF0QGuF99PfERkAXFfITWiTGml/6jS2G1vvgmdZUMHVwbegoSqENjVATJy9fbUMS39mhyRXHS0BUUEnfkQbTRuTHXkV4rQNV0h1hcshpCA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"c15f4a8bbfe549c390bb16ab09dbcfa1\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:55 GMT", + "content-length" : "1270", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0bfa63b4-eb1d-4227-923f-207998d2c468", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\",\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"csr\":\"MIICqTCCAZECAQAwGTEXMBUGA1UEAxMOVGVzdEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4q86mx/vht2JI+A13YuyiOf/nO/LV4JQrG7XjoDMD9q+P2MHDuaHJz3FfzLwspSVIeCELCYyBNHQp1NctCg/Js9HoBpQ08xbs/4y6v4HbunkTg5jeORC1m+sh9WbK0HHZM5psNR9SYoeV0LsGk0dcqEyRXzU8WhoxiYDeZM4S6zCKtmvmPNQtRgjOmOoYF7E/P89wnvHs9rAhvvPA2lBfplhTC2xeRqXiARoctcUykbkTkpQ2KCWVzIm9thSBdZhIlOYAujVpZINBlxvrd2NKbZn8ITsXrNiDxdMOzvPX/FERaxO2EGswZv+KVWh3merYM9Fa+ezj8th2xIZBpQN1AgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnK3UrFe7Lw/CVLjbaVEzyFuyruCJ1xJl0j6wD4wivt2dHS1gHYYCRQfIfAYF5/s7rMNjJB4ZG+DKuAoIXfjwb3eMC04Fr5Da9qDrn6H9s/Y65zkx1M445aeB27/BndvzYPyou6OKfmXmSfFIxgL5Bl6lA7YtF9nYwtI3+TahDDEM6X4A29SJAsIH5COwrLlmYA0x4ZtmsQWOMEynKhU4GU/UMb7lDmBJLSYAPe6NDmWUxF0QGuF99PfERkAXFfITWiTGml/6jS2G1vvgmdZUMHVwbegoSqENjVATJy9fbUMS39mhyRXHS0BUUEnfkQbTRuTHXkV4rQNV0h1hcshpCA==\",\"cancellation_requested\":false,\"status\":\"completed\",\"target\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12\",\"request_id\":\"c15f4a8bbfe549c390bb16ab09dbcfa1\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:57 GMT", + "content-length" : "2418", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "635ae0b6-c95c-4f62-8640-1b36ca3ce8cd", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"x5t\":\"fUfw4DGjio1BqfdwQ7AK951i8Zk\",\"cer\":\"MIIDODCCAiCgAwIBAgIQFmqP0PPTRM6FBFX3cXaQZTANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDEw5UZXN0SmF2YVBrY3MxMjAeFw0xODA2MjUyMDI2NTFaFw0xOTA2MjUyMDM2NTFaMBkxFzAVBgNVBAMTDlRlc3RKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKvOpsf74bdiSPgNd2Lsojn/5zvy1eCUKxu146AzA/avj9jBw7mhyc9xX8y8LKUlSHghCwmMgTR0KdTXLQoPybPR6AaUNPMW7P+Mur+B27p5E4OY3jkQtZvrIfVmytBx2TOabDUfUmKHldC7BpNHXKhMkV81PFoaMYmA3mTOEuswirZr5jzULUYIzpjqGBexPz/PcJ7x7PawIb7zwNpQX6ZYUwtsXkal4gEaHLXFMpG5E5KUNigllcyJvbYUgXWYSJTmALo1aWSDQZcb63djSm2Z/CE7F6zYg8XTDs7z1/xREWsTthBrMGb/ilVod5nq2DPRWvns4/LYdsSGQaUDdQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUwghKbu/mgatv1mPyZik7IBwTsdgwHQYDVR0OBBYEFIqpy5Hq8S9KYnv97NIhcheyHb+DMA0GCSqGSIb3DQEBCwUAA4IBAQBOtplnWVtSddrIvUtnQ0T+SgFarJ8z8LATN10xFFn6WoN12FZJbLsLIgZ2X8XI8R8mzsxUoH97pTlodS6BIFUQEwSV6Md9MONqqnxcky87fAs0tc/dYPaU6e+xx0xqzle2EJu4pPNoe/vT4PoIFpixIec6T8X65wUgh1wl6IOElGNVen5GuteEfPJ7z2HedAPom3c0hU+ZHFWTkkRXvY+Bh83txI/SMAP16y+YhOhCAM4HqUg2sq+T5BFYZ79vSw1r+SODSqWtYNOjIGTEVhvhYSjaevodTHjKis9S+9xhvftZSzMadyts1tg6RZqrCH1Igqjq9Q1ujGZW1HLggwVX\",\"attributes\":{\"enabled\":true,\"nbf\":1529958411,\"exp\":1561495011,\"created\":1529959011,\"updated\":1529959011,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=TestJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529958991,\"updated\":1529958991}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:58 GMT", + "content-length" : "3952", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a2456f4d-093c-4cc1-96a5-a84c6d533844", + "Body" : "{\"value\":\"MIIKRAIBAzCCCgQGCSqGSIb3DQEHAaCCCfUEggnxMIIJ7TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAg8o5c5g7J6TwICB9AEggTYiGKSTwV0OrtVJrsTI2Yol5UdtQdqS435RsMHCkGv8ME+qKQBE06TVj0RvDGIdYLjG6jerTzZAqDZexlto+zNsbp5utTGIjnkdJ3mTs7B6NE6gPM1MEmoOm3oUaQh+Dw7mACNdz1YOsriqlb/FGLZ4bRUCmsKfVYirdsbUHCKyuWbm8sBiTVA41aIRPQGBxdjyzFFRFYJ0ZwUEkmCyCt9NhQaEYgBe6IqNdq62sjIdbLQce2IwjFDfIockwHkl0olLFyp5+xqMJO5QKsxF65iyorUmZ68fjlTyhTYbBrILihFSsYvdbVNIDHvVh6JP6VHyD6rfoeNm+qXsQvKRkAFpcs4ThhvuiJwi19xWE9qrft2FFkeooOaI5+fx33JJKmQ5ezT+9tqGabfzzxGQhmTwHVlEF6ahKOwRsQpPPD0rErYaUGXHAd4dWOtDt5VgE/hwME7Rfqe/HGIVyK7hJ9VcWTrI6n3hqfr6uR3Us8emkf7xCJbxVTdcyeoY0lAG0R1+lYg2a69u8d/hhLY2xE+BfEKNJL3804hWWob/arEN9JcEapSxnKdoAryJ7O2vzqDrCuuugb2hvAZvyIgxwzWpKyqdfhiP5dKM3lc09JWplko7iveIG8V8NELMHUV+LVlzOM+K45X1P6sXcofSsSweoDcmuywBLzu1usmlV7CKjt8Tqt81pkgR6JBIbBg0bP2klsgklVST616EjbXcPMfdRyNLa/NOGH7BS4uSgtGrlrZe0uPpQBts7UYkjs8GX07IEcVmH4bfVyiZE7zMYnEUyohPD8aJNKCN8FE2vIOqtB57QxyvDwRsdKVhsLhm5faLSj5oT7QdNWu1OGASg7clSBHSIdm3pZYp+Ga6BSAlbCqS6GIERSi8JiIq/pFbdLO78mAZ01+fJIN3+Qo95vjWLPe7JM1Bbz//0n5Zp0NUpum7AjnvFHh/Om6VhQfwelemaUhbD2kNfNIxGVGubXR6Fr07Vq5UUm9GvuQgaLDBdJ9m98iVxxQBLyOECMprRi4nTJczwwS7Q7ZJYXmRsJ5wvgp4s6dwnv0mcxevb07+G3f1vJ0Fm5b+q8ylchP3brm0M/A8lZdL5MT2FfM6rcxbjMNjq586kmj7xn8kETH0GmJ+zwgNgFmW0y823y5tBrLQ+lc7P/QH6P9+CP3IAXsMn7Sz0zGjs35/D03dIbYzdMf0EU3ssST6y4/KQtaeSNqqq4GjWDpxfVLTZvQoZ/Y4YQi4JGxUbOIxf56g55JMTXc/0AhVru1wKWRsqAfazZJvTmBG9rRk7pudxtSPUDQNVrbSaGCXK8IxQGzqWf7wzp/ohXFf5J55/fa0L/emJ5/bx9Yu5TFRhJJaEFKSrXexernVp7vs6rcfxrUhqh/q99KUiuQK1G7SxCvSJOVPHZLOxLrqZb3S6d91Qlgc8aNYXXpmXjlesYFnJfCRtHfNpwnMZ5YJKpox0nb5tNPKgxlxUQl/3wSTA8OZoH1/ghaIVu2Mlgpn2VOPJZS1KxCJ/iyaBQvLGs01teG7KLi3dZOA66sggfWiVJrbzLUdjH6OglG/W0IOMHpj69rlQMHEEkQDGhZPI6ZwXhEVuOyvYrIheCKgrqLPGjxaXZim13QkFi2mk+eoVPidoRe5fuGVC7rMCzEX5bkBDGB6TATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IADMAYwAxAGMAZgA1ADEAYgAtAGYAOABlADcALQA0AGUANgA0AC0AYgA1AGEAYQAtADAANwAwADAAOQA3ADgANQBkADQANAA2MHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDzwYJKoZIhvcNAQcGoIIDwDCCA7wCAQAwggO1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAgWR6MBt5KQiAICB9CAggOI7x1riy9+iM47LpKqv8F1OmmmELs2bLf2GKYmGmTdZtEyAz5dOsYWgLkeYMcK+fnpc5vujT3fJRLl7dRWluikjVI5eOJImq60xuuwDWYjShfoXYIDGO2aSQpZ31bjlYhNkPMaGXVdck/X7DTrcIwyFiAI8leFdG8VvyOt0+ymhNf1bAAZvjictow8nm8uABQxS1Kn2XZ286A/EmaQsT8Apy6fe/ugNLlQ7MgfarYAdhmxilO80R2ukw4lyePzYSJyjgWh0eTdDjpQQJrT97oz+cQkQ5TXKqVV1J9de8yjeAapULCYeztAPlAyP43mwHjjqV5OZOmvgZ4VFm/feIzMOXEYgcoRJd2uNTiGQkktI9dee6TR7wx/V9UKRFw8mC8a4EI9K9v6PnDu3pcyPLeUorx10W/WT/cniKvTBuCP9Nlxt1cZ3ikYKLQT+N6dmypaU6LuXb0fXWEfmv7cC+F38Oii5hfgBDoBF4YAVGPmHHAenCWpyjTZbMoLtdcDncTs1ojNAR/R0ZZd7SGzB9Onr6Rz2JqZbxCN/70c+hK3pFviufxDUzIr80ykTvlJrm+Q5XpAqv45Dr1Epxz38wmFAzX3W68LThfC+c56lrGvNPijmbL0JNWKEga6Fv/uNIE75MspKpQdbUDKx/PGlBXiiZqDgKaDEJo/qYIqx5Kib/Q0vDyCr1mx0Wq/A+k/jmyewZqRITFGQh7/JVf+crfe2sJQbMCwo8/AT+g09nI0XgOnI+l+a3dr8ymlSilsm8XCp+EHfkPoqFsm34nf0BevZ9on5+nOHMwTJyGw87ytWY6jFtazTTUc96iqB/Y1j5AiW+0GrKlLDgIDo8lhYOwvZR75B+uyeBV39uWoHQe47+DihZl/9qR1qWkQbbK80eYmB7xEUHO8VDkj2+81tlHeRA+9d88ARuRqSME3c0Ne9CMspXg/XassZqVXPeryOxwWIAqbzcg15vnsAQzw429FY2Ojx9EB5O2uXio2rMgcruJdqmI4jo42X2PAcQ2XFs0hEayYg0Ed2vKAQXE+e/CQGfzs2SscTSeaPj80Q3MKtNob2f3G3HP1D2sh4JHrxDWdzEQArJMz/qy2POlmuoFLnRQJ1jdCATbw3gU6VLPxDi/ggT3igBUwyCX5eldzkj21uAMTkpCT+TwOGGwM3yg+haR+1ch816XiBXs6bXIs03jsk1Q93LbTLTA3MB8wBwYFKw4DAhoEFBUzGWV1vQFSAjtey9okIuIDeTpQBBR8jLkhFJmG4hy4WeXl4CCxWJ2xpg==\",\"contentType\":\"application/x-pkcs12\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1529958411,\"exp\":1561495011,\"created\":1529959011,\"updated\":1529959011,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:59 GMT", + "content-length" : "2578", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0a79c785-73b7-4d8f-b2ce-de746d2dc09c", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPkcs12\",\"deletedDate\":1529959020,\"scheduledPurgeDate\":1537735020,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"x5t\":\"fUfw4DGjio1BqfdwQ7AK951i8Zk\",\"cer\":\"MIIDODCCAiCgAwIBAgIQFmqP0PPTRM6FBFX3cXaQZTANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDEw5UZXN0SmF2YVBrY3MxMjAeFw0xODA2MjUyMDI2NTFaFw0xOTA2MjUyMDM2NTFaMBkxFzAVBgNVBAMTDlRlc3RKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKvOpsf74bdiSPgNd2Lsojn/5zvy1eCUKxu146AzA/avj9jBw7mhyc9xX8y8LKUlSHghCwmMgTR0KdTXLQoPybPR6AaUNPMW7P+Mur+B27p5E4OY3jkQtZvrIfVmytBx2TOabDUfUmKHldC7BpNHXKhMkV81PFoaMYmA3mTOEuswirZr5jzULUYIzpjqGBexPz/PcJ7x7PawIb7zwNpQX6ZYUwtsXkal4gEaHLXFMpG5E5KUNigllcyJvbYUgXWYSJTmALo1aWSDQZcb63djSm2Z/CE7F6zYg8XTDs7z1/xREWsTthBrMGb/ilVod5nq2DPRWvns4/LYdsSGQaUDdQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUwghKbu/mgatv1mPyZik7IBwTsdgwHQYDVR0OBBYEFIqpy5Hq8S9KYnv97NIhcheyHb+DMA0GCSqGSIb3DQEBCwUAA4IBAQBOtplnWVtSddrIvUtnQ0T+SgFarJ8z8LATN10xFFn6WoN12FZJbLsLIgZ2X8XI8R8mzsxUoH97pTlodS6BIFUQEwSV6Md9MONqqnxcky87fAs0tc/dYPaU6e+xx0xqzle2EJu4pPNoe/vT4PoIFpixIec6T8X65wUgh1wl6IOElGNVen5GuteEfPJ7z2HedAPom3c0hU+ZHFWTkkRXvY+Bh83txI/SMAP16y+YhOhCAM4HqUg2sq+T5BFYZ79vSw1r+SODSqWtYNOjIGTEVhvhYSjaevodTHjKis9S+9xhvftZSzMadyts1tg6RZqrCH1Igqjq9Q1ujGZW1HLggwVX\",\"attributes\":{\"enabled\":true,\"nbf\":1529958411,\"exp\":1561495011,\"created\":1529959011,\"updated\":1529959011,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=TestJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529958991,\"updated\":1529958991}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:00 GMT", + "content-length" : "96", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c803b6d6-4eba-437f-b904-59635515bb09", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: createTestJavaPkcs12\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:01 GMT", + "content-length" : "104", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b05aaae2-bf42-458e-ad41-5551d5163ee7", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: createTestJavaPkcs12\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:13 GMT", + "content-length" : "2578", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "21cd89ee-1e05-4d01-98bb-f2e7cb2c46dc", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPkcs12\",\"deletedDate\":1529959020,\"scheduledPurgeDate\":1537735020,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createTestJavaPkcs12/db453f84c0b646e0967f1135a1ad702b\",\"x5t\":\"fUfw4DGjio1BqfdwQ7AK951i8Zk\",\"cer\":\"MIIDODCCAiCgAwIBAgIQFmqP0PPTRM6FBFX3cXaQZTANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDEw5UZXN0SmF2YVBrY3MxMjAeFw0xODA2MjUyMDI2NTFaFw0xOTA2MjUyMDM2NTFaMBkxFzAVBgNVBAMTDlRlc3RKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKvOpsf74bdiSPgNd2Lsojn/5zvy1eCUKxu146AzA/avj9jBw7mhyc9xX8y8LKUlSHghCwmMgTR0KdTXLQoPybPR6AaUNPMW7P+Mur+B27p5E4OY3jkQtZvrIfVmytBx2TOabDUfUmKHldC7BpNHXKhMkV81PFoaMYmA3mTOEuswirZr5jzULUYIzpjqGBexPz/PcJ7x7PawIb7zwNpQX6ZYUwtsXkal4gEaHLXFMpG5E5KUNigllcyJvbYUgXWYSJTmALo1aWSDQZcb63djSm2Z/CE7F6zYg8XTDs7z1/xREWsTthBrMGb/ilVod5nq2DPRWvns4/LYdsSGQaUDdQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUwghKbu/mgatv1mPyZik7IBwTsdgwHQYDVR0OBBYEFIqpy5Hq8S9KYnv97NIhcheyHb+DMA0GCSqGSIb3DQEBCwUAA4IBAQBOtplnWVtSddrIvUtnQ0T+SgFarJ8z8LATN10xFFn6WoN12FZJbLsLIgZ2X8XI8R8mzsxUoH97pTlodS6BIFUQEwSV6Md9MONqqnxcky87fAs0tc/dYPaU6e+xx0xqzle2EJu4pPNoe/vT4PoIFpixIec6T8X65wUgh1wl6IOElGNVen5GuteEfPJ7z2HedAPom3c0hU+ZHFWTkkRXvY+Bh83txI/SMAP16y+YhOhCAM4HqUg2sq+T5BFYZ79vSw1r+SODSqWtYNOjIGTEVhvhYSjaevodTHjKis9S+9xhvftZSzMadyts1tg6RZqrCH1Igqjq9Q1ujGZW1HLggwVX\",\"attributes\":{\"enabled\":true,\"nbf\":1529958411,\"exp\":1561495011,\"created\":1529959011,\"updated\":1529959011,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=TestJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"createCertificateJavaPkcs12Issuer01\"},\"attributes\":{\"enabled\":true,\"created\":1529958991,\"updated\":1529958991}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createTestJavaPkcs12/pending\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createTestJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:15 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "edeef58a-7aa2-4472-9298-2e3d6b0938d0", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCsrForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCsrForCertificateOperationsTest.json new file mode 100644 index 0000000000000..ae7b54df16fd4 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createCsrForCertificateOperationsTest.json @@ -0,0 +1,219 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:27 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a0f34146-5a20-40d9-8806-1eb5bf6c49d7", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:30 GMT", + "content-length" : "1259", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/pending?api-version=7.0&request_id=f2caef2d83a84c4e8bebf94d982e0852", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0f5438ad-4f89-47a9-a589-98da9e341b43", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/pending\",\"issuer\":{\"name\":\"Unknown\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUTWFudWFsRW5yb2xsbWVudEphdmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgqgzEAxG0KxQGeHiqsCsI1EA6jE4nxqHLC834D+zJVeXdSBZeO2ZfI9XL8y0ziklbknBE8cphgB2eTmrQmUF2tx0iM1v5jgaI7QcZ1TwmnbFiOWrfYCGs9zIAYDRZt5MwlFbO53B/YIWV2iXWpxTNW+cuhXl60fHdWtLLvGxIjEn3400sdS8nRkf6IzTH3aCjyAGR735WfnuBPUQi6SR5cQaGeC7llNgX/crmtlizjqkjlw/ywa9ZwHGw/8ISPTe/ExJCsjjYdlNG5imzSYgAl3PYclOiUBtl+Q2J90xM+QCXx6MfIKvXKvPYlgvRTtWR/0Aec//FbcNz97/f4jczAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAFr37WCz2JCGcLKVaw6db4LZ1/2EBBSDErQciUEESOYu5MFzeO87g/SK1a0D5/p680YRu0CxYsUXSWoFIsudHjkzTo0HRQw/Gu9HRzPSygnw0TwWAOLqaWLIjdCrCtkBbtWynBXCA/UucgAGbFBaNhQ4851hybgZerU+UMoZESdf/SoJGJChUW7x4Gu+xirgsI04QgACAGU/mWOFnlVkN5xjTdM8rqswgqMwPfp8Uf9Mkf8+sXMLNf52N+erX1WV6ERTKYi/50MyIe/oLQrqY2I7B8CMGJuNNWoqnUAAxiiMImd3db7hl/4C3V81/agiigfjW6Iw5iVeDe0/QNApNJA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Please Perform Merge to complete the request.\",\"request_id\":\"f2caef2d83a84c4e8bebf94d982e0852\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:31 GMT", + "content-length" : "924", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/pkcs10; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "73be7c6d-4e36-4c12-9cea-3e6c0faa0bbd", + "Body" : "MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUTWFudWFsRW5yb2xsbWVudEphdmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgqgzEAxG0KxQGeHiqsCsI1EA6jE4nxqHLC834D+zJVeXdSBZeO2ZfI9XL8y0ziklbknBE8cphgB2eTmrQmUF2tx0iM1v5jgaI7QcZ1TwmnbFiOWrfYCGs9zIAYDRZt5MwlFbO53B/YIWV2iXWpxTNW+cuhXl60fHdWtLLvGxIjEn3400sdS8nRkf6IzTH3aCjyAGR735WfnuBPUQi6SR5cQaGeC7llNgX/crmtlizjqkjlw/ywa9ZwHGw/8ISPTe/ExJCsjjYdlNG5imzSYgAl3PYclOiUBtl+Q2J90xM+QCXx6MfIKvXKvPYlgvRTtWR/0Aec//FbcNz97/f4jczAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAFr37WCz2JCGcLKVaw6db4LZ1/2EBBSDErQciUEESOYu5MFzeO87g/SK1a0D5/p680YRu0CxYsUXSWoFIsudHjkzTo0HRQw/Gu9HRzPSygnw0TwWAOLqaWLIjdCrCtkBbtWynBXCA/UucgAGbFBaNhQ4851hybgZerU+UMoZESdf/SoJGJChUW7x4Gu+xirgsI04QgACAGU/mWOFnlVkN5xjTdM8rqswgqMwPfp8Uf9Mkf8+sXMLNf52N+erX1WV6ERTKYi/50MyIe/oLQrqY2I7B8CMGJuNNWoqnUAAxiiMImd3db7hl/4C3V81/agiigfjW6Iw5iVeDe0/QNApNJA==" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:35 GMT", + "content-length" : "1205", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "578aac55-8fca-4e26-85e3-0652d565f2d2", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createManualEnrollmentJava\",\"deletedDate\":1529959295,\"scheduledPurgeDate\":1537735295,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/b404ced3cc4d4bb29b4e478a6ef92395\",\"attributes\":{\"enabled\":false,\"nbf\":1529958690,\"exp\":1561495290,\"created\":1529959290,\"updated\":1529959290,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=ManualEnrollmentJava\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959290,\"updated\":1529959290}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createManualEnrollmentJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:38 GMT", + "content-length" : "110", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b60ecaac-5df4-4627-a22d-06362f652b63", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: createManualEnrollmentJava\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createManualEnrollmentJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:49 GMT", + "content-length" : "1205", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6eecc755-9bf8-44a9-ac07-a556d66323f2", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createManualEnrollmentJava\",\"deletedDate\":1529959295,\"scheduledPurgeDate\":1537735295,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/b404ced3cc4d4bb29b4e478a6ef92395\",\"attributes\":{\"enabled\":false,\"nbf\":1529958690,\"exp\":1561495290,\"created\":1529959290,\"updated\":1529959290,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=ManualEnrollmentJava\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959290,\"updated\":1529959290}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createManualEnrollmentJava/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:49 GMT", + "content-length" : "102", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b36c1004-1223-4d39-9275-e5bba9ad2300", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: createManualEnrollmentJava\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createManualEnrollmentJava?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:41:51 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c374d284-521e-482d-8650-d99ecef6fe27", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json new file mode 100644 index 0000000000000..a6f59ad326f4b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json @@ -0,0 +1,300 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:37 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6a8a1d9b-8dbe-43fd-a505-aaa027eb670b", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:41 GMT", + "content-length" : "1313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending?api-version=7.0&request_id=9a1c2f6199a9412a8ff05a0733dd1aca", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e48eb61a-c2ac-483e-8ea0-e9cd569268a8", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrDCCAZQCAQAwHDEaMBgGA1UEAxMRU2VsZlNpZ25lZEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCyd9kXpYdEAp8bFC90eXhWxpZlKiQqx31hMEaEJvMmGZO+ejmGELYFaJ45Yh/NTCsl/iGqerAvl/H6qcZ+E/VERTLTgiGwxP5Ap5gAyoAY9M7clm8gkSWGd68To/OPU6qZU6UUTnVmvAi4Q6j7CfsMasZPZFtc+1kvO/LekgoTedsMatG1bURMJlRrsOthrtE9SZ01et1eVrKlOudTpkMK2xO0QFp6TBsdMRioWSTlISE826oXqHHhuHYUdZbvMwhjzlkY+gPBJkQxjuiUxbX6hqrR7FkSJ+mTW9ZVtHnQgADzjQUfc6uMUF+0AtjkfM/24oR5UvfkEG5qA1M3BzSZAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAT8UT7y0bAveoRY+wlRY4kFkrgrPIxSxI5kNO6A+D92jktSYDlr4VA+PpANJDGHKVpGpduLyY4QwKCRiXvND4kzZXy3gC/VyJwQYIR4BX11e6rn4/1tksiEYhE9pHVdpDRY42vxgju65sMl3Xh0Kh9esb2zuUaSnKlhb98iK5hlPHzrIN0GlBs1gEl0BBZq7jp0Pavl0zkUnnW7Z6hONB4X+IUnk/GaJ8ZpNunJu+tcAmpCdfDKTY26TyeDwTdrKatr7q0pq9SG9Rf0CSmb+GVaIjIewCPkuMZS7ZmSsnMdmhotCQlNcsegxMBpsi5NU6NXqDVJbtIdqqyDhFiltfaQ==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"9a1c2f6199a9412a8ff05a0733dd1aca\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:43 GMT", + "content-length" : "1313", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b4c7f660-46c8-46fc-b639-1316e6c4c094", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrDCCAZQCAQAwHDEaMBgGA1UEAxMRU2VsZlNpZ25lZEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCyd9kXpYdEAp8bFC90eXhWxpZlKiQqx31hMEaEJvMmGZO+ejmGELYFaJ45Yh/NTCsl/iGqerAvl/H6qcZ+E/VERTLTgiGwxP5Ap5gAyoAY9M7clm8gkSWGd68To/OPU6qZU6UUTnVmvAi4Q6j7CfsMasZPZFtc+1kvO/LekgoTedsMatG1bURMJlRrsOthrtE9SZ01et1eVrKlOudTpkMK2xO0QFp6TBsdMRioWSTlISE826oXqHHhuHYUdZbvMwhjzlkY+gPBJkQxjuiUxbX6hqrR7FkSJ+mTW9ZVtHnQgADzjQUfc6uMUF+0AtjkfM/24oR5UvfkEG5qA1M3BzSZAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAT8UT7y0bAveoRY+wlRY4kFkrgrPIxSxI5kNO6A+D92jktSYDlr4VA+PpANJDGHKVpGpduLyY4QwKCRiXvND4kzZXy3gC/VyJwQYIR4BX11e6rn4/1tksiEYhE9pHVdpDRY42vxgju65sMl3Xh0Kh9esb2zuUaSnKlhb98iK5hlPHzrIN0GlBs1gEl0BBZq7jp0Pavl0zkUnnW7Z6hONB4X+IUnk/GaJ8ZpNunJu+tcAmpCdfDKTY26TyeDwTdrKatr7q0pq9SG9Rf0CSmb+GVaIjIewCPkuMZS7ZmSsnMdmhotCQlNcsegxMBpsi5NU6NXqDVJbtIdqqyDhFiltfaQ==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"9a1c2f6199a9412a8ff05a0733dd1aca\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:53 GMT", + "content-length" : "1237", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b63c95e4-d74c-48d6-abe5-95b9ec9f836e", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrDCCAZQCAQAwHDEaMBgGA1UEAxMRU2VsZlNpZ25lZEphdmFQZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCyd9kXpYdEAp8bFC90eXhWxpZlKiQqx31hMEaEJvMmGZO+ejmGELYFaJ45Yh/NTCsl/iGqerAvl/H6qcZ+E/VERTLTgiGwxP5Ap5gAyoAY9M7clm8gkSWGd68To/OPU6qZU6UUTnVmvAi4Q6j7CfsMasZPZFtc+1kvO/LekgoTedsMatG1bURMJlRrsOthrtE9SZ01et1eVrKlOudTpkMK2xO0QFp6TBsdMRioWSTlISE826oXqHHhuHYUdZbvMwhjzlkY+gPBJkQxjuiUxbX6hqrR7FkSJ+mTW9ZVtHnQgADzjQUfc6uMUF+0AtjkfM/24oR5UvfkEG5qA1M3BzSZAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAT8UT7y0bAveoRY+wlRY4kFkrgrPIxSxI5kNO6A+D92jktSYDlr4VA+PpANJDGHKVpGpduLyY4QwKCRiXvND4kzZXy3gC/VyJwQYIR4BX11e6rn4/1tksiEYhE9pHVdpDRY42vxgju65sMl3Xh0Kh9esb2zuUaSnKlhb98iK5hlPHzrIN0GlBs1gEl0BBZq7jp0Pavl0zkUnnW7Z6hONB4X+IUnk/GaJ8ZpNunJu+tcAmpCdfDKTY26TyeDwTdrKatr7q0pq9SG9Rf0CSmb+GVaIjIewCPkuMZS7ZmSsnMdmhotCQlNcsegxMBpsi5NU6NXqDVJbtIdqqyDhFiltfaQ==\",\"cancellation_requested\":false,\"status\":\"completed\",\"target\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem\",\"request_id\":\"9a1c2f6199a9412a8ff05a0733dd1aca\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:54 GMT", + "content-length" : "2385", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "83851e8c-ecef-4809-9e1b-0490ad6820b0", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"x5t\":\"KnlJ2_j6yD9ZRy39d6WbSXhCR9Y\",\"cer\":\"MIIDPjCCAiagAwIBAgIQMQE1Kme+SLe/rFhCWlN6nDANBgkqhkiG9w0BAQsFADAcMRowGAYDVQQDExFTZWxmU2lnbmVkSmF2YVBlbTAeFw0xODA2MjUyMDM0NDlaFw0xOTA2MjUyMDQ0NDlaMBwxGjAYBgNVBAMTEVNlbGZTaWduZWRKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsnfZF6WHRAKfGxQvdHl4VsaWZSokKsd9YTBGhCbzJhmTvno5hhC2BWieOWIfzUwrJf4hqnqwL5fx+qnGfhP1REUy04IhsMT+QKeYAMqAGPTO3JZvIJElhnevE6Pzj1OqmVOlFE51ZrwIuEOo+wn7DGrGT2RbXPtZLzvy3pIKE3nbDGrRtW1ETCZUa7DrYa7RPUmdNXrdXlaypTrnU6ZDCtsTtEBaekwbHTEYqFkk5SEhPNuqF6hx4bh2FHWW7zMIY85ZGPoDwSZEMY7olMW1+oaq0exZEifpk1vWVbR50IAA840FH3OrjFBftALY5HzP9uKEeVL35BBuagNTNwc0mQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUmdOum0ntfOsgxdbHizaG4DCjMSEwHQYDVR0OBBYEFJnTrptJ7XzrIMXWx4s2huAwozEhMA0GCSqGSIb3DQEBCwUAA4IBAQBcMAm7qZ6rzrZ9RpGdJpdDbgvxH3gZojieXXuLR+4rnqNd/TRMhgd/QQZwqzxiqEtyKHN3lVFAuS7lB/m3f37GI6VW2u0avruIXu/J5QDtGS/cCcg2W0uA0yIi4Y6IrIGkp3NNsDx32VIObnv0nP/CniHKjA64BdXZN0rTK84281mI/LeVSUWNDgrkEVbFuP5qZriJqHi2uZB10vXZnfPp9N4M0lcm9ETooBTDLrNYCaCBagNrIfTqWIk8NlJNdCVxpyD1NRJSjkrUADLNJT4aDETBiwRXe7Xkv2KShlTIzjzlXb0sJqg5/oHladvAxlkKv2bN4cNGWL6uXIXBIfT1\",\"attributes\":{\"enabled\":true,\"nbf\":1529958889,\"exp\":1561495489,\"created\":1529959489,\"updated\":1529959489,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959481,\"updated\":1529959481}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/SelfSignedJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:57 GMT", + "content-length" : "3376", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8900c07b-fd73-4a75-b98d-e846ad5de0c0", + "Body" : "{\"value\":\"-----BEGIN PRIVATE KEY-----\\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCyd9kXpYdEAp8b\\nFC90eXhWxpZlKiQqx31hMEaEJvMmGZO+ejmGELYFaJ45Yh/NTCsl/iGqerAvl/H6\\nqcZ+E/VERTLTgiGwxP5Ap5gAyoAY9M7clm8gkSWGd68To/OPU6qZU6UUTnVmvAi4\\nQ6j7CfsMasZPZFtc+1kvO/LekgoTedsMatG1bURMJlRrsOthrtE9SZ01et1eVrKl\\nOudTpkMK2xO0QFp6TBsdMRioWSTlISE826oXqHHhuHYUdZbvMwhjzlkY+gPBJkQx\\njuiUxbX6hqrR7FkSJ+mTW9ZVtHnQgADzjQUfc6uMUF+0AtjkfM/24oR5UvfkEG5q\\nA1M3BzSZAgMBAAECggEABbf5aNyQ/QjoeEGpU54g0QcEArHa/tPtnJOjbtCgsfPX\\n3B6mgTk/2+SCTWxrgHSUXV9LTN8pjhzcUB/okFmrXkipXEWrNrLZQtEb+cqDWElf\\n54maffyoqypincp/H3Sa3tbjT0dEU8pqrRzd6U1kkf1J5XldxBj5vp25JpCfaghL\\nyzp3un9VIQMXOWduCNwvfVwLEekx7/Wrqv9FaHwBddNI6QVz2ueHEcqWBzcF9BxA\\nwQn3OW14QG5MUroVtjowMa86eJEAWXxunfkIaVoNdOKzklRDPb+TPhQgvR6NFr4Z\\nI7IdShOIZpZnDe7fCv0wKAUrta4apvdAjtwnNKc7QQKBgQDs54BVd6VAEVC34KnG\\nvPoewNjewpwcM4H4Kgd3SDFK/ZaCiWkmvm+a9JBHlUZ2Smq8MHakLQwlnb35f9aF\\nXqjPY+vEGLMxrAWFg3rvW4pUygbdK/bG0UVuEnzFIzHIodXFAvJYaJdIEJ3uTjbo\\nmSsLOE8FjJeibtGym9q6HftdpQKBgQDA2oWs4rYFKb2weaM/6iortwL6MAi1Ut0Q\\nOIbFaGt3lbXZTDLEg19t9L0e376rS+/UEW1H0ahInto2PQtEPStUUlz0mXQOu0+L\\nL9POBbtH9nQLc0RfyJZLBwsY2OALuMKhJVum1vGKuMuZV2vCOzMnGJ+4HcKbi3GB\\nCJYPfa+w5QKBgQCqI3ykZQAWKhlZZY0owPG1AnT+Tq/FBSzzaGPiQ8O7ArKEX2FY\\nRO5sT/YKoudu7vUG4JtkP0H5Bfe45xnOwPPltfJN7BtNsihpActZedm4GTuivf9G\\nPGdrrPVUs3j+iVO4YOxhmAQF6oEx85Q1qkMilLcT2ivQqVwKtSn5/qxXTQKBgQCB\\nQ/fF4lBPNaNH3sBl3vdVRd5hBEFSCLDUZo8vUsZ16Ytyk3iT79rPQPRi9WZAOy4N\\n34B4WzeJNbDeGhyrKLUaV/qmmRUJqtOuX+iAd6cInVE7O4/hA/p5X8c4aGYEdVs/\\n2GKOehR8/1C4/7fjAPtQgVjNeGUxDU6PRsoOqBhTYQKBgQDFPpdNSVuykKJ+llxU\\nEFnDnGmrljTMzSxVsaxw/zPod0ZQCoTNcH+AnWr8JAjaNJq23OPQ2j+MwwmuQ04R\\nTTFXt1aJpb043KtozgylZC+pO0S7ic2W0NfD9wftMUtRlDTv7T1o08dkfeiGco9Z\\nlKX6asy68LPHeXFbc14ZuEBN7g==\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIIDPjCCAiagAwIBAgIQMQE1Kme+SLe/rFhCWlN6nDANBgkqhkiG9w0BAQsFADAc\\nMRowGAYDVQQDExFTZWxmU2lnbmVkSmF2YVBlbTAeFw0xODA2MjUyMDM0NDlaFw0x\\nOTA2MjUyMDQ0NDlaMBwxGjAYBgNVBAMTEVNlbGZTaWduZWRKYXZhUGVtMIIBIjAN\\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsnfZF6WHRAKfGxQvdHl4VsaWZSok\\nKsd9YTBGhCbzJhmTvno5hhC2BWieOWIfzUwrJf4hqnqwL5fx+qnGfhP1REUy04Ih\\nsMT+QKeYAMqAGPTO3JZvIJElhnevE6Pzj1OqmVOlFE51ZrwIuEOo+wn7DGrGT2Rb\\nXPtZLzvy3pIKE3nbDGrRtW1ETCZUa7DrYa7RPUmdNXrdXlaypTrnU6ZDCtsTtEBa\\nekwbHTEYqFkk5SEhPNuqF6hx4bh2FHWW7zMIY85ZGPoDwSZEMY7olMW1+oaq0exZ\\nEifpk1vWVbR50IAA840FH3OrjFBftALY5HzP9uKEeVL35BBuagNTNwc0mQIDAQAB\\no3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEF\\nBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUmdOum0ntfOsgxdbHizaG4DCjMSEw\\nHQYDVR0OBBYEFJnTrptJ7XzrIMXWx4s2huAwozEhMA0GCSqGSIb3DQEBCwUAA4IB\\nAQBcMAm7qZ6rzrZ9RpGdJpdDbgvxH3gZojieXXuLR+4rnqNd/TRMhgd/QQZwqzxi\\nqEtyKHN3lVFAuS7lB/m3f37GI6VW2u0avruIXu/J5QDtGS/cCcg2W0uA0yIi4Y6I\\nrIGkp3NNsDx32VIObnv0nP/CniHKjA64BdXZN0rTK84281mI/LeVSUWNDgrkEVbF\\nuP5qZriJqHi2uZB10vXZnfPp9N4M0lcm9ETooBTDLrNYCaCBagNrIfTqWIk8NlJN\\ndCVxpyD1NRJSjkrUADLNJT4aDETBiwRXe7Xkv2KShlTIzjzlXb0sJqg5/oHladvA\\nxlkKv2bN4cNGWL6uXIXBIfT1\\n-----END CERTIFICATE-----\\n\",\"contentType\":\"application/x-pem-file\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1529958889,\"exp\":1561495489,\"created\":1529959489,\"updated\":1529959489,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:58 GMT", + "content-length" : "2542", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b98a4940-9a18-4844-9f0d-26349229c9e8", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/SelfSignedJavaPem\",\"deletedDate\":1529959498,\"scheduledPurgeDate\":1537735498,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"x5t\":\"KnlJ2_j6yD9ZRy39d6WbSXhCR9Y\",\"cer\":\"MIIDPjCCAiagAwIBAgIQMQE1Kme+SLe/rFhCWlN6nDANBgkqhkiG9w0BAQsFADAcMRowGAYDVQQDExFTZWxmU2lnbmVkSmF2YVBlbTAeFw0xODA2MjUyMDM0NDlaFw0xOTA2MjUyMDQ0NDlaMBwxGjAYBgNVBAMTEVNlbGZTaWduZWRKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsnfZF6WHRAKfGxQvdHl4VsaWZSokKsd9YTBGhCbzJhmTvno5hhC2BWieOWIfzUwrJf4hqnqwL5fx+qnGfhP1REUy04IhsMT+QKeYAMqAGPTO3JZvIJElhnevE6Pzj1OqmVOlFE51ZrwIuEOo+wn7DGrGT2RbXPtZLzvy3pIKE3nbDGrRtW1ETCZUa7DrYa7RPUmdNXrdXlaypTrnU6ZDCtsTtEBaekwbHTEYqFkk5SEhPNuqF6hx4bh2FHWW7zMIY85ZGPoDwSZEMY7olMW1+oaq0exZEifpk1vWVbR50IAA840FH3OrjFBftALY5HzP9uKEeVL35BBuagNTNwc0mQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUmdOum0ntfOsgxdbHizaG4DCjMSEwHQYDVR0OBBYEFJnTrptJ7XzrIMXWx4s2huAwozEhMA0GCSqGSIb3DQEBCwUAA4IBAQBcMAm7qZ6rzrZ9RpGdJpdDbgvxH3gZojieXXuLR+4rnqNd/TRMhgd/QQZwqzxiqEtyKHN3lVFAuS7lB/m3f37GI6VW2u0avruIXu/J5QDtGS/cCcg2W0uA0yIi4Y6IrIGkp3NNsDx32VIObnv0nP/CniHKjA64BdXZN0rTK84281mI/LeVSUWNDgrkEVbFuP5qZriJqHi2uZB10vXZnfPp9N4M0lcm9ETooBTDLrNYCaCBagNrIfTqWIk8NlJNdCVxpyD1NRJSjkrUADLNJT4aDETBiwRXe7Xkv2KShlTIzjzlXb0sJqg5/oHladvAxlkKv2bN4cNGWL6uXIXBIfT1\",\"attributes\":{\"enabled\":true,\"nbf\":1529958889,\"exp\":1561495489,\"created\":1529959489,\"updated\":1529959489,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959481,\"updated\":1529959481}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:44:59 GMT", + "content-length" : "93", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "226d04f8-0a32-4e3c-994c-28023f337f07", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: SelfSignedJavaPem\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/SelfSignedJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:45:02 GMT", + "content-length" : "101", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c4c3f40c-4a46-4c37-816c-49762c6f2ad2", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: SelfSignedJavaPem\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/SelfSignedJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:45:14 GMT", + "content-length" : "2542", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5fe3760a-853e-4c17-9244-1e6ed78f9234", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/SelfSignedJavaPem\",\"deletedDate\":1529959498,\"scheduledPurgeDate\":1537735498,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/SelfSignedJavaPem/1b06fdbadbc94641a2f3314b582f6b7f\",\"x5t\":\"KnlJ2_j6yD9ZRy39d6WbSXhCR9Y\",\"cer\":\"MIIDPjCCAiagAwIBAgIQMQE1Kme+SLe/rFhCWlN6nDANBgkqhkiG9w0BAQsFADAcMRowGAYDVQQDExFTZWxmU2lnbmVkSmF2YVBlbTAeFw0xODA2MjUyMDM0NDlaFw0xOTA2MjUyMDQ0NDlaMBwxGjAYBgNVBAMTEVNlbGZTaWduZWRKYXZhUGVtMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsnfZF6WHRAKfGxQvdHl4VsaWZSokKsd9YTBGhCbzJhmTvno5hhC2BWieOWIfzUwrJf4hqnqwL5fx+qnGfhP1REUy04IhsMT+QKeYAMqAGPTO3JZvIJElhnevE6Pzj1OqmVOlFE51ZrwIuEOo+wn7DGrGT2RbXPtZLzvy3pIKE3nbDGrRtW1ETCZUa7DrYa7RPUmdNXrdXlaypTrnU6ZDCtsTtEBaekwbHTEYqFkk5SEhPNuqF6hx4bh2FHWW7zMIY85ZGPoDwSZEMY7olMW1+oaq0exZEifpk1vWVbR50IAA840FH3OrjFBftALY5HzP9uKEeVL35BBuagNTNwc0mQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUmdOum0ntfOsgxdbHizaG4DCjMSEwHQYDVR0OBBYEFJnTrptJ7XzrIMXWx4s2huAwozEhMA0GCSqGSIb3DQEBCwUAA4IBAQBcMAm7qZ6rzrZ9RpGdJpdDbgvxH3gZojieXXuLR+4rnqNd/TRMhgd/QQZwqzxiqEtyKHN3lVFAuS7lB/m3f37GI6VW2u0avruIXu/J5QDtGS/cCcg2W0uA0yIi4Y6IrIGkp3NNsDx32VIObnv0nP/CniHKjA64BdXZN0rTK84281mI/LeVSUWNDgrkEVbFuP5qZriJqHi2uZB10vXZnfPp9N4M0lcm9ETooBTDLrNYCaCBagNrIfTqWIk8NlJNdCVxpyD1NRJSjkrUADLNJT4aDETBiwRXe7Xkv2KShlTIzjzlXb0sJqg5/oHladvAxlkKv2bN4cNGWL6uXIXBIfT1\",\"attributes\":{\"enabled\":true,\"nbf\":1529958889,\"exp\":1561495489,\"created\":1529959489,\"updated\":1529959489,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pem-file\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPem\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959481,\"updated\":1529959481}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/SelfSignedJavaPem/pending\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/SelfSignedJavaPem?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:45:19 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a9a9e1b1-296b-4b0f-a235-08cbf70b6516", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePkcs12ForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePkcs12ForCertificateOperationsTest.json new file mode 100644 index 0000000000000..a7bbc1fc5a362 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/createSelfSignedCertificatePkcs12ForCertificateOperationsTest.json @@ -0,0 +1,354 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:43 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "afabb736-8218-4d8c-b329-a293ef539a4e", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:45 GMT", + "content-length" : "1326", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "location" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending?api-version=7.0&request_id=448c82bd75404f79a69178bc29097cf2", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "da0d60e4-d504-4850-a308-8d35e793621b", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrUssWRdIge64A9WiJm66RQyXzh8MU4lpSZ3JRpWMjwZlfAFeIsePeois0q0NS7ig96nWie9t80MveLtA/KrDf+IzAcMbFslKXw3DTHOp74DWiWID7pwvZvGJVGkhTAkkYjcS7TFTe6CMOayI+p0ykg+4Lqos6Gb3IJSTaCf0verghoxIFPQfl9PeTifpHO2pQ60p2oenQsOIrs6JXDvfBwjCc/N5ciedavvToTjmhlpI1vGI1aphXrRd/V49Pea5dEEqvRJ2cJ16m3lnTrezrsUUFyd89ZkfR6q/VXl/gJCsqUmEir+HC0yY1cAaLv3Kmb+JEKP5unDS1pgzXH7sJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnNvYD9nx/m+I90NN6WnpjZMYWpWmmAFqbfeMj/orylW5hSDUfFGg2w1NLOoIArKuQIQu9cKa8125NPvjvrDV6LK07xmf/+TaVdazHW/sRyVTd8q6eqLZqKsIM7T8uX0jQTTic08o3funpGmBJd64e7YFz1oqIIFUPYqYoMtTxw6pe2AOMr8Jtov2lPN1E4krKB7GYcBMwM5/B4nP6j/61BrCJbCa+OfMICYV802DizbbETmbIZKUDhdZ3DOfzkzMKtybOM+xTuKabSvTcbJ+RLv998Mvu8F3bdsSKjCDiYOkYpQTpJ6VZnDkhGW593MKP+RVrdxZV6gsBtGO0J9PtA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"448c82bd75404f79a69178bc29097cf2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:47 GMT", + "content-length" : "1326", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9dd810f2-feb6-4304-a51f-2fd61d74e295", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrUssWRdIge64A9WiJm66RQyXzh8MU4lpSZ3JRpWMjwZlfAFeIsePeois0q0NS7ig96nWie9t80MveLtA/KrDf+IzAcMbFslKXw3DTHOp74DWiWID7pwvZvGJVGkhTAkkYjcS7TFTe6CMOayI+p0ykg+4Lqos6Gb3IJSTaCf0verghoxIFPQfl9PeTifpHO2pQ60p2oenQsOIrs6JXDvfBwjCc/N5ciedavvToTjmhlpI1vGI1aphXrRd/V49Pea5dEEqvRJ2cJ16m3lnTrezrsUUFyd89ZkfR6q/VXl/gJCsqUmEir+HC0yY1cAaLv3Kmb+JEKP5unDS1pgzXH7sJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnNvYD9nx/m+I90NN6WnpjZMYWpWmmAFqbfeMj/orylW5hSDUfFGg2w1NLOoIArKuQIQu9cKa8125NPvjvrDV6LK07xmf/+TaVdazHW/sRyVTd8q6eqLZqKsIM7T8uX0jQTTic08o3funpGmBJd64e7YFz1oqIIFUPYqYoMtTxw6pe2AOMr8Jtov2lPN1E4krKB7GYcBMwM5/B4nP6j/61BrCJbCa+OfMICYV802DizbbETmbIZKUDhdZ3DOfzkzMKtybOM+xTuKabSvTcbJ+RLv998Mvu8F3bdsSKjCDiYOkYpQTpJ6VZnDkhGW593MKP+RVrdxZV6gsBtGO0J9PtA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"448c82bd75404f79a69178bc29097cf2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:58 GMT", + "content-length" : "1326", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0b1f6533-47d9-460b-887e-bb7595934933", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrUssWRdIge64A9WiJm66RQyXzh8MU4lpSZ3JRpWMjwZlfAFeIsePeois0q0NS7ig96nWie9t80MveLtA/KrDf+IzAcMbFslKXw3DTHOp74DWiWID7pwvZvGJVGkhTAkkYjcS7TFTe6CMOayI+p0ykg+4Lqos6Gb3IJSTaCf0verghoxIFPQfl9PeTifpHO2pQ60p2oenQsOIrs6JXDvfBwjCc/N5ciedavvToTjmhlpI1vGI1aphXrRd/V49Pea5dEEqvRJ2cJ16m3lnTrezrsUUFyd89ZkfR6q/VXl/gJCsqUmEir+HC0yY1cAaLv3Kmb+JEKP5unDS1pgzXH7sJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnNvYD9nx/m+I90NN6WnpjZMYWpWmmAFqbfeMj/orylW5hSDUfFGg2w1NLOoIArKuQIQu9cKa8125NPvjvrDV6LK07xmf/+TaVdazHW/sRyVTd8q6eqLZqKsIM7T8uX0jQTTic08o3funpGmBJd64e7YFz1oqIIFUPYqYoMtTxw6pe2AOMr8Jtov2lPN1E4krKB7GYcBMwM5/B4nP6j/61BrCJbCa+OfMICYV802DizbbETmbIZKUDhdZ3DOfzkzMKtybOM+xTuKabSvTcbJ+RLv998Mvu8F3bdsSKjCDiYOkYpQTpJ6VZnDkhGW593MKP+RVrdxZV6gsBtGO0J9PtA==\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"448c82bd75404f79a69178bc29097cf2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:15 GMT", + "content-length" : "1259", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "50474355-e9b0-4b67-acd7-f0887431a1f5", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICrzCCAZcCAQAwHzEdMBsGA1UEAxMUU2VsZlNpZ25lZEphdmFQa2NzMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrUssWRdIge64A9WiJm66RQyXzh8MU4lpSZ3JRpWMjwZlfAFeIsePeois0q0NS7ig96nWie9t80MveLtA/KrDf+IzAcMbFslKXw3DTHOp74DWiWID7pwvZvGJVGkhTAkkYjcS7TFTe6CMOayI+p0ykg+4Lqos6Gb3IJSTaCf0verghoxIFPQfl9PeTifpHO2pQ60p2oenQsOIrs6JXDvfBwjCc/N5ciedavvToTjmhlpI1vGI1aphXrRd/V49Pea5dEEqvRJ2cJ16m3lnTrezrsUUFyd89ZkfR6q/VXl/gJCsqUmEir+HC0yY1cAaLv3Kmb+JEKP5unDS1pgzXH7sJAgMBAAGgSzBJBgkqhkiG9w0BCQ4xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAnNvYD9nx/m+I90NN6WnpjZMYWpWmmAFqbfeMj/orylW5hSDUfFGg2w1NLOoIArKuQIQu9cKa8125NPvjvrDV6LK07xmf/+TaVdazHW/sRyVTd8q6eqLZqKsIM7T8uX0jQTTic08o3funpGmBJd64e7YFz1oqIIFUPYqYoMtTxw6pe2AOMr8Jtov2lPN1E4krKB7GYcBMwM5/B4nP6j/61BrCJbCa+OfMICYV802DizbbETmbIZKUDhdZ3DOfzkzMKtybOM+xTuKabSvTcbJ+RLv998Mvu8F3bdsSKjCDiYOkYpQTpJ6VZnDkhGW593MKP+RVrdxZV6gsBtGO0J9PtA==\",\"cancellation_requested\":false,\"status\":\"completed\",\"target\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12\",\"request_id\":\"448c82bd75404f79a69178bc29097cf2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:16 GMT", + "content-length" : "2449", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f316a7d3-ecc7-4fca-a925-9d5d4e5c4577", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"x5t\":\"Om-VbbinEvfYKd16l9bSxFd3Im8\",\"cer\":\"MIIDRDCCAiygAwIBAgIQBvZ7Z9zkRNSBnvfas7VmDzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUyMDMzMDJaFw0xOTA2MjUyMDQzMDJaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq1LLFkXSIHuuAPVoiZuukUMl84fDFOJaUmdyUaVjI8GZXwBXiLHj3qIrNKtDUu4oPep1onvbfNDL3i7QPyqw3/iMwHDGxbJSl8Nw0xzqe+A1oliA+6cL2bxiVRpIUwJJGI3Eu0xU3ugjDmsiPqdMpIPuC6qLOhm9yCUk2gn9L3q4IaMSBT0H5fT3k4n6RztqUOtKdqHp0LDiK7OiVw73wcIwnPzeXInnWr706E45oZaSNbxiNWqYV60Xf1ePT3muXRBKr0SdnCdept5Z063s67FFBcnfPWZH0eqv1V5f4CQrKlJhIq/hwtMmNXAGi79ypm/iRCj+bpw0taYM1x+7CQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUV9eXvCJbaBAw21wYVaQJlyD5A+gwHQYDVR0OBBYEFFfXl7wiW2gQMNtcGFWkCZcg+QPoMA0GCSqGSIb3DQEBCwUAA4IBAQCosg7Vof1TmGtM3Q2IWM6w5J6eJd++hcfsrF6nSovqMjc3poEdfLfuWJ0NSOYoKw8oksvAi/QkrpKU4bOFwEa2S0f76pdsqtwIXmDKgdoPxFORd+lKFp3vzc9QMMQYHTl+PzlvnN5rbsdBpwHrUVWW5qF7YYqJnpGVOqrWi3EplmaAOfcwNuIsL1d9et+zA1ubuPqt+W+N+4wORcQ6d2mnTaYlXgucJZI0/SNUvLOrCoudLYhc5QVRsGSAXAuttaWTS0vY7pOWZdl31G+URlrOwwVOjln0dxX9UNHw6BHIt7CctIvH3N4datvDbGTa/f8n7+9J4jx7GE8jIB5Bwv4Z\",\"attributes\":{\"enabled\":true,\"nbf\":1529958782,\"exp\":1561495382,\"created\":1529959382,\"updated\":1529959382,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959366,\"updated\":1529959366}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/createSelfSignedJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:17 GMT", + "content-length" : "3994", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c9ea60d3-710d-49ee-a5f8-f793c25327a1", + "Body" : "{\"value\":\"MIIKVAIBAzCCChQGCSqGSIb3DQEHAaCCCgUEggoBMIIJ/TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAhNOzCvxJu4FgICB9AEggTYdKc7DmhSBb5CGM1o6CFwkLk7jkfN0b7i7J7K2dMduPkaR/u4W1+HPxdtilbm276Ak4ug3a4QJIaQQGspv+FfJuWGDWJnN8oNDE7HBrrbeM/RTzUiRV1pCNZ88YZHTCdoFeDVTbGcxHslg/nU7aVt39EUMraaVdKepdjyn+v3m9//Ce9Qr+GAq3jGAkxqS7iT2G8ZeIWDe6CBebpaTuSFn3V3Li4vqJQfAF4GV1Mz9EyKx4C9sApq2O0vLesZLnT1UDo9fjFbgTwPSIJLPwxbdZB2dsUOF844nd4OXZdb0sl291keOezYUNYuPe/XNSz8hAhRt3IAFdB4rpgEOS9ahtXSRebjkuXWtOuuBGcC3LijpsgmlljYKRDzNuEkL3CwWco3DciWtD1glnUdd6gwsPb00DbDtyXVQB6Ucuni5C3U3PaLUOmUNLrHgbofW7bmvK/08isYtIgbNUNWs3smRQzKC39kI4Z4COseJqqsisLQqJD8hHrzWK8zEMJRGJNm0KmrFBon93E2cQi+ZBaLnZfzCLyntp2DUGkFa22Y+dH3OkEBhhc0XcJXlExvmyXhOlMAD0WyZJCVj6Cjw+ON0hZRZrcBFgb1zlK/FL9bzuxAD35K3jGHRUCYhtk/zupUzt4FQ+1k8CDd+bZ/fVpn4WFX69lwIPEAdcxKEVNeXIa8c1ci7n3tA+mmIjPD+3VimTiNocvAilD8vgz6PesYfre7CokANCcgqAjLQlhAwPhwx0ys3DZwX125mfPYhpviosNwUR5QTWR/2Ompq0sqriKQir9H/jruAK0ZGTZC/SWUihaoTSlpn+jp7J6wGCOSzDZKuKLXLpvG14pDO1/e7L9pILLQ729fNuVXwDzx4GbCuROjjwQQgL1f29jfTdsLTvp45YbKOVHEC4fQGWe1ydNGi5OifUmykUsDOk9wMF+GR6VnIZ9uQ5/1eAfqa6adXFd19R/uCpnyR2t4CHbi/UG6uyOeNHGsIrVCkgtDlk3tucon5Nl0sgu4JlhbvibrvEfRg7zjLYacOSb2tjWtl0A0nlPZeRA8z+bUBLeIzxeNVFE75B0L92k/jpzfFMIzMUtC+q0J7NlXdCtVK3dfJN42s5bCjN2k5Blq1SaKMdIODnmiFaAtNk3BQX34dm8pfvQQ/bsmMViFYrcEIgzokx/Ih0E8yPLYfFUr2eSPObRNJ6s9q063Kpu0qCBzyk9HR3biHfGgD8RqbTo1WD8boXff5ywDVm0D5Iq+1UI1nQ1kFb19ncB5kr7wcdbDAibChB5jcoa8l2YXerHKy4hwlrZs8MnPo7Ox6Hnrx/PqchLDdS8hRMyj+eg7Htxak4AblDPUaqvTuTmveG9ecEkwQ9+uEnZZv1dTyK4CmfO01qQdZWND5FCGzE3ifWx5jNXvFBD3ADSA/y3NaIpIcmtpVa/JyJdX6T6yVyAFAly+vViMf+0hagPh0fKjtLpV8+jtcag20oC0jtrf81TdWBOynt1xuNQB/WTXlT+aoytMlRKtE90tfoDCTcUtlrb1i0WWLY//jmFf1Qeu0ZXRzWSYHZaaxVBGd219nLTjeF409mWdVi6bVUVSIRwNgE0DJDMzXRQarBfejW9IaMKITy49EeF+7EPhlf43grsVKqKrqqgcqF+0XGg9yTGB6TATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IADMAZgA5ADEAZAAyADQAYQAtAGIANQAzAGMALQA0AGUAMQA2AC0AOAA0AGMAZgAtADEAMQA2ADkANQA1ADkAMwA5ADUAZQAwMHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIID3wYJKoZIhvcNAQcGoIID0DCCA8wCAQAwggPFBgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAizSKvFhTEBRAICB9CAggOY2bYYRnNQhUXJLOcEqyOiwCqNb2bf8kaPTJZnsDUPVCfLuYBOB1MPxd5sgwYcgn4vrb4M4c2tIG+NoeMt8p8gUMeGCVVb2+GCxlMxjxsFc9kfJO3pvwIklr6iqsFPyxN37HWby+QxYUQmE0umCmhRx8BdK0SHTeMwg/E0fZLq+HOFpdnNrbQyOYj4Js1Tm9ul5TpV37TIPIiaoaKxm86N4qhhoVmvj8/Y6aSaiCtWLciM9vWutnvB//AyWJtspaZJPmq4KtPDg791jIWzUz+4tEe2RhqsVZWuH/rLMe89YNdU3focX+qIpX4GEpXr9bVHkZXvCik5Hh0rpmkmct8auO4MKY5EEvhgPdGc7ouj2PF0HrC1KPy7pkDnfcqfNsGeyubCZpQXoO7/sm3+N6ttPXo8QNh7pQajVhxBCRmo8X6NH6hNKt4NCzALlqeZm0A41DqHkjtk8dX5kJ/WC3qxKEg+qLEFrsC295TjayBR6BniyhGTUNbZIIRpWr9pCkvgNtlX1JPbzNAb9YFUq9hvqa7gP6amnw7IN/Li75SfQP3o3wQ6EERlOxs3NCSrT3Uor+b7IpU2+DlGh2Fb2T1y6YZc7X0R3Y4vRAU1savvJDy4pmUWOj2JHb1P3uXHjeOZ1UCoYGq/w7a3ei15JdQbQh2lVzIrwUKV/E6K+Dxg8pKRTmBOB5TdvdW1yDNyExmcOrh5o2D4ALKbGIMSutgNeo84fzlDWssQL5mUttrnQHhlsOtCWHVwd5CScIk7A/bGZt9JL5bOfqtZUh0gX4yT+ehzgE0cdJk/k1HpFPngXwzJpiAlxDowm2HNx2EgH8NezVZebhVc+GH1fxLoel2oPhCWdMIP5Re38v59xapi5Jq3+dNc7REUqBl7dmR0s7QnBl/gH0iITv9XkfnIodxgAF4zz8IB6LY9Bs6Fkcf3HV2MEYvpNnatiGO48ANBEWCnqCP+d/lYafBvgOaO2vPE1gj9w6wQ+DqTXEcUMcxKV1VSn2+DH6wOrtyk6FcAHUBs+RWGzuFcHUlKTkonPHxu35q+hjZh4HQRJbc8KX/MtIC5lyn2H3hfvd8xrjoSpocHcGVmhZI6hMzsWxdIFQns6GlJ7Wm3qV4UnTV8LEUBJcXquE6zbx3IbR6BXS2EU781jIYT6oJv5ABcrcBit3lVzX9ZeWvuQjfBKYsYyde8bmHlOmQEXGaV0eyK47tU0vvfE/lUAh0DeJUwNzAfMAcGBSsOAwIaBBQjOs4O9ikadRlBFPAOgpDj5pe94AQUBs24ab+iiKOkuaiG8Ek54sbyEBs=\",\"contentType\":\"application/x-pkcs12\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1529958782,\"exp\":1561495382,\"created\":1529959382,\"updated\":1529959382,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:18 GMT", + "content-length" : "722", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3bccf37e-cdd3-4b96-8ccd-8fec9aa34b00", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"q1LLFkXSIHuuAPVoiZuukUMl84fDFOJaUmdyUaVjI8GZXwBXiLHj3qIrNKtDUu4oPep1onvbfNDL3i7QPyqw3_iMwHDGxbJSl8Nw0xzqe-A1oliA-6cL2bxiVRpIUwJJGI3Eu0xU3ugjDmsiPqdMpIPuC6qLOhm9yCUk2gn9L3q4IaMSBT0H5fT3k4n6RztqUOtKdqHp0LDiK7OiVw73wcIwnPzeXInnWr706E45oZaSNbxiNWqYV60Xf1ePT3muXRBKr0SdnCdept5Z063s67FFBcnfPWZH0eqv1V5f4CQrKlJhIq_hwtMmNXAGi79ypm_iRCj-bpw0taYM1x-7CQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":1529958782,\"exp\":1561495382,\"created\":1529959382,\"updated\":1529959382,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"managed\":true}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:20 GMT", + "content-length" : "2615", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d76ccb4b-3444-462e-8682-722ee5dd1773", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createSelfSignedJavaPkcs12\",\"deletedDate\":1529959401,\"scheduledPurgeDate\":1537735401,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"x5t\":\"Om-VbbinEvfYKd16l9bSxFd3Im8\",\"cer\":\"MIIDRDCCAiygAwIBAgIQBvZ7Z9zkRNSBnvfas7VmDzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUyMDMzMDJaFw0xOTA2MjUyMDQzMDJaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq1LLFkXSIHuuAPVoiZuukUMl84fDFOJaUmdyUaVjI8GZXwBXiLHj3qIrNKtDUu4oPep1onvbfNDL3i7QPyqw3/iMwHDGxbJSl8Nw0xzqe+A1oliA+6cL2bxiVRpIUwJJGI3Eu0xU3ugjDmsiPqdMpIPuC6qLOhm9yCUk2gn9L3q4IaMSBT0H5fT3k4n6RztqUOtKdqHp0LDiK7OiVw73wcIwnPzeXInnWr706E45oZaSNbxiNWqYV60Xf1ePT3muXRBKr0SdnCdept5Z063s67FFBcnfPWZH0eqv1V5f4CQrKlJhIq/hwtMmNXAGi79ypm/iRCj+bpw0taYM1x+7CQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUV9eXvCJbaBAw21wYVaQJlyD5A+gwHQYDVR0OBBYEFFfXl7wiW2gQMNtcGFWkCZcg+QPoMA0GCSqGSIb3DQEBCwUAA4IBAQCosg7Vof1TmGtM3Q2IWM6w5J6eJd++hcfsrF6nSovqMjc3poEdfLfuWJ0NSOYoKw8oksvAi/QkrpKU4bOFwEa2S0f76pdsqtwIXmDKgdoPxFORd+lKFp3vzc9QMMQYHTl+PzlvnN5rbsdBpwHrUVWW5qF7YYqJnpGVOqrWi3EplmaAOfcwNuIsL1d9et+zA1ubuPqt+W+N+4wORcQ6d2mnTaYlXgucJZI0/SNUvLOrCoudLYhc5QVRsGSAXAuttaWTS0vY7pOWZdl31G+URlrOwwVOjln0dxX9UNHw6BHIt7CctIvH3N4datvDbGTa/f8n7+9J4jx7GE8jIB5Bwv4Z\",\"attributes\":{\"enabled\":true,\"nbf\":1529958782,\"exp\":1561495382,\"created\":1529959382,\"updated\":1529959382,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959366,\"updated\":1529959366}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createSelfSignedJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:22 GMT", + "content-length" : "110", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8b3d944f-284c-40db-9172-a7cd25dd0326", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: createSelfSignedJavaPkcs12\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createSelfSignedJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:35 GMT", + "content-length" : "2615", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dce45f36-0d39-40e9-b984-e2be7ee74836", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createSelfSignedJavaPkcs12\",\"deletedDate\":1529959401,\"scheduledPurgeDate\":1537735401,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/createSelfSignedJavaPkcs12/8f43b64ff07940198fa4474a201ae3b7\",\"x5t\":\"Om-VbbinEvfYKd16l9bSxFd3Im8\",\"cer\":\"MIIDRDCCAiygAwIBAgIQBvZ7Z9zkRNSBnvfas7VmDzANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRTZWxmU2lnbmVkSmF2YVBrY3MxMjAeFw0xODA2MjUyMDMzMDJaFw0xOTA2MjUyMDQzMDJaMB8xHTAbBgNVBAMTFFNlbGZTaWduZWRKYXZhUGtjczEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq1LLFkXSIHuuAPVoiZuukUMl84fDFOJaUmdyUaVjI8GZXwBXiLHj3qIrNKtDUu4oPep1onvbfNDL3i7QPyqw3/iMwHDGxbJSl8Nw0xzqe+A1oliA+6cL2bxiVRpIUwJJGI3Eu0xU3ugjDmsiPqdMpIPuC6qLOhm9yCUk2gn9L3q4IaMSBT0H5fT3k4n6RztqUOtKdqHp0LDiK7OiVw73wcIwnPzeXInnWr706E45oZaSNbxiNWqYV60Xf1ePT3muXRBKr0SdnCdept5Z063s67FFBcnfPWZH0eqv1V5f4CQrKlJhIq/hwtMmNXAGi79ypm/iRCj+bpw0taYM1x+7CQIDAQABo3wwejAOBgNVHQ8BAf8EBAMCBaAwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHwYDVR0jBBgwFoAUV9eXvCJbaBAw21wYVaQJlyD5A+gwHQYDVR0OBBYEFFfXl7wiW2gQMNtcGFWkCZcg+QPoMA0GCSqGSIb3DQEBCwUAA4IBAQCosg7Vof1TmGtM3Q2IWM6w5J6eJd++hcfsrF6nSovqMjc3poEdfLfuWJ0NSOYoKw8oksvAi/QkrpKU4bOFwEa2S0f76pdsqtwIXmDKgdoPxFORd+lKFp3vzc9QMMQYHTl+PzlvnN5rbsdBpwHrUVWW5qF7YYqJnpGVOqrWi3EplmaAOfcwNuIsL1d9et+zA1ubuPqt+W+N+4wORcQ6d2mnTaYlXgucJZI0/SNUvLOrCoudLYhc5QVRsGSAXAuttaWTS0vY7pOWZdl31G+URlrOwwVOjln0dxX9UNHw6BHIt7CctIvH3N4datvDbGTa/f8n7+9J4jx7GE8jIB5Bwv4Z\",\"attributes\":{\"enabled\":true,\"nbf\":1529958782,\"exp\":1561495382,\"created\":1529959382,\"updated\":1529959382,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=SelfSignedJavaPkcs12\",\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1529959366,\"updated\":1529959366}},\"pending\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/pending\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/createSelfSignedJavaPkcs12/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:35 GMT", + "content-length" : "102", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b1f550d3-2404-4092-9eac-52205c202fe9", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: createSelfSignedJavaPkcs12\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/createSelfSignedJavaPkcs12?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:43:37 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8878602d-e3e7-46b0-b18f-1a5fb2bd038f", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForKeyOperationsTest.json new file mode 100644 index 0000000000000..bc3b475e8eb14 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForKeyOperationsTest.json @@ -0,0 +1,407 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:28 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0c9207fd-514a-47d1-9894-80140e299e7b", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:29 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0bc6e3d8-15ff-4941-a70b-6a3e9040c3ba", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:30 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ef81adfe-83f4-4b7e-8859-9bcf5646efd7", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:35 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a7dfbf8a-b8d6-4e3b-92e3-9f3e8c340bfc", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:37 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a8b2062c-5b0a-40ee-a58a-cae797201c73", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:38 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "98e8c977-afc4-4daa-b135-00108f9f3aed", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:39 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c2e130aa-4458-4779-ac94-16c7d326904f", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956470,\"updated\":1529956470,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:40 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "98cf454e-0705-48b5-ba59-6ff33678414a", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527361680,\"created\":1529956470,\"updated\":1529956480,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:42 GMT", + "content-length" : "676", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bafdd1a6-b3ae-4430-8c9c-cc578ebfca42", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":949438480,\"exp\":2527361680,\"created\":1529956470,\"updated\":1529956483,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:46 GMT", + "content-length" : "815", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b356c4e8-eee3-41c7-bbe2-58ea63893433", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956485,\"scheduledPurgeDate\":1537732485,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":949438480,\"exp\":2527361680,\"created\":1529956470,\"updated\":1529956483,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:47 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ad64b9cc-f622-4343-ad04-ff6c24bc614d", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:59 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "93fa29e6-e858-4096-aac7-8c2fce5ac220", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:12 GMT", + "content-length" : "815", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "38dea960-55c0-4456-80de-44da49f31229", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956485,\"scheduledPurgeDate\":1537732485,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/782dc12fba224594867fa86b794abe5b\",\"kty\":\"RSA\",\"key_ops\":[\"sign\",\"verify\"],\"n\":\"1A35EKPtATdtykmf5w_NcQ3Il9NOq7ZUz8YTIBFEXw_w6SdJsVdIzOSQb8v7SaXUJayQmsrZVtDm0qPfOmjsUu7nbHk0I9aYZQpFGhfIWI7N6PvshgM7BFhyptACSwA6-cxVBu8JGZwwDD3jbbgiuPF7O0RqKQAC_3oa5X6axjAbczvxvWgEbamZ5cUGcafJdzK-ya1MRRerA1ANZ6TK8AlsRXkAQs3PT9eENCJA8ok5mMAPaF4KX5FOsJ55h-deNuqGSa169TD4KBOpV9zGT_uHCb7dfH9dThOQjFjt0GcYJeF4dsojr_gg_9IQUTpBqAmqUCjABMQkDZEqegUbLQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":949438480,\"exp\":2527361680,\"created\":1529956470,\"updated\":1529956483,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:13 GMT", + "content-length" : "67", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d0805287-e6dd-4628-b356-cbf9d4b9dd58", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key not found: javaKey\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:15 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "01ffed22-c060-4446-a45e-f107389c0635", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForSecretOperationsTest.json new file mode 100644 index 0000000000000..3b75b96bac3cb --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/crudOperationsForSecretOperationsTest.json @@ -0,0 +1,326 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:58 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "01ff418a-dc4d-46a0-8142-61b87a348c46", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:59 GMT", + "content-length" : "275", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "95d0c9c8-a6e2-40c6-9114-299dbda17343", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"created\":1529957220,\"updated\":1529957220,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:01 GMT", + "content-length" : "275", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "12057c25-1fb9-456f-bcb3-dfa18458df1d", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"created\":1529957220,\"updated\":1529957220,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:02 GMT", + "content-length" : "275", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "93a776b7-6eaa-4a76-9b29-286dce04543c", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"created\":1529957220,\"updated\":1529957220,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:02 GMT", + "content-length" : "275", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "90057129-007f-4300-8f0c-79554069843e", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"created\":1529957220,\"updated\":1529957220,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:03 GMT", + "content-length" : "275", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1fab8b49-3f0e-4f0b-b3c7-83327a680d0d", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"created\":1529957220,\"updated\":1529957220,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:05 GMT", + "content-length" : "290", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7b869764-4052-4926-b64c-55a8867ef498", + "Body" : "{\"contentType\":\"application/html\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"exp\":2527362423,\"created\":1529957220,\"updated\":1529957225,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:06 GMT", + "content-length" : "307", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6b3f77cb-332b-475b-8e4c-a1386992b5c1", + "Body" : "{\"contentType\":\"application/html\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"nbf\":949439225,\"exp\":2527362423,\"created\":1529957220,\"updated\":1529957226,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"rex\":\"woof\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:08 GMT", + "content-length" : "452", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c2f3e9da-32df-4471-9987-bf39852a6107", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/crudSecret\",\"deletedDate\":1529957228,\"scheduledPurgeDate\":1537733228,\"contentType\":\"application/html\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"nbf\":949439225,\"exp\":2527362423,\"created\":1529957220,\"updated\":1529957226,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"rex\":\"woof\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/crudSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:14 GMT", + "content-length" : "452", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6a23c9e5-9053-42f4-a39e-dc7f25d51357", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/crudSecret\",\"deletedDate\":1529957228,\"scheduledPurgeDate\":1537733228,\"contentType\":\"application/html\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/323c8db683d942028d0aa1221d268d43\",\"attributes\":{\"enabled\":true,\"nbf\":949439225,\"exp\":2527362423,\"created\":1529957220,\"updated\":1529957226,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"rex\":\"woof\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/crudSecret/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:15 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "709c0f0e-2da9-46c9-bf93-0f6034cf5523", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Secret not found: crudSecret\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/crudSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:16 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1e80aa35-92f7-4f72-81cc-a934ac804546", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/deserializeWithExtraFieldTestForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/deserializeWithExtraFieldTestForSecretOperationsTest.json new file mode 100644 index 0000000000000..723a9ae601f8e --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/deserializeWithExtraFieldTestForSecretOperationsTest.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/disabledSecretGetForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/disabledSecretGetForSecretOperationsTest.json new file mode 100644 index 0000000000000..707334830dfc5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/disabledSecretGetForSecretOperationsTest.json @@ -0,0 +1,137 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:21 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "931a3fce-0ebb-4a78-9cfd-b22b4b599a5e", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:23 GMT", + "content-length" : "280", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1667161f-06cc-47b8-9255-779534cb077f", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret/35ae81e2550e44bc85ae7114c3259401\",\"attributes\":{\"enabled\":false,\"created\":1529957243,\"updated\":1529957243,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret/35ae81e2550e44bc85ae7114c3259401?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:24 GMT", + "content-length" : "132", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "403", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5ed25588-d1dc-49e9-96d3-66b407e9ec44", + "Body" : "{\"error\":{\"code\":\"Forbidden\",\"message\":\"Operation get is not allowed on a disabled secret.\",\"innererror\":{\"code\":\"SecretDisabled\"}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:26 GMT", + "content-length" : "373", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "47845f04-ded9-473d-9ca0-b2cb067b018b", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/disabledsecret\",\"deletedDate\":1529957247,\"scheduledPurgeDate\":1537733247,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/disabledsecret/35ae81e2550e44bc85ae7114c3259401\",\"attributes\":{\"enabled\":false,\"created\":1529957243,\"updated\":1529957243,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/disabledsecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:08:09 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "df0f2b59-d08e-4de6-92dc-e1551a03df64", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/encryptDecryptOperationsForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/encryptDecryptOperationsForKeyOperationsTest.json new file mode 100644 index 0000000000000..7425d897e1b20 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/encryptDecryptOperationsForKeyOperationsTest.json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:44:59 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4531c61d-c14c-40ab-ab7c-abccd229122a", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:01 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c4ccbfa0-5997-4c47-8540-f8e0911746fd", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955901,\"updated\":1529955901,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//encrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:03 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e186c997-305b-44f3-a9ef-48af40c5d99e", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"value\":\"G8d2JDBD_lCgTcjwYQfjqNxTDBO1IGfFo8M-lNyAJzls43ia6bK24xl_4-Rk0EB5Qs_bT7TCflSwCJ4dNbA9dDjmG4yEQ9PuWPR-QqvM9vHYrHHbarro1wePWmYufeJ0caof2vr7BdQxadVqWsscjpYZvTabuyeP0COd50RlPn8VVZbpHlqryHvVlKyA-tgqZVAwuDwI7EGIu6LcKGBmHbZc3oN7QKRNc1eUvNQzhM8BcuelLQkqS5H4AnW9iDrW7nL4mHwEtvV9xxJoYXRq6LFGpConEDrfKIJDgwcKpk_RTV_YU3wQqIcUpR3Xx7HzH1MROfZoSNmqZtFsYKLpdg\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//decrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:07 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0cd57441-afcc-4f01-8431-05c413420403", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45/encrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:09 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3aa5cf94-ccaa-4439-b7cf-cd4ed02b16b2", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"value\":\"in5vHTWLaAyZBXLCy0Ng4Z4qShtDunVhhsWM0BhMsOGwFHgabCC8VoPEINwIvVymPaj0CZZ05lAGcxlugNvgZvyWo8hMwB87NlC916bThVy5kS85g4-pSQEmjayEP1j2LrKTv49UgzrGsTWrBWY6HTSINhWp9wcoGHi8Xx9DMqDErpdNj5KrDnlzFiMzYoiUbfcTqplaMgtfFOyzZl-UCkbJMszY03dQgv6ga9zSdA3mRMZKLtmQ7ugw-mydjPdWCg_hjEhMjx8jkuGKf2EE333gCqh37nJIMNMYNt0cpTJc-WKwH16R0CF9DTzs_swnDjXfDIUnt5xgXvgah2NWgA\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45/decrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:12 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "afe31985-77bf-4d53-85ec-159b4c6182ca", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importCertificatePkcs12ForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importCertificatePkcs12ForCertificateOperationsTest.json new file mode 100644 index 0000000000000..d19ea3c790eaf --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importCertificatePkcs12ForCertificateOperationsTest.json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:38 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e9284d38-a33b-4357-bd98-fcf7606f74ee", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:40 GMT", + "content-length" : "1856", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "262438e8-b233-4071-9a87-6eafac1db1dc", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529958940,\"updated\":1529958940,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529958940,\"updated\":1529958940}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/importCertPkcs/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:44 GMT", + "content-length" : "3570", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9fcb8408-46bf-4bc8-b3e9-5f707d155fdd", + "Body" : "{\"value\":\"MIIJKAIBAzCCCOgGCSqGSIb3DQEHAaCCCNkEggjVMIII0TCCBfoGCSqGSIb3DQEHAaCCBesEggXnMIIF4zCCBd8GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAi1hm/i/Cl2sAICB9AEggTY5xWw5bqf9JqWWE/lpv4JTDdlW8PPLPQz/VXQlz0HRoX1DZMtBQUJxkL3sjir0RHZWr5mQ8rRj5UICIX2pNWl8g50nl7iNXyV28imd7EhYNcPzugkgp9QKFyVYN9OT5I94LD5ZkMNmRpUAd5109/ujxXmAX64Yof4NCwROzGraJsjIUy+ClYsAt4xmsazNWu3fmMXLn/rjoV3xk4WkW8SIZYHbVmgS0Sd7kQj03ENafv3tCTGeKopyaQBOSxvSMbjNT1rwkTEKdP2YWe7hAAO0Gv56LlWSBQt4tGCoVLDTU6pLEZ2+o7o5n9ktIa+WLNjlxwB/CnNvb0OSs/ZKnBiRLXo5S7KmI6QD3au8hUaEDM6WliJ8hIJed1xyhR8bS8CzosrrJpusyhCVTyLeV7iBzBUoEAkh3FQNYyRWd+pbcj3E+emsaPm9J7fyAIXwZZBkqfonDvVGslFePrJiIE+xLmumUDBJbHaq7LWbc1E8Q69TfyROJvNwgaYzTDxv7ZV9OJgW04mfbOJowC+Nwqz1vNQeyIwX+n9s12HpJpQEDglGKo91bgBdk+dwZnzd5ejs5lpB5AcopCuYr1L7fD16X4L161h95mo21/oR2W04Um84E/EBqbiAr/j7KCarD106aRIFY6xl1MGDMOF5aa8qDImYTXHKurj9fZX+HgTMV49wGv9QXdsOIViXIDxKncyHnxvh7lfczylvPJFuY/WCF90HVZQUioVsIVXDTJLfkEuWpjPRSQqLJq4ldfzmuWeGkf47XQNbBjOVtjB4Ige21rZ/ni+lvn3fVYMgqpe3HrGbzLGQAk9xSu72olwBBfs3O5WzD4RsIeNKvxqGFVodsUKSdc8rOtNU/ALXMIo86p4MfCCZ1X9ezV4ChS85h5tTpxIEXoBI1TZwnRLLKpXarwIJGgbxNu0paepGQl+YaLoH/FdFg4L2wAaDskMf+mepXQwsmp/5pL5+78eehus2TyGvsXeMK4ndCnRfzT3XQLNbXD5GcYpWB8IeMvr0cd8WXvx7ka5I31d9hrEtbR3cgwhgHKo5pA8DfjP0gO3HGK0MEWkF+bC62MmD6CNnQW0wdyKP4cnXZfX1wwbFebibNL40gwALke+DwUCen1/PGBX/4cx2oGZMu6jEmDvztKAtxSGGVL50vb1TomPJ9ouq6WQpdHYnTFjlh0n8E2Vca+ad5E9KAXtD/O/UZyjFTCP+f/ofIaOU0hLZYeIoQEJmu5XMXvLDPy3rK2ZSyUrWNl42Zquij6Bx7PW3dcYhZ15iBWBd9waqud/6S4aKPQ7CiX1lTlR5vvc7UxrdH88eaXbSpmWPlS4cg1wWDzyf7bJxEdJ7qkwFmY0kz5O4pQ8W3YkQ6QIQ6kH0yPPXHbS7TjA9rJJJMhOaBVAw7T0qdXG1oBfCswvZn5iKSwMAWnUkJKmmyXacBxrX0AuVso7icc372qMITjrH+h9nkVALMeW+eIlcsM2wutb806bJxOx9jUNm2wcIcP/OlqPIRxUvUCtysAA2iTKe+BJvOtT/JMB9R+sKHp2cjWpFoVu1esI2+o1npRLRB5ysnDLIfr9VCFllDmQNcdb7FnoBqSS49NB3z6DKG3mCYHsNlp+B98W4OOclqCJ5lNvO7zu7QpZs9/t80y/++vllDGBzTATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECBuGktyvzWetAgIH0ICCAoiev4rLUr7Nh/LVB+KtlImXa4okxncvGrU/KublgWqKepzFRVKERJZJFkMPQtsAgkGDvafX8qPQhEekbUENoFQgZNruaSa6xgWDqnb6aA5xtKbkj5OPyL/oyov0x6+mgpgl4imBcyj+4vwoBJnb+CF1858rQcQqSp7jh9WyJN90xjb1Kx7k4hFR5f065jfkEZLGXOHfTPknqlrF/PUyrmUo0lMJN5O7V2TaFZT8586FP4Qj8B8JF/zfxJTuk0kMhgvqsScsvFY8Xc7SDkEpJDJgWSbnnzbl+ZJtWeTJ/+4739qETRMKqi91Uhur0+DkEJUn9vF20cCbO7P8mHC2aFboaYWtdHEof9DLxi0/lOmc9ClP57xRKcTWl7h521NPiVPx4aS8UUW9Wtn3NjHqaXLvnmLTQYuTw0KSzMSiSytjEXlf+5CBKLRwQpIeO7myfRGIXCClSB/epfwHqjaQhN0LNKZ5VQ51UejOSAycNcq9SB70EB8ylPibeevbPqOgmROsY4gQvJg/KTHND57giZDavlYO+fDkzqHyFLZTvKcPNH31AwRJlmn47zRF3mGhpwKToiRGqs6HlxTsFJBAZ914pjSR/VIZopbGFI59HvN0jzutD4de8U4NJ8ApIVbzwl7e/PhqyW/e5+nipd6biIWkmkELR6ucBEiGPsIcttV0wHcHRMpDpRxE3DMClGPtd7d76wnRZlMJwfP5ymcIP63O6i9SNlAgjlMSPYLzfo35Os+ErTbMVdbjs94rR7j9qvJxxbtbzWSpcrBXfGPlXGoBBD+pCo4dlkAsXJiK3DgYKSTbU+D8AXDWIEB+Nmhsi/edDSRHGTR8EpSx67IrnBIUfXfFDj0QzqgwNzAfMAcGBSsOAwIaBBSI0iufeieEHxWcozGwZD5E+3FZlAQUCeKoCYO8VQUNFUHLW9BofkQ6srQ=\",\"contentType\":\"application/x-pkcs12\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529958940,\"updated\":1529958940,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/importCertPkcs/816c0d97aa45484d83f50ec916028274\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:46 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "442e0c9d-ed5d-4f12-a84f-bef47fdd1647", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs\",\"deletedDate\":1529958946,\"scheduledPurgeDate\":1537734946,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529958940,\"updated\":1529958940,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529958940,\"updated\":1529958940}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:46 GMT", + "content-length" : "98", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7a3f539a-414d-4d51-a4ba-61d32598bbfc", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: importCertPkcs\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:57 GMT", + "content-length" : "98", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4f88aff1-8f31-4d84-a71d-9f67ed623451", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: importCertPkcs\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:09 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "76e0053a-3fe1-4949-846f-de53bd2dc005", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs\",\"deletedDate\":1529958946,\"scheduledPurgeDate\":1537734946,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/importCertPkcs/816c0d97aa45484d83f50ec916028274\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529958940,\"updated\":1529958940,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529958940,\"updated\":1529958940}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/importCertPkcs/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:10 GMT", + "content-length" : "90", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "866c10f5-ae60-4365-8e1c-d115831aee42", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate not found: importCertPkcs\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/importCertPkcs?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:36:14 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "62bbe322-5417-45dd-af0f-7c115df06db7", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importKeyOperationForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importKeyOperationForKeyOperationsTest.json new file mode 100644 index 0000000000000..3c6c8c23c5a1f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/importKeyOperationForKeyOperationsTest.json @@ -0,0 +1,193 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:16 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cb3bb1b1-92e8-4440-bcad-f47f3a9c0e75", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:17 GMT", + "content-length" : "680", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "32aa2bdb-402b-44a9-8334-dc649bdbd8ab", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/dc38d2c3e5874dbd8a9799181034fc8c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":948833656,\"exp\":2526756856,\"created\":1529956457,\"updated\":1529956457,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/dc38d2c3e5874dbd8a9799181034fc8c/encrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:18 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a42b0abe-7614-4ad4-bb33-3bf0120baa89", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/dc38d2c3e5874dbd8a9799181034fc8c\",\"value\":\"qjlvOsKO5yWWlJFvl5y9d0RtNJcObzDLc-VRf8dIYT1Dp3vlAjytvXNTLyeoF6GXLdNFZb8nL5ut28NCUTNmr8fZlTlcz5Wuwp13V_57wefsebOs4U1Y6HeseiUTsg6ccAnIIRfUegOHsh8KZMO17tWg7PM4ZeVxWgJzo_Ur5GBf16rjvODdY3aPrANvyajhUT55LkcEi9iifAQ_TA2diXPZwRYhPYEQUk2sY3UR2bk1_Zok0hZhA_sbUa4A4QFrLFUuaVYOdL-VSfAfdcp2RXK8uAnaddXZe0a-6SHMq0Xfo43OJ__JAbH7rKEbnOWtDuEVGUbDdF6g-zqeO9Wfdw\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/dc38d2c3e5874dbd8a9799181034fc8c/decrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:22 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "676780a2-c058-45d0-bbfc-3ebba95f63da", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/dc38d2c3e5874dbd8a9799181034fc8c\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:23 GMT", + "content-length" : "684", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c6bfb3cd-32fe-4a81-9ece-f8e7346f217f", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/67e41a759268430385285661e21cd3d8\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":948833662,\"exp\":2526756862,\"created\":1529956464,\"updated\":1529956464,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/67e41a759268430385285661e21cd3d8/encrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:24 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d4a574e4-1769-44da-a29e-c171c112800d", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/67e41a759268430385285661e21cd3d8\",\"value\":\"RGg52mu0diB0U_UpW34fNZbgnfdgV9DCg6u-EXo9959zu_q17MSIagzAbQUsd2E6yOpp3M4vuMDXe6so13VJ_aYJHOoP8EfgFPjT4qqX3CL23oiUg--S_lOt6ceq5zpgkTo_jU2X1rsGLrHOpaa0jDzymz2FJCoeCFNfC6AOXG8ua34XsaqCubVRuTnzA8Xsb-uMMQTiVAPOM4kROyOsVzcP0YxVk-TKbd1Tdwokrc6Z_xcxCZNa7gG71NGNMM8DMcOhuc8mq2R1M9GgciTXyB1AtIPoSs2gh3_IGYK4-Ryk_Ug9OAllBfM6qgMVR6helOTbRrwh5ZavWf97OzJ46w\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/67e41a759268430385285661e21cd3d8/decrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:54:27 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "874658a5-201c-4df7-86fc-9e8312975a40", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/67e41a759268430385285661e21cd3d8\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerAsyncForAsyncOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerAsyncForAsyncOperationsTest.json new file mode 100644 index 0000000000000..36ff4b0f87d20 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerAsyncForAsyncOperationsTest.json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:01 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c7b1d61a-39a9-4344-9a8f-c8c5d55874ba", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:03 GMT", + "content-length" : "175", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f0bbfa0d-62e4-460c-a3c5-6f47e5666ca6", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer\",\"provider\":\"Test\",\"attributes\":{\"enabled\":true,\"created\":1529955063,\"updated\":1529955063}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:04 GMT", + "content-length" : "179", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9fdabe80-3302-4e4e-8e6f-7c6a0fc37f36", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer\",\"provider\":\"SslAdmin\",\"attributes\":{\"enabled\":true,\"created\":1529955063,\"updated\":1529955065}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:05 GMT", + "content-length" : "179", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "851bdd94-97dc-412a-88b6-dcb31983c9cc", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer\",\"provider\":\"SslAdmin\",\"attributes\":{\"enabled\":true,\"created\":1529955063,\"updated\":1529955065}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:06 GMT", + "content-length" : "394", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4f0cd220-9ef1-4818-bf7b-05cb4e37687e", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01\",\"provider\":\"Test\"},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01\",\"provider\":\"Test\"},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer\",\"provider\":\"SslAdmin\"}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:11 GMT", + "content-length" : "179", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7c8ed540-59ee-48ab-97b3-d9269605f7b8", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/myIssuer\",\"provider\":\"SslAdmin\",\"attributes\":{\"enabled\":true,\"created\":1529955063,\"updated\":1529955065}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerCrudOperationsForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerCrudOperationsForCertificateOperationsTest.json new file mode 100644 index 0000000000000..be47d353eb9c3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/issuerCrudOperationsForCertificateOperationsTest.json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:27 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6a09b730-be17-4352-b3f4-61393c2da0ec", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:30 GMT", + "content-length" : "348", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1dd9c201-4f06-496c-9e76-b2d5d6bf2134", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account1\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1529958930,\"updated\":1529958930}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:33 GMT", + "content-length" : "348", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b98746fc-11ff-4e05-97c3-4ef61c5e7c96", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account1\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1529958930,\"updated\":1529958930}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:34 GMT", + "content-length" : "348", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "47fcd550-156d-4ab9-8b1c-87f7877302ad", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account2\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1529958930,\"updated\":1529958935}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:37 GMT", + "content-length" : "348", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bf23edd8-59da-4818-a051-fd0a1f1408bf", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"account2\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john.doe@contoso.com\",\"phone\":\"1234567890\"}]},\"attributes\":{\"enabled\":true,\"created\":1529958930,\"updated\":1529958935}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/issuers/issuer1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:35:38 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4a83881b-744a-4fac-a0a0-4c5bc45f760d", + "Body" : "{\"error\":{\"code\":\"CertificateIssuerNotFound\",\"message\":\"Issuer not found\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/keyAsyncForAsyncOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/keyAsyncForAsyncOperationsTest.json new file mode 100644 index 0000000000000..86433b9e0cc9f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/keyAsyncForAsyncOperationsTest.json @@ -0,0 +1,864 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:20 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ea64f8c9-310c-4ae4-9c5d-504a86cad5e7", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:21 GMT", + "content-length" : "662", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f7d33391-3d60-4541-9fe3-9f6502c143c8", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955141,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:24 GMT", + "content-length" : "662", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f0ffcc59-3b24-4914-a0ae-ced6c413a39c", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:26 GMT", + "content-length" : "662", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c44ef5b5-58df-434f-bcbb-cb5c20607bde", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?maxresults=2&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:26 GMT", + "content-length" : "312", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "fc8d5215-af4b-432b-b0f4-ad74ab871cc3", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXdJV3RsZVM5RFVrVkJWRVZUUlV4R1UwbEhUa1ZFU2tGV1FWQkxRMU14TWlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXdJV3RsZVM5RFVrVkJWRVZUUlV4R1UwbEhUa1ZFU2tGV1FWQkxRMU14TWlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:33 GMT", + "content-length" : "300", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1d4107ed-b5e4-472d-9d72-e360baab521a", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlEVWtWQlZFVlVSVk5VU2tGV1FWQkxRMU14TWlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlEVWtWQlZFVlVSVk5VU2tGV1FWQkxRMU14TWlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:34 GMT", + "content-length" : "278", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8aa4eb08-4a05-4096-afd7-cc26df608e9b", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElXdGxlUzlLUVZaQlMwVlpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElXdGxlUzlLUVZaQlMwVlpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:37 GMT", + "content-length" : "475", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2ca0c2a9-dd7a-4ff3-911f-846b331ef580", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey\",\"attributes\":{\"enabled\":true,\"created\":1527889585,\"updated\":1527889585,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:38 GMT", + "content-length" : "294", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f4244160-4521-496e-915b-76158956c18b", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:41 GMT", + "content-length" : "289", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e9acd702-8bb5-4e65-979a-26483aa6d0dc", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlOV1VORlVsUkpSa2xEUVZSRklUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlOV1VORlVsUkpSa2xEUVZSRklUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:43 GMT", + "content-length" : "457", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d3ca59df-aeec-4a06-b3b9-ad26eb1d4885", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey\",\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeklXdGxlUzlQVkVoRlVrdEZXVEloTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeklXdGxlUzlQVkVoRlVrdEZXVEloTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:44 GMT", + "content-length" : "658", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8d337d8d-b50a-4ee9-ba92-38e397caa86f", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2\",\"attributes\":{\"enabled\":true,\"created\":1528498195,\"updated\":1528498195,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey\",\"attributes\":{\"enabled\":true,\"created\":1528324427,\"updated\":1528324427,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlUUlV4R1UwbEhUa1ZFU2tGV1FWQkZUU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlUUlV4R1UwbEhUa1ZFU2tGV1FWQkZUU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:45 GMT", + "content-length" : "28", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f46405f6-2a05-42fe-a871-ca230bfb697b", + "Body" : "{\"value\":[],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/versions?maxresults=2&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:46 GMT", + "content-length" : "240", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dd587ad3-d3ee-437a-9983-29b702f54cb4", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/backup?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:47 GMT", + "content-length" : "13480", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "608f04cf-aa19-42f4-91d3-d0f58c75e739", + "Body" : "{\"value\":\"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLkk0UUE3NWU2OW5kWlpqbWp5N3g5SGxnVmRiQWpveDRPX0lTMi1lbEJZa1FWTlZmb1BIcFZDWmhncUlrZVJLcjNoN0hQVGYycDItVV9raVVKNHdGaFdLdFRRRko0Z2x1Z2prTXBPcUFPZ2d6NUFRR2lGNmpKX2JyWml4Vjk5UndsZ2hLc1B5T0tiaC1tSGFmTXcyZEhRTkVKRjhTUmtzN242YThCdTF1TEpiZ1EyMnpwMHNaRVdQT05tZnFubWhXX0NTLVpYM29MM0Jvd09qc1JoVDZTbmpfRVJkdl9ub3lJRTRPak1BVFRxbm83TGJDaEc1MlhuNVRTTnFvZlhYdWhoTnNvdlNfa3p2WGZhSG1RUFVUYXBuWUtSQnB2aHo2WUFzR0ZqMzZMQXBwYklES2c5UDdFNm9wMTgyajIxZ08tNGV2V3B1UGlvQ0x0NHhzeTk0Qk5VZy5BUnItcmNVMERjMjc3dFZTOTI3d2FRLlRQNXFJZ3pGLW0xRGt1a0NuZEJ2Vk1NODFQaW9yYW5WRVR5cHByTmQ3cmFNalNXVExVaTdTcDUwRTdnaklubUs0TlhCVGotWXJUNDdYLWU4NVNOLVlYTGktWGNjNl9TcXE2WHlXdlVZejNxcWxsd2VHcUxfN0loOHFzR3VhNXFfaGczYl9BUlRoWGtlWUttSVcyNzNnWE9jREtBTWdsc2FXbTM4dzg3aE1CYXdTVEdSOUdkMERmb0Q2bmhUaHp3ZVFHZGljellDMTlrOUJkR0dYZnJIUGwzSHR0UVAtTmlZY3JfYmdzNU5ncW9tdlNIUmZKTE1OR0ZHZGVNbjhsUTdFbS1NajBYYlZ2Y1JBWWUtdm91RENBR3lxOThPWmJHcU8tZlhEQ0U3NkVPUV81MG5xWVBmbHlJcElOUklZRzJiZkphZG1JTjJPbzNjbDdLWmlqT1hXM0xpNmVES1Y1WDhTY1BBN3BQMnJyUTdNa0lIRkw2TllpWTZ4SjhuQnBUMnNvNzNMUklJcmk1ZkFDX3pTYVlsY2tSZmlGeG1BMGE1c3ZLUkdUT0xRNVZ0allPQjdQcEo3Vlo3WHNPSk5LUUMySF9jM1RkOE5HV3FDcVM3amdhc0dsWFlpZHFQX29tcmpEVDF0Z2tPeU9uelp3cTlyTUJ5cVh6NkhlZ0xEOVlia3J3QVZGSHI0Z01vNkZIZUpJZTNXV1RKa3cxU1RKX0Nxd29GY2NSekUtMS1tSzFaa3BKcjNYU1NsUE1KSTJITlNGbHIxLXdyVW9sTnNSTHNFUjlrUWd6NWxrcVFyYzk4U0c4NzZpZUF0OXE5SW5qVWE0MXNsRjFFTTJOU1I1ZmxYUHJoVjlqXzRqZl82cDE4RVBQMFlTamJRcTlSTWpPOXNQMnBvWW90WVlYaWQwVWdZQjdQMVNncHBSU2J6bmtMRFZ3RGFlYkhfR04xSnNmWlhNQmN6MTBkSXU5VTY4MlVVcmE3WVJBY1A3NGl2TjhsVTVueVM0R2hsX0VlNVVDYmYxUGM3RmJWeXV3UnZGTHVfLW4zMi1EM0FlQWt0b3lxV3ZmQS1NMldLZ1JuRHdFOU8tX1Z3ZmhFcWpTN3UxZmhEVXBpZmRGak5JX3pQaFdzb0FTWmlFT0hpMjFhSUR5OUVIOExQNGhjZ0t6ZEFoWXZ1QlNQeHJ2LWphT2t4ZEY4ek5ud2Jma09jcW1wTWZndFM4QmNVaU1aaktCcTlLS1RsbHI1VFR4UkllT0txenhvUnVGTFhhVWNHbm52QmJTdlFjVzF2LTlLZ1JDeTN5YlV5Ny1RcTl6N2h1SlVsTnBqRVh3ZGxUTktTSzlGLUQ0VXBxbEpkOS0yRzBvWWpEOEdqWE95azRKNjZreTdjN2tOQzhXOGkxZXBTaW1tcmd1a2hldHVfREtuT1JqaWVsRTduU0FHNXVobHBDOTJUQ052VUw2M19mY19YZWpfV0lYcjFCWUt0elhuZUVOLUoydXFYdGRUVUVIOGs2VTEwRVBEejNlSTlPakpHYk5xaHRvODQ2TzZZdHlCejN6WGtoblBTSTU3c3M0bnVraEkxVi1jN3BpZzQzaWZYWF80elh0R3VfV3pIcEdjV0pSN01RNDVSUTZzazhpa3JfRjVmaXZmMkd5Qm45R0Fmb2hfRkNtTERLQUN3TURBT1czV1VMMk9sU3RXQjhjc1EwMkV0RkNOd1hfUnQzYTJaUWpaT1BXU0JZWWpIbTJmQnRyQkxSQU9PLVlUTkw2aVRkOVBVTTFmWXVkS3BVMzZRNTA2djU5NUpNa09SZFNMSy1senRJRlhqYnJXSDJHcXZmT0V3eVp2VDdYdE10RWhfbDhVSDZzRmo3Q2laak40QzRmYmpMNVlFckcyejZ1S1kxcjdCUW0xRF9nUHNBNkM4dEJEVGdKOFJkX3ZfdGo1U3Y0VzVLclpqemQ1U0xyVkxKbTFxTV9lMU1lc1JMYnFoNWhJTUgzQ0ZZSG90bEpla0FnUUY1aGcyQzhhZkpoSmZhaERVaVJldWxZQ3Y0ZlBuc2gwY0Y0RlZQNFZjOGFpeXRMXzdVT2NNTFVwWTFPdWM5QzQ4SUZ6WHVzeVcwaDNaMkFCR1J4SXMwZlpGUzlqUllrUlc2U1U2dVZBeWwyOEZGQi1Wb0ZnTVpxcUFxa2kxWWMybHFSdmcydzh0LUZHUmtrOWR6bHJxamwwWmZkcW9wb1UxVGVETE94a3VMdDZTbWlYZlRPTVcxU09NcmZsZ2lQaXlGWHZ2SmxKaXBpbmk5QjZraVFQOG80Nk9EOFQxcDVEU0RhZURtM2swMWJiT1BpTzJFcm1hYUU4Z2FrZTNJd3FfY0xVbEp2TGV5YXhwWkdyZUFqQ256MW1fQkpQT0JmZENSeTZHeHRYaGVDQ0JCSy1kVXMzdUpkVkZFNUNQVGpmOUVnMXNqWEtKbl91RTVJNUQ3VGpmSlNzQnhCRWN2QW1nYmd0ZTMwWlFibTNyNUFUUzVMbTg5RDZ2a3dQSi04Y0NSR2F0bXlRRUlBNHVnaVZXQWpVU0RYZ00xRTFKMC1DT2FPQ1hsWUNZaUN5NWRjX1lSeXM4Ul8yWm9rUGV5Q0pxMW1DLXVZVFZwV1hoM1lva214RTZJRDBaZ29PX2l6UzRNc2t5OVFLSl9vdTdFay14cUcwMjEtYnFyWlZaV0NDMGdILVVKQkdPaXFEbk5VWGIxdEZnNUM0cWthV05GOGNzdkk4NE5MajVfQjZlTHpwYmdfOFBWSzczM3I0ZHVvbFBpZ1hZUC1oelRtUmlMMG10M2xhOVdJSFl4Vl9uTFBGeV9scVFKaHJneVBFak9zYXlzWE5GcUpWZkNKbW1ycW9fTVpUelpTOXVGYkNuR185NmJmeU53c01reGVrRTcyc1YtR2drMHA0VHg4dk5XR1Z5eUxJcUZweGRDeEQ4UjdpaFRNS2lGOGFuZDdYU0NTZVNZSzlFdVdhLTFxRWMtaV9DLUxBemhQeGJNbE1xNkFLY3pUbDhGeVBlRW9TUjk5ZVB4RHNZa2M5Y3NSeGM0R0x2ejQxdVlsREdhZkJGR19Qc2h0aksxSVRXSzNrWFJZdDlkUzBnZG82TXFaTVo1REd2bWhnQ19PVlZTdG5xeUtJcUduZElJa3AycmlSQkVnc0JlQWtyM0lXejVqQ0x5NG9TcDItSnZFRUVDNGZzeHRWQWM0WXcxbTZkZjlKdk43eU4wX0JtY3I4RXVZZnBzQnc2U0NvR21lWmhsRTU3UjQ2Y3p1RHBrcW1ySTRUV28zWUhRdjRaUDgwb0J0V2ZzaHgzZmN0Q0wzTm9CWUFodGlJTG5HWEZzRDZFbEhYMkduR2E4dHRERnlSRVBjNHJXTXVJZ0gwanJKVUZwc3hrRk9kc2NpNzM0WC1ob0c2LW5UU2tqc3BXRGRJS3R3TkVpRk9mU3BsQUozLWxXMmY3Rld4NFNFMVhOZ2o1aWJ0Q3AxUWFtRWIxeTVZNXBvUXBQTU03R3NhYlNjVzB2djNQSU9Bd094ZktZYzZjVWRxbGQzMWJWNW96SDNXSERYQkM1ei1qVHBlSVZUdlBkYjdhVklTalpQc1RHXzhLQ1pGaW5aYlhjX212VnB5Q2tvd1o5bGM1SFRKMmZYTFYtLTVXWG1UNEhLall5dzJMb24tVDhfcHBMbEpYQldrOHNnUkhFMGFhc2d4S3cxeGNKNXpRM0xscTllT0hsT2QxdllNYWNaZy03aUZGV0lJbURYVjJZNU1YcTNQSVBtR2dmWGx5SmpsTDRudWVwYVFHeU95VFo5WHZwRG9JX2tDY2pxVWxwcUFpUkdvbkE4R0J4dUhYTEEwVmtXdWpvSW05TVNWYl8yRzdzQ1BlanRjM0VrYkNyNkZzYnZxbjNoWmNMYkV2R0c5ZmZVd0VsRm1ob3U3a1J6Tmt5VVoxWHJzeTlfalp5d0FpX1pyckQxNklvaGl2R2JFSzlFLVdEZUExcDQ3TXhkMTIySkxzNWRnN1g3Sjd5eVl5Qm80bTN3cU9ESVFETHJMajAyWlU5aENYbm5MNnJmbTczX05MVnhuRE5WclptS2ZpQUtIMV9oVDlSaTVTQmQ4bW5MZDRzMkt0M1VVYnRHNkV1R1l4Qjk5VXRReTF3YWV1dnFnLXFtUWU5cllQampCM1Raek9wZXFLUDZqNm5WOUxQeFRFa18yNl94NVRTcklZNDdfNUxyU3h4MXgyRzA2MXliOTZwMXlmOGFfQ2ZOaEVqNVNOQ2RzWU9sZUh3dEhLYktQQjV1Vld2T2hnLVk2MlF2d0laU1EtLTQwaFZnZV8yTUJDY25yVFhieU9xVEtieWxiYUxobzZXT0d6cklMUnVZNzlKbFVUV014V3pjaHB3dmJ0NkVRTGpWeXlrQ3ltWDVRRENKMjlZWWhaQ29RdEtCeVFiN0xoTzdyZ1FJMEotMmwwWEpWSm5kYjFMMFh1eC1aMVd4YWdpenhOTlNURmZHWmJqc3dtWUVuNkg5Q2YwbEpFU1otdVloTjEyRnZaNGtxckd4UkRWLUd1X1hDV2E1YmVGLUtQRHE4RFNMRGtUYi1CUVBmRTlxSk91QUIzbVluanlXWGJFRFRjNkQ4cEVPdG9QVXowbUFDV0lUcXlqT1JsN1FCbUtSNlI2WW9VZ2VhaU5hSXJTNkxWcUwxczAybzJWbGZjLUo1ZFhYVjVyY2Y3eHNtMG5JS3lZR3l6Z05lM1FoRlZnVDJ3bmVWeENpN044VExsNnNGdjVCMXFKVmw2ZHhvdE1oQ2lUekFHQjMyM3VsbzJtbWRmM3FBZDBuR1FEa3FSLXJGa2JaQUJRZ2d0a3I1REhORTNFelRxSWlZZVU3NFNLbDhySThEenF5ZjNKV21takxLMDFxdDFPZ1BlekJRT1Zoa09RYnBfdnNKRXhfOUxuRnA1Q1lacldwNmZLeFpsRENETlBEcUd3LWprTjE3bWpvX3dKWDZOVjJ4UFkyTDBBbDN4YXpJekFMZWdDQjM3dXUwRnRDQlZhMHpSUmcwU2VDQXBNbkN1OF9aQXQzM3BxWU1jV2h4ME0zZHdLdVI0ajBETmxudTVUcEJzTlQ4Yk05TFM3THl1LUZwYmRUZExPeUE4TDJDWkM2T0lkNnRkVFhjckRXZE9CalA2R19xbnZZUjlQVGdkc3NXd1ZjV0R0RDlfWHRIangzS19EZ2RyZGs3NXB0cjJtWHBnOWh0aGdEVFRnZkF1RlZmbjg2T1I2UkcxMm0yaW1oWURJUEFzRkh1OF9LcEd5Q0YwUjVGVERYSk1iZ2pJRHNKSXd5Q0N1WDVCMV9xX1UxRlhvbEN0bHRoOFdNNDAxSVk0Y3lBZkd2V2tOMmFCYUJsNUxYdnRpZEpoWDUyTWpLOXphc1JSMVdES3BFVHR2c3AtcnhIdFpKblBneVRoUmpvbkFSZ2padVZMdXJPTUo4eUxqNmNVajdFYjFlMGVqYWRvT2RmS1J2QkYycHZHZFZGcGFGa2dFWmVJenhDMW9aMTZyS2d6VjhiWlVobWlVNXkyVXRxRXltZXdMQUNVaG5sbkphOVM4RDZjZjRvX24zc1Bpb0tobmU1ZFJfbGt2MzFwUTlmWWtFcm9CM193OUJyMFplOWlhb2FPS1RuSXpwTWRjaDhYX3NETGV6akp0RGZVMTFRcTRqWC1idzNqRGhrS3RXeXlRYl9FVlZGSHVVdzVGS2ZHcC01eFVSbVlCaTZCS0xQTC1hQUFiSEdseGJoOG4xN1Z0UE51Zkc4bWZMQXJ4WU5fdnowemFlaW5GZUJLQlk0OTRablJUdmJDLUp0bXFKbGJaeWgwVFVtZVZJWUtVblNuMm95Ym0zclkwOTVRZHBtSEtUN3pNbkF4ZHM0aXRaS3FCYk9QTC10UEdZWDJKeXY1NGN0dnp2aHh6NlZHZV9ScElUQWhhdmY3WTVNeHp4aVBSOTVPSVJvMVR3SXdpdlBWdkZHTExKYWtoVWlnNGJ3M1lBS00weWtZQ3Zkc2lGUTFNbFpFTUowZHVSX0EtNEF3WWRodmpVa2p5dUlVWUdvQlZjOGpldURNR1JtZ182cW1pelFPRjl0LVZpSklmaGNQZjJGU1VLRC1QaGxvc1lkMmtRS3F5RFpnTkllQjQ5WnFHejZ1MXU3OHkxTU1XcU9Rcl9pdkd6SEdQY0NYekViajU4T2V1Q2lGZ3h4UGljTERTSTEwdGFUMXNEaDJnU2xEMzBTMFF0UlpmMjdTZEdROHl0UkZ1MjU0SzhzVkRXZmY1SFJyMTFCdmNtdzBsWUR4bTZteWtuenBzbjY4TW0zMFZBNGNRMHZLWHNsRlJmV2NKYTZBeEZVYVJfNGtEdlJUYWZlZnhjdkt6ZGMySWFFTWltNFdtZXM5aWFTS2s4YlRaUTE5cUVLMlYzNVpjMUhIYm1nTDNFS3VRV19abGZOc0JEc0hrNWx0WDhUekRRWVBNeUxtUzlKX1RYVlFvb3dWTTI5V1ZXeXNhbFk4ZjZ0cWhydHU5YjJPV3dDT1dQMXRNRmd4VjUxc1NLZ3EyTTlOdDNSRHRzTURSNUpma1JZd1F2TExTMnhCZGpUdk9EeXpWVmJsVlFXWS02dDRtb24teTNQTkItYk5FLThEWnpsZDRXUHVyNXFEVjFmTzVzZ0pvd0trMEJsa05xWVBfZ2dFZFZQS1Z5RVYxSF9JT1FCRk1LU0gwMmpZT243Q3FXTHE2aGJuTVhqNjZGSG5ETUgyRnJtYUJINmM1REg3dFdKZTFRbU9JZ1V5VXhHNkFTZ1NUSjV0clE5dmtGZmJHazA3QlFFczhSU2F3TGFxV0JEZkoyS0FEdVlsNXprVXZza0pfV0Npa3lJb0ZSSmlkMHg1WWJfSzlEUGJsLVU0SkllOFNJM0d2REFrRGZJUWppN2xHd1RxNW9qUFpaNmZYdG9tM09nc05SOURFbk82RFJpdVRNUEdGaDRPVktNWkw1dGhfVi1pdmZoejFYc3RZZ2V0NU1rNV9NaVJiSGI4cDlwS2o5dERGWmNSSDlOZTdSaXdCY3NjQXV5XzhiM2daWjBySlRBMDNTV252TkRYVmNzS1N6UGFBYmdNMndveThRY1FOQjBRZXpGMzVUQVg2RnlXTVpBNFJlcy1wR19GaDZIRW5OdFROdTBBOGNQZ3FITDV3RTR6Q3JiNTIzdDUxTmh6bTdzLTB5V251LWdVUnJIM0JWYlVHMmt3MXozZ1JvT0VhM3ktZXo4Nm94eUxEd3N3UlhSdDZGdC1kNXVWTjBqLVZndHMwQkItY29lMWJqeGw2aDRTTFB2SzlZRUN5dXBRdFdfNEJJWUlnam96b2ZRR25SQ05PZHoyVmY5OFRxM0xpNXZNX096T0xsdU1TRTgxTTdURHZvMUVFT0ZmZURKcUxaWUdhVFJOcjE5N1lONWVfZ1BSenpaVm41RmZ6Y3RzNGZxTlhDak1nNFZMVzNSUVdFN0FOSU1UNFBUX1lYSzNyVkl1T25oaFAxZS1rVXZMZ0EyZndkU2xFOFY0YnF5aU1uOGZNcHljMDQwaWZtbEJfYTR3MDJXV1VVcjE0N1VqSkgyWkNRc0pkVThnQlVRcDgtdVUzRW9wVy1tOVhMZVptbUk1aERfcXAtRDJ5cUxETnZFVU9MTEJ2RkVVQjA1SDdJbElEMWd1TTBucWpGeHpfUWk1M05XY2p5Rk1IVHVYUGcxalQzZ3BqRTRfREZnNmdFY2tZWmpTTEg4UE5PWHk4bmlqUDd1bDlXbTJLTm93RWtNVV9YbThlZVRXX2w3aWp6QjVjQlF0RkY2cEtVSFpXTVNJWjdqQTVQbzdlOVpCQl9SQjRZdTVxLURVOVQ3LXFadWZMV3dkUWRaUnh0c0NkVkdUU0tYM1AwMU9iQnlJcExQODNoc3pibmNlWEtpWlRXQmlhNHZLd3ZPNnUta0ZkdWFHWXl0N2NhZkRIeTFqci1FM1J4OWFnSFlEdzVTRGQtS2Jydk5MS2ltZy1YLWQ4cmNHYzBNNzNsN0lSeXg3UFpoaDY5UVRXTW1peGNRV0xxZTNWZWlYMkV5LWZmZk5kcDNSSFMxMEw2OG01VGRJcEJPQzVSYjFwbUVqZldrLWVXY2JoWk1Sb2E1WVMtV19haTBhdnZWenNiYmpDVFB2MlVPbUR0Ujh5THJxRnRfVTlob3gzWnB2c1BDM01OMHMwRHBfN194T0wyX2dGeGd1NWFpUmJwT1N4UnktTTg3dmtvd0NtdzBOdmc5SjJnWHlYa0RCVE1xcUIyT1FWOFVQeV8zOUdxUWhuUW5fckx5UnlPeWV4RmFhVktaNVZFUzJFeWNoY2g5bjdXTzdQMWxCY2pqZXQ0WEFiN3kyNV9SOWZfcm8yZ3ZUa2dlODdzSTlVM0FtYktBbG5Db18yMFNJM2VXSmprTEhzdHU2QS1UWlhmdXNFUVpSNE9PNlBITl81TWQtOXB3ckpvajlmb1FucTlRaFlkVEJCckF3VEQzbEs0ZHFzM2dTOWJYUnU1YWtPSW9tUzdqOElrLXhpa2FrSkw5N0o5Z2JFQVBKc0hvRHBjdVNybzZOcE9reTVCdFRjU0toRjJtX2FaT2lQN0ZIeDc4MXNONmxlNGI0akIwWnlRUVR2WHhFYnNQLW5IUUJicm1JM0NYOGwxNHc2VGJjc1VHY2s0MmVpdVhYODMyYkVvcEVCVHhPRUU4cXMxd0hPOENUWmJmdFZDdXdIX0pzSjlNWXpDNFMzdlpkVlNGSGxTQzloX3dLbC1PcmQtWUZ2QWRZX1EtRElXd0dBNS04MFdQb0xXYTA4WUw5U1ptZmlFbHN5REtpWDhTN1pnQXo1cnVfdEJfcXZQeTdGbWVPbEJUNU0yMmpmcVpzTU9xcnhEN3ZYbXFvWHdoQ2RuSGhuTWt1eG1MSWRhM0VLaTU1RVg3U2dxZXI2V05nRmc3WEV4aVNiSjFrNnY0SlJtblV2Z1k3T25BYkFtS2JldXZSUVFPYmpoWXd6TUF5X0RvZDJRaGFrMk1zbXFOUlIwR2hyU1U5WDZKVWRKTjk4bkFZSF9TajRKODdUQXVaYVZ5VVR1UnJOU3g1TXdueWxpQmNNMElJcWx0aUxlZWV0NElzOTBhTng0WG5JTG05R1pWdDRxSUpqNnY3Z2hweHVWZGZLSGY4RmFreVJPMGVWNkE0bHYwdTdRSXZsQUtFUlpUUVVIUWpLel8wWWs3S2tibHYwaVVIdXJ5R1pHTVNrVl9BN2hobWhnY181dm5tYkk5VTRCU2k1U1VDbFdjclpaeTJQWEZvN2lrcXB0ZEJLZFFsQWlzeGhlRVF0eDlHeUlLeUhJUHhjUlpxdlpWZUtPRjBlMEJ2RVVMVWdIM296M2tpWklaQjNsejUzVlY1d0FpVV9fb1dSY2ZBcl83aGhPZXhwMHFKZG43ZjI0eXhlU0NOOFduaGsxZVVuU1VuY0FWT0UwZmQ3VVVPbG9hRGpSLWVpZzg0SUdFTjl0REdKaXpXamRIUklfSjctVUlWUnJuckhnREFaZlRuRGdXYzVFRWtFRW1zVFc5dnNXbVJVMkV1YTBJYkJiUXRQbjJWRTNLeU9JSmlVZGVvWEpnR3J5Zndndi0ybmRyNjlVQzRBeVVBa2VVMTFZR0E0VGVlT1V5aUlCRXlpWHJaclRpUVB4a01uMEo1VDZmNi1semR6anhFeWdYUmxGSnBHZFlRczhfZVVSZTBFQTgxU1g4MjMxQmFSMnllSnY0bFlDYUZOVmlqUWo4Ykh0aGl2UjhEb1gyYmcySnU5R1d3QkFDRjdwNGtBQ0otQWdBSlR3c3NvMkctOVlOeWZmdjBPWXNJSVZNbWs5bUVpWkdEVHVEcFRPWi1XSEJhbEM4Y1VHSGZnenpFRVQ3Z2s2cHpGRFdOUnJfYVFWaF9FcWJfSFBidVJLTzdZY3pJbFBCSVdTamwxSzl3QTdzOWtVN3hNTFpyRWNJNDNsVXRnZFAtXzkwUFJVOEVWNGtEUElEUTJQbF9rWlJTVnVPNzV1cjZTbTBMNVIxQ3lvS3QtZGp3V2FsR3RQTjJhT0VETE9xbEZXdlJCeEg5VG5ndnVoRFJPLWdmdVUxaDNCV0phYzRodEQtdUpaSTJpRHcxaHJ2T0Z2M2FUbDJfNzNOZXZ0Um9zYTZYMXpFdTFvRkxtdGdiTHpfVVNfZnhuMm9LdnNMZmlIYWhacDg4ei14dS10ckdiUjg5UzVhR2FPWlF5NUVqNUJUbDcxZUlTNEk2VG51TzNzZ3RsLXFYOHQyNDNGdHpmalkwMTV4Y1hTQUhZck1mSEJ5b1NXMjduZkN5b2xCSGdhd3J5eDZvdGE0dUhaQkcwTWduN1lGbk5kRWs4T3JNY0I5M0RxOWpSYkdBYlZiN3NEckhPeGpvYVJPNzF5eExCX3o5ZWtsUWNmT2w1aTZVVTczOEhDUnQ3RjdSUEdzcWpxNkRBUjk2blVydVFzUlJ4VHdybk1ZNGhuVjkySi1WTEdJZUV0UnhvUUZVcXhvYXRTc1h5WDFybEVRaWNOZW5DMnB0ZXlRMVJUNU9FdnFqLXF0VF9xTmZubTM4VnFlNy1OcWJ5MjdvUmNXUDA0TnNIUXd2anpzd0ZSYjltR2xKUElYd3YxODRrXzVFZlpmVWFwUjRXYlFZN2ZTa2xSUjZwdVhnYzQ4QUhScVJTWkxYM0ZjX1ZmUEFCQzNFX0J2Y1dSYUE3dUdCUnN6MEhXeHBSaWc2T3RkQ2NRRFBHNjduUHlfSVFxTVAwVHdna2dsLU5CeDQ4eUFhNkpqRlRxdFFaeE44Y3UzR0JUUnd0ZVhBOWNXalFJQUN2OW9XRS1ZMkpKR0ZTZ0gzb3UzcTVfWGZlNFRQZVpQRVU0b1BvRXN0eHdEYWI0UlZBZmVtd1BIS0dKVFQybUIxTzZvdWk4aWI2ZTJxU3VERnRabnVYWWZyLXBsNHZaQ0xnN2FFRGdUVTdYT3N5Ni0wcnROUUE4VHpSWi1KM3J0eFpTLUpERUNKT2RuMjNMUDFJYkQxVWs2THg2OE10WUZHSzNqek1qREVTWTBubThuNHBOR0ZQMWtIVDA2RmVZbWxXVWhvcHdyWURVU0cwMDVLdW1BUkQ0amt4LWRNeU5YVVJQeFdqc1kxdFlRTEs5NXd2ODU1Z1BUMHhGRmpta19SazFHVVJtemdzYnVhRHpCZ2xhY2p5LVNObGxUU2Z6QThwVG1OVEFoYkNkRkwzaDdXWTFmVFRFdy1WN1Rmd2N5a2dEb29IQUdLNHNXTFJOalZiZGNKR0FWdlpBZDV1MHdQZkk0Wk04Z3dhVlFnOVBlQ0VzSDgyY0ZhQk1BRGVTUFMxS094ZWQtZmxuVkhpdG9nbDZUZmJ3MENXNTdZLXZkNVJNY3J1bzNEbkl6dVl1UnVVTWhEbk1sRUZuWVBFR25QdENaM2pwcGJLRGNtSkZiYVhDemtRMXJTM2kzeXRva2xfcVdHdVF4MWxWQ2QzN1lvdUMtZmxOU3EwdmVCTU9Cd0VGZU4xSVNaR0JqbVh0SU5HNGdWM1p1WXFpYkFTalhUQXlkT3N5OEctRmY4U2N0ajBXTUFNTlJzd2Vhc051Q0lheFl1WmUtZ1g4Y3lZQWJoVE9PNFpsNXotejRDRFF0SHJXTFNXTkJSWkYxRm1UVnNGLUdaWExzUTNxSWpQMmNKcmdxS2twMHI4YVVRVVZWbFFOdFZsZ2liT3lFS1VnOXU1QVU1c2U2SWM1em14aXdzeTlhVzhOcDJ5aEJrRW9ua3FFMnQwTko4ek5wMHFqb3ljcEZwU0Q2X3RLVC1PdFdDeVF5ckpQaVo0OTZlMlFwdl9nYXdoUWpXUkdfQWlkYWQtT0o2eEFyS00zRExyZndYTGt2T0VWWUJRX2FlenFQUFZHVkJBWWtTbExuUE5KNGJEQlZfS3JZRFRsM2o3LXdHWGJPNUZjREgzTV9WNkR4REc0cTZnU29vUHZQR3BmTGJpbHhpQVZuTk82OFpUWGlXa0Z0dHhJbXlsM2REZXM2WktvVjdrMXhJc19SUEF4RDh5SVlxYnBUTXdGM1pDQ0dFTlplcVdWbE5rQ1lnWkpHaVh4QUhYTTh3bm9JQ2lMMmtEN2d2WjM1VmdXMW1BaXN4ZjBJd0FzZnFLWWxhcEV5RWcxTWJvQ0hCQU81cmhhWmppcXdsZFpTTHgtejNOd2U0UzFINktEOUZNYVpOYWV0UlJsdnd2Q3YxOXNFUzNhNWMwZFBFQjRRaXBVSU9qZksyY0xwV0J1UkFrLWd1aml1QmM4dDhVcVlvMWVZanB6bm1wbGI5RWxzWkxIS3BJazcyczlPYTJnTldObXhUVmdNdG51SEVCUURPMHZqZHJaeHd6TVZicTBYZTczYWFiaUs0VEhmVGgzZmxHbGFHcjRVLVlJdlNMRl9ER2JOWlRmZWJlZzZNbm5mc0ZxYmJuOThKVk16anBTVzRYNklrdEhYbHYza1JpYXUwcW8yX1lqWUlNZXZsZTRRRHdzN1JZTU5MSHhxYlFaNENvSjZSQ0ZlYm9mak11MXA1WE1jUUt3d3RMTDFySUFFaWZURkFrWGotbHZkRGtzTEQxTi1OZlYxRzJqd1d0MHdjRUxxN3R2bWNmbUNVbTljY3Bpel9tdEZBeGc3d1gzdXRacTBZZXdsR0M3S1AzeVhCOXpVaThjV0dldkcwMlZxUUhjWGRRVnN6RFVBUmRUaVdLOEpmVnVoaWhxOUJ4Q2ZSWG5PY0Z2Z1NTa2NuQzBYSjNLZ0RXNG5WQS5rVm9iRlZDdEdXejd5dXVyQl9aTjJn\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:49 GMT", + "content-length" : "799", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "57095ee1-fc1a-4db1-a05e-fa40ce8612a0", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey\",\"deletedDate\":1529955169,\"scheduledPurgeDate\":1537731169,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:32:50 GMT", + "content-length" : "73", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "59308436-f8b5-490e-977b-8b2a8014d08e", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: mykey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:02 GMT", + "content-length" : "799", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9ce3e469-3bf1-4668-bbf0-927016923650", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey\",\"deletedDate\":1529955169,\"scheduledPurgeDate\":1537731169,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:05 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ba3e67a5-dc5b-426e-9728-c4cb9e09221f", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/restore?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:28 GMT", + "content-length" : "662", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b31fca5a-57ae-4a6a-9222-4ca4b137d1eb", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/encrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:33 GMT", + "content-length" : "453", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "967c56c9-10be-4857-b01e-f92c27523252", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"value\":\"erYmYOm0ajwQ5aPjd4ABINeQzlnNcgwZ-7NxlnHJ-YFiJTeF5iDRAmSfgrpwllDs_-P9hAKCOOrMXA4jcUrkl-31dANx8lhc-d5dwICBCsR503fnZVqo-uAWRTYNK480skK_KQ16bO9CBlwXDIfdWZ67t6gzA6-gEmA__M-1LKeD-qAmaJhfiyBZhTds9fQdYlGtbz1RJNo2WyMIzVNmBRdVmWs-W2bivmWvp6A6ZBcq9MOdf_x_pnnU4lzcIlxiBS6qcNqRyHb0i9-7zvIahErfDMRzkt1Hm84etBlWSePM5HWwHWPIVMfyvrx0nN7nWBkRXlpUG3VhfPcoRrK1HQ\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/decrypt?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:34 GMT", + "content-length" : "245", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8d038330-0313-4c84-8375-44fe487e5a5a", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"value\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/wrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:34 GMT", + "content-length" : "453", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "34df3d36-5b86-4046-a3aa-3f7bee3cf047", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"value\":\"QDIhPnQAntVyheWbDC7XR3L81dZYznSM_s91jhO0lFZG4nLdA0Si0czdpw9ZD66V8ohdTQtAKaVhA6cjfloD23ARBHOALdjH8c35WizbfbHrAMbBeEq4OrKFjnErclGjtUZQybLRnBe-mcAH8jjMyJltEaJHHxM2lB6sCD-Kwza7BkWLhCQF5jQbxJ1SZ-Hbs8S-Z9WgHxz9rFkm8JuziZ_obFYotqnScPejMeBm7AteumbJExv25_Zdb5lCT6qC2S6JzKquDBEK0X5oRmzhWHcdUf_MYmg11vcu1AWq5NJctBSdMZjETDy7ehgFPHkGDZ-27QKTp0XFUAbvdK1p_w\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/unwrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:36 GMT", + "content-length" : "245", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dec501cf-86b9-4ffc-80d4-d73dfcdeffba", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"value\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/sign?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:37 GMT", + "content-length" : "453", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "819b6ae7-712e-4899-ab81-01eec55e09db", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"value\":\"XTv9CvECml4QuN27XTG2nvmQtL9xRDSnI7hLC62ivMiiot96QLoT6_Hb1k9cHOeYcndgHPQapb-Xkomp1CpaJhrBSyH8DS-dnYd7j8-SY6vVljcUOQ3hucokvRc0TW2feCVpH3yVXhn3XXT3H4RJ2c8yPcSUFWhr_FQLjAeDqmngoGYKMdO_-_T4Pq_WUyioKwxjopavpJQACvl76qxVwaqv9gicvSzw4CWcM9Gfk20SKyhUnsji76U9pnvDHTZ-GZI1rH1HXopcHWt46gAd36jLmUtTfKq4o7l61PChKUeHx6JglwflE_djABjWmIUyO6Gy5bl8XzBLZ74iWWcE0w\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7/verify?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:42 GMT", + "content-length" : "14", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a5e43463-bd3b-4256-be0a-da48c39cae3b", + "Body" : "{\"value\":true}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:43 GMT", + "content-length" : "799", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a5ea7ef8-7632-4928-9ded-60fb3f95ec86", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey\",\"deletedDate\":1529955223,\"scheduledPurgeDate\":1537731223,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:43 GMT", + "content-length" : "73", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4126f8d7-7321-4770-a96d-9cedb5275a63", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: mykey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:33:55 GMT", + "content-length" : "73", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "36fd6da7-f74d-4438-92b1-639f8b6c4eaa", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: mykey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:34:07 GMT", + "content-length" : "799", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9dd24a78-2491-4e6c-b7e6-34357397e198", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey\",\"deletedDate\":1529955223,\"scheduledPurgeDate\":1537731223,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey/3e460debb7fe40e5b54d4e08343a3ba7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iB_ttu57Y6X92UP_lga-3CRL_Gi4kTiaWla7hssnksNIs8oCv4IJAldkU7igm0QrX74ewVjLHoGwVcRVLjEtiQR9SmohEGz2oy00pGhyv3RzyMU7vGtYyxu-JPqtUY--8Edf1rfPrplrRcIO8kBW4Y4hGSQRi_V031jYK7jTvu0b_p2KRRq85xhiLQzCAucvttyGUVT3MXtlABPUSfzXGGt2WoSQgQJEMvUldg8HNtWE6w0HZuqN6iSlho3QQhewuVnr__NKbtMTaVli2FIJiI7nyHNoh7JROZDaMQNKHntWeFPwsAwfCYWV8V1sCR_u3MK04Ki9-43cR2iaFn9z5Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955141,\"updated\":1529955144,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:34:08 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "12f98a13-a38f-43b6-b12d-149491cb86eb", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/mykey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:34:31 GMT", + "content-length" : "65", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "422333ff-9c77-4bbf-b450-2d3da99a04ba", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key not found: mykey\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificateVersionsForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificateVersionsForCertificateOperationsTest.json new file mode 100644 index 0000000000000..9002fb4a1c198 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificateVersionsForCertificateOperationsTest.json @@ -0,0 +1,326 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:11 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "eff8e1fa-cd72-45c1-803d-3552feac6c99", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:14 GMT", + "content-length" : "1882", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1b83255d-5418-4a3f-ab5a-ffd04a97a6f7", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/a85065d141eb43fab3281b2a097cb916\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/a85065d141eb43fab3281b2a097cb916\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/a85065d141eb43fab3281b2a097cb916\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959334,\"updated\":1529959334,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959334}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:17 GMT", + "content-length" : "1882", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3cb5718c-3ff3-4c68-9972-5f096bad8bd5", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/2716a4cf0ca24847bceff841ea15c2c3\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/2716a4cf0ca24847bceff841ea15c2c3\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/2716a4cf0ca24847bceff841ea15c2c3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959337,\"updated\":1529959337,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959337}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:18 GMT", + "content-length" : "1882", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8ed20a87-144c-4cf2-bb53-a4460f3839b9", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/4e8c436beb3749d58cd814df978e2358\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/4e8c436beb3749d58cd814df978e2358\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/4e8c436beb3749d58cd814df978e2358\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959339,\"updated\":1529959339,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959339}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:19 GMT", + "content-length" : "1882", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f39236ad-585e-4674-901e-86ce9332f8ee", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959340,\"updated\":1529959340,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959340}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/versions?maxresults=3&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:21 GMT", + "content-length" : "1241", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "189a4943-ae93-4671-8b33-00e3bc9d88a5", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/2716a4cf0ca24847bceff841ea15c2c3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959337,\"updated\":1529959337}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/4e8c436beb3749d58cd814df978e2358\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959339,\"updated\":1529959339}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/a85065d141eb43fab3281b2a097cb916\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959334,\"updated\":1529959334}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/certificates/listCertificateVersions/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjQhTURBd01EYzNJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVlpGVWxOSlQwNVRMMVpGVWxOSlQwNVRMMFpCUkRWRFFrTkdNVEkwTXpRMk9UUTRPRVk0TnpBMU1qWkNNa0kwT0VZeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjQhTURBd01EYzNJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVlpGVWxOSlQwNVRMMVpGVWxOSlQwNVRMMFpCUkRWRFFrTkdNVEkwTXpRMk9UUTRPRVk0TnpBMU1qWkNNa0kwT0VZeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:22 GMT", + "content-length" : "295", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7741ff7e-67e7-4aca-8306-b1ab7d020bc1", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959340,\"updated\":1529959340}}],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/versions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:23 GMT", + "content-length" : "1099", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2fd54aed-e996-4d0f-b941-159b415fefe4", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/2716a4cf0ca24847bceff841ea15c2c3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959337,\"updated\":1529959337}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/4e8c436beb3749d58cd814df978e2358\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959339,\"updated\":1529959339}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/a85065d141eb43fab3281b2a097cb916\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959334,\"updated\":1529959334}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959340,\"updated\":1529959340}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:25 GMT", + "content-length" : "2045", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5fffcf77-3c08-47ec-9cfd-7ec280017783", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificateVersions\",\"deletedDate\":1529959346,\"scheduledPurgeDate\":1537735346,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959340,\"updated\":1529959340,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959340}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificateVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:27 GMT", + "content-length" : "107", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "06953c6c-e9ca-4142-a5e0-2ce38f16998b", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificateVersions\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificateVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:43 GMT", + "content-length" : "2045", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e15c55e9-f8a7-4f3e-ae66-af7e363df646", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificateVersions\",\"deletedDate\":1529959346,\"scheduledPurgeDate\":1537735346,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificateVersions/fad5cbcf1243469488f870526b2b48f2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959340,\"updated\":1529959340,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificateVersions/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959334,\"updated\":1529959340}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificateVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:42:44 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9156820c-1028-412a-b705-f04eeb01a125", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificatesForCertificateOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificatesForCertificateOperationsTest.json new file mode 100644 index 0000000000000..4e1386df59fa9 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listCertificatesForCertificateOperationsTest.json @@ -0,0 +1,644 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:43 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f0792e7f-ae7f-411a-ad0c-602ea8690a37", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:44 GMT", + "content-length" : "1854", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3c7457d5-59e9-4a0d-a8e5-c2d1259b1476", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959064,\"updated\":1529959064,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959064,\"updated\":1529959064}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:46 GMT", + "content-length" : "1854", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "923b96fa-9d42-4a5d-881c-f022ccb17c55", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959066,\"updated\":1529959066,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959066,\"updated\":1529959066}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:52 GMT", + "content-length" : "1854", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b93e866f-cb77-4af1-9700-cdbea343fb26", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/e40473726096485885a03c4187f32ca0\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate2/e40473726096485885a03c4187f32ca0\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate2/e40473726096485885a03c4187f32ca0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959072,\"updated\":1529959072,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959072,\"updated\":1529959072}}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/import?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:56 GMT", + "content-length" : "1854", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ef38b007-d226-4f6f-b152-6b32b4ae543e", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959076,\"updated\":1529959076,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959076,\"updated\":1529959076}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates?maxresults=3&includePending=false&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:57 GMT", + "content-length" : "1013", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "82da5088-cc16-421e-bd0b-efa90d6c8ad6", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959064,\"updated\":1529959064}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959066,\"updated\":1529959066}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959072,\"updated\":1529959072}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/certificates?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEl2VUU5TVNVTlpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEl2VUU5TVNVTlpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:58 GMT", + "content-length" : "255", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9a5384aa-0060-484f-a41b-1f8cd88be526", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959076,\"updated\":1529959076}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:37:59 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5e7d0cef-2aa3-4ce1-a32e-6db3e9cf7eb4", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate1\",\"deletedDate\":1529959079,\"scheduledPurgeDate\":1537735079,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959066,\"updated\":1529959066,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959066,\"updated\":1529959066}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:00 GMT", + "content-length" : "100", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f02d758d-9c80-498b-bd32-47d560521936", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificate1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:13 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e54e83a2-2e7a-4b3b-86d4-5e742b94c1ef", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate1\",\"deletedDate\":1529959079,\"scheduledPurgeDate\":1537735079,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate1/bf0a8c214ff34fc3902c767249a969b8\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959066,\"updated\":1529959066,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate1/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959066,\"updated\":1529959066}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:15 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "92f99041-da48-4d3f-84a9-f8bae3cc8219", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:28 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "be41c4f7-78aa-4b88-8356-1a0c1dbb8e85", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate2\",\"deletedDate\":1529959108,\"scheduledPurgeDate\":1537735108,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/e40473726096485885a03c4187f32ca0\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate2/e40473726096485885a03c4187f32ca0\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate2/e40473726096485885a03c4187f32ca0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959072,\"updated\":1529959072,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959072,\"updated\":1529959072}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:29 GMT", + "content-length" : "100", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f970252f-72f7-485f-869a-76ec0d3eb18a", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificate2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:40 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d165f6f0-31a9-425c-b62d-b19e91b44203", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate2\",\"deletedDate\":1529959108,\"scheduledPurgeDate\":1537735108,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/e40473726096485885a03c4187f32ca0\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate2/e40473726096485885a03c4187f32ca0\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate2/e40473726096485885a03c4187f32ca0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959072,\"updated\":1529959072,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate2/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959072,\"updated\":1529959072}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:40 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "14c1afb1-be4e-4a53-8df3-e11350078dcd", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:54 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "48ea0908-c760-4f4b-b4ba-2d14d430374a", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3\",\"deletedDate\":1529959134,\"scheduledPurgeDate\":1537735134,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959076,\"updated\":1529959076,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959076,\"updated\":1529959076}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:38:55 GMT", + "content-length" : "100", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "31ce2318-5673-4af7-a0b4-3e32315fa7b1", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificate3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:07 GMT", + "content-length" : "100", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3e3085cc-54c0-4d1b-9e62-4d308983180e", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificate3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:19 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "51b01711-a3a6-4533-ba32-84f6292f6f34", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3\",\"deletedDate\":1529959134,\"scheduledPurgeDate\":1537735134,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate3/41d744311ea04826a5a65bbdb52e742a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959076,\"updated\":1529959076,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate3/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959076,\"updated\":1529959076}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:21 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7fce4ebe-9eb4-48d7-a504-4ca23f02016a", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:33 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "fd091de4-9f6a-4c4c-8b85-e575e16b235d", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate0\",\"deletedDate\":1529959174,\"scheduledPurgeDate\":1537735174,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959064,\"updated\":1529959064,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959064,\"updated\":1529959064}}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:33 GMT", + "content-length" : "100", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3afe0156-f4cd-4e20-a95e-b5122e660ccf", + "Body" : "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Deleted Certificate not found: listCertificate0\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:45 GMT", + "content-length" : "2010", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4623496f-dc05-404c-a053-54d2204b5b61", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate0\",\"deletedDate\":1529959174,\"scheduledPurgeDate\":1537735174,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"sid\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/listCertificate0/145c1f4d5b6140be8c4b5a8e0329f5ab\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1529959064,\"updated\":1529959064,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"policy\":{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/certificates/listCertificate0/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1529959064,\"updated\":1529959064}}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedcertificates/listCertificate0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:39:47 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "eab030ff-a5e0-45dd-904a-df1bef3ab1c4", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeyVersionsForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeyVersionsForKeyOperationsTest.json new file mode 100644 index 0000000000000..c65425ffc6d56 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeyVersionsForKeyOperationsTest.json @@ -0,0 +1,326 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:03 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9acb74b7-2f44-4866-a8c5-a5c955e458a4", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:07 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d82133b9-e745-433b-874f-7d3024a29e2f", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/51374aa5d790497ab1fcae270b647402\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tVn-_yOWjHT8Mmc9XmNBPsEDVYz4X4Yu3741T5ZAauxwixnC-1PLFM2cgrR3pi4MwuPeiM8tMxuqpQRGEvSE18q8iD9CAJ9bw5UbHQo1GO3nmjKa8EzzG_BJS1Jk7sypHkrSgO-ofsJpKCZrWdHwAzzV_BdJl8-TY3heyir_wgr1IMsSeD6PKd5q7KhLGb7AibhlHMuszrexnP_UTuz7vJesNV4-s3PXEtY9Kl2YR8xh3vN36Nzl6zGsljTsLP9AQNsiEQqjiP5ylwC1dacBO_FkAC-WGaSkGVo9lku1az1Y8SxpACvGJpXRo6ZNsmb3AmHnvfZ-Bo4ux8JwRrXC7w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956387,\"updated\":1529956387,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:09 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e81b2a6b-803a-4993-813f-b3fa9f9465b5", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/1f08e3afd3bf40e79109746d07dad50c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"5DM2bMSoTOKkxjE2cINalxMTk4Vb03N1oNVO-CGUT69PORW6N65-3ZXcS97XuS4pdYE-Zh491a6pVPKmD3qQWpDEeQQvgr0DTxJXImbb9zMrNGw4s_yKj8Kehg0Kqq5g0kgP8ME0KOVK3T_oqKLXq6voawevAj8hRJ2c3NR_bQT7Tqs6d-wa2P3EwMP2m0jVr1iBqU5XxMdqBnBx_uJFQCVoEEIT7ycXfy8l9QoDKGyN0n_7P4GWKBzEJCsoV9_iSZrxFnzM3_bX73fd8IfwFFXFLMdqRwSR9XZvjv2YNC531RD9C9bdlzfhnEmoWPV5hF10pH2O0qZXzpTTK_JWlQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956389,\"updated\":1529956389,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:10 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "72aafe9a-c1d2-4545-9871-a79523d9effa", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/003904806cd74f9fbcb2e7bd03a8a1e8\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"rZS4PFPiUL3BZO58BFInyYbGfrRl-2amrEi69uuaP53Ujbd28zEL5yo8MReTSVp14xg51kzF4jWyr5USKYdh5LYn7PvEvmKpHjvOpg1pjvKJSm1bgdGLvUEc7nqS58DmnO7R0AdbDehiJa1jdihlJvodZtC05P9iK4oNq86EE-FbOckIvk-zGqFf-ucWaZUIVJ_nY1Rq4Foj3U7Khk1opoA8lDVPkRZgx2nWpGmiKqqZWsDkfynqz6v2deR-mjpyybBHan7UN6VvAZa6y0z8ARnSmMoxfzo2_CblWZ29mzP35XpuWlxeiyI4_SsNGp_dHqQYYJ3saOzRa-3Qex2cwQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956391,\"updated\":1529956391,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:12 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c0d05795-37dc-4d32-91ef-d8d116f2c7df", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/26f227e491cc4c77938975b7c6d0e890\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"h1m4X_hODwyKVjQcPZ_LdsH9xQbwKszXWxN5yVWfmHylCwNCNkvVWxBdlmHXaLl4nf7g1ZlVBK4zyy9agcAXFL9JItksEqkiSeNVUfwP3NCrq2xLn-BXv1NL4dz-1o47OWS4j8-6nPPBoMqolqDSQkGdw02S3AzUoy9XQcCgmvdYNLTiDLlQ8csRhTA6X74SUDygdf9_rsGcOmnsyrOC7MGt2K77DD2r_xb4xXSL7-_leG8hWRHZ8irpXAdZSNsjIat2EtxI9d-3Eut91C1EUloFrH_eYnNHndjaVnLpb36b8BmwgMcM6IPTW3C3JJLWu8KiAAi6JJoVQsVf6UQwlw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956392,\"updated\":1529956392,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/versions?maxresults=4&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:15 GMT", + "content-length" : "1214", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ac1fc657-b065-4928-8136-4fa7ad106b7b", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/003904806cd74f9fbcb2e7bd03a8a1e8\",\"attributes\":{\"enabled\":true,\"created\":1529956391,\"updated\":1529956391,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/1f08e3afd3bf40e79109746d07dad50c\",\"attributes\":{\"enabled\":true,\"created\":1529956389,\"updated\":1529956389,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/26f227e491cc4c77938975b7c6d0e890\",\"attributes\":{\"enabled\":true,\"created\":1529956392,\"updated\":1529956392,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/51374aa5d790497ab1fcae270b647402\",\"attributes\":{\"enabled\":true,\"created\":1529956387,\"updated\":1529956387,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys/javaKey/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjAhTURBd01EUTBJV3RsZVM5S1FWWkJTMFZaTHpaQk16WTJSVEZGTWpZNE1UUkROa000UkVKRE5qWTJOVE15TkRFMlFqbEZJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=4\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjAhTURBd01EUTBJV3RsZVM5S1FWWkJTMFZaTHpaQk16WTJSVEZGTWpZNE1UUkROa000UkVKRE5qWTJOVE15TkRFMlFqbEZJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=4", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:17 GMT", + "content-length" : "242", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c34154bb-4bb7-494a-bc40-289ac480d091", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020\",\"attributes\":{\"enabled\":true,\"created\":1529956372,\"updated\":1529956372,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/versions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:19 GMT", + "content-length" : "1102", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8479f427-a1cf-41f1-9658-78383aceb583", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/003904806cd74f9fbcb2e7bd03a8a1e8\",\"attributes\":{\"enabled\":true,\"created\":1529956391,\"updated\":1529956391,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/1f08e3afd3bf40e79109746d07dad50c\",\"attributes\":{\"enabled\":true,\"created\":1529956389,\"updated\":1529956389,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/26f227e491cc4c77938975b7c6d0e890\",\"attributes\":{\"enabled\":true,\"created\":1529956392,\"updated\":1529956392,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/51374aa5d790497ab1fcae270b647402\",\"attributes\":{\"enabled\":true,\"created\":1529956387,\"updated\":1529956387,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020\",\"attributes\":{\"enabled\":true,\"created\":1529956372,\"updated\":1529956372,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:22 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "502a3ec2-a94d-48a3-aa53-fd42677927b0", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956402,\"scheduledPurgeDate\":1537732402,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/26f227e491cc4c77938975b7c6d0e890\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"h1m4X_hODwyKVjQcPZ_LdsH9xQbwKszXWxN5yVWfmHylCwNCNkvVWxBdlmHXaLl4nf7g1ZlVBK4zyy9agcAXFL9JItksEqkiSeNVUfwP3NCrq2xLn-BXv1NL4dz-1o47OWS4j8-6nPPBoMqolqDSQkGdw02S3AzUoy9XQcCgmvdYNLTiDLlQ8csRhTA6X74SUDygdf9_rsGcOmnsyrOC7MGt2K77DD2r_xb4xXSL7-_leG8hWRHZ8irpXAdZSNsjIat2EtxI9d-3Eut91C1EUloFrH_eYnNHndjaVnLpb36b8BmwgMcM6IPTW3C3JJLWu8KiAAi6JJoVQsVf6UQwlw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956392,\"updated\":1529956392,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:24 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "64e465db-0f2a-43fb-a28e-240d477960f0", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:35 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "30f4b2b8-ab3f-4b08-a662-ae629bfaf8ac", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956402,\"scheduledPurgeDate\":1537732402,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/26f227e491cc4c77938975b7c6d0e890\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"h1m4X_hODwyKVjQcPZ_LdsH9xQbwKszXWxN5yVWfmHylCwNCNkvVWxBdlmHXaLl4nf7g1ZlVBK4zyy9agcAXFL9JItksEqkiSeNVUfwP3NCrq2xLn-BXv1NL4dz-1o47OWS4j8-6nPPBoMqolqDSQkGdw02S3AzUoy9XQcCgmvdYNLTiDLlQ8csRhTA6X74SUDygdf9_rsGcOmnsyrOC7MGt2K77DD2r_xb4xXSL7-_leG8hWRHZ8irpXAdZSNsjIat2EtxI9d-3Eut91C1EUloFrH_eYnNHndjaVnLpb36b8BmwgMcM6IPTW3C3JJLWu8KiAAi6JJoVQsVf6UQwlw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956392,\"updated\":1529956392,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:36 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "89dbcd68-1ee5-445e-9205-e703c211c6b6", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeysForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeysForKeyOperationsTest.json new file mode 100644 index 0000000000000..91036340f5fea --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listKeysForKeyOperationsTest.json @@ -0,0 +1,1178 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:12 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "00e9d961-ff1b-4b4a-9c4e-047c214536b2", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:13 GMT", + "content-length" : "665", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2e83ccbf-1d8a-4b4c-9f1b-f1d34c0e5492", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0/a2ca8d3a34754bcfac4482a6e93a2c89\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"ua_AoKdqySiDmuhDzKLEG_rjn93eATGx_iMA4VvUoIhW1fh-BiJdl842pyYcPJ5WhvSMP-hokvUwN9nNbD87SgXKjlfMsDPeZE1R5B3c8lmiNaANt3I5hjiK-KINvFvmkGn_Ck0ta4OOxryqIB9RKpO2Ovodpf628YlynDJeIZnrWRcIC--ImvP5OVUnS2G38DeONa3oaCIGxnDFJnTZq8WSwLWEBd-EhOUB0WdRqrsWMl0algCBazGdU094AsoptYdtVv8AxZjTSXAO1gX0Ug3wVGGvckG5EgO-XeMH3L1lbT1WRnuhWpUPXbjdARoc95f_OLh-xrOVH6AQ8t6mvw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955914,\"updated\":1529955914,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:14 GMT", + "content-length" : "665", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "874555a7-208d-4110-9149-9cf2abebb8a7", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1/4df00d400ab2401385ceb5a232ad4811\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"jC3MGXY_VawDhysKwB0cgbt4dYWK8URxwcpsmHnYDpds_b8QY_DcnTtIVPt_yIqIvFBA8T_D4RhX3Iisk1tK_tIF4mpF89Uv62VstOpvQ_UkDsEcGD3bZ5Ovkek_zKaM6bBJT3KHHQSoMsVx6d2waGQUdnO-MtFwNcZqkQYw6JWSrCbecR6QfFSqC3y2avqkRxbEhNqWB27cY970Ts3CSc2VbuYTpouk_VcnKYp3eAK8iAAwVjbm1Sl5ocXLspzLsvPtrpxK_5wyCDbHMUQERTIr8jjA2_9ZFNxwUtckM9fj7hv4S4qfmm6HaOY1IVDDg2tiwvS5ixPX4cIXm4bU6Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955915,\"updated\":1529955915,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:16 GMT", + "content-length" : "665", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e4f61451-a26b-4224-a5d8-2f00c7108198", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2/fed263ac4f9f46f1a013605e439e9c95\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"vxiLUvR99uXF2PBRhz1DIxZtGZm1UeIb2hhybQcCjq8RSIh1y0v154mOjfZDtUGG8zC9gpuqIosQBYThuzffaJ9uPgDBYFnqXdv7KmRNLRyIM2XSpsfHdfpVPnYH98TFYXKn90qYGJdFN_b0oJmJ54Kamenr5srF7lrtVmoFZWTK_7QEY_OKVTpZYUoDID0hbs48ISfqNE-UBJi2U8cLGDn7QD2nwDtADE49i2h7HF2QuOcEf8uATwq1VN4eWTrPQfVBid9tGYc5mlDr9x3a7u8DxzMYSJq-0XKgcwnkAmAFNxHIpkUrVZq8Gq6Y_g6sFN11rbxvES2JIX1jYiZfqQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955917,\"updated\":1529955917,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:20 GMT", + "content-length" : "665", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6710e60b-4a18-437f-a7d8-bf33f9239f3b", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3/f2eeb783813846a892ea08ddb15d9b4f\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Og5QpSCcphZ5NuiO8hTPcdrsxOXvin3Pwvq7agQdRK1_oWC2dY9rDMdX7nOO_8a-m6V-E1xmuir3v4hvLkF8eVvN1VusFIUmAnMXOUUMeAybyx9GIplXte8yyJqLMBcGyS13X_0rA6JSFdH8o-8ksoSqqz5A0elLQeY1iVCaCn96I0xPCXJvveETTg64k8bI2njv5_E4IvYWfZfc_3dHUgqidWS4SI46QywQACEoxApDcnz824rbZZX1LhYST55x1KdhN53RfFVEIzG6u6m26UFmJFEF6DTOCcZ-vVQZ8STnz4Dg9rQVQN6xnnjng-09DDJ5FS-kxKveAxs6NZtZQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955921,\"updated\":1529955921,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?maxresults=3&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:21 GMT", + "content-length" : "294", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "97b16305-0ec2-453a-86a7-6cc7a209584b", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlEVWtWQlZFVlVSVk5VU2tGV1FWQkZUU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlEVWtWQlZFVlVSVk5VU2tGV1FWQkZUU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:23 GMT", + "content-length" : "294", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bce81807-780a-4d1e-9b52-4d6f442b1f77", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlLUVZaQlJWaFVSVTVUU1U5T1MwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElXdGxlUzlLUVZaQlJWaFVSVTVUU1U5T1MwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:25 GMT", + "content-length" : "825", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "621e2f6a-33ed-4b84-a75f-b8b74a0ef6b5", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey\",\"attributes\":{\"enabled\":true,\"created\":1529955901,\"updated\":1529955901,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0\",\"attributes\":{\"enabled\":true,\"created\":1529955914,\"updated\":1529955914,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1\",\"attributes\":{\"enabled\":true,\"created\":1529955915,\"updated\":1529955915,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlLUVZaQlMwVlpNaUV3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlLUVZaQlMwVlpNaUV3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:27 GMT", + "content-length" : "659", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b5426136-ba16-4a16-9236-8054b30d35c0", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2\",\"attributes\":{\"enabled\":true,\"created\":1529955917,\"updated\":1529955917,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3\",\"attributes\":{\"enabled\":true,\"created\":1529955921,\"updated\":1529955921,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:28 GMT", + "content-length" : "305", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8ffb4f19-a650-4440-9c0c-ad71f4d82cb6", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVldSVkpUU1U5T1V5RXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVldSVkpUU1U5T1V5RXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:32 GMT", + "content-length" : "456", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "020c27b7-afe6-44cb-9126-4801598f7dcc", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2\",\"attributes\":{\"enabled\":true,\"created\":1528498195,\"updated\":1528498195,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3MiFNREF3TURFd0lXdGxlUzlRVTFOTFJWa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3MiFNREF3TURFd0lXdGxlUzlRVTFOTFJWa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:34 GMT", + "content-length" : "208", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "41791ae9-3e26-463d-956d-dc34c6059bc3", + "Body" : "{\"value\":[{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey\",\"attributes\":{\"enabled\":true,\"created\":1528324427,\"updated\":1528324427,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:36 GMT", + "content-length" : "801", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "91db84d6-b4aa-4698-bc36-6708c9b37924", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey\",\"deletedDate\":1529955936,\"scheduledPurgeDate\":1537731936,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey/4afd2d81a8414c569054b7945534e053\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1528324427,\"updated\":1528324427,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:40 GMT", + "content-length" : "74", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c32bde51-8134-4d3b-a7c1-9259b58187e6", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: psskey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:45:52 GMT", + "content-length" : "74", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "70bfcef4-7618-4912-82ec-bdcd5812a366", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: psskey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:04 GMT", + "content-length" : "801", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a4b2c4a9-eb21-44ec-9f37-2bf252e2d522", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey\",\"deletedDate\":1529955936,\"scheduledPurgeDate\":1537731936,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey/4afd2d81a8414c569054b7945534e053\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1528324427,\"updated\":1528324427,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:05 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "496d7312-22dc-4099-8a0e-b5b247d80780", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3\",\"deletedDate\":1529955965,\"scheduledPurgeDate\":1537731965,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3/f2eeb783813846a892ea08ddb15d9b4f\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Og5QpSCcphZ5NuiO8hTPcdrsxOXvin3Pwvq7agQdRK1_oWC2dY9rDMdX7nOO_8a-m6V-E1xmuir3v4hvLkF8eVvN1VusFIUmAnMXOUUMeAybyx9GIplXte8yyJqLMBcGyS13X_0rA6JSFdH8o-8ksoSqqz5A0elLQeY1iVCaCn96I0xPCXJvveETTg64k8bI2njv5_E4IvYWfZfc_3dHUgqidWS4SI46QywQACEoxApDcnz824rbZZX1LhYST55x1KdhN53RfFVEIzG6u6m26UFmJFEF6DTOCcZ-vVQZ8STnz4Dg9rQVQN6xnnjng-09DDJ5FS-kxKveAxs6NZtZQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955921,\"updated\":1529955921,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:07 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2f80e2b5-0e5e-473b-bf61-6017bc2f8ccc", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:19 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8014cb84-809d-4c19-8a66-fc238b4bcce4", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3\",\"deletedDate\":1529955965,\"scheduledPurgeDate\":1537731965,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3/f2eeb783813846a892ea08ddb15d9b4f\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Og5QpSCcphZ5NuiO8hTPcdrsxOXvin3Pwvq7agQdRK1_oWC2dY9rDMdX7nOO_8a-m6V-E1xmuir3v4hvLkF8eVvN1VusFIUmAnMXOUUMeAybyx9GIplXte8yyJqLMBcGyS13X_0rA6JSFdH8o-8ksoSqqz5A0elLQeY1iVCaCn96I0xPCXJvveETTg64k8bI2njv5_E4IvYWfZfc_3dHUgqidWS4SI46QywQACEoxApDcnz824rbZZX1LhYST55x1KdhN53RfFVEIzG6u6m26UFmJFEF6DTOCcZ-vVQZ8STnz4Dg9rQVQN6xnnjng-09DDJ5FS-kxKveAxs6NZtZQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955921,\"updated\":1529955921,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:22 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b020fb71-4421-4b21-a7d9-dac8bfb8b307", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2\",\"deletedDate\":1529955983,\"scheduledPurgeDate\":1537731983,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2/fed263ac4f9f46f1a013605e439e9c95\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"vxiLUvR99uXF2PBRhz1DIxZtGZm1UeIb2hhybQcCjq8RSIh1y0v154mOjfZDtUGG8zC9gpuqIosQBYThuzffaJ9uPgDBYFnqXdv7KmRNLRyIM2XSpsfHdfpVPnYH98TFYXKn90qYGJdFN_b0oJmJ54Kamenr5srF7lrtVmoFZWTK_7QEY_OKVTpZYUoDID0hbs48ISfqNE-UBJi2U8cLGDn7QD2nwDtADE49i2h7HF2QuOcEf8uATwq1VN4eWTrPQfVBid9tGYc5mlDr9x3a7u8DxzMYSJq-0XKgcwnkAmAFNxHIpkUrVZq8Gq6Y_g6sFN11rbxvES2JIX1jYiZfqQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955917,\"updated\":1529955917,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:24 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4cb7be57-4534-4791-816b-243e973a503f", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:36 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7b0edd5b-4e5c-4dca-94d3-bc2e87e5f02f", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:49 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "905a1fb9-6a24-4640-b37d-f7cedda78aec", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2\",\"deletedDate\":1529955983,\"scheduledPurgeDate\":1537731983,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2/fed263ac4f9f46f1a013605e439e9c95\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"vxiLUvR99uXF2PBRhz1DIxZtGZm1UeIb2hhybQcCjq8RSIh1y0v154mOjfZDtUGG8zC9gpuqIosQBYThuzffaJ9uPgDBYFnqXdv7KmRNLRyIM2XSpsfHdfpVPnYH98TFYXKn90qYGJdFN_b0oJmJ54Kamenr5srF7lrtVmoFZWTK_7QEY_OKVTpZYUoDID0hbs48ISfqNE-UBJi2U8cLGDn7QD2nwDtADE49i2h7HF2QuOcEf8uATwq1VN4eWTrPQfVBid9tGYc5mlDr9x3a7u8DxzMYSJq-0XKgcwnkAmAFNxHIpkUrVZq8Gq6Y_g6sFN11rbxvES2JIX1jYiZfqQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955917,\"updated\":1529955917,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:51 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b3bd2660-2085-4e3b-afa0-50e5c84f7558", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956011,\"scheduledPurgeDate\":1537732011,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955901,\"updated\":1529955901,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:46:52 GMT", + "content-length" : "75", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "dc6be061-e837-4270-887b-ec0c0627c466", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:03 GMT", + "content-length" : "803", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "79fc36cb-4101-47d6-846e-7c29d3d99dab", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956011,\"scheduledPurgeDate\":1537732011,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/336e2905d0cd43ce9e10dfe3db55fc45\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955901,\"updated\":1529955901,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:06 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "55c81627-5e07-43fc-b3a8-172742c4632d", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1\",\"deletedDate\":1529956026,\"scheduledPurgeDate\":1537732026,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1/4df00d400ab2401385ceb5a232ad4811\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"jC3MGXY_VawDhysKwB0cgbt4dYWK8URxwcpsmHnYDpds_b8QY_DcnTtIVPt_yIqIvFBA8T_D4RhX3Iisk1tK_tIF4mpF89Uv62VstOpvQ_UkDsEcGD3bZ5Ovkek_zKaM6bBJT3KHHQSoMsVx6d2waGQUdnO-MtFwNcZqkQYw6JWSrCbecR6QfFSqC3y2avqkRxbEhNqWB27cY970Ts3CSc2VbuYTpouk_VcnKYp3eAK8iAAwVjbm1Sl5ocXLspzLsvPtrpxK_5wyCDbHMUQERTIr8jjA2_9ZFNxwUtckM9fj7hv4S4qfmm6HaOY1IVDDg2tiwvS5ixPX4cIXm4bU6Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955915,\"updated\":1529955915,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:08 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e63f7643-4971-4c39-88c5-15b291f7a267", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:18 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "bdfa8ad4-945f-4741-8139-2c5f30b5ea74", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1\",\"deletedDate\":1529956026,\"scheduledPurgeDate\":1537732026,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1/4df00d400ab2401385ceb5a232ad4811\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"jC3MGXY_VawDhysKwB0cgbt4dYWK8URxwcpsmHnYDpds_b8QY_DcnTtIVPt_yIqIvFBA8T_D4RhX3Iisk1tK_tIF4mpF89Uv62VstOpvQ_UkDsEcGD3bZ5Ovkek_zKaM6bBJT3KHHQSoMsVx6d2waGQUdnO-MtFwNcZqkQYw6JWSrCbecR6QfFSqC3y2avqkRxbEhNqWB27cY970Ts3CSc2VbuYTpouk_VcnKYp3eAK8iAAwVjbm1Sl5ocXLspzLsvPtrpxK_5wyCDbHMUQERTIr8jjA2_9ZFNxwUtckM9fj7hv4S4qfmm6HaOY1IVDDg2tiwvS5ixPX4cIXm4bU6Q\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955915,\"updated\":1529955915,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:20 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e839784b-9867-4121-92f3-b8fe1c470e20", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0\",\"deletedDate\":1529956040,\"scheduledPurgeDate\":1537732040,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0/a2ca8d3a34754bcfac4482a6e93a2c89\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"ua_AoKdqySiDmuhDzKLEG_rjn93eATGx_iMA4VvUoIhW1fh-BiJdl842pyYcPJ5WhvSMP-hokvUwN9nNbD87SgXKjlfMsDPeZE1R5B3c8lmiNaANt3I5hjiK-KINvFvmkGn_Ck0ta4OOxryqIB9RKpO2Ovodpf628YlynDJeIZnrWRcIC--ImvP5OVUnS2G38DeONa3oaCIGxnDFJnTZq8WSwLWEBd-EhOUB0WdRqrsWMl0algCBazGdU094AsoptYdtVv8AxZjTSXAO1gX0Ug3wVGGvckG5EgO-XeMH3L1lbT1WRnuhWpUPXbjdARoc95f_OLh-xrOVH6AQ8t6mvw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955914,\"updated\":1529955914,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:23 GMT", + "content-length" : "76", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f03b6084-e94f-475f-ac1e-3562377f206c", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: javaKey0\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:36 GMT", + "content-length" : "805", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b894f0aa-dfd1-48be-850a-2b1fc7d4e8a5", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0\",\"deletedDate\":1529956040,\"scheduledPurgeDate\":1537732040,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0/a2ca8d3a34754bcfac4482a6e93a2c89\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"ua_AoKdqySiDmuhDzKLEG_rjn93eATGx_iMA4VvUoIhW1fh-BiJdl842pyYcPJ5WhvSMP-hokvUwN9nNbD87SgXKjlfMsDPeZE1R5B3c8lmiNaANt3I5hjiK-KINvFvmkGn_Ck0ta4OOxryqIB9RKpO2Ovodpf628YlynDJeIZnrWRcIC--ImvP5OVUnS2G38DeONa3oaCIGxnDFJnTZq8WSwLWEBd-EhOUB0WdRqrsWMl0algCBazGdU094AsoptYdtVv8AxZjTSXAO1gX0Ug3wVGGvckG5EgO-XeMH3L1lbT1WRnuhWpUPXbjdARoc95f_OLh-xrOVH6AQ8t6mvw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955914,\"updated\":1529955914,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:38 GMT", + "content-length" : "807", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "123340bd-b924-4fae-9778-95b4b56165c9", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2\",\"deletedDate\":1529956058,\"scheduledPurgeDate\":1537732058,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2/47041a5e3b994e4b9db708d6352408d0\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1528498195,\"updated\":1528498195,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:38 GMT", + "content-length" : "77", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d86c3bfe-1403-4013-8d3a-7eec7b69c180", + "Body" : "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Deleted Key not found: otherkey2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:49 GMT", + "content-length" : "807", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3729a2d0-d600-4ddc-9702-da075acff800", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2\",\"deletedDate\":1529956058,\"scheduledPurgeDate\":1537732058,\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2/47041a5e3b994e4b9db708d6352408d0\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1528498195,\"updated\":1528498195,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:53 GMT", + "content-length" : "1960", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "18aa00d7-e70c-468e-ad94-f48ee92eaeeb", + "Body" : "{\"value\":[{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey\",\"deletedDate\":1529956011,\"scheduledPurgeDate\":1537732011,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey\",\"attributes\":{\"enabled\":true,\"created\":1529955901,\"updated\":1529955901,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0\",\"deletedDate\":1529956040,\"scheduledPurgeDate\":1537732040,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey0\",\"attributes\":{\"enabled\":true,\"created\":1529955914,\"updated\":1529955914,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1\",\"deletedDate\":1529956026,\"scheduledPurgeDate\":1537732026,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey1\",\"attributes\":{\"enabled\":true,\"created\":1529955915,\"updated\":1529955915,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2\",\"deletedDate\":1529955983,\"scheduledPurgeDate\":1537731983,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey2\",\"attributes\":{\"enabled\":true,\"created\":1529955917,\"updated\":1529955917,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3\",\"deletedDate\":1529955965,\"scheduledPurgeDate\":1537731965,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey3\",\"attributes\":{\"enabled\":true,\"created\":1529955921,\"updated\":1529955921,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/deletedkeys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4THpBd01USTROa0ZDUVVJelJUUkROVFZCT0VaQ1FVSTNOVVF3TURaRlJqTkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4THpBd01USTROa0ZDUVVJelJUUkROVFZCT0VaQ1FVSTNOVVF3TURaRlJqTkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:55 GMT", + "content-length" : "671", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "97f0cf15-fe18-4277-8e65-197d86da8e7a", + "Body" : "{\"value\":[{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2\",\"deletedDate\":1529956058,\"scheduledPurgeDate\":1537732058,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/otherkey2\",\"attributes\":{\"enabled\":true,\"created\":1528498195,\"updated\":1528498195,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey\",\"deletedDate\":1529955936,\"scheduledPurgeDate\":1537731936,\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/psskey\",\"attributes\":{\"enabled\":true,\"created\":1528324427,\"updated\":1528324427,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:47:56 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1be5ffd8-958d-40bf-9347-ec0b2becb327", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:48:40 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3b0e224d-4954-494e-bc3f-e02563a91b86", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:49:21 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2dc3a062-d8c8-40b0-b5c6-94051a98e086", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:50:03 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1673f2ed-a351-42f0-b7e2-7b6faf624c6c", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/javaKey3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:50:44 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "74452134-e090-4b61-b7fc-080f587be6a8", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/otherkey2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:51:27 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9063a352-98ee-4061-ad71-aebfac69d7e3", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedkeys/psskey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:10 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "06671cf4-5358-4422-a5fc-1b6e8b3ec191", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretVersionsForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretVersionsForSecretOperationsTest.json new file mode 100644 index 0000000000000..cb2280b29e667 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretVersionsForSecretOperationsTest.json @@ -0,0 +1,353 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:08 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2c75824c-371f-41e8-8e9a-5ec01cf40195", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:15 GMT", + "content-length" : "283", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2c458d79-6a32-4ede-b731-addbc052b5d2", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/41754735bad946d692a24dcadbf12db0\",\"attributes\":{\"enabled\":true,\"created\":1529957175,\"updated\":1529957175,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:16 GMT", + "content-length" : "283", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4c56ef30-a14e-47a4-a7ed-b1ed0b764569", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/bcae35f5a9f1438cbc64bcd2bc77548e\",\"attributes\":{\"enabled\":true,\"created\":1529957177,\"updated\":1529957177,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:20 GMT", + "content-length" : "283", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ef7a0d7e-20e9-4d1a-a6b6-6bc2efb966bd", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/719fe46020d447a9a0e0541c97adc73b\",\"attributes\":{\"enabled\":true,\"created\":1529957181,\"updated\":1529957181,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:23 GMT", + "content-length" : "283", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "96c66816-0089-42ca-8df7-d43aa30475e1", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/013abcff50844ef9ab448331a98d7b31\",\"attributes\":{\"enabled\":true,\"created\":1529957183,\"updated\":1529957183,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/versions?maxresults=3&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:23 GMT", + "content-length" : "1074", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5965ad6c-f5ab-467e-a663-a89892f5905e", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/013abcff50844ef9ab448331a98d7b31\",\"attributes\":{\"enabled\":true,\"created\":1529957183,\"updated\":1529957183,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/41754735bad946d692a24dcadbf12db0\",\"attributes\":{\"enabled\":true,\"created\":1529957175,\"updated\":1529957175,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/719fe46020d447a9a0e0541c97adc73b\",\"attributes\":{\"enabled\":true,\"created\":1529957181,\"updated\":1529957181,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets/javaSecretVersions/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzYhTURBd01EVTRJWE5sWTNKbGRDOUtRVlpCVTBWRFVrVlVWa1ZTVTBsUFRsTXZRa05CUlRNMVJqVkJPVVl4TkRNNFEwSkROalJDUTBReVFrTTNOelUwT0VVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/versions?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzYhTURBd01EVTRJWE5sWTNKbGRDOUtRVlpCVTBWRFVrVlVWa1ZTVTBsUFRsTXZRa05CUlRNMVJqVkJPVVl4TkRNNFEwSkROalJDUTBReVFrTTNOelUwT0VVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:24 GMT", + "content-length" : "255", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "08493c54-f278-4c63-879d-9f52a3030027", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/bcae35f5a9f1438cbc64bcd2bc77548e\",\"attributes\":{\"enabled\":true,\"created\":1529957177,\"updated\":1529957177,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/versions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:25 GMT", + "content-length" : "939", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "63aa7584-6c4c-47c6-90ae-dae8d9246e98", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/013abcff50844ef9ab448331a98d7b31\",\"attributes\":{\"enabled\":true,\"created\":1529957183,\"updated\":1529957183,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/41754735bad946d692a24dcadbf12db0\",\"attributes\":{\"enabled\":true,\"created\":1529957175,\"updated\":1529957175,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/719fe46020d447a9a0e0541c97adc73b\",\"attributes\":{\"enabled\":true,\"created\":1529957181,\"updated\":1529957181,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/bcae35f5a9f1438cbc64bcd2bc77548e\",\"attributes\":{\"enabled\":true,\"created\":1529957177,\"updated\":1529957177,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:29 GMT", + "content-length" : "380", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0d8db9a8-2e74-4b8e-9cdc-9b268f57ba71", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions\",\"deletedDate\":1529957189,\"scheduledPurgeDate\":1537733189,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/013abcff50844ef9ab448331a98d7b31\",\"attributes\":{\"enabled\":true,\"created\":1529957183,\"updated\":1529957183,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:30 GMT", + "content-length" : "92", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cd84ad83-16ec-4d76-a80b-ea39d2096100", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecretVersions\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:43 GMT", + "content-length" : "92", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8390da34-ca9f-4f8d-92af-f4e9a20dde70", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecretVersions\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:54 GMT", + "content-length" : "380", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "20249486-a0f1-44f9-afcb-dd453301bb9d", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions\",\"deletedDate\":1529957189,\"scheduledPurgeDate\":1537733189,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecretVersions/013abcff50844ef9ab448331a98d7b31\",\"attributes\":{\"enabled\":true,\"created\":1529957183,\"updated\":1529957183,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecretVersions?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:06:58 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a7ff180c-44c7-41ee-84f3-71ea4e503386", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretsForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretsForSecretOperationsTest.json new file mode 100644 index 0000000000000..a93b0117f0008 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/listSecretsForSecretOperationsTest.json @@ -0,0 +1,939 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:01:55 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "08230279-4bbe-4d9c-a2e3-3a9c87ca933e", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:01:57 GMT", + "content-length" : "276", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2de5ae03-59a4-41dd-b6a9-990a9f6282db", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0/b9fa9684b35e498ea811aba712a9270d\",\"attributes\":{\"enabled\":true,\"created\":1529956918,\"updated\":1529956918,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:01:58 GMT", + "content-length" : "276", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c558d525-20f5-4b27-a8ce-2c21e5b6556d", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1/f45e3ca2460949f79da26820be247a0a\",\"attributes\":{\"enabled\":true,\"created\":1529956919,\"updated\":1529956919,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:05 GMT", + "content-length" : "276", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ae76dc6a-aa55-457d-962d-ac3f0f619f94", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2/60048f9c48d04a92a166330759660b1c\",\"attributes\":{\"enabled\":true,\"created\":1529956925,\"updated\":1529956925,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:07 GMT", + "content-length" : "276", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "17fa6dda-5677-4a37-87cc-f6b236f8dd14", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3/5a500ee4fe2846b5b4b53e39564b46e2\",\"attributes\":{\"enabled\":true,\"created\":1529956927,\"updated\":1529956927,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?maxresults=3&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:10 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f7df6478-e1f2-4fb6-9d13-7111cac4fa79", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElYTmxZM0psZEM5RFVrVkJWRVZVUlZOVVNrRldRVkJGVFNFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElYTmxZM0psZEM5RFVrVkJWRVZVUlZOVVNrRldRVkJGVFNFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:14 GMT", + "content-length" : "308", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a23cef17-c86f-4927-90ce-737c9cbf9f28", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lYTmxZM0psZEM5S1FWWkJSVmhVUlU1VFNVOU9VMFZEVWtWVU1TRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lYTmxZM0psZEM5S1FWWkJSVmhVUlU1VFNVOU9VMFZEVWtWVU1TRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:16 GMT", + "content-length" : "936", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0f13f2cc-ec4e-4f17-bc6b-afca73812974", + "Body" : "{\"value\":[{\"contentType\":\"contentType\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret\",\"attributes\":{\"enabled\":true,\"nbf\":946857004,\"exp\":2524780204,\"created\":1525301405,\"updated\":1525301405,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0\",\"attributes\":{\"enabled\":true,\"created\":1529956918,\"updated\":1529956918,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1\",\"attributes\":{\"enabled\":true,\"created\":1529956919,\"updated\":1529956919,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5S1FWWkJVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5S1FWWkJVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:17 GMT", + "content-length" : "678", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "50d7383e-4341-4f40-b2fe-1188da8f7368", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2\",\"attributes\":{\"enabled\":true,\"created\":1529956925,\"updated\":1529956925,\"recoveryLevel\":\"Recoverable+Purgeable\"}},{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3\",\"attributes\":{\"enabled\":true,\"created\":1529956927,\"updated\":1529956927,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:19 GMT", + "content-length" : "315", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5c1d1926-90f3-429f-bad9-6c38c3421308", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXdJWE5sWTNKbGRDOU1TVk5VUTBWU1ZFbEdTVU5CVkVWV1JWSlRTVTlPVXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXdJWE5sWTNKbGRDOU1TVk5VUTBWU1ZFbEdTVU5CVkVWV1JWSlRTVTlPVXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:22 GMT", + "content-length" : "297", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d60a5d98-b735-4091-9f6a-240b366ee978", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElYTmxZM0psZEM5VlVFUkJWRVZEUlZKVVNrRldRU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeElYTmxZM0psZEM5VlVFUkJWRVZEUlZKVVNrRldRU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=3", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:23 GMT", + "content-length" : "28", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "74ac1d2d-fb78-4aa4-b46d-d3bfbc8c637b", + "Body" : "{\"value\":[],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:25 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6713dcbb-3ccf-40da-bb2c-5daaa32907c0", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0\",\"deletedDate\":1529956945,\"scheduledPurgeDate\":1537732945,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0/b9fa9684b35e498ea811aba712a9270d\",\"attributes\":{\"enabled\":true,\"created\":1529956918,\"updated\":1529956918,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:25 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "2344b631-0cb1-4576-b96c-b45795f8d5ab", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret0\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:36 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "607763b1-f185-4c76-82d7-9f9d884a9c91", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret0\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:53 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "88a61cfb-0772-403f-850d-c8de2356bc38", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0\",\"deletedDate\":1529956945,\"scheduledPurgeDate\":1537732945,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret0/b9fa9684b35e498ea811aba712a9270d\",\"attributes\":{\"enabled\":true,\"created\":1529956918,\"updated\":1529956918,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret0?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:02:55 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e6e1a021-3675-4c59-8522-d48357fbaa0b", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:17 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "896ea44f-1b01-456d-8866-3f947d034f11", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret1\",\"deletedDate\":1529956998,\"scheduledPurgeDate\":1537732998,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1/f45e3ca2460949f79da26820be247a0a\",\"attributes\":{\"enabled\":true,\"created\":1529956919,\"updated\":1529956919,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:21 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a590223c-9d1e-42a8-9f61-241cc271a1d6", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret1\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:33 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "1640e457-c662-49ad-88d4-58ad6ab83dba", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret1\",\"deletedDate\":1529956998,\"scheduledPurgeDate\":1537732998,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret1/f45e3ca2460949f79da26820be247a0a\",\"attributes\":{\"enabled\":true,\"created\":1529956919,\"updated\":1529956919,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret1?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:34 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5bd6dde7-b54a-4341-b2f2-30e946556c51", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:56 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "86880c00-0f90-4b67-8edc-9d9dbc227a56", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret2\",\"deletedDate\":1529957037,\"scheduledPurgeDate\":1537733037,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2/60048f9c48d04a92a166330759660b1c\",\"attributes\":{\"enabled\":true,\"created\":1529956925,\"updated\":1529956925,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:03:59 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ca7ac3d5-89a4-43a4-b852-4588dc4c7cb6", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret2\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:12 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e6d41612-ee3c-41a7-9056-98fe4cffcb9d", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret2\",\"deletedDate\":1529957037,\"scheduledPurgeDate\":1537733037,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret2/60048f9c48d04a92a166330759660b1c\",\"attributes\":{\"enabled\":true,\"created\":1529956925,\"updated\":1529956925,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret2?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:14 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f542e052-523f-4761-b1ed-d093cabfb10c", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:35 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "755f59d6-6c9d-43c6-a32d-7866033ac224", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3\",\"deletedDate\":1529957076,\"scheduledPurgeDate\":1537733076,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3/5a500ee4fe2846b5b4b53e39564b46e2\",\"attributes\":{\"enabled\":true,\"created\":1529956927,\"updated\":1529956927,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:37 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "84330d52-3023-4b8c-8c68-8c28276a0f7f", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:47 GMT", + "content-length" : "85", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "562aba07-c551-4799-ba44-08c3a8842da2", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret3\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:58 GMT", + "content-length" : "366", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d4bb3297-adc1-4548-9a0d-2e3112fba615", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3\",\"deletedDate\":1529957076,\"scheduledPurgeDate\":1537733076,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret3/5a500ee4fe2846b5b4b53e39564b46e2\",\"attributes\":{\"enabled\":true,\"created\":1529956927,\"updated\":1529956927,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret3?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:04:59 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0c73e76e-5247-4f72-b40e-fbdcdd4522d5", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:05:23 GMT", + "content-length" : "446", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cccecda1-64aa-4fa5-b416-a8a312e747c0", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret\",\"deletedDate\":1529957124,\"scheduledPurgeDate\":1537733124,\"contentType\":\"contentType\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret/713884f5253a44d1bda6bdcaa44466ca\",\"attributes\":{\"enabled\":true,\"nbf\":946857004,\"exp\":2524780204,\"created\":1525301405,\"updated\":1525301405,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:05:24 GMT", + "content-length" : "84", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ee34d65a-6074-43b8-89fc-f2a9f0826e9d", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:05:36 GMT", + "content-length" : "84", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "a6435927-6142-4455-9243-5db8f2ac8a24", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: javaSecret\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:05:47 GMT", + "content-length" : "446", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "62a49eb0-1af2-4a4b-aacb-b2da7ced46c1", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret\",\"deletedDate\":1529957124,\"scheduledPurgeDate\":1537733124,\"contentType\":\"contentType\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret/713884f5253a44d1bda6bdcaa44466ca\",\"attributes\":{\"enabled\":true,\"nbf\":946857004,\"exp\":2524780204,\"created\":1525301405,\"updated\":1525301405,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:05:48 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "52c236c5-277a-4ca8-b4b5-cd2da94104bc", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/secretAsyncForAsyncOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/secretAsyncForAsyncOperationsTest.json new file mode 100644 index 0000000000000..37ba78ff59b8b --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/secretAsyncForAsyncOperationsTest.json @@ -0,0 +1,488 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:12 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7a228ca8-d5f8-4f20-841c-0c0bb83669b8", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:13 GMT", + "content-length" : "236", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c904649b-7d4e-4fdc-a89e-ae73ff287126", + "Body" : "{\"value\":\"password\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955073,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:15 GMT", + "content-length" : "217", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "cd1eaff6-4636-47ea-a21f-439b552f4897", + "Body" : "{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:16 GMT", + "content-length" : "236", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "08c6ace8-0b99-4880-8dfe-cc9d5bb7601e", + "Body" : "{\"value\":\"password\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?maxresults=2&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:17 GMT", + "content-length" : "320", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "006bd35a-f6ce-4bc2-9148-e47b43514652", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETXpJWE5sWTNKbGRDOURVa1ZCVkVWVFJVeEdVMGxIVGtWRVNrRldRVkJMUTFNeE1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETXpJWE5sWTNKbGRDOURVa1ZCVkVWVFJVeEdVMGxIVGtWRVNrRldRVkJMUTFNeE1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:20 GMT", + "content-length" : "308", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "97d0267e-7161-47a1-949d-f9f8cde2d4cb", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lYTmxZM0psZEM5RFVrVkJWRVZVUlZOVVNrRldRVkJMUTFNeE1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJM0lYTmxZM0psZEM5RFVrVkJWRVZVUlZOVVNrRldRVkJMUTFNeE1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:23 GMT", + "content-length" : "292", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5665ab08-d4db-4365-b60e-3683f51fd073", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:24 GMT", + "content-length" : "571", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d0995cef-19da-4e81-a8d9-92c4e6ea6b50", + "Body" : "{\"value\":[{\"contentType\":\"contentType\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret\",\"attributes\":{\"enabled\":true,\"nbf\":946857004,\"exp\":2524780204,\"created\":1525301405,\"updated\":1525301405,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV4SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:26 GMT", + "content-length" : "303", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "e6151ba9-bc30-4347-922e-3eb62c94b156", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:31 GMT", + "content-length" : "297", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d232760c-7f94-4cdf-b745-6c45517f0a01", + "Body" : "{\"value\":[],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lYTmxZM0psZEM5TldVTkZVbFJKUmtsRFFWUkZJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lYTmxZM0psZEM5TldVTkZVbFJKUmtsRFFWUkZJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:33 GMT", + "content-length" : "487", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "3c9db8a9-ec89-4a2e-9dac-842a8bd991b1", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":\"https://tifchen-keyvault-fancy.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElYTmxZM0psZEM5VFJVeEdVMGxIVGtWRVNrRldRVkJGVFNFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElYTmxZM0psZEM5VFJVeEdVMGxIVGtWRVNrRldRVkJGVFNFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:35 GMT", + "content-length" : "28", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7e667c2c-d0fb-487c-a1e2-d59ae01bc8a3", + "Body" : "{\"value\":[],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/versions?maxresults=2&api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:36 GMT", + "content-length" : "245", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "68bdc85b-c327-4b4a-b6d8-e7aace54e6f3", + "Body" : "{\"value\":[{\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:37 GMT", + "content-length" : "360", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8ffa953c-549f-48bb-8d6c-d9262e086ab7", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/mySecret\",\"deletedDate\":1529955097,\"scheduledPurgeDate\":1537731097,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:39 GMT", + "content-length" : "74", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "7890578c-6761-4007-9fb6-9320c16d797b", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Secret not found: mySecret\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:44 GMT", + "content-length" : "82", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "404", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "d4f30e76-fe7e-41ed-b3f5-4b0d7a51469f", + "Body" : "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Deleted Secret not found: mySecret\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:54 GMT", + "content-length" : "360", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "549bc32d-9dff-4122-9275-bc2deeee7a85", + "Body" : "{\"recoveryId\":\"https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/mySecret\",\"deletedDate\":1529955097,\"scheduledPurgeDate\":1537731097,\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/mySecret/4c0b6145ce354d5faaba40f02d3e3cbd\",\"attributes\":{\"enabled\":true,\"created\":1529955073,\"updated\":1529955075,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/deletedsecrets/mySecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:31:59 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "204", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6b4d73d4-fee9-4093-9d1c-6da7c3d14046", + "Body" : "" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/signVerifyOperationsForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/signVerifyOperationsForKeyOperationsTest.json new file mode 100644 index 0000000000000..0886071eddf0d --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/signVerifyOperationsForKeyOperationsTest.json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:51 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "5540e9af-3515-4bdd-83ba-75e3b1403142", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:52 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ecba9497-f55b-46b5-8fd1-ed4dfc52709d", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956372,\"updated\":1529956372,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//sign?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:54 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "afb885d0-d130-4881-85ec-a7d862b0cc1d", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020\",\"value\":\"VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//verify?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:56 GMT", + "content-length" : "14", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "8997d15d-b73d-4265-9bf6-f304a68b7024", + "Body" : "{\"value\":true}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020/sign?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:52:59 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4dc07972-0840-43f9-9f54-0f782f1b1219", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020\",\"value\":\"VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/e980beac4ecf46d0be73665033846020/verify?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:53:03 GMT", + "content-length" : "14", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "778a7ebc-69b2-4665-b48b-116ac31faff5", + "Body" : "{\"value\":true}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testCrudOperationsForManagedStorageAccountKey.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testCrudOperationsForManagedStorageAccountKey.json new file mode 100644 index 0000000000000..6988e5b59a99f --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testCrudOperationsForManagedStorageAccountKey.json @@ -0,0 +1,441 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/%5C/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-07-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (AuthorizationManagementClient, 2015-07-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:03 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "87830", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-ms-request-charge" : "1", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "205af036-08c5-465d-a915-29e98bdadca1", + "set-cookie" : "x-ms-gateway-slice=productionb; path=/; secure; HttpOnly", + "x-ms-ratelimit-remaining-tenant-reads" : "14999", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195703Z:205af036-08c5-465d-a915-29e98bdadca1", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "2020ac1a-7445-472d-8c55-a026958ba1a2", + "Body" : "{\"value\":[{\"properties\":{\"roleName\":\"AcrImageSigner\",\"type\":\"BuiltInRole\",\"description\":\"acr image signer\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/read\",\"Microsoft.ContainerRegistry/registries/*/write\"],\"notActions\":[]}],\"createdOn\":\"2018-03-15T23:23:08.4038322Z\",\"updatedOn\":\"2018-03-17T01:25:51.8758677Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6cef56e8-d556-48e5-a04f-b8e64114680f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6cef56e8-d556-48e5-a04f-b8e64114680f\"},{\"properties\":{\"roleName\":\"AcrQuarantineReader\",\"type\":\"BuiltInRole\",\"description\":\"acr quarantine data reader\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-16T00:27:39.9596835Z\",\"updatedOn\":\"2018-03-17T01:26:48.6387319Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/cdda3590-29a3-44f6-95f2-9f980659eb04\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"cdda3590-29a3-44f6-95f2-9f980659eb04\"},{\"properties\":{\"roleName\":\"AcrQuarantineWriter\",\"type\":\"BuiltInRole\",\"description\":\"acr quarantine data writer\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/write\",\"Microsoft.ContainerRegistry/registries/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-16T00:26:37.5871820Z\",\"updatedOn\":\"2018-03-17T01:27:36.3941651Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"c8d4ff99-41c3-41a8-9f60-21dfdad59608\"},{\"properties\":{\"roleName\":\"API Management Service Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage API Management services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2017-01-23T23:12:00.5823195Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/312a565d-c81f-4fd8-895a-4e21e48d571c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"312a565d-c81f-4fd8-895a-4e21e48d571c\"},{\"properties\":{\"roleName\":\"API Management Service Operator Role\",\"type\":\"BuiltInRole\",\"description\":\"Can manage service but not the APIs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*/read\",\"Microsoft.ApiManagement/service/backup/action\",\"Microsoft.ApiManagement/service/delete\",\"Microsoft.ApiManagement/service/managedeployments/action\",\"Microsoft.ApiManagement/service/read\",\"Microsoft.ApiManagement/service/restore/action\",\"Microsoft.ApiManagement/service/updatecertificate/action\",\"Microsoft.ApiManagement/service/updatehostname/action\",\"Microsoft.ApiManagement/service/write\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.ApiManagement/service/users/keys/read\"]}],\"createdOn\":\"2016-11-09T00:03:42.1194019Z\",\"updatedOn\":\"2016-11-18T23:56:25.4682649Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e022efe7-f5ba-4159-bbe4-b44f577e9b61\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e022efe7-f5ba-4159-bbe4-b44f577e9b61\"},{\"properties\":{\"roleName\":\"API Management Service Reader Role\",\"type\":\"BuiltInRole\",\"description\":\"Read-only access to service and APIs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*/read\",\"Microsoft.ApiManagement/service/read\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.ApiManagement/service/users/keys/read\"]}],\"createdOn\":\"2016-11-09T00:26:45.1540473Z\",\"updatedOn\":\"2017-01-23T23:10:34.8876776Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/71522526-b88f-4d52-b57f-d31fc3546d0d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"71522526-b88f-4d52-b57f-d31fc3546d0d\"},{\"properties\":{\"roleName\":\"Application Insights Component Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage Application Insights components\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.Insights/webtests/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-11-29T20:30:34.2313394Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ae349356-3a1b-4a5e-921d-050484c6347e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ae349356-3a1b-4a5e-921d-050484c6347e\"},{\"properties\":{\"roleName\":\"Application Insights Snapshot Debugger\",\"type\":\"BuiltInRole\",\"description\":\"Gives user permission to use Application Insights Snapshot Debugger features\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T21:25:12.3728747Z\",\"updatedOn\":\"2017-04-19T23:34:59.9511581Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/08954f03-6346-4c2e-81c0-ec3a5cfae23b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"08954f03-6346-4c2e-81c0-ec3a5cfae23b\"},{\"properties\":{\"roleName\":\"Automation Job Operator\",\"type\":\"BuiltInRole\",\"description\":\"Create and Manage Jobs using Automation Runbooks.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/jobs/read\",\"Microsoft.Automation/automationAccounts/jobs/resume/action\",\"Microsoft.Automation/automationAccounts/jobs/stop/action\",\"Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/read\",\"Microsoft.Automation/automationAccounts/jobs/streams/read\",\"Microsoft.Automation/automationAccounts/jobs/suspend/action\",\"Microsoft.Automation/automationAccounts/jobs/write\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T20:52:41.0020018Z\",\"updatedOn\":\"2018-03-06T02:20:41.6886187Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/4fe576fe-1146-4730-92eb-48519fa6bf9f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"4fe576fe-1146-4730-92eb-48519fa6bf9f\"},{\"properties\":{\"roleName\":\"Automation Operator\",\"type\":\"BuiltInRole\",\"description\":\"Automation Operators are able to start, stop, suspend, and resume jobs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/read\",\"Microsoft.Automation/automationAccounts/jobs/read\",\"Microsoft.Automation/automationAccounts/jobs/resume/action\",\"Microsoft.Automation/automationAccounts/jobs/stop/action\",\"Microsoft.Automation/automationAccounts/jobs/streams/read\",\"Microsoft.Automation/automationAccounts/jobs/suspend/action\",\"Microsoft.Automation/automationAccounts/jobs/write\",\"Microsoft.Automation/automationAccounts/jobSchedules/read\",\"Microsoft.Automation/automationAccounts/jobSchedules/write\",\"Microsoft.Automation/automationAccounts/linkedWorkspace/read\",\"Microsoft.Automation/automationAccounts/read\",\"Microsoft.Automation/automationAccounts/runbooks/read\",\"Microsoft.Automation/automationAccounts/schedules/read\",\"Microsoft.Automation/automationAccounts/schedules/write\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Automation/automationAccounts/jobs/output/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-08-18T01:05:03.3916130Z\",\"updatedOn\":\"2018-05-10T20:12:39.6978200Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/d3881f73-407a-4167-8283-e981cbba0404\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"d3881f73-407a-4167-8283-e981cbba0404\"},{\"properties\":{\"roleName\":\"Automation Runbook Operator\",\"type\":\"BuiltInRole\",\"description\":\"Read Runbook properties - to be able to create Jobs of the runbook.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/runbooks/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T20:47:49.5640674Z\",\"updatedOn\":\"2017-04-25T01:00:45.6444999Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5fb5aef8-1081-4b8e-bb16-9d5d0385bab5\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5fb5aef8-1081-4b8e-bb16-9d5d0385bab5\"},{\"properties\":{\"roleName\":\"Azure Stack Registration Owner\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Azure Stack registrations.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.AzureStack/registrations/products/listDetails/action\",\"Microsoft.AzureStack/registrations/products/read\",\"Microsoft.AzureStack/registrations/read\"],\"notActions\":[]}],\"createdOn\":\"2017-11-13T23:42:06.2161827Z\",\"updatedOn\":\"2017-11-13T23:54:02.4007080Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6f12a6df-dd06-4f3e-bcb1-ce8be600526a\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6f12a6df-dd06-4f3e-bcb1-ce8be600526a\"},{\"properties\":{\"roleName\":\"Backup Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage backup service,but can't create vaults and give access to others\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/*\",\"Microsoft.RecoveryServices/Vaults/backupJobs/*\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/*\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/*\",\"Microsoft.RecoveryServices/Vaults/certificates/*\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/*\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/*\",\"Microsoft.RecoveryServices/Vaults/usages/*\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/*\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/*\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupSecurityPIN/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:12:15.7321344Z\",\"updatedOn\":\"2017-07-07T06:22:36.4530284Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5e467623-bb1f-42f4-a55d-6e525e11384b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5e467623-bb1f-42f4-a55d-6e525e11384b\"},{\"properties\":{\"roleName\":\"Backup Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage backup services, except removal of backup, vault creation and giving access to others\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/backup/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/write\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/*\",\"Microsoft.RecoveryServices/Vaults/backupJobs/cancel/action\",\"Microsoft.RecoveryServices/Vaults/backupJobs/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/read\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.RecoveryServices/Vaults/certificates/write\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/write\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/refreshContainers/action\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/write\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:21:11.8947640Z\",\"updatedOn\":\"2018-06-16T05:25:05.7455061Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/00c29273-979b-4161-815c-10b084fb9324\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"00c29273-979b-4161-815c-10b084fb9324\"},{\"properties\":{\"roleName\":\"Backup Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view backup services, but can't make changes\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/read\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:18:41.3893065Z\",\"updatedOn\":\"2017-09-13T10:33:25.5814653Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/a795c7a0-d4a2-40c1-ae25-d81f01202912\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"a795c7a0-d4a2-40c1-ae25-d81f01202912\"},{\"properties\":{\"roleName\":\"Billing Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you read billing data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Billing/*/read\",\"Microsoft.Consumption/*/read\",\"Microsoft.Commerce/*/read\",\"Microsoft.Management/managementGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-25T02:13:38.9054151Z\",\"updatedOn\":\"2017-09-19T17:36:32.7624564Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fa23ad8b-c56e-40d8-ac0c-ce449e1d2c64\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fa23ad8b-c56e-40d8-ac0c-ce449e1d2c64\"},{\"properties\":{\"roleName\":\"BizTalk Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage BizTalk services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.BizTalkServices/BizTalk/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:55.8430061Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5e3c6656-6cfa-4708-81fe-0de47ac73342\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5e3c6656-6cfa-4708-81fe-0de47ac73342\"},{\"properties\":{\"roleName\":\"CDN Endpoint Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage CDN endpoints, but can’t grant access to other users.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/endpoints/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:52.6231539Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/426e0c7f-0c7e-4658-b36f-ff54d6c29b45\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"426e0c7f-0c7e-4658-b36f-ff54d6c29b45\"},{\"properties\":{\"roleName\":\"CDN Endpoint Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view CDN endpoints, but can’t make changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/endpoints/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:53.1585846Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/871e35f6-b5c1-49cc-a043-bde969a0f2cd\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"871e35f6-b5c1-49cc-a043-bde969a0f2cd\"},{\"properties\":{\"roleName\":\"CDN Profile Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage CDN profiles and their endpoints, but can’t grant access to other users.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:53.7051278Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ec156ff8-a8d1-4d15-830c-5b80698ca432\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ec156ff8-a8d1-4d15-830c-5b80698ca432\"},{\"properties\":{\"roleName\":\"CDN Profile Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view CDN profiles and their endpoints, but can’t make changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:54.2283001Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/8f96442b-4075-438f-813d-ad51ab4019af\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"8f96442b-4075-438f-813d-ad51ab4019af\"},{\"properties\":{\"roleName\":\"Classic Network Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic networks, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicNetwork/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:56.3934954Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b34d265f-36f7-4a0d-a4d4-e158ca92e90f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b34d265f-36f7-4a0d-a4d4-e158ca92e90f\"},{\"properties\":{\"roleName\":\"Classic Storage Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic storage accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicStorage/storageAccounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:56.9379206Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/86e8f5dc-a6e9-4c67-9d15-de283e8eac25\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"86e8f5dc-a6e9-4c67-9d15-de283e8eac25\"},{\"properties\":{\"roleName\":\"Classic Storage Account Key Operator Service Role\",\"type\":\"BuiltInRole\",\"description\":\"Classic Storage Account Key Operators are allowed to list and regenerate keys on Classic Storage Accounts\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ClassicStorage/storageAccounts/listkeys/action\",\"Microsoft.ClassicStorage/storageAccounts/regeneratekey/action\"],\"notActions\":[]}],\"createdOn\":\"2017-04-13T18:22:52.1461100Z\",\"updatedOn\":\"2017-04-13T20:54:03.0505986Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/985d6b00-f706-48f5-a6fe-d0ca12fb668d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"985d6b00-f706-48f5-a6fe-d0ca12fb668d\"},{\"properties\":{\"roleName\":\"Classic Virtual Machine Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic virtual machines, but not access to them, and not the virtual network or storage account they’re connected to.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicCompute/domainNames/*\",\"Microsoft.ClassicCompute/virtualMachines/*\",\"Microsoft.ClassicNetwork/networkSecurityGroups/join/action\",\"Microsoft.ClassicNetwork/reservedIps/link/action\",\"Microsoft.ClassicNetwork/reservedIps/read\",\"Microsoft.ClassicNetwork/virtualNetworks/join/action\",\"Microsoft.ClassicNetwork/virtualNetworks/read\",\"Microsoft.ClassicStorage/storageAccounts/disks/read\",\"Microsoft.ClassicStorage/storageAccounts/images/read\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.ClassicStorage/storageAccounts/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:57.4788684Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/d73bb868-a0df-4d4d-bd69-98a00b01fccb\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"d73bb868-a0df-4d4d-bd69-98a00b01fccb\"},{\"properties\":{\"roleName\":\"ClearDB MySQL DB Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage ClearDB MySQL databases, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"successbricks.cleardb/databases/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:58.1393839Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9106cda0-8a86-4e81-b686-29a22c54effe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9106cda0-8a86-4e81-b686-29a22c54effe\"},{\"properties\":{\"roleName\":\"Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage everything except access to resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*\"],\"notActions\":[\"Microsoft.Authorization/*/Delete\",\"Microsoft.Authorization/*/Write\",\"Microsoft.Authorization/elevateAccess/Action\",\"Microsoft.Blueprint/blueprintAssignments/write\",\"Microsoft.Blueprint/blueprintAssignments/delete\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-05-30T19:22:32.4538167Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b24988ac-6180-42a0-ab88-20f7382dd24c\"},{\"properties\":{\"roleName\":\"Cosmos DB Account Reader Role\",\"type\":\"BuiltInRole\",\"description\":\"Can read Azure Cosmos DB Accounts data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DocumentDB/*/read\",\"Microsoft.DocumentDB/databaseAccounts/readonlykeys/action\",\"Microsoft.Insights/MetricDefinitions/read\",\"Microsoft.Insights/Metrics/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-10-30T17:53:54.6005577Z\",\"updatedOn\":\"2018-02-21T01:36:59.6186231Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fbdf93bf-df7d-467e-a4d2-9458aa1360c8\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fbdf93bf-df7d-467e-a4d2-9458aa1360c8\"},{\"properties\":{\"roleName\":\"Data Factory Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage data factories, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DataFactory/dataFactories/*\",\"Microsoft.DataFactory/factories/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-04-06T22:49:28.1118955Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/673868aa-7521-48a0-acc6-0f60742d39f5\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"673868aa-7521-48a0-acc6-0f60742d39f5\"},{\"properties\":{\"roleName\":\"Data Lake Analytics Developer\",\"type\":\"BuiltInRole\",\"description\":\"Lets you submit, monitor, and manage your own jobs but not create or delete Data Lake Analytics accounts.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.BigAnalytics/accounts/*\",\"Microsoft.DataLakeAnalytics/accounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.BigAnalytics/accounts/Delete\",\"Microsoft.BigAnalytics/accounts/TakeOwnership/action\",\"Microsoft.BigAnalytics/accounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/TakeOwnership/action\",\"Microsoft.DataLakeAnalytics/accounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/dataLakeStoreAccounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/dataLakeStoreAccounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/storageAccounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/storageAccounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/firewallRules/Write\",\"Microsoft.DataLakeAnalytics/accounts/firewallRules/Delete\",\"Microsoft.DataLakeAnalytics/accounts/computePolicies/Write\",\"Microsoft.DataLakeAnalytics/accounts/computePolicies/Delete\"]}],\"createdOn\":\"2015-10-20T00:33:29.3115234Z\",\"updatedOn\":\"2017-08-18T00:00:17.0411642Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/47b7735b-770e-4598-a7da-8b91488b4c88\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"47b7735b-770e-4598-a7da-8b91488b4c88\"},{\"properties\":{\"roleName\":\"Data Purger\",\"type\":\"BuiltInRole\",\"description\":\"Can purge analytics data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Insights/components/*/read\",\"Microsoft.Insights/components/purge/action\",\"Microsoft.OperationalInsights/workspaces/*/read\",\"Microsoft.OperationalInsights/workspaces/purge/action\"],\"notActions\":[]}],\"createdOn\":\"2018-04-30T22:39:49.6167700Z\",\"updatedOn\":\"2018-04-30T22:44:15.1171162Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/150f5e0c-0603-4f03-8c7f-cf70034c4e90\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"150f5e0c-0603-4f03-8c7f-cf70034c4e90\"},{\"properties\":{\"roleName\":\"DevTest Labs User\",\"type\":\"BuiltInRole\",\"description\":\"Lets you connect, start, restart, and shutdown virtual machines in your Azure DevTest Labs.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Compute/availabilitySets/read\",\"Microsoft.Compute/virtualMachines/*/read\",\"Microsoft.Compute/virtualMachines/deallocate/action\",\"Microsoft.Compute/virtualMachines/read\",\"Microsoft.Compute/virtualMachines/restart/action\",\"Microsoft.Compute/virtualMachines/start/action\",\"Microsoft.DevTestLab/*/read\",\"Microsoft.DevTestLab/labs/createEnvironment/action\",\"Microsoft.DevTestLab/labs/claimAnyVm/action\",\"Microsoft.DevTestLab/labs/formulas/delete\",\"Microsoft.DevTestLab/labs/formulas/read\",\"Microsoft.DevTestLab/labs/formulas/write\",\"Microsoft.DevTestLab/labs/policySets/evaluatePolicies/action\",\"Microsoft.DevTestLab/labs/virtualMachines/claim/action\",\"Microsoft.Network/loadBalancers/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatRules/join/action\",\"Microsoft.Network/networkInterfaces/*/read\",\"Microsoft.Network/networkInterfaces/join/action\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Network/networkInterfaces/write\",\"Microsoft.Network/publicIPAddresses/*/read\",\"Microsoft.Network/publicIPAddresses/join/action\",\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/subnets/join/action\",\"Microsoft.Resources/deployments/operations/read\",\"Microsoft.Resources/deployments/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listKeys/action\"],\"notActions\":[\"Microsoft.Compute/virtualMachines/vmSizes/read\"]}],\"createdOn\":\"2015-06-08T21:52:45.0657582Z\",\"updatedOn\":\"2017-02-02T02:38:38.2961026Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/76283e04-6283-4c54-8f91-bcf1374a3c64\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"76283e04-6283-4c54-8f91-bcf1374a3c64\"},{\"properties\":{\"roleName\":\"DNS Zone Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage DNS zones and record sets in Azure DNS, but does not let you control who has access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/dnsZones/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-10-15T23:33:25.9730842Z\",\"updatedOn\":\"2016-05-31T23:13:40.3710365Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/befefa01-2a29-4197-83a8-272ff33ce314\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"befefa01-2a29-4197-83a8-272ff33ce314\"},{\"properties\":{\"roleName\":\"DocumentDB Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage DocumentDB accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DocumentDb/databaseAccounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:07.2132374Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5bd9cd88-fe45-4216-938b-f97437e15450\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5bd9cd88-fe45-4216-938b-f97437e15450\"},{\"properties\":{\"roleName\":\"Intelligent Systems Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Intelligent Systems accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.IntelligentSystems/accounts/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:59.7946586Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/03a6d094-3444-4b3d-88af-7477090a9e5e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"03a6d094-3444-4b3d-88af-7477090a9e5e\"},{\"properties\":{\"roleName\":\"Key Vault Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage key vaults, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.KeyVault/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.KeyVault/locations/deletedVaults/purge/action\",\"Microsoft.KeyVault/hsmPools/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2017-12-14T02:01:18.4641200Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/f25e0fa2-a7c8-4377-a976-54943a77a395\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"f25e0fa2-a7c8-4377-a976-54943a77a395\"},{\"properties\":{\"roleName\":\"Lab Creator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you create, manage, delete your managed labs under your Azure Lab Accounts.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.LabServices/labAccounts/*/read\",\"Microsoft.LabServices/labAccounts/createLab/action\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2018-01-18T23:38:58.1036141Z\",\"updatedOn\":\"2018-03-08T19:53:30.3032044Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b97fb8bc-a8b2-4522-a38b-dd33c7e65ead\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b97fb8bc-a8b2-4522-a38b-dd33c7e65ead\"},{\"properties\":{\"roleName\":\"Log Analytics Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Log Analytics Contributor can read all monitoring data and edit monitoring settings. Editing monitoring settings includes adding the VM extension to VMs; reading storage account keys to be able to configure collection of logs from Azure Storage; creating and configuring Automation accounts; adding solutions; and configuring Azure diagnostics on all Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Automation/automationAccounts/*\",\"Microsoft.ClassicCompute/virtualMachines/extensions/*\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.Compute/virtualMachines/extensions/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.OperationalInsights/*\",\"Microsoft.OperationsManagement/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourcegroups/deployments/*\",\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-25T21:51:45.3174711Z\",\"updatedOn\":\"2018-01-30T18:08:26.6376126Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"92aaf0da-9dab-42b6-94a3-d43ce8d16293\"},{\"properties\":{\"roleName\":\"Log Analytics Reader\",\"type\":\"BuiltInRole\",\"description\":\"Log Analytics Reader can view and search all monitoring data as well as and view monitoring settings, including viewing the configuration of Azure diagnostics on all Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.OperationalInsights/workspaces/analytics/query/action\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.OperationalInsights/workspaces/sharedKeys/read\"]}],\"createdOn\":\"2017-05-02T00:20:28.1449012Z\",\"updatedOn\":\"2018-01-30T18:08:26.0438523Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/73c42c96-874c-492b-b04d-ab87d138a893\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"73c42c96-874c-492b-b04d-ab87d138a893\"},{\"properties\":{\"roleName\":\"Logic App Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage logic app, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.ClassicStorage/storageAccounts/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.Insights/logdefinitions/*\",\"Microsoft.Insights/metricDefinitions/*\",\"Microsoft.Logic/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/operationresults/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listkeys/action\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\",\"Microsoft.Web/connectionGateways/*\",\"Microsoft.Web/connections/*\",\"Microsoft.Web/customApis/*\",\"Microsoft.Web/serverFarms/join/action\",\"Microsoft.Web/serverFarms/read\",\"Microsoft.Web/sites/functions/listSecrets/action\"],\"notActions\":[]}],\"createdOn\":\"2016-04-28T21:33:30.4656007Z\",\"updatedOn\":\"2018-01-10T23:11:44.8580600Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/87a39d53-fc1b-424a-814c-f7e04687dc9e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"87a39d53-fc1b-424a-814c-f7e04687dc9e\"},{\"properties\":{\"roleName\":\"Logic App Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you read, enable and disable logic app.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*/read\",\"Microsoft.Insights/diagnosticSettings/*/read\",\"Microsoft.Insights/metricDefinitions/*/read\",\"Microsoft.Logic/*/read\",\"Microsoft.Logic/workflows/disable/action\",\"Microsoft.Logic/workflows/enable/action\",\"Microsoft.Logic/workflows/validate/action\",\"Microsoft.Resources/deployments/operations/read\",\"Microsoft.Resources/subscriptions/operationresults/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/connectionGateways/*/read\",\"Microsoft.Web/connections/*/read\",\"Microsoft.Web/customApis/*/read\",\"Microsoft.Web/serverFarms/read\"],\"notActions\":[]}],\"createdOn\":\"2016-04-28T21:33:30.4656007Z\",\"updatedOn\":\"2018-01-10T23:14:26.9539724Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/515c2055-d9d4-4321-b1b9-bd0c9a0f79fe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"515c2055-d9d4-4321-b1b9-bd0c9a0f79fe\"},{\"properties\":{\"roleName\":\"Managed Identity Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Create, Read, Update, and Delete User Assigned Identity\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ManagedIdentity/userAssignedIdentities/*/read\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/write\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/delete\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-12-14T19:53:42.8804692Z\",\"updatedOn\":\"2017-12-14T22:17:02.2740594Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e40ec5ca-96e0-45a2-b4ff-59039f2c2b59\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e40ec5ca-96e0-45a2-b4ff-59039f2c2b59\"},{\"properties\":{\"roleName\":\"Managed Identity Operator\",\"type\":\"BuiltInRole\",\"description\":\"Read and Assign User Assigned Identity\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ManagedIdentity/userAssignedIdentities/*/read\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-12-14T19:52:04.3924594Z\",\"updatedOn\":\"2017-12-14T22:16:00.1483256Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/f1a07417-d97a-45cb-824c-7a7467783830\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"f1a07417-d97a-45cb-824c-7a7467783830\"},{\"properties\":{\"roleName\":\"Management Group Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Management Group Contributor Role\",\"assignableScopes\":[\"/providers/Microsoft.Management\"],\"permissions\":[{\"actions\":[\"Microsoft.Management/managementGroups/delete\",\"Microsoft.Management/managementGroups/read\",\"Microsoft.Management/managementGroups/subscriptions/delete\",\"Microsoft.Management/managementGroups/subscriptions/write\",\"Microsoft.Management/managementGroups/write\"],\"notActions\":[]}],\"createdOn\":\"2018-06-22T00:28:29.0523964Z\",\"updatedOn\":\"2018-06-22T00:29:40.3047486Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5d58bcaf-24a5-4b20-bdb6-eed9f69fbe4c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5d58bcaf-24a5-4b20-bdb6-eed9f69fbe4c\"},{\"properties\":{\"roleName\":\"Management Group Reader\",\"type\":\"BuiltInRole\",\"description\":\"Management Group Reader Role\",\"assignableScopes\":[\"/providers/Microsoft.Management\"],\"permissions\":[{\"actions\":[\"Microsoft.Management/managementGroups/read\"],\"notActions\":[]}],\"createdOn\":\"2018-06-22T00:31:03.4295347Z\",\"updatedOn\":\"2018-06-22T00:32:11.5701900Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ac63b705-f282-497d-ac71-919bf39d939d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ac63b705-f282-497d-ac71-919bf39d939d\"},{\"properties\":{\"roleName\":\"Monitoring Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can read all monitoring data and update monitoring settings.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.AlertsManagement/alerts/*\",\"Microsoft.AlertsManagement/alertsSummary/*\",\"Microsoft.Insights/AlertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.Insights/DiagnosticSettings/*\",\"Microsoft.Insights/eventtypes/*\",\"Microsoft.Insights/LogDefinitions/*\",\"Microsoft.Insights/MetricDefinitions/*\",\"Microsoft.Insights/Metrics/*\",\"Microsoft.Insights/Register/Action\",\"Microsoft.Insights/webtests/*\",\"Microsoft.Insights/actiongroups/*\",\"Microsoft.Insights/metricalerts/*\",\"Microsoft.Insights/scheduledqueryrules/*\",\"Microsoft.OperationalInsights/workspaces/intelligencepacks/*\",\"Microsoft.OperationalInsights/workspaces/savedSearches/*\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.OperationalInsights/workspaces/sharedKeys/action\",\"Microsoft.OperationalInsights/workspaces/storageinsightconfigs/*\",\"Microsoft.Support/*\",\"Microsoft.WorkloadMonitor/workloads/*\"],\"notActions\":[]}],\"createdOn\":\"2016-09-21T19:21:08.4345976Z\",\"updatedOn\":\"2018-04-02T19:04:30.9448972Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/749f88d5-cbae-40b8-bcfc-e573ddc772fa\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"749f88d5-cbae-40b8-bcfc-e573ddc772fa\"},{\"properties\":{\"roleName\":\"Monitoring Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can read all monitoring data.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-09-21T19:19:52.4939376Z\",\"updatedOn\":\"2018-01-30T18:08:27.2626250Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"43d0d8ad-25c7-4714-9337-8ba259a9fe05\"},{\"properties\":{\"roleName\":\"Network Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage networks, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2016-05-31T23:14:00.3326359Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"4d97b98b-1d4f-4787-a291-c67834d212e7\"},{\"properties\":{\"roleName\":\"New Relic APM Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage New Relic Application Performance Management accounts and applications, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"NewRelic.APM/accounts/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:07.7538043Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5d28c62d-5b37-4476-8438-e587778df237\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5d28c62d-5b37-4476-8438-e587778df237\"},{\"properties\":{\"roleName\":\"Owner\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage everything, including access to resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:00.9179619Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"8e3af657-a8ff-443c-a75c-2fe8c4bcb635\"},{\"properties\":{\"roleName\":\"PowerApps Administrator\",\"type\":\"BuiltInRole\",\"description\":\"The user has access to perform administrative actions on all PowerApps resources within the tenant.\",\"assignableScopes\":[\"/providers/Microsoft.PowerApps\"],\"permissions\":[{\"actions\":[\"Microsoft.PowerApps/actions/admin/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:41.9912926Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/53be45b2-ad40-43ab-bc1f-2c962ac99ded\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"53be45b2-ad40-43ab-bc1f-2c962ac99ded\"},{\"properties\":{\"roleName\":\"PowerAppsReaderWithReshare\",\"type\":\"BuiltInRole\",\"description\":\"PowerAppsReadersWithReshare can use the resource and re-share it with other users, but cannot edit the resource or re-share it with edit permissions.\",\"assignableScopes\":[\"/providers/Microsoft.PowerApps\"],\"permissions\":[{\"actions\":[\"Microsoft.PowerApps/*/permissions/write\",\"Microsoft.PowerApps/*/read\"],\"notActions\":[\"Microsoft.PowerApps/*/delete\",\"Microsoft.PowerApps/*/write\"]}],\"createdOn\":\"2016-03-15T00:55:03.0666416Z\",\"updatedOn\":\"2016-05-31T23:14:09.6924345Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6877c72c-edd3-4048-9b4b-cf8e514477b0\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6877c72c-edd3-4048-9b4b-cf8e514477b0\"},{\"properties\":{\"roleName\":\"Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view everything, but not make any changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-01-30T18:08:25.4031403Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"acdd72a7-3385-48ef-bd42-f606fba81ae7\"},{\"properties\":{\"roleName\":\"Reader and Data Access\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view everything but will not let you delete or create a storage account or contained resource. It will also allow read/write access to all data contained in a storage account via access to storage account keys.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Storage/storageAccounts/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-27T23:20:46.1498906Z\",\"updatedOn\":\"2018-03-28T17:50:03.9656854Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/c12c1c16-33a1-487b-954d-41c89c60f349\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"c12c1c16-33a1-487b-954d-41c89c60f349\"},{\"properties\":{\"roleName\":\"Redis Cache Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Redis caches, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cache/redis/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:01.9877071Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e0f68234-74aa-48ed-b826-c38b57376e17\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e0f68234-74aa-48ed-b826-c38b57376e17\"},{\"properties\":{\"roleName\":\"Resource Policy Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"(Preview) Backfilled users from EA, with rights to create/modify resource policy, create support ticket and read resources/hierarchy.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Authorization/policyassignments/*\",\"Microsoft.Authorization/policydefinitions/*\",\"Microsoft.Authorization/policysetdefinitions/*\",\"Microsoft.PolicyInsights/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-08-25T19:08:01.3861639Z\",\"updatedOn\":\"2018-01-30T18:08:27.8272264Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/36243c78-bf99-498c-9df9-86d9f8d28608\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"36243c78-bf99-498c-9df9-86d9f8d28608\"},{\"properties\":{\"roleName\":\"Scheduler Job Collections Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Scheduler job collections, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Scheduler/jobcollections/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:02.5343995Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/188a0f2f-5c9e-469b-ae67-2aa5ce574b94\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"188a0f2f-5c9e-469b-ae67-2aa5ce574b94\"},{\"properties\":{\"roleName\":\"Search Service Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Search services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Search/searchServices/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:03.0463472Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/7ca78c08-252a-4471-8644-bb5ff32d4ba0\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"7ca78c08-252a-4471-8644-bb5ff32d4ba0\"},{\"properties\":{\"roleName\":\"Security Admin\",\"type\":\"BuiltInRole\",\"description\":\"Security Admin Role\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Authorization/policyAssignments/*\",\"Microsoft.Authorization/policyDefinitions/*\",\"Microsoft.Authorization/policySetDefinitions/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.operationalInsights/workspaces/*/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*/read\",\"Microsoft.Security/locations/alerts/dismiss/action\",\"Microsoft.Security/locations/alerts/activate/action\",\"Microsoft.Security/locations/tasks/dismiss/action\",\"Microsoft.Security/locations/tasks/activate/action\",\"Microsoft.Security/policies/write\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-03T07:51:23.0917487Z\",\"updatedOn\":\"2018-03-08T18:19:50.7393029Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fb1c8493-542b-48eb-b624-b4c8fea62acd\"},{\"properties\":{\"roleName\":\"Security Manager\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage security components, security policies and virtual machines\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicCompute/*/read\",\"Microsoft.ClassicCompute/virtualMachines/*/write\",\"Microsoft.ClassicNetwork/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-22T17:45:15.8986455Z\",\"updatedOn\":\"2018-03-08T18:18:48.6183620Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e3d13bf0-dd5a-482e-ba6b-9b8433878d10\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e3d13bf0-dd5a-482e-ba6b-9b8433878d10\"},{\"properties\":{\"roleName\":\"Security Reader\",\"type\":\"BuiltInRole\",\"description\":\"Security Reader Role\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.operationalInsights/workspaces/*/read\",\"Microsoft.Authorization/*/read\",\"Microsoft.Support/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*/read\"],\"notActions\":[]}],\"createdOn\":\"2017-05-03T07:48:49.0516559Z\",\"updatedOn\":\"2017-05-03T18:42:54.9787380Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/39bc4728-0917-49c7-9d2c-d95423bc2eb4\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"39bc4728-0917-49c7-9d2c-d95423bc2eb4\"},{\"properties\":{\"roleName\":\"Site Recovery Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Site Recovery service except vault creation and role assignment\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/locations/allocateStamp/action\",\"Microsoft.RecoveryServices/Vaults/certificates/write\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/*\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/*\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/*\",\"Microsoft.RecoveryServices/vaults/replicationJobs/*\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/*\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/*\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/*\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:46:17.4592776Z\",\"updatedOn\":\"2017-06-29T05:31:19.7240473Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6670b86e-a3f7-4917-ac9b-5d6ab1be4567\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6670b86e-a3f7-4917-ac9b-5d6ab1be4567\"},{\"properties\":{\"roleName\":\"Site Recovery Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you failover and failback but not perform other Site Recovery management operations\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/locations/allocateStamp/action\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/read\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/checkConsistency/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/reassociateGateway/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/renewcertificate/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/applyRecoveryPoint/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/failoverCommit/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/plannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/repairReplication/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/reProtect/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailoverCleanup/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/unplannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/updateMobilityService/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/refreshProvider/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/read\",\"Microsoft.RecoveryServices/vaults/replicationJobs/*\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/failoverCommit/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/plannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/reProtect/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailoverCleanup/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/unplannedFailover/action\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/*\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:47:50.1341148Z\",\"updatedOn\":\"2017-06-29T05:42:27.1715639Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/494ae006-db33-4328-bf46-533a6560a3ca\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"494ae006-db33-4328-bf46-533a6560a3ca\"},{\"properties\":{\"roleName\":\"Site Recovery Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view Site Recovery status but not perform other management operations\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/read\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/read\",\"Microsoft.RecoveryServices/vaults/replicationJobs/read\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:35:40.0093634Z\",\"updatedOn\":\"2017-05-26T19:54:51.3933250Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/dbaa88c4-0c30-4179-9fb3-46319faa6149\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"dbaa88c4-0c30-4179-9fb3-46319faa6149\"},{\"properties\":{\"roleName\":\"SQL DB Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage SQL databases, but not access to them. Also, you can't manage their security-related policies or their parent SQL servers.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/locations/*/read\",\"Microsoft.Sql/servers/databases/*\",\"Microsoft.Sql/servers/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:41.1575716Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9b7fa17d-e63e-47b0-bb0a-15c516ac86ec\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9b7fa17d-e63e-47b0-bb0a-15c516ac86ec\"},{\"properties\":{\"roleName\":\"SQL Security Manager\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage the security-related policies of SQL servers and databases, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/action\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/servers/auditingPolicies/*\",\"Microsoft.Sql/servers/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/read\",\"Microsoft.Sql/servers/databases/schemas/read\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/read\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/schemas/tables/read\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\",\"Microsoft.Sql/servers/firewallRules/*\",\"Microsoft.Sql/servers/read\",\"Microsoft.Sql/servers/securityAlertPolicies/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:40.2200727Z\",\"createdBy\":null,\"updatedBy\":\"yaiyun\"},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/056cd41c-7e88-42e1-933e-88ba6a50c9c3\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"056cd41c-7e88-42e1-933e-88ba6a50c9c3\"},{\"properties\":{\"roleName\":\"SQL Server Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage SQL servers and databases, but not access to them, and not their security -related policies.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/locations/*/read\",\"Microsoft.Sql/servers/*\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.Sql/servers/auditingPolicies/*\",\"Microsoft.Sql/servers/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\",\"Microsoft.Sql/servers/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/securityAlertPolicies/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:41.8450730Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6d8ee4ec-f05a-4a1d-8b00-a9b17e38b437\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6d8ee4ec-f05a-4a1d-8b00-a9b17e38b437\"},{\"properties\":{\"roleName\":\"Storage Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage storage accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/action\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2017-08-21T07:43:20.3060994Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"17d1049b-9a84-46fb-8f53-869881c3d3ab\"},{\"properties\":{\"roleName\":\"Storage Account Key Operator Service Role\",\"type\":\"BuiltInRole\",\"description\":\"Storage Account Key Operators are allowed to list and regenerate keys on Storage Accounts\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/listkeys/action\",\"Microsoft.Storage/storageAccounts/regeneratekey/action\"],\"notActions\":[]}],\"createdOn\":\"2017-04-13T18:26:11.5770570Z\",\"updatedOn\":\"2017-04-13T20:57:14.5990198Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"81a9662b-bebf-436f-a333-f67b29880f12\"},{\"properties\":{\"roleName\":\"Storage Blob Data Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read, write and delete access to Azure Storage blob containers and data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/blobServices/containers/delete\",\"Microsoft.Storage/storageAccounts/blobServices/containers/read\",\"Microsoft.Storage/storageAccounts/blobServices/containers/write\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:11:00.4629296Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ba92f5b4-2d11-453d-a403-e96b0029c9fe\"},{\"properties\":{\"roleName\":\"Storage Blob Data Reader (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read access to Azure Storage blob containers and data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/blobServices/containers/read\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:15:19.5080840Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/2a2b9908-6ea1-4ae2-8e65-a410df84e7d1\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"2a2b9908-6ea1-4ae2-8e65-a410df84e7d1\"},{\"properties\":{\"roleName\":\"Storage Queue Data Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read, write, and delete access to Azure Storage queues and queue messages\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/queueServices/queues/delete\",\"Microsoft.Storage/storageAccounts/queueServices/queues/read\",\"Microsoft.Storage/storageAccounts/queueServices/queues/write\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:16:40.1371662Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/974c5e8b-45b9-4653-ba55-5f855dd0fb88\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"974c5e8b-45b9-4653-ba55-5f855dd0fb88\"},{\"properties\":{\"roleName\":\"Storage Queue Data Reader (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read access to Azure Storage queues and queue messages\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/queueServices/queues/read\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:19:30.5001463Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/19e7f393-937e-4f77-808e-94535e297925\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"19e7f393-937e-4f77-808e-94535e297925\"},{\"properties\":{\"roleName\":\"Support Request Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you create and manage Support requests\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-06-22T22:25:37.8053068Z\",\"updatedOn\":\"2017-06-23T01:06:24.2399631Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/cfd33db0-3dd1-45e3-aa9d-cdbdf3b6f24e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"cfd33db0-3dd1-45e3-aa9d-cdbdf3b6f24e\"},{\"properties\":{\"roleName\":\"Traffic Manager Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Traffic Manager profiles, but does not let you control who has access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/trafficManagerProfiles/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-10-15T23:33:25.9730842Z\",\"updatedOn\":\"2016-05-31T23:13:44.1458854Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/a4b10055-b0c7-44c2-b00f-c7b5b3550cf7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"a4b10055-b0c7-44c2-b00f-c7b5b3550cf7\"},{\"properties\":{\"roleName\":\"User Access Administrator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage user access to Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Authorization/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-01-30T18:08:24.4656640Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/18d7d88d-d35e-4fb5-a5c3-7773c20a72d9\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"18d7d88d-d35e-4fb5-a5c3-7773c20a72d9\"},{\"properties\":{\"roleName\":\"Virtual Machine Administrator Login\",\"type\":\"BuiltInRole\",\"description\":\"View Virtual Machines in the portal and login as administrator\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Compute/virtualMachines/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-02-09T18:36:13.3315744Z\",\"updatedOn\":\"2018-05-09T22:17:57.0514548Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/1c0163c0-47e6-4577-8991-ea5c82e286e4\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"1c0163c0-47e6-4577-8991-ea5c82e286e4\"},{\"properties\":{\"roleName\":\"Virtual Machine Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage virtual machines, but not access to them, and not the virtual network or storage account they’re connected to.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Compute/availabilitySets/*\",\"Microsoft.Compute/locations/*\",\"Microsoft.Compute/virtualMachines/*\",\"Microsoft.Compute/virtualMachineScaleSets/*\",\"Microsoft.DevTestLab/schedules/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/applicationGateways/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatRules/join/action\",\"Microsoft.Network/loadBalancers/probes/join/action\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/locations/*\",\"Microsoft.Network/networkInterfaces/*\",\"Microsoft.Network/networkSecurityGroups/join/action\",\"Microsoft.Network/networkSecurityGroups/read\",\"Microsoft.Network/publicIPAddresses/join/action\",\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/virtualNetworks/subnets/join/action\",\"Microsoft.RecoveryServices/locations/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/*/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/write\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/backupProtectionIntent/write\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/write\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/write\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2017-11-14T03:00:30.1736393Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9980e02c-c2be-4d73-94e8-173b1dc7cf3c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9980e02c-c2be-4d73-94e8-173b1dc7cf3c\"},{\"properties\":{\"roleName\":\"Virtual Machine User Login\",\"type\":\"BuiltInRole\",\"description\":\"View Virtual Machines in the portal and login as a regular user.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Compute/virtualMachines/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-02-09T18:36:13.3315744Z\",\"updatedOn\":\"2018-05-09T22:18:52.2780979Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fb879df8-f326-4884-b1cf-06f3ad86be52\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fb879df8-f326-4884-b1cf-06f3ad86be52\"},{\"properties\":{\"roleName\":\"Web Plan Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage the web plans for websites, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/serverFarms/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:05.9401651Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/2cc479cb-7b4d-49a8-b449-8c00fd0f0a4b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"2cc479cb-7b4d-49a8-b449-8c00fd0f0a4b\"},{\"properties\":{\"roleName\":\"Website Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage websites (not web plans), but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/certificates/*\",\"Microsoft.Web/listSitesAssignedToHostName/read\",\"Microsoft.Web/serverFarms/join/action\",\"Microsoft.Web/serverFarms/read\",\"Microsoft.Web/sites/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:06.5272742Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/de139f84-1756-47ae-9be6-808fbbe84772\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"de139f84-1756-47ae-9be6-808fbbe84772\"}]}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de?api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:07 GMT", + "content-length" : "0", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "ccb474ac-238e-4ca6-b476-f940a2605936", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195707Z:ccb474ac-238e-4ca6-b476-f940a2605936", + "content-type" : "text/plain; charset=utf-8", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/44894d05-901e-4141-8eb7-5c5ba66e3987?monitor=true&api-version=2016-01-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "44894d05-901e-4141-8eb7-5c5ba66e3987", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/44894d05-901e-4141-8eb7-5c5ba66e3987?monitor=true&api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:11 GMT", + "content-length" : "0", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14999", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "c6e6f8d6-e46d-4c85-8060-705e4bb86d1e", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195711Z:c6e6f8d6-e46d-4c85-8060-705e4bb86d1e", + "content-type" : "text/plain; charset=utf-8", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/44894d05-901e-4141-8eb7-5c5ba66e3987?monitor=true&api-version=2016-01-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "c673a180-ff08-437f-aaef-db16b0b5bd3a", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/44894d05-901e-4141-8eb7-5c5ba66e3987?monitor=true&api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:28 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "907", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14998", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "051491d6-12eb-4750-b804-f8949bc28b61", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195728Z:051491d6-12eb-4750-b804-f8949bc28b61", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "31e536f6-9336-4230-9de2-784792656503", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"name\":\"sa22c29322de\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"encryption\":{\"services\":{\"blob\":{\"enabled\":true,\"lastEnabledTime\":\"2018-06-25T19:57:07.3309146Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2018-06-25T19:57:07.2527139Z\",\"primaryEndpoints\":{\"blob\":\"https://sa22c29322de.blob.core.windows.net/\",\"queue\":\"https://sa22c29322de.queue.core.windows.net/\",\"table\":\"https://sa22c29322de.table.core.windows.net/\",\"file\":\"https://sa22c29322de.file.core.windows.net/\"},\"primaryLocation\":\"westcentralus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus2\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de?api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:28 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "907", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14997", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "e0f391a5-af65-4732-86c0-0738af44a4f0", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195728Z:e0f391a5-af65-4732-86c0-0738af44a4f0", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "aba6d670-3f42-4dc0-82b2-554f144bd7ab", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"name\":\"sa22c29322de\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"encryption\":{\"services\":{\"blob\":{\"enabled\":true,\"lastEnabledTime\":\"2018-06-25T19:57:07.3309146Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2018-06-25T19:57:07.2527139Z\",\"primaryEndpoints\":{\"blob\":\"https://sa22c29322de.blob.core.windows.net/\",\"queue\":\"https://sa22c29322de.queue.core.windows.net/\",\"table\":\"https://sa22c29322de.table.core.windows.net/\",\"file\":\"https://sa22c29322de.file.core.windows.net/\"},\"primaryLocation\":\"westcentralus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus2\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de/providers/Microsoft.Authorization/roleAssignments/4a9d964f-b76c-4e33-9d89-bf6f3a3d220b?api-version=2015-07-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (AuthorizationManagementClient, 2015-07-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:32 GMT", + "content-length" : "868", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-ms-request-charge" : "3", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "cb9fbbc4-091a-48e8-ba9a-1d0d552efe91", + "set-cookie" : "x-ms-gateway-slice=productionb; path=/; secure; HttpOnly", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195732Z:cb9fbbc4-091a-48e8-ba9a-1d0d552efe91", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "8dc91423-9658-4d21-afd4-a3e5e1b7926b", + "Body" : "{\"properties\":{\"roleDefinitionId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"principalId\":\"93c27d83-f79b-4cb2-8dd4-4aa716542e74\",\"scope\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"createdOn\":\"2018-06-25T19:57:29.4073593Z\",\"updatedOn\":\"2018-06-25T19:57:29.4073593Z\",\"createdBy\":null,\"updatedBy\":\"00000000-0000-0000-0000-000000000000\"},\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de/providers/Microsoft.Authorization/roleAssignments/4a9d964f-b76c-4e33-9d89-bf6f3a3d220b\",\"type\":\"Microsoft.Authorization/roleAssignments\",\"name\":\"4a9d964f-b76c-4e33-9d89-bf6f3a3d220b\"}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:34 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "819", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "x-ms-ratelimit-remaining-subscription-writes" : "1197", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "f92e3842-bb30-4d26-848a-e6bc47ce7874", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195735Z:f92e3842-bb30-4d26-848a-e6bc47ce7874", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "f92e3842-bb30-4d26-848a-e6bc47ce7874", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495\",\"name\":\"vault815130495\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"get\",\"backup\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vault815130495.vault.azure.net\",\"provisioningState\":\"RegisteringDns\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:57:34 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "820", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14996", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "1adf5245-3b25-4651-b5f7-4dfdb6608457", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195735Z:1adf5245-3b25-4651-b5f7-4dfdb6608457", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "1adf5245-3b25-4651-b5f7-4dfdb6608457", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495\",\"name\":\"vault815130495\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"get\",\"backup\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vault815130495.vault.azure.net\",\"provisioningState\":\"RegisteringDns\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:05 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "815", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14995", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "52306e25-95c8-4dae-b317-fd481ae007d9", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195805Z:52306e25-95c8-4dae-b317-fd481ae007d9", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "52306e25-95c8-4dae-b317-fd481ae007d9", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vault815130495\",\"name\":\"vault815130495\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"get\",\"backup\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vault815130495.vault.azure.net\",\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:04 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "6e160f0b-ecec-4c4c-ac01-b1e4646c42e1", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:08 GMT", + "content-length" : "402", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "a79cd7b0-02de-472d-9854-75c1784e8b6c", + "Body" : "{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"activeKeyName\":\"key1\",\"autoRegenerateKey\":true,\"regenerationPeriod\":\"P30D\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956689,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://vault815130495.vault.azure.net/storage?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:11 GMT", + "content-length" : "354", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "9f18b775-7248-4516-af92-bf5d1f1e67be", + "Body" : "{\"value\":[{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956689,\"recoveryLevel\":\"Purgeable\"}}],\"nextLink\":null}" + } + }, { + "Method" : "GET", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:13 GMT", + "content-length" : "402", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "1afd1f24-fc5c-4214-84d5-f4a121e6f4e6", + "Body" : "{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"activeKeyName\":\"key1\",\"autoRegenerateKey\":true,\"regenerationPeriod\":\"P30D\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956689,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "PATCH", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:16 GMT", + "content-length" : "403", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "68734eec-d905-44f0-bf46-9bf5f3e2f5dd", + "Body" : "{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"activeKeyName\":\"key2\",\"autoRegenerateKey\":false,\"regenerationPeriod\":\"P60D\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956696,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:17 GMT", + "content-length" : "403", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "b301b119-8771-4b6b-b06a-44b0e42afd7d", + "Body" : "{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"activeKeyName\":\"key2\",\"autoRegenerateKey\":false,\"regenerationPeriod\":\"P60D\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956696,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "https://vault815130495.vault.azure.net/storage/sa22c29322de?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:19 GMT", + "content-length" : "403", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "99defcc1-132b-47ac-a61e-14ad418f0b4a", + "Body" : "{\"id\":\"https://vault815130495.vault.azure.netstorage/sa22c29322de\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sa22c29322de\",\"activeKeyName\":\"key2\",\"autoRegenerateKey\":false,\"regenerationPeriod\":\"P60D\",\"attributes\":{\"enabled\":true,\"created\":1529956689,\"updated\":1529956696,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ "sa22c29322de", "vault815130495" ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testSetAndGetSasDefinitionForManagedStorageAccountKey.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testSetAndGetSasDefinitionForManagedStorageAccountKey.json new file mode 100644 index 0000000000000..7c82fe281d6d3 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/testSetAndGetSasDefinitionForManagedStorageAccountKey.json @@ -0,0 +1,387 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "http://localhost:1234/%5C/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-07-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (AuthorizationManagementClient, 2015-07-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:20 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "87830", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-ms-request-charge" : "1", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "2e3d66fb-4307-418a-a681-d99dfbc9ccc5", + "set-cookie" : "x-ms-gateway-slice=productionb; path=/; secure; HttpOnly", + "x-ms-ratelimit-remaining-tenant-reads" : "14999", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195820Z:2e3d66fb-4307-418a-a681-d99dfbc9ccc5", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "5a9b4103-c2e9-4a60-be83-f6322192428f", + "Body" : "{\"value\":[{\"properties\":{\"roleName\":\"AcrImageSigner\",\"type\":\"BuiltInRole\",\"description\":\"acr image signer\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/read\",\"Microsoft.ContainerRegistry/registries/*/write\"],\"notActions\":[]}],\"createdOn\":\"2018-03-15T23:23:08.4038322Z\",\"updatedOn\":\"2018-03-17T01:25:51.8758677Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6cef56e8-d556-48e5-a04f-b8e64114680f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6cef56e8-d556-48e5-a04f-b8e64114680f\"},{\"properties\":{\"roleName\":\"AcrQuarantineReader\",\"type\":\"BuiltInRole\",\"description\":\"acr quarantine data reader\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-16T00:27:39.9596835Z\",\"updatedOn\":\"2018-03-17T01:26:48.6387319Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/cdda3590-29a3-44f6-95f2-9f980659eb04\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"cdda3590-29a3-44f6-95f2-9f980659eb04\"},{\"properties\":{\"roleName\":\"AcrQuarantineWriter\",\"type\":\"BuiltInRole\",\"description\":\"acr quarantine data writer\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ContainerRegistry/registries/*/write\",\"Microsoft.ContainerRegistry/registries/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-16T00:26:37.5871820Z\",\"updatedOn\":\"2018-03-17T01:27:36.3941651Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"c8d4ff99-41c3-41a8-9f60-21dfdad59608\"},{\"properties\":{\"roleName\":\"API Management Service Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage API Management services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2017-01-23T23:12:00.5823195Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/312a565d-c81f-4fd8-895a-4e21e48d571c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"312a565d-c81f-4fd8-895a-4e21e48d571c\"},{\"properties\":{\"roleName\":\"API Management Service Operator Role\",\"type\":\"BuiltInRole\",\"description\":\"Can manage service but not the APIs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*/read\",\"Microsoft.ApiManagement/service/backup/action\",\"Microsoft.ApiManagement/service/delete\",\"Microsoft.ApiManagement/service/managedeployments/action\",\"Microsoft.ApiManagement/service/read\",\"Microsoft.ApiManagement/service/restore/action\",\"Microsoft.ApiManagement/service/updatecertificate/action\",\"Microsoft.ApiManagement/service/updatehostname/action\",\"Microsoft.ApiManagement/service/write\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.ApiManagement/service/users/keys/read\"]}],\"createdOn\":\"2016-11-09T00:03:42.1194019Z\",\"updatedOn\":\"2016-11-18T23:56:25.4682649Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e022efe7-f5ba-4159-bbe4-b44f577e9b61\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e022efe7-f5ba-4159-bbe4-b44f577e9b61\"},{\"properties\":{\"roleName\":\"API Management Service Reader Role\",\"type\":\"BuiltInRole\",\"description\":\"Read-only access to service and APIs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ApiManagement/service/*/read\",\"Microsoft.ApiManagement/service/read\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.ApiManagement/service/users/keys/read\"]}],\"createdOn\":\"2016-11-09T00:26:45.1540473Z\",\"updatedOn\":\"2017-01-23T23:10:34.8876776Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/71522526-b88f-4d52-b57f-d31fc3546d0d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"71522526-b88f-4d52-b57f-d31fc3546d0d\"},{\"properties\":{\"roleName\":\"Application Insights Component Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage Application Insights components\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.Insights/webtests/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-11-29T20:30:34.2313394Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ae349356-3a1b-4a5e-921d-050484c6347e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ae349356-3a1b-4a5e-921d-050484c6347e\"},{\"properties\":{\"roleName\":\"Application Insights Snapshot Debugger\",\"type\":\"BuiltInRole\",\"description\":\"Gives user permission to use Application Insights Snapshot Debugger features\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T21:25:12.3728747Z\",\"updatedOn\":\"2017-04-19T23:34:59.9511581Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/08954f03-6346-4c2e-81c0-ec3a5cfae23b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"08954f03-6346-4c2e-81c0-ec3a5cfae23b\"},{\"properties\":{\"roleName\":\"Automation Job Operator\",\"type\":\"BuiltInRole\",\"description\":\"Create and Manage Jobs using Automation Runbooks.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/jobs/read\",\"Microsoft.Automation/automationAccounts/jobs/resume/action\",\"Microsoft.Automation/automationAccounts/jobs/stop/action\",\"Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/read\",\"Microsoft.Automation/automationAccounts/jobs/streams/read\",\"Microsoft.Automation/automationAccounts/jobs/suspend/action\",\"Microsoft.Automation/automationAccounts/jobs/write\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T20:52:41.0020018Z\",\"updatedOn\":\"2018-03-06T02:20:41.6886187Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/4fe576fe-1146-4730-92eb-48519fa6bf9f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"4fe576fe-1146-4730-92eb-48519fa6bf9f\"},{\"properties\":{\"roleName\":\"Automation Operator\",\"type\":\"BuiltInRole\",\"description\":\"Automation Operators are able to start, stop, suspend, and resume jobs\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/read\",\"Microsoft.Automation/automationAccounts/jobs/read\",\"Microsoft.Automation/automationAccounts/jobs/resume/action\",\"Microsoft.Automation/automationAccounts/jobs/stop/action\",\"Microsoft.Automation/automationAccounts/jobs/streams/read\",\"Microsoft.Automation/automationAccounts/jobs/suspend/action\",\"Microsoft.Automation/automationAccounts/jobs/write\",\"Microsoft.Automation/automationAccounts/jobSchedules/read\",\"Microsoft.Automation/automationAccounts/jobSchedules/write\",\"Microsoft.Automation/automationAccounts/linkedWorkspace/read\",\"Microsoft.Automation/automationAccounts/read\",\"Microsoft.Automation/automationAccounts/runbooks/read\",\"Microsoft.Automation/automationAccounts/schedules/read\",\"Microsoft.Automation/automationAccounts/schedules/write\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Automation/automationAccounts/jobs/output/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-08-18T01:05:03.3916130Z\",\"updatedOn\":\"2018-05-10T20:12:39.6978200Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/d3881f73-407a-4167-8283-e981cbba0404\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"d3881f73-407a-4167-8283-e981cbba0404\"},{\"properties\":{\"roleName\":\"Automation Runbook Operator\",\"type\":\"BuiltInRole\",\"description\":\"Read Runbook properties - to be able to create Jobs of the runbook.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Automation/automationAccounts/runbooks/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-19T20:47:49.5640674Z\",\"updatedOn\":\"2017-04-25T01:00:45.6444999Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5fb5aef8-1081-4b8e-bb16-9d5d0385bab5\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5fb5aef8-1081-4b8e-bb16-9d5d0385bab5\"},{\"properties\":{\"roleName\":\"Azure Stack Registration Owner\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Azure Stack registrations.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.AzureStack/registrations/products/listDetails/action\",\"Microsoft.AzureStack/registrations/products/read\",\"Microsoft.AzureStack/registrations/read\"],\"notActions\":[]}],\"createdOn\":\"2017-11-13T23:42:06.2161827Z\",\"updatedOn\":\"2017-11-13T23:54:02.4007080Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6f12a6df-dd06-4f3e-bcb1-ce8be600526a\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6f12a6df-dd06-4f3e-bcb1-ce8be600526a\"},{\"properties\":{\"roleName\":\"Backup Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage backup service,but can't create vaults and give access to others\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/*\",\"Microsoft.RecoveryServices/Vaults/backupJobs/*\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/*\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/*\",\"Microsoft.RecoveryServices/Vaults/certificates/*\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/*\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/*\",\"Microsoft.RecoveryServices/Vaults/usages/*\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/*\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/*\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupSecurityPIN/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:12:15.7321344Z\",\"updatedOn\":\"2017-07-07T06:22:36.4530284Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5e467623-bb1f-42f4-a55d-6e525e11384b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5e467623-bb1f-42f4-a55d-6e525e11384b\"},{\"properties\":{\"roleName\":\"Backup Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage backup services, except removal of backup, vault creation and giving access to others\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/backup/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/write\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/*\",\"Microsoft.RecoveryServices/Vaults/backupJobs/cancel/action\",\"Microsoft.RecoveryServices/Vaults/backupJobs/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/read\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/*\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/*\",\"Microsoft.RecoveryServices/Vaults/backupProtectableItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.RecoveryServices/Vaults/certificates/write\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/write\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/refreshContainers/action\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/write\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:21:11.8947640Z\",\"updatedOn\":\"2018-06-16T05:25:05.7455061Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/00c29273-979b-4161-815c-10b084fb9324\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"00c29273-979b-4161-815c-10b084fb9324\"},{\"properties\":{\"roleName\":\"Backup Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view backup services, but can't make changes\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupJobs/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/action\",\"Microsoft.RecoveryServices/Vaults/backupManagementMetaData/read\",\"Microsoft.RecoveryServices/Vaults/backupOperationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupProtectionContainers/read\",\"Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\"],\"notActions\":[]}],\"createdOn\":\"2017-01-03T13:18:41.3893065Z\",\"updatedOn\":\"2017-09-13T10:33:25.5814653Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/a795c7a0-d4a2-40c1-ae25-d81f01202912\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"a795c7a0-d4a2-40c1-ae25-d81f01202912\"},{\"properties\":{\"roleName\":\"Billing Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you read billing data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Billing/*/read\",\"Microsoft.Consumption/*/read\",\"Microsoft.Commerce/*/read\",\"Microsoft.Management/managementGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-25T02:13:38.9054151Z\",\"updatedOn\":\"2017-09-19T17:36:32.7624564Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fa23ad8b-c56e-40d8-ac0c-ce449e1d2c64\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fa23ad8b-c56e-40d8-ac0c-ce449e1d2c64\"},{\"properties\":{\"roleName\":\"BizTalk Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage BizTalk services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.BizTalkServices/BizTalk/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:55.8430061Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5e3c6656-6cfa-4708-81fe-0de47ac73342\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5e3c6656-6cfa-4708-81fe-0de47ac73342\"},{\"properties\":{\"roleName\":\"CDN Endpoint Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage CDN endpoints, but can’t grant access to other users.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/endpoints/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:52.6231539Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/426e0c7f-0c7e-4658-b36f-ff54d6c29b45\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"426e0c7f-0c7e-4658-b36f-ff54d6c29b45\"},{\"properties\":{\"roleName\":\"CDN Endpoint Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view CDN endpoints, but can’t make changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/endpoints/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:53.1585846Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/871e35f6-b5c1-49cc-a043-bde969a0f2cd\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"871e35f6-b5c1-49cc-a043-bde969a0f2cd\"},{\"properties\":{\"roleName\":\"CDN Profile Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can manage CDN profiles and their endpoints, but can’t grant access to other users.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:53.7051278Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ec156ff8-a8d1-4d15-830c-5b80698ca432\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ec156ff8-a8d1-4d15-830c-5b80698ca432\"},{\"properties\":{\"roleName\":\"CDN Profile Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can view CDN profiles and their endpoints, but can’t make changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cdn/edgenodes/read\",\"Microsoft.Cdn/operationresults/*\",\"Microsoft.Cdn/profiles/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-01-23T02:48:46.4996252Z\",\"updatedOn\":\"2016-05-31T23:13:54.2283001Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/8f96442b-4075-438f-813d-ad51ab4019af\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"8f96442b-4075-438f-813d-ad51ab4019af\"},{\"properties\":{\"roleName\":\"Classic Network Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic networks, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicNetwork/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:56.3934954Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b34d265f-36f7-4a0d-a4d4-e158ca92e90f\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b34d265f-36f7-4a0d-a4d4-e158ca92e90f\"},{\"properties\":{\"roleName\":\"Classic Storage Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic storage accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicStorage/storageAccounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:56.9379206Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/86e8f5dc-a6e9-4c67-9d15-de283e8eac25\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"86e8f5dc-a6e9-4c67-9d15-de283e8eac25\"},{\"properties\":{\"roleName\":\"Classic Storage Account Key Operator Service Role\",\"type\":\"BuiltInRole\",\"description\":\"Classic Storage Account Key Operators are allowed to list and regenerate keys on Classic Storage Accounts\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ClassicStorage/storageAccounts/listkeys/action\",\"Microsoft.ClassicStorage/storageAccounts/regeneratekey/action\"],\"notActions\":[]}],\"createdOn\":\"2017-04-13T18:22:52.1461100Z\",\"updatedOn\":\"2017-04-13T20:54:03.0505986Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/985d6b00-f706-48f5-a6fe-d0ca12fb668d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"985d6b00-f706-48f5-a6fe-d0ca12fb668d\"},{\"properties\":{\"roleName\":\"Classic Virtual Machine Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage classic virtual machines, but not access to them, and not the virtual network or storage account they’re connected to.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicCompute/domainNames/*\",\"Microsoft.ClassicCompute/virtualMachines/*\",\"Microsoft.ClassicNetwork/networkSecurityGroups/join/action\",\"Microsoft.ClassicNetwork/reservedIps/link/action\",\"Microsoft.ClassicNetwork/reservedIps/read\",\"Microsoft.ClassicNetwork/virtualNetworks/join/action\",\"Microsoft.ClassicNetwork/virtualNetworks/read\",\"Microsoft.ClassicStorage/storageAccounts/disks/read\",\"Microsoft.ClassicStorage/storageAccounts/images/read\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.ClassicStorage/storageAccounts/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:57.4788684Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/d73bb868-a0df-4d4d-bd69-98a00b01fccb\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"d73bb868-a0df-4d4d-bd69-98a00b01fccb\"},{\"properties\":{\"roleName\":\"ClearDB MySQL DB Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage ClearDB MySQL databases, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"successbricks.cleardb/databases/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:58.1393839Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9106cda0-8a86-4e81-b686-29a22c54effe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9106cda0-8a86-4e81-b686-29a22c54effe\"},{\"properties\":{\"roleName\":\"Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage everything except access to resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*\"],\"notActions\":[\"Microsoft.Authorization/*/Delete\",\"Microsoft.Authorization/*/Write\",\"Microsoft.Authorization/elevateAccess/Action\",\"Microsoft.Blueprint/blueprintAssignments/write\",\"Microsoft.Blueprint/blueprintAssignments/delete\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-05-30T19:22:32.4538167Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b24988ac-6180-42a0-ab88-20f7382dd24c\"},{\"properties\":{\"roleName\":\"Cosmos DB Account Reader Role\",\"type\":\"BuiltInRole\",\"description\":\"Can read Azure Cosmos DB Accounts data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DocumentDB/*/read\",\"Microsoft.DocumentDB/databaseAccounts/readonlykeys/action\",\"Microsoft.Insights/MetricDefinitions/read\",\"Microsoft.Insights/Metrics/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-10-30T17:53:54.6005577Z\",\"updatedOn\":\"2018-02-21T01:36:59.6186231Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fbdf93bf-df7d-467e-a4d2-9458aa1360c8\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fbdf93bf-df7d-467e-a4d2-9458aa1360c8\"},{\"properties\":{\"roleName\":\"Data Factory Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage data factories, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DataFactory/dataFactories/*\",\"Microsoft.DataFactory/factories/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-04-06T22:49:28.1118955Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/673868aa-7521-48a0-acc6-0f60742d39f5\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"673868aa-7521-48a0-acc6-0f60742d39f5\"},{\"properties\":{\"roleName\":\"Data Lake Analytics Developer\",\"type\":\"BuiltInRole\",\"description\":\"Lets you submit, monitor, and manage your own jobs but not create or delete Data Lake Analytics accounts.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.BigAnalytics/accounts/*\",\"Microsoft.DataLakeAnalytics/accounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.BigAnalytics/accounts/Delete\",\"Microsoft.BigAnalytics/accounts/TakeOwnership/action\",\"Microsoft.BigAnalytics/accounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/TakeOwnership/action\",\"Microsoft.DataLakeAnalytics/accounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/dataLakeStoreAccounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/dataLakeStoreAccounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/storageAccounts/Write\",\"Microsoft.DataLakeAnalytics/accounts/storageAccounts/Delete\",\"Microsoft.DataLakeAnalytics/accounts/firewallRules/Write\",\"Microsoft.DataLakeAnalytics/accounts/firewallRules/Delete\",\"Microsoft.DataLakeAnalytics/accounts/computePolicies/Write\",\"Microsoft.DataLakeAnalytics/accounts/computePolicies/Delete\"]}],\"createdOn\":\"2015-10-20T00:33:29.3115234Z\",\"updatedOn\":\"2017-08-18T00:00:17.0411642Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/47b7735b-770e-4598-a7da-8b91488b4c88\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"47b7735b-770e-4598-a7da-8b91488b4c88\"},{\"properties\":{\"roleName\":\"Data Purger\",\"type\":\"BuiltInRole\",\"description\":\"Can purge analytics data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Insights/components/*/read\",\"Microsoft.Insights/components/purge/action\",\"Microsoft.OperationalInsights/workspaces/*/read\",\"Microsoft.OperationalInsights/workspaces/purge/action\"],\"notActions\":[]}],\"createdOn\":\"2018-04-30T22:39:49.6167700Z\",\"updatedOn\":\"2018-04-30T22:44:15.1171162Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/150f5e0c-0603-4f03-8c7f-cf70034c4e90\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"150f5e0c-0603-4f03-8c7f-cf70034c4e90\"},{\"properties\":{\"roleName\":\"DevTest Labs User\",\"type\":\"BuiltInRole\",\"description\":\"Lets you connect, start, restart, and shutdown virtual machines in your Azure DevTest Labs.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Compute/availabilitySets/read\",\"Microsoft.Compute/virtualMachines/*/read\",\"Microsoft.Compute/virtualMachines/deallocate/action\",\"Microsoft.Compute/virtualMachines/read\",\"Microsoft.Compute/virtualMachines/restart/action\",\"Microsoft.Compute/virtualMachines/start/action\",\"Microsoft.DevTestLab/*/read\",\"Microsoft.DevTestLab/labs/createEnvironment/action\",\"Microsoft.DevTestLab/labs/claimAnyVm/action\",\"Microsoft.DevTestLab/labs/formulas/delete\",\"Microsoft.DevTestLab/labs/formulas/read\",\"Microsoft.DevTestLab/labs/formulas/write\",\"Microsoft.DevTestLab/labs/policySets/evaluatePolicies/action\",\"Microsoft.DevTestLab/labs/virtualMachines/claim/action\",\"Microsoft.Network/loadBalancers/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatRules/join/action\",\"Microsoft.Network/networkInterfaces/*/read\",\"Microsoft.Network/networkInterfaces/join/action\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Network/networkInterfaces/write\",\"Microsoft.Network/publicIPAddresses/*/read\",\"Microsoft.Network/publicIPAddresses/join/action\",\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/subnets/join/action\",\"Microsoft.Resources/deployments/operations/read\",\"Microsoft.Resources/deployments/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listKeys/action\"],\"notActions\":[\"Microsoft.Compute/virtualMachines/vmSizes/read\"]}],\"createdOn\":\"2015-06-08T21:52:45.0657582Z\",\"updatedOn\":\"2017-02-02T02:38:38.2961026Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/76283e04-6283-4c54-8f91-bcf1374a3c64\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"76283e04-6283-4c54-8f91-bcf1374a3c64\"},{\"properties\":{\"roleName\":\"DNS Zone Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage DNS zones and record sets in Azure DNS, but does not let you control who has access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/dnsZones/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-10-15T23:33:25.9730842Z\",\"updatedOn\":\"2016-05-31T23:13:40.3710365Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/befefa01-2a29-4197-83a8-272ff33ce314\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"befefa01-2a29-4197-83a8-272ff33ce314\"},{\"properties\":{\"roleName\":\"DocumentDB Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage DocumentDB accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.DocumentDb/databaseAccounts/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:07.2132374Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5bd9cd88-fe45-4216-938b-f97437e15450\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5bd9cd88-fe45-4216-938b-f97437e15450\"},{\"properties\":{\"roleName\":\"Intelligent Systems Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Intelligent Systems accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.IntelligentSystems/accounts/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:59.7946586Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/03a6d094-3444-4b3d-88af-7477090a9e5e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"03a6d094-3444-4b3d-88af-7477090a9e5e\"},{\"properties\":{\"roleName\":\"Key Vault Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage key vaults, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.KeyVault/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.KeyVault/locations/deletedVaults/purge/action\",\"Microsoft.KeyVault/hsmPools/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2017-12-14T02:01:18.4641200Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/f25e0fa2-a7c8-4377-a976-54943a77a395\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"f25e0fa2-a7c8-4377-a976-54943a77a395\"},{\"properties\":{\"roleName\":\"Lab Creator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you create, manage, delete your managed labs under your Azure Lab Accounts.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.LabServices/labAccounts/*/read\",\"Microsoft.LabServices/labAccounts/createLab/action\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2018-01-18T23:38:58.1036141Z\",\"updatedOn\":\"2018-03-08T19:53:30.3032044Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/b97fb8bc-a8b2-4522-a38b-dd33c7e65ead\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"b97fb8bc-a8b2-4522-a38b-dd33c7e65ead\"},{\"properties\":{\"roleName\":\"Log Analytics Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Log Analytics Contributor can read all monitoring data and edit monitoring settings. Editing monitoring settings includes adding the VM extension to VMs; reading storage account keys to be able to configure collection of logs from Azure Storage; creating and configuring Automation accounts; adding solutions; and configuring Azure diagnostics on all Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Automation/automationAccounts/*\",\"Microsoft.ClassicCompute/virtualMachines/extensions/*\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.Compute/virtualMachines/extensions/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.OperationalInsights/*\",\"Microsoft.OperationsManagement/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourcegroups/deployments/*\",\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-04-25T21:51:45.3174711Z\",\"updatedOn\":\"2018-01-30T18:08:26.6376126Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"92aaf0da-9dab-42b6-94a3-d43ce8d16293\"},{\"properties\":{\"roleName\":\"Log Analytics Reader\",\"type\":\"BuiltInRole\",\"description\":\"Log Analytics Reader can view and search all monitoring data as well as and view monitoring settings, including viewing the configuration of Azure diagnostics on all Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.OperationalInsights/workspaces/analytics/query/action\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.OperationalInsights/workspaces/sharedKeys/read\"]}],\"createdOn\":\"2017-05-02T00:20:28.1449012Z\",\"updatedOn\":\"2018-01-30T18:08:26.0438523Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/73c42c96-874c-492b-b04d-ab87d138a893\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"73c42c96-874c-492b-b04d-ab87d138a893\"},{\"properties\":{\"roleName\":\"Logic App Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage logic app, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicStorage/storageAccounts/listKeys/action\",\"Microsoft.ClassicStorage/storageAccounts/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.Insights/logdefinitions/*\",\"Microsoft.Insights/metricDefinitions/*\",\"Microsoft.Logic/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/operationresults/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listkeys/action\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\",\"Microsoft.Web/connectionGateways/*\",\"Microsoft.Web/connections/*\",\"Microsoft.Web/customApis/*\",\"Microsoft.Web/serverFarms/join/action\",\"Microsoft.Web/serverFarms/read\",\"Microsoft.Web/sites/functions/listSecrets/action\"],\"notActions\":[]}],\"createdOn\":\"2016-04-28T21:33:30.4656007Z\",\"updatedOn\":\"2018-01-10T23:11:44.8580600Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/87a39d53-fc1b-424a-814c-f7e04687dc9e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"87a39d53-fc1b-424a-814c-f7e04687dc9e\"},{\"properties\":{\"roleName\":\"Logic App Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you read, enable and disable logic app.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*/read\",\"Microsoft.Insights/diagnosticSettings/*/read\",\"Microsoft.Insights/metricDefinitions/*/read\",\"Microsoft.Logic/*/read\",\"Microsoft.Logic/workflows/disable/action\",\"Microsoft.Logic/workflows/enable/action\",\"Microsoft.Logic/workflows/validate/action\",\"Microsoft.Resources/deployments/operations/read\",\"Microsoft.Resources/subscriptions/operationresults/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/connectionGateways/*/read\",\"Microsoft.Web/connections/*/read\",\"Microsoft.Web/customApis/*/read\",\"Microsoft.Web/serverFarms/read\"],\"notActions\":[]}],\"createdOn\":\"2016-04-28T21:33:30.4656007Z\",\"updatedOn\":\"2018-01-10T23:14:26.9539724Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/515c2055-d9d4-4321-b1b9-bd0c9a0f79fe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"515c2055-d9d4-4321-b1b9-bd0c9a0f79fe\"},{\"properties\":{\"roleName\":\"Managed Identity Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Create, Read, Update, and Delete User Assigned Identity\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ManagedIdentity/userAssignedIdentities/*/read\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/write\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/delete\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-12-14T19:53:42.8804692Z\",\"updatedOn\":\"2017-12-14T22:17:02.2740594Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e40ec5ca-96e0-45a2-b4ff-59039f2c2b59\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e40ec5ca-96e0-45a2-b4ff-59039f2c2b59\"},{\"properties\":{\"roleName\":\"Managed Identity Operator\",\"type\":\"BuiltInRole\",\"description\":\"Read and Assign User Assigned Identity\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.ManagedIdentity/userAssignedIdentities/*/read\",\"Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action\",\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-12-14T19:52:04.3924594Z\",\"updatedOn\":\"2017-12-14T22:16:00.1483256Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/f1a07417-d97a-45cb-824c-7a7467783830\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"f1a07417-d97a-45cb-824c-7a7467783830\"},{\"properties\":{\"roleName\":\"Management Group Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Management Group Contributor Role\",\"assignableScopes\":[\"/providers/Microsoft.Management\"],\"permissions\":[{\"actions\":[\"Microsoft.Management/managementGroups/delete\",\"Microsoft.Management/managementGroups/read\",\"Microsoft.Management/managementGroups/subscriptions/delete\",\"Microsoft.Management/managementGroups/subscriptions/write\",\"Microsoft.Management/managementGroups/write\"],\"notActions\":[]}],\"createdOn\":\"2018-06-22T00:28:29.0523964Z\",\"updatedOn\":\"2018-06-22T00:29:40.3047486Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5d58bcaf-24a5-4b20-bdb6-eed9f69fbe4c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5d58bcaf-24a5-4b20-bdb6-eed9f69fbe4c\"},{\"properties\":{\"roleName\":\"Management Group Reader\",\"type\":\"BuiltInRole\",\"description\":\"Management Group Reader Role\",\"assignableScopes\":[\"/providers/Microsoft.Management\"],\"permissions\":[{\"actions\":[\"Microsoft.Management/managementGroups/read\"],\"notActions\":[]}],\"createdOn\":\"2018-06-22T00:31:03.4295347Z\",\"updatedOn\":\"2018-06-22T00:32:11.5701900Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ac63b705-f282-497d-ac71-919bf39d939d\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ac63b705-f282-497d-ac71-919bf39d939d\"},{\"properties\":{\"roleName\":\"Monitoring Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Can read all monitoring data and update monitoring settings.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.AlertsManagement/alerts/*\",\"Microsoft.AlertsManagement/alertsSummary/*\",\"Microsoft.Insights/AlertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.Insights/DiagnosticSettings/*\",\"Microsoft.Insights/eventtypes/*\",\"Microsoft.Insights/LogDefinitions/*\",\"Microsoft.Insights/MetricDefinitions/*\",\"Microsoft.Insights/Metrics/*\",\"Microsoft.Insights/Register/Action\",\"Microsoft.Insights/webtests/*\",\"Microsoft.Insights/actiongroups/*\",\"Microsoft.Insights/metricalerts/*\",\"Microsoft.Insights/scheduledqueryrules/*\",\"Microsoft.OperationalInsights/workspaces/intelligencepacks/*\",\"Microsoft.OperationalInsights/workspaces/savedSearches/*\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.OperationalInsights/workspaces/sharedKeys/action\",\"Microsoft.OperationalInsights/workspaces/storageinsightconfigs/*\",\"Microsoft.Support/*\",\"Microsoft.WorkloadMonitor/workloads/*\"],\"notActions\":[]}],\"createdOn\":\"2016-09-21T19:21:08.4345976Z\",\"updatedOn\":\"2018-04-02T19:04:30.9448972Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/749f88d5-cbae-40b8-bcfc-e573ddc772fa\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"749f88d5-cbae-40b8-bcfc-e573ddc772fa\"},{\"properties\":{\"roleName\":\"Monitoring Reader\",\"type\":\"BuiltInRole\",\"description\":\"Can read all monitoring data.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.OperationalInsights/workspaces/search/action\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2016-09-21T19:19:52.4939376Z\",\"updatedOn\":\"2018-01-30T18:08:27.2626250Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"43d0d8ad-25c7-4714-9337-8ba259a9fe05\"},{\"properties\":{\"roleName\":\"Network Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage networks, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2016-05-31T23:14:00.3326359Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"4d97b98b-1d4f-4787-a291-c67834d212e7\"},{\"properties\":{\"roleName\":\"New Relic APM Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage New Relic Application Performance Management accounts and applications, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"NewRelic.APM/accounts/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:07.7538043Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/5d28c62d-5b37-4476-8438-e587778df237\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"5d28c62d-5b37-4476-8438-e587778df237\"},{\"properties\":{\"roleName\":\"Owner\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage everything, including access to resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:00.9179619Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"8e3af657-a8ff-443c-a75c-2fe8c4bcb635\"},{\"properties\":{\"roleName\":\"PowerApps Administrator\",\"type\":\"BuiltInRole\",\"description\":\"The user has access to perform administrative actions on all PowerApps resources within the tenant.\",\"assignableScopes\":[\"/providers/Microsoft.PowerApps\"],\"permissions\":[{\"actions\":[\"Microsoft.PowerApps/actions/admin/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:13:41.9912926Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/53be45b2-ad40-43ab-bc1f-2c962ac99ded\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"53be45b2-ad40-43ab-bc1f-2c962ac99ded\"},{\"properties\":{\"roleName\":\"PowerAppsReaderWithReshare\",\"type\":\"BuiltInRole\",\"description\":\"PowerAppsReadersWithReshare can use the resource and re-share it with other users, but cannot edit the resource or re-share it with edit permissions.\",\"assignableScopes\":[\"/providers/Microsoft.PowerApps\"],\"permissions\":[{\"actions\":[\"Microsoft.PowerApps/*/permissions/write\",\"Microsoft.PowerApps/*/read\"],\"notActions\":[\"Microsoft.PowerApps/*/delete\",\"Microsoft.PowerApps/*/write\"]}],\"createdOn\":\"2016-03-15T00:55:03.0666416Z\",\"updatedOn\":\"2016-05-31T23:14:09.6924345Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6877c72c-edd3-4048-9b4b-cf8e514477b0\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6877c72c-edd3-4048-9b4b-cf8e514477b0\"},{\"properties\":{\"roleName\":\"Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view everything, but not make any changes.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-01-30T18:08:25.4031403Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"acdd72a7-3385-48ef-bd42-f606fba81ae7\"},{\"properties\":{\"roleName\":\"Reader and Data Access\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view everything but will not let you delete or create a storage account or contained resource. It will also allow read/write access to all data contained in a storage account via access to storage account keys.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Storage/storageAccounts/read\"],\"notActions\":[]}],\"createdOn\":\"2018-03-27T23:20:46.1498906Z\",\"updatedOn\":\"2018-03-28T17:50:03.9656854Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/c12c1c16-33a1-487b-954d-41c89c60f349\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"c12c1c16-33a1-487b-954d-41c89c60f349\"},{\"properties\":{\"roleName\":\"Redis Cache Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Redis caches, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Cache/redis/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:01.9877071Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e0f68234-74aa-48ed-b826-c38b57376e17\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e0f68234-74aa-48ed-b826-c38b57376e17\"},{\"properties\":{\"roleName\":\"Resource Policy Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"(Preview) Backfilled users from EA, with rights to create/modify resource policy, create support ticket and read resources/hierarchy.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Authorization/policyassignments/*\",\"Microsoft.Authorization/policydefinitions/*\",\"Microsoft.Authorization/policysetdefinitions/*\",\"Microsoft.PolicyInsights/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-08-25T19:08:01.3861639Z\",\"updatedOn\":\"2018-01-30T18:08:27.8272264Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/36243c78-bf99-498c-9df9-86d9f8d28608\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"36243c78-bf99-498c-9df9-86d9f8d28608\"},{\"properties\":{\"roleName\":\"Scheduler Job Collections Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Scheduler job collections, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Scheduler/jobcollections/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:02.5343995Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/188a0f2f-5c9e-469b-ae67-2aa5ce574b94\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"188a0f2f-5c9e-469b-ae67-2aa5ce574b94\"},{\"properties\":{\"roleName\":\"Search Service Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Search services, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Search/searchServices/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:03.0463472Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/7ca78c08-252a-4471-8644-bb5ff32d4ba0\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"7ca78c08-252a-4471-8644-bb5ff32d4ba0\"},{\"properties\":{\"roleName\":\"Security Admin\",\"type\":\"BuiltInRole\",\"description\":\"Security Admin Role\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Authorization/policyAssignments/*\",\"Microsoft.Authorization/policyDefinitions/*\",\"Microsoft.Authorization/policySetDefinitions/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.operationalInsights/workspaces/*/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*/read\",\"Microsoft.Security/locations/alerts/dismiss/action\",\"Microsoft.Security/locations/alerts/activate/action\",\"Microsoft.Security/locations/tasks/dismiss/action\",\"Microsoft.Security/locations/tasks/activate/action\",\"Microsoft.Security/policies/write\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-03T07:51:23.0917487Z\",\"updatedOn\":\"2018-03-08T18:19:50.7393029Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fb1c8493-542b-48eb-b624-b4c8fea62acd\"},{\"properties\":{\"roleName\":\"Security Manager\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage security components, security policies and virtual machines\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.ClassicCompute/*/read\",\"Microsoft.ClassicCompute/virtualMachines/*/write\",\"Microsoft.ClassicNetwork/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-22T17:45:15.8986455Z\",\"updatedOn\":\"2018-03-08T18:18:48.6183620Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/e3d13bf0-dd5a-482e-ba6b-9b8433878d10\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"e3d13bf0-dd5a-482e-ba6b-9b8433878d10\"},{\"properties\":{\"roleName\":\"Security Reader\",\"type\":\"BuiltInRole\",\"description\":\"Security Reader Role\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Insights/alertRules/*\",\"Microsoft.Resources/deployments/*\",\"Microsoft.operationalInsights/workspaces/*/read\",\"Microsoft.Authorization/*/read\",\"Microsoft.Support/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Security/*/read\"],\"notActions\":[]}],\"createdOn\":\"2017-05-03T07:48:49.0516559Z\",\"updatedOn\":\"2017-05-03T18:42:54.9787380Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/39bc4728-0917-49c7-9d2c-d95423bc2eb4\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"39bc4728-0917-49c7-9d2c-d95423bc2eb4\"},{\"properties\":{\"roleName\":\"Site Recovery Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Site Recovery service except vault creation and role assignment\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/locations/allocateStamp/action\",\"Microsoft.RecoveryServices/Vaults/certificates/write\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/*\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/*\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/*\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/*\",\"Microsoft.RecoveryServices/vaults/replicationJobs/*\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/*\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/*\",\"Microsoft.RecoveryServices/Vaults/storageConfig/*\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/*\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:46:17.4592776Z\",\"updatedOn\":\"2017-06-29T05:31:19.7240473Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6670b86e-a3f7-4917-ac9b-5d6ab1be4567\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6670b86e-a3f7-4917-ac9b-5d6ab1be4567\"},{\"properties\":{\"roleName\":\"Site Recovery Operator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you failover and failback but not perform other Site Recovery management operations\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/locations/allocateStamp/action\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/read\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/checkConsistency/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/reassociateGateway/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/renewcertificate/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/applyRecoveryPoint/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/failoverCommit/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/plannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/repairReplication/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/reProtect/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailoverCleanup/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/unplannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/updateMobilityService/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/refreshProvider/action\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/read\",\"Microsoft.RecoveryServices/vaults/replicationJobs/*\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/failoverCommit/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/plannedFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/reProtect/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailover/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailoverCleanup/action\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/unplannedFailover/action\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/*\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:47:50.1341148Z\",\"updatedOn\":\"2017-06-29T05:42:27.1715639Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/494ae006-db33-4328-bf46-533a6560a3ca\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"494ae006-db33-4328-bf46-533a6560a3ca\"},{\"properties\":{\"roleName\":\"Site Recovery Reader\",\"type\":\"BuiltInRole\",\"description\":\"Lets you view Site Recovery status but not perform other management operations\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.RecoveryServices/locations/allocatedStamp/read\",\"Microsoft.RecoveryServices/Vaults/extendedInformation/read\",\"Microsoft.RecoveryServices/Vaults/monitoringAlerts/read\",\"Microsoft.RecoveryServices/Vaults/monitoringConfigurations/notificationConfiguration/read\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/refreshContainers/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read\",\"Microsoft.RecoveryServices/Vaults/registeredIdentities/read\",\"Microsoft.RecoveryServices/vaults/replicationAlertSettings/read\",\"Microsoft.RecoveryServices/vaults/replicationEvents/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/read\",\"Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/read\",\"Microsoft.RecoveryServices/vaults/replicationJobs/read\",\"Microsoft.RecoveryServices/vaults/replicationPolicies/read\",\"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/read\",\"Microsoft.RecoveryServices/Vaults/storageConfig/read\",\"Microsoft.RecoveryServices/Vaults/tokenInfo/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/vaultTokens/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-05-19T13:35:40.0093634Z\",\"updatedOn\":\"2017-05-26T19:54:51.3933250Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/dbaa88c4-0c30-4179-9fb3-46319faa6149\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"dbaa88c4-0c30-4179-9fb3-46319faa6149\"},{\"properties\":{\"roleName\":\"SQL DB Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage SQL databases, but not access to them. Also, you can't manage their security-related policies or their parent SQL servers.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/locations/*/read\",\"Microsoft.Sql/servers/databases/*\",\"Microsoft.Sql/servers/read\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:41.1575716Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9b7fa17d-e63e-47b0-bb0a-15c516ac86ec\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9b7fa17d-e63e-47b0-bb0a-15c516ac86ec\"},{\"properties\":{\"roleName\":\"SQL Security Manager\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage the security-related policies of SQL servers and databases, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/action\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/servers/auditingPolicies/*\",\"Microsoft.Sql/servers/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/read\",\"Microsoft.Sql/servers/databases/schemas/read\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/read\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/schemas/tables/read\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\",\"Microsoft.Sql/servers/firewallRules/*\",\"Microsoft.Sql/servers/read\",\"Microsoft.Sql/servers/securityAlertPolicies/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:40.2200727Z\",\"createdBy\":null,\"updatedBy\":\"yaiyun\"},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/056cd41c-7e88-42e1-933e-88ba6a50c9c3\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"056cd41c-7e88-42e1-933e-88ba6a50c9c3\"},{\"properties\":{\"roleName\":\"SQL Server Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage SQL servers and databases, but not access to them, and not their security -related policies.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Sql/locations/*/read\",\"Microsoft.Sql/servers/*\",\"Microsoft.Support/*\"],\"notActions\":[\"Microsoft.Sql/servers/auditingPolicies/*\",\"Microsoft.Sql/servers/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditingPolicies/*\",\"Microsoft.Sql/servers/databases/auditingSettings/*\",\"Microsoft.Sql/servers/databases/auditRecords/read\",\"Microsoft.Sql/servers/databases/connectionPolicies/*\",\"Microsoft.Sql/servers/databases/dataMaskingPolicies/*\",\"Microsoft.Sql/servers/databases/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/securityAlertPolicies/*\",\"Microsoft.Sql/servers/databases/securityMetrics/*\",\"Microsoft.Sql/servers/databases/sensitivityLabels/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessments/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentScans/*\",\"Microsoft.Sql/servers/databases/vulnerabilityAssessmentSettings/*\",\"Microsoft.Sql/servers/extendedAuditingSettings/*\",\"Microsoft.Sql/servers/securityAlertPolicies/*\"]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-02-15T19:48:41.8450730Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/6d8ee4ec-f05a-4a1d-8b00-a9b17e38b437\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"6d8ee4ec-f05a-4a1d-8b00-a9b17e38b437\"},{\"properties\":{\"roleName\":\"Storage Account Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage storage accounts, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/diagnosticSettings/*\",\"Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/action\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2017-08-21T07:43:20.3060994Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"17d1049b-9a84-46fb-8f53-869881c3d3ab\"},{\"properties\":{\"roleName\":\"Storage Account Key Operator Service Role\",\"type\":\"BuiltInRole\",\"description\":\"Storage Account Key Operators are allowed to list and regenerate keys on Storage Accounts\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/listkeys/action\",\"Microsoft.Storage/storageAccounts/regeneratekey/action\"],\"notActions\":[]}],\"createdOn\":\"2017-04-13T18:26:11.5770570Z\",\"updatedOn\":\"2017-04-13T20:57:14.5990198Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"81a9662b-bebf-436f-a333-f67b29880f12\"},{\"properties\":{\"roleName\":\"Storage Blob Data Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read, write and delete access to Azure Storage blob containers and data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/blobServices/containers/delete\",\"Microsoft.Storage/storageAccounts/blobServices/containers/read\",\"Microsoft.Storage/storageAccounts/blobServices/containers/write\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:11:00.4629296Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"ba92f5b4-2d11-453d-a403-e96b0029c9fe\"},{\"properties\":{\"roleName\":\"Storage Blob Data Reader (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read access to Azure Storage blob containers and data\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/blobServices/containers/read\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:15:19.5080840Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/2a2b9908-6ea1-4ae2-8e65-a410df84e7d1\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"2a2b9908-6ea1-4ae2-8e65-a410df84e7d1\"},{\"properties\":{\"roleName\":\"Storage Queue Data Contributor (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read, write, and delete access to Azure Storage queues and queue messages\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/queueServices/queues/delete\",\"Microsoft.Storage/storageAccounts/queueServices/queues/read\",\"Microsoft.Storage/storageAccounts/queueServices/queues/write\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:16:40.1371662Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/974c5e8b-45b9-4653-ba55-5f855dd0fb88\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"974c5e8b-45b9-4653-ba55-5f855dd0fb88\"},{\"properties\":{\"roleName\":\"Storage Queue Data Reader (Preview)\",\"type\":\"BuiltInRole\",\"description\":\"Allows for read access to Azure Storage queues and queue messages\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/queueServices/queues/read\"],\"notActions\":[]}],\"createdOn\":\"2017-12-21T00:01:24.7972312Z\",\"updatedOn\":\"2018-04-02T17:19:30.5001463Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/19e7f393-937e-4f77-808e-94535e297925\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"19e7f393-937e-4f77-808e-94535e297925\"},{\"properties\":{\"roleName\":\"Support Request Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you create and manage Support requests\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2017-06-22T22:25:37.8053068Z\",\"updatedOn\":\"2017-06-23T01:06:24.2399631Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/cfd33db0-3dd1-45e3-aa9d-cdbdf3b6f24e\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"cfd33db0-3dd1-45e3-aa9d-cdbdf3b6f24e\"},{\"properties\":{\"roleName\":\"Traffic Manager Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage Traffic Manager profiles, but does not let you control who has access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/trafficManagerProfiles/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-10-15T23:33:25.9730842Z\",\"updatedOn\":\"2016-05-31T23:13:44.1458854Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/a4b10055-b0c7-44c2-b00f-c7b5b3550cf7\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"a4b10055-b0c7-44c2-b00f-c7b5b3550cf7\"},{\"properties\":{\"roleName\":\"User Access Administrator\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage user access to Azure resources.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"*/read\",\"Microsoft.Authorization/*\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2018-01-30T18:08:24.4656640Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/18d7d88d-d35e-4fb5-a5c3-7773c20a72d9\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"18d7d88d-d35e-4fb5-a5c3-7773c20a72d9\"},{\"properties\":{\"roleName\":\"Virtual Machine Administrator Login\",\"type\":\"BuiltInRole\",\"description\":\"View Virtual Machines in the portal and login as administrator\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Compute/virtualMachines/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-02-09T18:36:13.3315744Z\",\"updatedOn\":\"2018-05-09T22:17:57.0514548Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/1c0163c0-47e6-4577-8991-ea5c82e286e4\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"1c0163c0-47e6-4577-8991-ea5c82e286e4\"},{\"properties\":{\"roleName\":\"Virtual Machine Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage virtual machines, but not access to them, and not the virtual network or storage account they’re connected to.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Compute/availabilitySets/*\",\"Microsoft.Compute/locations/*\",\"Microsoft.Compute/virtualMachines/*\",\"Microsoft.Compute/virtualMachineScaleSets/*\",\"Microsoft.DevTestLab/schedules/*\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Network/applicationGateways/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/backendAddressPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatPools/join/action\",\"Microsoft.Network/loadBalancers/inboundNatRules/join/action\",\"Microsoft.Network/loadBalancers/probes/join/action\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/locations/*\",\"Microsoft.Network/networkInterfaces/*\",\"Microsoft.Network/networkSecurityGroups/join/action\",\"Microsoft.Network/networkSecurityGroups/read\",\"Microsoft.Network/publicIPAddresses/join/action\",\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/virtualNetworks/subnets/join/action\",\"Microsoft.RecoveryServices/locations/*\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/*/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/write\",\"Microsoft.RecoveryServices/Vaults/backupFabrics/backupProtectionIntent/write\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/read\",\"Microsoft.RecoveryServices/Vaults/backupPolicies/write\",\"Microsoft.RecoveryServices/Vaults/read\",\"Microsoft.RecoveryServices/Vaults/usages/read\",\"Microsoft.RecoveryServices/Vaults/write\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Storage/storageAccounts/listKeys/action\",\"Microsoft.Storage/storageAccounts/read\",\"Microsoft.Support/*\"],\"notActions\":[]}],\"createdOn\":\"2015-06-02T00:18:27.3542698Z\",\"updatedOn\":\"2017-11-14T03:00:30.1736393Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/9980e02c-c2be-4d73-94e8-173b1dc7cf3c\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"9980e02c-c2be-4d73-94e8-173b1dc7cf3c\"},{\"properties\":{\"roleName\":\"Virtual Machine User Login\",\"type\":\"BuiltInRole\",\"description\":\"View Virtual Machines in the portal and login as a regular user.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Network/publicIPAddresses/read\",\"Microsoft.Network/virtualNetworks/read\",\"Microsoft.Network/loadBalancers/read\",\"Microsoft.Network/networkInterfaces/read\",\"Microsoft.Compute/virtualMachines/*/read\"],\"notActions\":[]}],\"createdOn\":\"2018-02-09T18:36:13.3315744Z\",\"updatedOn\":\"2018-05-09T22:18:52.2780979Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/fb879df8-f326-4884-b1cf-06f3ad86be52\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"fb879df8-f326-4884-b1cf-06f3ad86be52\"},{\"properties\":{\"roleName\":\"Web Plan Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage the web plans for websites, but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/serverFarms/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:05.9401651Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/2cc479cb-7b4d-49a8-b449-8c00fd0f0a4b\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"2cc479cb-7b4d-49a8-b449-8c00fd0f0a4b\"},{\"properties\":{\"roleName\":\"Website Contributor\",\"type\":\"BuiltInRole\",\"description\":\"Lets you manage websites (not web plans), but not access to them.\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Authorization/*/read\",\"Microsoft.Insights/alertRules/*\",\"Microsoft.Insights/components/*\",\"Microsoft.ResourceHealth/availabilityStatuses/read\",\"Microsoft.Resources/deployments/*\",\"Microsoft.Resources/subscriptions/resourceGroups/read\",\"Microsoft.Support/*\",\"Microsoft.Web/certificates/*\",\"Microsoft.Web/listSitesAssignedToHostName/read\",\"Microsoft.Web/serverFarms/join/action\",\"Microsoft.Web/serverFarms/read\",\"Microsoft.Web/sites/*\"],\"notActions\":[]}],\"createdOn\":\"0001-01-01T08:00:00.0000000Z\",\"updatedOn\":\"2016-05-31T23:14:06.5272742Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/de139f84-1756-47ae-9be6-808fbbe84772\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"de139f84-1756-47ae-9be6-808fbbe84772\"}]}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a?api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:24 GMT", + "content-length" : "0", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "e5de8f47-33bc-472b-a11d-7a8964817561", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195824Z:e5de8f47-33bc-472b-a11d-7a8964817561", + "content-type" : "text/plain; charset=utf-8", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/e73eb155-6b04-4c13-a038-fb14f536dc7f?monitor=true&api-version=2016-01-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "e73eb155-6b04-4c13-a038-fb14f536dc7f", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/e73eb155-6b04-4c13-a038-fb14f536dc7f?monitor=true&api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:24 GMT", + "content-length" : "0", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14999", + "StatusCode" : "202", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "68b2d90c-a954-494c-9d32-0bfdbee0e8bc", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195825Z:68b2d90c-a954-494c-9d32-0bfdbee0e8bc", + "content-type" : "text/plain; charset=utf-8", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/e73eb155-6b04-4c13-a038-fb14f536dc7f?monitor=true&api-version=2016-01-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "1240f427-9d11-463a-a85f-490db6502844", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westcentralus/asyncoperations/e73eb155-6b04-4c13-a038-fb14f536dc7f?monitor=true&api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:41 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "907", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14998", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "c78d072c-6b8d-4bf5-8177-a9e692ecbe3a", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195842Z:c78d072c-6b8d-4bf5-8177-a9e692ecbe3a", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "567cf13f-dbec-4f2c-bfaf-c4ff1ffac9be", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a\",\"name\":\"sabc0663752a\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"encryption\":{\"services\":{\"blob\":{\"enabled\":true,\"lastEnabledTime\":\"2018-06-25T19:58:23.9216529Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2018-06-25T19:58:23.8747773Z\",\"primaryEndpoints\":{\"blob\":\"https://sabc0663752a.blob.core.windows.net/\",\"queue\":\"https://sabc0663752a.queue.core.windows.net/\",\"table\":\"https://sabc0663752a.table.core.windows.net/\",\"file\":\"https://sabc0663752a.file.core.windows.net/\"},\"primaryLocation\":\"westcentralus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus2\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a?api-version=2016-01-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (StorageManagementClient, 2016-01-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:41 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "907", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14997", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "8cb1cbb4-b925-4e0c-b8a3-e885b6318900", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195842Z:8cb1cbb4-b925-4e0c-b8a3-e885b6318900", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "9cefcf44-5a0e-4af1-ab37-15c9418ee90e", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a\",\"name\":\"sabc0663752a\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"encryption\":{\"services\":{\"blob\":{\"enabled\":true,\"lastEnabledTime\":\"2018-06-25T19:58:23.9216529Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2018-06-25T19:58:23.8747773Z\",\"primaryEndpoints\":{\"blob\":\"https://sabc0663752a.blob.core.windows.net/\",\"queue\":\"https://sabc0663752a.queue.core.windows.net/\",\"table\":\"https://sabc0663752a.table.core.windows.net/\",\"file\":\"https://sabc0663752a.file.core.windows.net/\"},\"primaryLocation\":\"westcentralus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus2\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a/providers/Microsoft.Authorization/roleAssignments/8a6fc5ba-7601-4071-954a-adbce7cae7ae?api-version=2015-07-01", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.3.0 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (AuthorizationManagementClient, 2015-07-01)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:45 GMT", + "content-length" : "868", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-ms-request-charge" : "4", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "d68d4fec-0d68-4d87-bb87-44e3200af560", + "set-cookie" : "x-ms-gateway-slice=productionb; path=/; secure; HttpOnly", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195846Z:d68d4fec-0d68-4d87-bb87-44e3200af560", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "0c8dd70b-7635-49cf-bf47-33b86ef40d4d", + "Body" : "{\"properties\":{\"roleDefinitionId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"principalId\":\"93c27d83-f79b-4cb2-8dd4-4aa716542e74\",\"scope\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a\",\"createdOn\":\"2018-06-25T19:58:43.1732809Z\",\"updatedOn\":\"2018-06-25T19:58:43.1732809Z\",\"createdBy\":null,\"updatedBy\":\"00000000-0000-0000-0000-000000000000\"},\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a/providers/Microsoft.Authorization/roleAssignments/8a6fc5ba-7601-4071-954a-adbce7cae7ae\",\"type\":\"Microsoft.Authorization/roleAssignments\",\"name\":\"8a6fc5ba-7601-4071-954a-adbce7cae7ae\"}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:48 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "819", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "x-ms-ratelimit-remaining-subscription-writes" : "1197", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "c035050b-b12c-4c27-ae83-45973bc26a05", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195848Z:c035050b-b12c-4c27-ae83-45973bc26a05", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "c035050b-b12c-4c27-ae83-45973bc26a05", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b\",\"name\":\"vaultff052787b\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"backup\",\"get\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vaultff052787b.vault.azure.net\",\"provisioningState\":\"RegisteringDns\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:58:48 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "820", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14996", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "c664c3a5-a6c4-42ea-99bd-816c1ad1d38c", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195849Z:c664c3a5-a6c4-42ea-99bd-816c1ad1d38c", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "c664c3a5-a6c4-42ea-99bd-816c1ad1d38c", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b\",\"name\":\"vaultff052787b\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"backup\",\"get\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vaultff052787b.vault.azure.net\",\"provisioningState\":\"RegisteringDns\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b?api-version=2018-02-14-preview", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/1.11.1 OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultManagementClient, 2018-02-14-preview)" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:18 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "815", + "expires" : "-1", + "transfer-encoding" : "chunked", + "vary" : "Accept-Encoding", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "14995", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id" : "60590e31-79a4-4d91-9f3a-313ca1ba63cb", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "WESTUS2:20180625T195919Z:60590e31-79a4-4d91-9f3a-313ca1ba63cb", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.220", + "x-ms-request-id" : "60590e31-79a4-4d91-9f3a-313ca1ba63cb", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.KeyVault/vaults/vaultff052787b\",\"name\":\"vaultff052787b\",\"type\":\"Microsoft.KeyVault/vaults\",\"location\":\"westcentralus\",\"tags\":{},\"properties\":{\"sku\":{\"family\":\"A\",\"name\":\"standard\"},\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"accessPolicies\":[{\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"permissions\":{\"secrets\":[\"list\",\"restore\",\"set\",\"recover\",\"purge\",\"delete\",\"backup\",\"get\"],\"storage\":[\"recover\",\"regeneratekey\",\"get\",\"deletesas\",\"list\",\"purge\",\"set\",\"update\",\"getsas\",\"listsas\",\"delete\",\"backup\",\"setsas\",\"restore\"]}}],\"enabledForDeployment\":false,\"vaultUri\":\"https://vaultff052787b.vault.azure.net\",\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://vaultff052787b.vault.azure.net/storage/sabc0663752a?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:19 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "0fa52602-294f-43f3-b67b-9b1be9fc3a87", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://vaultff052787b.vault.azure.net/storage/sabc0663752a?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:23 GMT", + "content-length" : "402", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "67d92322-06a9-4c79-ac8b-98c69730f823", + "Body" : "{\"id\":\"https://vaultff052787b.vault.azure.netstorage/sabc0663752a\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-0/providers/Microsoft.Storage/storageAccounts/sabc0663752a\",\"activeKeyName\":\"key1\",\"autoRegenerateKey\":true,\"regenerationPeriod\":\"P30D\",\"attributes\":{\"enabled\":true,\"created\":1529956764,\"updated\":1529956764,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://vaultff052787b.vault.azure.net/storage/sabc0663752a/sas/acctall?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:28 GMT", + "content-length" : "437", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "0e5c6915-c1d1-4758-b748-fc7494b485bb", + "Body" : "{\"id\":\"https://vaultff052787b.vault.azure.netstorage/sabc0663752a/sas/acctall\",\"sid\":\"https://vaultff052787b.vault.azure.netsecrets/sabc0663752a-acctall\",\"templateUri\":\"ss=bfqt&sig=Seeukj2J9YdffimRILCDhU3S8GXMcPkD8fRG8LlWIJA%3D&se=2020-01-01T08%3A00%3A00Z&sv=2015-12-11&srt=sco&sp=racwdlup\",\"sasType\":\"account\",\"validityPeriod\":\"PT2H\",\"attributes\":{\"enabled\":true,\"created\":1529956768,\"updated\":1529956768,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://vaultff052787b.vault.azure.net/secrets/sabc0663752a-acctall/?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:29 GMT", + "content-length" : "354", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "fce2b47a-f96b-4e2c-8826-919870e1e6ec", + "Body" : "{\"value\":\"?sv=2015-12-11&ss=bfqt&srt=sco&sp=racwdlup&se=2018-06-25T21:59:30Z&sig=OntGT2YbqwSlM7LJtg%2F%2FZLOb26TDmeZys%2Bzra%2BIeGIM%3D\",\"contentType\":\"application/vnd.ms-sastoken-storage\",\"id\":\"https://vaultff052787b.vault.azure.netsecrets/sabc0663752a-acctall\",\"managed\":true,\"attributes\":{\"enabled\":true,\"exp\":1529963970,\"recoveryLevel\":\"Purgeable\"}}" + } + }, { + "Method" : "GET", + "Uri" : "https://vaultff052787b.vault.azure.net/storage/sabc0663752a/sas/acctall?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:59:32 GMT", + "content-length" : "437", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "westcentralus", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.852", + "x-ms-request-id" : "db46158a-0ba5-4f35-9f44-26f1abb29069", + "Body" : "{\"id\":\"https://vaultff052787b.vault.azure.netstorage/sabc0663752a/sas/acctall\",\"sid\":\"https://vaultff052787b.vault.azure.netsecrets/sabc0663752a-acctall\",\"templateUri\":\"ss=bfqt&sig=Seeukj2J9YdffimRILCDhU3S8GXMcPkD8fRG8LlWIJA%3D&se=2020-01-01T08%3A00%3A00Z&sv=2015-12-11&srt=sco&sp=racwdlup\",\"sasType\":\"account\",\"validityPeriod\":\"PT2H\",\"attributes\":{\"enabled\":true,\"created\":1529956768,\"updated\":1529956768,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ "sabc0663752a", "vaultff052787b" ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForKeyOperationsTest.json new file mode 100644 index 0000000000000..5633cbc2a63a8 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForKeyOperationsTest.json @@ -0,0 +1,112 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:26 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "b0179497-cd10-4322-86bb-21bb60d911db", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:32 GMT", + "content-length" : "680", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "766dadb8-5dae-4faa-89ca-8662ed5d8bee", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/4c3e30f116904a68b557b1d0d4ca7a7f\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"7eisF4pz-3JMiB39vB_KJlfjZkZLkqDEb-wDSad42LgleRn8wrQPDB7VK8kilkt6SQOKXRSDSivjusn3FGkr4vJA_H9yMLun9rGHO8_K7Kqfxy9ciUz5kfdJKwfGvoUWAj-TmAR6CuXT3rMYqYmCKTFF2m88eRGEAvOjZBRpCeEvFT8PuhThR3NHa8-FwciU4EaSADwoDFFHjg9Pp0cWF-mbjttyat_VM-2VbZ0IMGlRRJKSbgAFyEIYhtI74_mRyGp3o_BMHv0MFlzyuH7zqK0MlHpuEAJzIzdXS8UtqrrmRb2PTHkXHsCazUCmfdtnX6AaAR1JsmvOgC5gBbrgkw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"nbf\":948833006,\"exp\":2526756206,\"created\":1529955812,\"updated\":1529955812,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancier.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:33 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "0a9f79e1-1ea9-4abb-9d36-12016ad6e6bf", + "Body" : "" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancier.vault.azure.net/keys/javaKey/create?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:43:33 GMT", + "content-length" : "654", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4bf01bfb-3154-412a-9c5a-6cacc9c7a5cd", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancier.vault.azure.net/keys/javaKey/ea063d69848c4c13b62aaefad515d239\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"k27DlIuMgvzoumqZ53El0BMiWYBmFezORMQ2KXWcEXr3zbFnBJCPSemXEC83Z6do7FEW13zGEwRzU98w9tIvt3UsOsw5U5-KLD--TgrU5yWG2nQrEAvVN13aT3XlToQeu9QKfPZMRlY5eyrwkZpxiuu_tkxi2HZeAyuevOxdLCRYspQ5Hc0BBBAlfBMJ0-uW8GkEjGX181-WMfHRvIsipCTu8zvcB66pgfU7ikJc0IhnOedDfE44JtpFojJgwi6sB_eYsNtpuj2j-GQ5KSx9aTqSB8d877j5Fmbm0S6KPbHO60XWzWt559aYGeR9Ox6NC9mELKk19VVqwQ7CDHpXSw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529955814,\"updated\":1529955814,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForSecretOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForSecretOperationsTest.json new file mode 100644 index 0000000000000..5f963cfbd2af5 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/transparentAuthenticationForSecretOperationsTest.json @@ -0,0 +1,112 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:16 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9574f54b-b122-470b-8699-a53133f33770", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:18 GMT", + "content-length" : "357", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "4c44633f-c1d2-461e-a49c-33133f7f6ccd", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"contentType\":\"contentType\",\"id\":\"https://tifchen-keyvault-fancy.vault.azure.net/secrets/javaSecret/e2d2f878fe2b41f882706b488fd0b585\",\"attributes\":{\"enabled\":true,\"nbf\":948834437,\"exp\":2526757637,\"created\":1529957238,\"updated\":1529957238,\"recoveryLevel\":\"Recoverable+Purgeable\"},\"tags\":{\"foo\":\"baz\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancier.vault.azure.net/secrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:19 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "35280e03-4520-46a6-8cac-5f90e1b2cf8d", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancier.vault.azure.net/secrets/javaSecret?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 20:07:21 GMT", + "content-length" : "265", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ab0b2b14-2df9-4b7b-8e61-beff28cd9d6e", + "Body" : "{\"value\":\"Chocolate is hidden in the toothpaste cabinet\",\"id\":\"https://tifchen-keyvault-fancier.vault.azure.net/secrets/javaSecret/266b468bf6ab4e04871fbf66f4c16070\",\"attributes\":{\"enabled\":true,\"created\":1529957241,\"updated\":1529957241,\"recoveryLevel\":\"Purgeable\"}}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/wrapUnwrapOperationsForKeyOperationsTest.json b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/wrapUnwrapOperationsForKeyOperationsTest.json new file mode 100644 index 0000000000000..1be9f67cf2299 --- /dev/null +++ b/keyvault/data-plane/azure-keyvault/target/test-classes/session-records/wrapUnwrapOperationsForKeyOperationsTest.json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:56 GMT", + "content-length" : "0", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "www-authenticate" : "Bearer authorization=\"https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\", resource=\"https://vault.azure.net\"", + "retry-after" : "0", + "StatusCode" : "401", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "ea6e784c-246c-4bf0-a931-20e36dab68e5", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:57 GMT", + "content-length" : "664", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "c3fcb2dd-f80e-4359-a7c4-6b5bbd60c119", + "Body" : "{\"key\":{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1529956558,\"updated\":1529956558,\"recoveryLevel\":\"Recoverable+Purgeable\"}}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//wrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:55:58 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "11c684ca-b96b-446c-a03e-39e5a1d3dc86", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550\",\"value\":\"TYZd7iedngWAfBbqLJZsEiHQEE0DDDkveyM2kG8A84EANHxNYEcX2nL_dBmD5A-W1ki8U6FykRc5AgaUjfoRmwjFPGRW0UzSw-Fj0nsrk5H6CpLQ35WNpnk8iJOg79rERvx2JGxKd7tJxsSy647pwdYaaKNdwInR2ipP6SzXmADdDw7OC3pYKjQ0xqJoHuBSuJz7DlTMKvTAnu9w4-091x6tlFK_stPhW4RBXJnw8WIdDXc1zb0bkyoFFwPc-PLcWu7AzVhp-EAnJoiuoAfmX8z_GOSTy_mggrQVuMg4PiLxSKEaGN-uyj6qSoGKM1chSAFhsQ6_kziIoMOkUiqGlw\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey//unwrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:56:03 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "f20381db-8de0-4d4f-b030-f9d6bae6228f", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550/wrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:56:05 GMT", + "content-length" : "455", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "9671b7a2-82e9-4052-b6df-ece714447aff", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550\",\"value\":\"MFseSGDBevDzJXFk3sBecnr1SR1OLe_qrwizXWGcSdRztK-I1kl8EgvgVT_VRKEZyvPpsaPMa0Kgk-xj2W6yf8W72aYHXjqd480-0-2mt_SHSCmep3-HJkALS3rAA18zidmpZuHyrTIV2xbqtoKZndJwatoiFFcTMEgxQuLwRtmNnOlNMfgcB2rS_xIttEqzt8Gh3idrm-i8sJAWWCgN_zSPbtTd-HF6WfsG6GpP113yB76WwoXoU9YFBwruMBS1b29l605H40t4YbODc1_O9vzmXIhryJe1bVwMJxSfetaZf7ZVnGolYxpAveub0ZmMUDF2ivu3fQRcGWMN9TC-wQ\"}" + } + }, { + "Method" : "POST", + "Uri" : "https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550/unwrapkey?api-version=7.0", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:08b8c65810754c5927ba6275e7902c61544ffc9cb2de4d24196bc80b2fbba780 Java:1.8.0_172 (KeyVaultClientBase, 7.0)", + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "date" : "Mon, 25 Jun 2018 19:56:10 GMT", + "content-length" : "247", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000;includeSubDomains", + "x-content-type-options" : "nosniff", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "x-ms-keyvault-network-info" : "addr=167.220.1.18;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region" : "West US", + "cache-control" : "no-cache", + "x-ms-keyvault-service-version" : "1.0.0.849", + "x-ms-request-id" : "6386e270-47a2-45ac-9da4-ae0ec0230e65", + "Body" : "{\"kid\":\"https://tifchen-keyvault-fancy.vault.azure.net/keys/javaKey/94ce16ca83fe4c1c96b4f5e15adca550\",\"value\":\"G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw\"}" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/keyvault/data-plane/history.md b/keyvault/data-plane/history.md new file mode 100644 index 0000000000000..451e453641a62 --- /dev/null +++ b/keyvault/data-plane/history.md @@ -0,0 +1,17 @@ +# Release History + +## 1.1 +* Moving azure-keyvault to stable API version 7.0 +* Renaming curve SECP256K1 and algorithm ECDSA256 to P-256K and ES256K respectively + +### 1.1-beta-1 +* Added elliptic curve key support +* Added message encryption support for message encryption enabled vaults + +### 1.1-alpha-1 +* Adding managed storage account key backup, restore and soft-delete support +* Added certificate backup and restore support +* Added managed storage account SasDefintion creation + +## 1.0.0 +* Initial release diff --git a/keyvault/data-plane/pom.xml b/keyvault/data-plane/pom.xml new file mode 100644 index 0000000000000..be8ddf0150ada --- /dev/null +++ b/keyvault/data-plane/pom.xml @@ -0,0 +1,455 @@ + + + 4.0.0 + + com.microsoft.azure + azure-sdk-parent + 1.0-SNAPSHOT + ../../pom.client.xml + + 1.1.2 + azure-keyvault-parent + pom + + Microsoft Azure Key Vault SDK Parent + This package contains the parent module of Microsoft Azure Key Vault SDK. + https://github.com/Azure/azure-keyvault-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-keyvault-java + scm:git:git@github.com:Azure/azure-keyvault-java.git + HEAD + + + + UTF-8 + + + + 2.9.6 + + + playback + 11080 + 11081 + + + + + microsoft + Microsoft + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + true + default + + + + + + + + com.microsoft.azure + azure-keyvault-webkey + 1.1.2 + + + com.microsoft.azure + azure-keyvault-cryptography + 1.1.2 + + + com.microsoft.azure + azure-keyvault-core + 1.1.2 + + + com.microsoft.azure + azure-keyvault + 1.1.2 + + + com.microsoft.azure + azure-keyvault-extensions + 1.1.2 + + + + + + com.microsoft.azure + azure-mgmt-keyvault + 1.11.1 + + + com.microsoft.azure + azure-client-runtime + 1.3.0 + + + com.microsoft.azure + azure-mgmt-resources + 1.3.0 + + + com.microsoft.azure + azure + 1.3.0 + + + + + com.microsoft.rest + client-runtime + 1.6.1 + + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + + + org.apache.commons + commons-lang3 + 3.4 + + + commons-codec + commons-codec + 1.10 + + + io.reactivex + rxjava + 1.2.4 + + + com.google.guava + guava + 20.0 + + + + + junit + junit + 4.12 + test + + + com.microsoft.azure + adal4j + 1.4.0 + test + + + org.bouncycastle + bcprov-jdk15on + 1.59 + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + com.microsoft.azure + autorest-build-tools + 1.0.0-beta6-SNAPSHOT + + + com.puppycrawl.tools + checkstyle + 6.18 + + + + checkstyle.xml + samedir=runtimes/build-tools/src/main/resources + suppressions.xml + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + true + true + -Xlint:unchecked + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.22.v20170606 + + jetty.xml + + +
+ + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + + set-system-properties + + + + +KEYVAULT_VAULTURI + https://tifchen-keyvault-fancy.vault.azure.net + + + + KEYVAULT_VAULTURI_ALT + https://tifchen-keyvault-fancier.vault.azure.net + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.4.3 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + + **/Test*.java + **/*Test.java + **/*Tests.java + **/*TestCase.java + + + ${testMode} + https://tifchen-keyvault-fancy.vault.azure.net + https://tifchen-keyvault-fancier.vault.azure.net + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + true + + + target + false + + ** + + + test-classes/session-records/ + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + com.googlecode.addjars-maven-plugin + + + addjars-maven-plugin + + [1.0.5,) + + add-jars + + + + + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18.1 + + + + integration-test + verify + + + + + + +
+ + + run-shade-plugin + + runShadePlugin + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.1 + + + + + shade-plugin + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + + + + + ./azure-keyvault + ./azure-keyvault-core + ./azure-keyvault-webkey + ./azure-keyvault-cryptography + ./azure-keyvault-extensions + ./azure-keyvault-complete + +
diff --git a/keyvault/data-plane/regenerate_and_fix_sdk.py b/keyvault/data-plane/regenerate_and_fix_sdk.py new file mode 100644 index 0000000000000..eeb644fc3dd6a --- /dev/null +++ b/keyvault/data-plane/regenerate_and_fix_sdk.py @@ -0,0 +1,124 @@ +import os, sys, subprocess, re +from distutils.dir_util import copy_tree, remove_tree + +# Need python 3.6 for new subprocess API +MIN_PYTHON = (3, 6) +if sys.version_info < MIN_PYTHON: + sys.exit("Python %s.%s or later is required.\n" % MIN_PYTHON) + +# Configuration +verbose = True +autorest_target_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "tmp") +swagger_source_branch = "keyvault_preview" # Source branch in swagger repo to generate from +autorest_tag = "package-7.0-preview" # Autorest tag to use, if any +run_autorest = True # If false, assumes that we just need to repair generated code that is already in tree! +fix_generated_code = True # if false, assumes that we just need to run autorest +source_rest_spec = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/%s/specification/keyvault/data-plane/readme.md" % swagger_source_branch # Builds the URL to Swagger readme from branch +autorest_cmd = "autorest --java %s --azure-libraries-for-java-folder=%s" % (source_rest_spec, autorest_target_dir) + +if autorest_tag is not None: + autorest_cmd += " --tag=%s" % autorest_tag + +# Constant values +CODE_TARGET_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), "azure-keyvault", "src", "main", "java", "com", "microsoft", "azure", "keyvault") +CUSTOM_MODEL_DIR = os.path.join(CODE_TARGET_DIRECTORY, "models", "custom") +WEBKEY_REPLACE_MODELS = ['JsonWebKey', 'JsonWebKeyEncryptionAlgorithm', 'JsonWebKeyOperation', 'JsonWebKeySignatureAlgorithm', 'JsonWebKeyType'] +WEBKEY_NAMESPACE = 'com.microsoft.azure.keyvault.webkey' +CUSTOM_MODEL_NAMESPACE = 'com.microsoft.azure.keyvault.models.custom' +MODEL_NAMESPACE = 'com.microsoft.azure.keyvault.models' +FILES_TO_REMOVE = [ + 'azure-keyvault/models/%s.java' % model for model in WEBKEY_REPLACE_MODELS +] +FILES_TO_REMOVE.append('azure-keyvault/implementation/package-info.java') + +# Method definitions +def move_generated_code(autorest_target_dir, verbose): + # Remove JWK models, since those are in a separate non-generated package for now + print("Removing generated JWK models/package info") + for fn in FILES_TO_REMOVE: + + path = os.path.join(autorest_target_dir, fn) + if os.path.exists(path): + if verbose: + print("Removing %s" % path) + os.remove(path) + + # move (gen_directory)\azure-keyvault\* --> ./azure-keyvault\src\main\java\com\microsoft\azure\keyvault + print("Replacing old generated code") + copy_tree(os.path.join(autorest_target_dir, "azure-keyvault"), CODE_TARGET_DIRECTORY) + + print("Removing temporary generated files") + remove_tree(autorest_target_dir) + print("Done with generation process") + +# Fixes an individual source file +def correct_file(file, verbose): + if not file.endswith(".java"): + return + + with open(file) as f: + code = f.read() + + # Fix webkey models + for model in WEBKEY_REPLACE_MODELS: + code = code.replace("import %s.%s;" % (MODEL_NAMESPACE, model), "import %s.%s;" % (WEBKEY_NAMESPACE, model)) + + # Fix broken javadoc + jdocre = re.compile(r'([a-z|A-Z|0-9]*\<.*?\>)( \* \@param)') + code = jdocre.sub(r'\2', code) + + + classre = re.compile(r'public class ([a-z|A-Z|0-9]*?)[ \n\r\t]*{') + + # If this is a model class and not a custom model class, extend our custom code if necessary - additionally add back potentially nuked imports + dir, fn = os.path.split(file) + if os.path.split(dir)[1] == "models": + classes = classre.search(code) + if classes is not None: + classname = classes.group(1) + # check for corresponding custom class + if os.path.exists(os.path.join(CUSTOM_MODEL_DIR, classname + ".java")): + if verbose: + print("Updating generated '%s' to extend custom '%s'" % (classname, classname)) + code = classre.sub(r'public class \1 extends %s.\1 {' % CUSTOM_MODEL_NAMESPACE, code) + + # Add back webkey imports which may have been nuked + class_usage_re = re.compile(r'[ \t<](' + '|'.join(WEBKEY_REPLACE_MODELS) + ')[ \t>]') + needed_classes = list(set(class_usage_re.findall(code))) + if len(needed_classes) > 0: + if verbose: + print("Adding webkey imports for %s to %s" % ( ",".join(needed_classes), fn )) + potential_imports = ["import %s.%s;" % (WEBKEY_NAMESPACE, needed) for needed in needed_classes] + imports = [] + + for i in potential_imports: + if i not in code: + imports.append(i) + + if len(imports) > 0: + # find package statement at beginning of code, splice and add the imports in between + package_re = re.compile(r'package (.+?);\n\n') + package = package_re.search(code).group(0) + before, after = code.split(package, 2) + code = before + package + "\n".join(imports) + "\n" + after + + + # Write back to disk + with open(file, 'w') as f: + f.write(code) + + +if run_autorest: + print("Running autorest..") + if verbose: + print(autorest_cmd) + subprocess.run(autorest_cmd, check=True, shell=True) + move_generated_code(autorest_target_dir, verbose) + +if fix_generated_code: + print("Fixing generated code..") + for path, dirs, files in os.walk(CODE_TARGET_DIRECTORY): + if path == CUSTOM_MODEL_DIR: # skip custom code + continue + for file in files: + correct_file(os.path.join(path, file), verbose) \ No newline at end of file diff --git a/keyvault/resource-manager/v2015_06_01/pom.xml b/keyvault/resource-manager/v2015_06_01/pom.xml index 269d75c11a90e..ea1d4ba1ba114 100644 --- a/keyvault/resource-manager/v2015_06_01/pom.xml +++ b/keyvault/resource-manager/v2015_06_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-keyvault diff --git a/keyvault/resource-manager/v2016_10_01/pom.xml b/keyvault/resource-manager/v2016_10_01/pom.xml index 038d43c2ed7dc..65f396a4a2ef4 100644 --- a/keyvault/resource-manager/v2016_10_01/pom.xml +++ b/keyvault/resource-manager/v2016_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-keyvault diff --git a/locks/resource-manager/v2016_09_01/pom.xml b/locks/resource-manager/v2016_09_01/pom.xml index a521817a58607..9296e8359d294 100644 --- a/locks/resource-manager/v2016_09_01/pom.xml +++ b/locks/resource-manager/v2016_09_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-locks diff --git a/loganalytics/data-plane/README.md b/loganalytics/data-plane/README.md new file mode 100644 index 0000000000000..aceb30a278e4d --- /dev/null +++ b/loganalytics/data-plane/README.md @@ -0,0 +1,51 @@ +# Azure Log Analytics + +This project provides client tools or utilities in Java that make it easy to query data in [Azure Log Analytics](https://azure.microsoft.com/en-us/services/log-analytics/). For reference documentation on classes and models, please see the [Azure SDK for Java reference](https://docs.microsoft.com/en-us/java/api/overview/azure/?view=azure-java-stable). + +Azure Log Analytics provides agents for telemtry collection and enables deep analytics via a [rich query language](https://docs.loganalytics.io/index). This SDK provides query access to data already stored in Log Analytics. To start collecting data from different sources, take a look at these [quickstarts](https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-quick-collect-azurevm). + +## Examples + +Please see [here](src/main/java/com/microsoft/azure/loganalytics/samples) for code examples using this SDK. + + +## Download + +### Latest release + +To get the binaries of the official Microsoft Azure Log Analytics SDK as distributed by Microsoft, reade for use within your project, you can use Maven. + +```xml + + com.microsoft.azure + azure-loganalytics + LATEST + +``` + +## Prerequisites + +- A Java Developer Kit (JDK), v 1.7 or later +- Maven + +## Help and Issues + +If you encounter any bugs with these SDKs, please file issues via [Issues](https://github.com/Azure/azure-sdk-for-java/issues) or checkout [StackOverflow for Azure Java SDK](http://stackoverflow.com/questions/tagged/azure-java-sdk). + +## Contribute Code + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +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 + +## More information +- [Azure Java SDKs](https://docs.microsoft.com/java/azure/) +- If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212) + +--- + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file diff --git a/loganalytics/data-plane/pom.xml b/loganalytics/data-plane/pom.xml new file mode 100644 index 0000000000000..1ccc97e1d303d --- /dev/null +++ b/loganalytics/data-plane/pom.xml @@ -0,0 +1,167 @@ + + + 4.0.0 + com.microsoft.azure + azure-loganalytics + 1.0.0-Preview-1 + jar + Microsoft Azure SDK for Log Analytics + This package contains Microsoft Log Analytics SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + 1.6.3 + record + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + ${runtime.version} + + + junit + junit + 4.12 + test + + + com.microsoft.azure + azure-client-authentication + ${runtime.version} + test + + + com.microsoft.azure + azure-arm-client-runtime + ${runtime.version} + test-jar + test + + + com.microsoft.azure + azure-arm-client-runtime + ${runtime.version} + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + generate-resources + + write-project-properties + + + + ${project.build.outputDirectory}/maven.properties + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+ + org.apache.maven.plugins + maven-surefire-plugin + 2.20 + + false + + **/Test*.java + **/*Test.java + **/*Tests.java + **/*TestCase.java + + + **/LogAnalyticsDataClientTests.java + + + ${testMode} + + + +
+
+
diff --git a/loganalytics/data-plane/samples/pom.xml b/loganalytics/data-plane/samples/pom.xml new file mode 100644 index 0000000000000..525d6b6f06558 --- /dev/null +++ b/loganalytics/data-plane/samples/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + com.microsoft.azure + azure-loganalytics-sample + 1.0.0-Preview-1 + jar + Microsoft Azure SDK for Log Analytics Sample + This package contains Microsoft Log Analytics SDK Sample. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + 1.6.3 + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-loganalytics + ${version} + + + com.microsoft.azure + azure-client-authentication + ${runtime.version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + + diff --git a/loganalytics/data-plane/samples/src/main/java/com/microsoft/azure/loganalytics/samples/BasicSample.java b/loganalytics/data-plane/samples/src/main/java/com/microsoft/azure/loganalytics/samples/BasicSample.java new file mode 100644 index 0000000000000..1e4ca1f68b00e --- /dev/null +++ b/loganalytics/data-plane/samples/src/main/java/com/microsoft/azure/loganalytics/samples/BasicSample.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.samples; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import com.microsoft.azure.loganalytics.implementation.LogAnalyticsDataClientImpl; +import com.microsoft.azure.loganalytics.models.Column; +import com.microsoft.azure.loganalytics.models.QueryBody; +import com.microsoft.azure.loganalytics.models.QueryResults; + +import java.util.List; + +/** + * Basic query example + * + */ +public class BasicSample +{ + public static void main( String[] args ) + { + // ApplicationTokenCredentials work well for service principal authentication + ApplicationTokenCredentials credentials = new ApplicationTokenCredentials( + "", + "", + "", + AzureEnvironment.AZURE + ); + + // New up client. Accepts credentials, or a pre-authenticated restClient + LogAnalyticsDataClientImpl client = new LogAnalyticsDataClientImpl(credentials); + + // Prepare information for query + String query = "Heartbeat | take 1"; + String workspaceId = ""; + + // Execute! + QueryResults queryResults = client.query(workspaceId, new QueryBody().withQuery(query)); + + // Process and print results + List row = queryResults.tables().get(0).rows().get(0); + List columnNames = queryResults + .tables() + .get(0) + .columns(); + + for (int i = 0; i < row.size(); i++){ + System.out.println("The value of " + columnNames.get(i).name() + " is " + row.get(i)); + } + + return; + } +} \ No newline at end of file diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClient.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClient.java new file mode 100644 index 0000000000000..d3408c258d512 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClient.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.loganalytics.models.ErrorResponseException; +import com.microsoft.azure.loganalytics.models.QueryBody; +import com.microsoft.azure.loganalytics.models.QueryResults; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * The interface for LogAnalyticsDataClient class. + */ +public interface LogAnalyticsDataClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + LogAnalyticsDataClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + LogAnalyticsDataClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + LogAnalyticsDataClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryResults object if successful. + */ + QueryResults query(String workspaceId, QueryBody body); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture queryAsync(String workspaceId, QueryBody body, final ServiceCallback serviceCallback); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + Observable queryAsync(String workspaceId, QueryBody body); + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + Observable> queryWithServiceResponseAsync(String workspaceId, QueryBody body); + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/LogAnalyticsDataClientImpl.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/LogAnalyticsDataClientImpl.java new file mode 100644 index 0000000000000..e27ac9b6f98d5 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/LogAnalyticsDataClientImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.loganalytics.LogAnalyticsDataClient; +import com.microsoft.azure.loganalytics.models.ErrorResponseException; +import com.microsoft.azure.loganalytics.models.QueryBody; +import com.microsoft.azure.loganalytics.models.QueryResults; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the LogAnalyticsDataClientImpl class. + */ +public class LogAnalyticsDataClientImpl extends AzureServiceClient implements LogAnalyticsDataClient { + /** The Retrofit service to perform REST calls. */ + private LogAnalyticsDataClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public LogAnalyticsDataClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public LogAnalyticsDataClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public LogAnalyticsDataClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of LogAnalyticsDataClient client. + * + * @param credentials the management credentials for Azure + */ + public LogAnalyticsDataClientImpl(ServiceClientCredentials credentials) { + this("https://api.loganalytics.io/v1", credentials); + } + + /** + * Initializes an instance of LogAnalyticsDataClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public LogAnalyticsDataClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of LogAnalyticsDataClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public LogAnalyticsDataClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "LogAnalyticsDataClient", "v1"); + } + + private void initializeService() { + service = restClient().retrofit().create(LogAnalyticsDataClientService.class); + } + + /** + * The interface defining all the services for LogAnalyticsDataClient to be + * used by Retrofit to perform actually REST calls. + */ + interface LogAnalyticsDataClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.loganalytics.LogAnalyticsDataClient query" }) + @POST("workspaces/{workspaceId}/query") + Observable> query(@Path("workspaceId") String workspaceId, @Body QueryBody body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryResults object if successful. + */ + public QueryResults query(String workspaceId, QueryBody body) { + return queryWithServiceResponseAsync(workspaceId, body).toBlocking().single().body(); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryAsync(String workspaceId, QueryBody body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryWithServiceResponseAsync(workspaceId, body), serviceCallback); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + public Observable queryAsync(String workspaceId, QueryBody body) { + return queryWithServiceResponseAsync(workspaceId, body).map(new Func1, QueryResults>() { + @Override + public QueryResults call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute an Analytics query. + * Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. + * + * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. + * @param body The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryResults object + */ + public Observable> queryWithServiceResponseAsync(String workspaceId, QueryBody body) { + if (workspaceId == null) { + throw new IllegalArgumentException("Parameter workspaceId is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.query(workspaceId, body, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = queryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse queryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/package-info.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/package-info.java new file mode 100644 index 0000000000000..265e5e521241a --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for LogAnalyticsDataClient. + * Log Analytics Data Plane Client. + */ +package com.microsoft.azure.loganalytics.implementation; diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Column.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Column.java new file mode 100644 index 0000000000000..4d2103234d74c --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Column.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A table column. + * A column in a table. + */ +public class Column { + /** + * The name of this column. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The data type of this column. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of this column. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of this column. + * + * @param name the name value to set + * @return the Column object itself. + */ + public Column withName(String name) { + this.name = name; + return this; + } + + /** + * Get the data type of this column. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the data type of this column. + * + * @param type the type value to set + * @return the Column object itself. + */ + public Column withType(String type) { + this.type = type; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorDetail.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorDetail.java new file mode 100644 index 0000000000000..cc5a332d29133 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorDetail.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetail { + /** + * The error's code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Indicates which property in the request is responsible for the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Indicates which value in 'target' is responsible for the error. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Indicates resources which were responsible for the error. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get the error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error's code. + * + * @param code the code value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates which property in the request is responsible for the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set indicates which property in the request is responsible for the error. + * + * @param target the target value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get indicates which value in 'target' is responsible for the error. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set indicates which value in 'target' is responsible for the error. + * + * @param value the value value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withValue(String value) { + this.value = value; + return this; + } + + /** + * Get indicates resources which were responsible for the error. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set indicates resources which were responsible for the error. + * + * @param resources the resources value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorInfo.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorInfo.java new file mode 100644 index 0000000000000..e65b218799356 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorInfo.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The code and message for an error. + */ +public class ErrorInfo { + /** + * A machine readable error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Inner error details if they exist. + */ + @JsonProperty(value = "innererror") + private ErrorInfo innererror; + + /** + * The additionalProperties property. + */ + @JsonProperty(value = "additionalProperties") + private Object additionalProperties; + + /** + * Get a machine readable error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set a machine readable error code. + * + * @param code the code value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set error details. + * + * @param details the details value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get inner error details if they exist. + * + * @return the innererror value + */ + public ErrorInfo innererror() { + return this.innererror; + } + + /** + * Set inner error details if they exist. + * + * @param innererror the innererror value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withInnererror(ErrorInfo innererror) { + this.innererror = innererror; + return this; + } + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Object additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the ErrorInfo object itself. + */ + public ErrorInfo withAdditionalProperties(Object additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponse.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponse.java new file mode 100644 index 0000000000000..0a30e4e4dbf05 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponse.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + * Contains details when the response code indicates an error. + */ +public class ErrorResponse { + /** + * The error details. + */ + @JsonProperty(value = "error", required = true) + private ErrorInfo error; + + /** + * Get the error details. + * + * @return the error value + */ + public ErrorInfo error() { + return this.error; + } + + /** + * Set the error details. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorInfo error) { + this.error = error; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponseException.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponseException.java new file mode 100644 index 0000000000000..7a8c7771d58d2 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryBody.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryBody.java new file mode 100644 index 0000000000000..1fceddac66241 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryBody.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Analytics query. Learn more about the [Analytics query + * syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/). + */ +public class QueryBody { + /** + * The query to execute. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /** + * Optional. The timespan over which to query data. This is an ISO8601 time + * period value. This timespan is applied in addition to any that are + * specified in the query expression. + */ + @JsonProperty(value = "timespan") + private String timespan; + + /** + * A list of workspaces that are included in the query. + */ + @JsonProperty(value = "workspaces") + private List workspaces; + + /** + * Get the query to execute. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Set the query to execute. + * + * @param query the query value to set + * @return the QueryBody object itself. + */ + public QueryBody withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. + * + * @return the timespan value + */ + public String timespan() { + return this.timespan; + } + + /** + * Set optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. + * + * @param timespan the timespan value to set + * @return the QueryBody object itself. + */ + public QueryBody withTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get a list of workspaces that are included in the query. + * + * @return the workspaces value + */ + public List workspaces() { + return this.workspaces; + } + + /** + * Set a list of workspaces that are included in the query. + * + * @param workspaces the workspaces value to set + * @return the QueryBody object itself. + */ + public QueryBody withWorkspaces(List workspaces) { + this.workspaces = workspaces; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryResults.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryResults.java new file mode 100644 index 0000000000000..bde5f9b305edc --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/QueryResults.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A query response. + * Contains the tables, columns & rows resulting from a query. + */ +public class QueryResults { + /** + * The list of tables, columns and rows. + */ + @JsonProperty(value = "tables", required = true) + private List tables; + + /** + * Get the list of tables, columns and rows. + * + * @return the tables value + */ + public List
tables() { + return this.tables; + } + + /** + * Set the list of tables, columns and rows. + * + * @param tables the tables value to set + * @return the QueryResults object itself. + */ + public QueryResults withTables(List
tables) { + this.tables = tables; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Table.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Table.java new file mode 100644 index 0000000000000..506d6a9f24b94 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/Table.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.loganalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A query response table. + * Contains the columns and rows for one table in a query response. + */ +public class Table { + /** + * The name of the table. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The list of columns in this table. + */ + @JsonProperty(value = "columns", required = true) + private List columns; + + /** + * The resulting rows from this query. + */ + @JsonProperty(value = "rows", required = true) + private List> rows; + + /** + * Get the name of the table. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the table. + * + * @param name the name value to set + * @return the Table object itself. + */ + public Table withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of columns in this table. + * + * @return the columns value + */ + public List columns() { + return this.columns; + } + + /** + * Set the list of columns in this table. + * + * @param columns the columns value to set + * @return the Table object itself. + */ + public Table withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get the resulting rows from this query. + * + * @return the rows value + */ + public List> rows() { + return this.rows; + } + + /** + * Set the resulting rows from this query. + * + * @param rows the rows value to set + * @return the Table object itself. + */ + public Table withRows(List> rows) { + this.rows = rows; + return this; + } + +} diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/package-info.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/package-info.java new file mode 100644 index 0000000000000..1cadbca8849c6 --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the models classes for LogAnalyticsDataClient. + * Log Analytics Data Plane Client. + */ +package com.microsoft.azure.loganalytics.models; diff --git a/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/package-info.java b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/package-info.java new file mode 100644 index 0000000000000..374e44497e9cf --- /dev/null +++ b/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for LogAnalyticsDataClient. + * Log Analytics Data Plane Client. + */ +package com.microsoft.azure.loganalytics; diff --git a/loganalytics/data-plane/src/test/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClientTests.java b/loganalytics/data-plane/src/test/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClientTests.java new file mode 100644 index 0000000000000..6a4a5604efb84 --- /dev/null +++ b/loganalytics/data-plane/src/test/java/com/microsoft/azure/loganalytics/LogAnalyticsDataClientTests.java @@ -0,0 +1,47 @@ +package com.microsoft.azure.loganalytics; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.loganalytics.implementation.LogAnalyticsDataClientImpl; +import com.microsoft.azure.loganalytics.models.QueryBody; +import com.microsoft.azure.loganalytics.models.QueryResults; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.arm.core.TestBase; +import com.microsoft.rest.RestClient; +import org.junit.Assert; +import org.junit.Test; + +public class LogAnalyticsDataClientTests extends TestBase { + protected static LogAnalyticsDataClientImpl logAnalyticsClient; + + @Override + protected String baseUri() { + return AzureEnvironment.AZURE.logAnalyticsEndpoint() + "v1/"; + } + + @Override + protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { + logAnalyticsClient = new LogAnalyticsDataClientImpl(restClient); + } + + @Override + protected void cleanUpResources() { + return; + } + + @Test + public void firstTest() { + String query = "Heartbeat | take 1"; + String workspaceId = "cab864ad-d0c1-496b-bc5e-4418315621bf"; + QueryResults queryResults = logAnalyticsClient.query(workspaceId, new QueryBody().withQuery(query)); + Assert.assertNotNull(queryResults); + + // Query should return a single table with one row + Assert.assertEquals(queryResults.tables().size(), 1); + Assert.assertEquals(queryResults.tables().get(0).rows().size(), 1); + + // Check type behavior on results + Assert.assertTrue(queryResults.tables().get(0).rows().get(0).get(1) instanceof String); + Assert.assertTrue(queryResults.tables().get(0).rows().get(0).get(16) instanceof Double); + Assert.assertNull(queryResults.tables().get(0).rows().get(0).get(15)); + } +} \ No newline at end of file diff --git a/logic/resource-manager/v2016_06_01/pom.xml b/logic/resource-manager/v2016_06_01/pom.xml index 8795f95e98950..1e10d8e0f6a37 100644 --- a/logic/resource-manager/v2016_06_01/pom.xml +++ b/logic/resource-manager/v2016_06_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-logic diff --git a/mediaservices/resource-manager/v2015_10_01/pom.xml b/mediaservices/resource-manager/v2015_10_01/pom.xml index b866f49db4d30..89795e9dccd8c 100644 --- a/mediaservices/resource-manager/v2015_10_01/pom.xml +++ b/mediaservices/resource-manager/v2015_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-media @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Media Management This package contains Microsoft Media Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaService.java b/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaService.java index 82c73b92947cf..dc4c77e5de390 100644 --- a/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaService.java +++ b/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaService.java @@ -58,11 +58,13 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup storageAccounts); } @@ -86,11 +88,13 @@ interface Update extends Appliable, Resource.UpdateWithTags storageAccounts); } diff --git a/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesManagementClientImpl.java b/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesManagementClientImpl.java index bf1f992bdc148..f14c35010ce0e 100644 --- a/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesManagementClientImpl.java +++ b/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesManagementClientImpl.java @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public MediaServicesManagementClientImpl withAcceptLanguage(String acceptLanguag return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public MediaServicesManagementClientImpl withLongRunningOperationRetryTimeout(in return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -205,6 +205,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "MediaServicesManagementClient", "2015-10-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MediaServicesManagementClient", "2015-10-01"); } } diff --git a/mediaservices/resource-manager/v2015_10_01/src/test/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaTest.java b/mediaservices/resource-manager/v2015_10_01/src/test/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaTest.java deleted file mode 100644 index b496dde4e966f..0000000000000 --- a/mediaservices/resource-manager/v2015_10_01/src/test/java/com/microsoft/azure/management/mediaservices/v2015_10_01/MediaTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2015_10_01; -import com.microsoft.azure.arm.core.TestBase; -import com.microsoft.azure.management.mediaservices.v2015_10_01.implementation.MediaManager; -import com.microsoft.azure.management.resources.implementation.ResourceManager; -import com.microsoft.rest.RestClient; -import com.microsoft.azure.arm.utils.SdkContext; -import org.junit.Test; -import org.junit.Assert; -import com.microsoft.azure.arm.resources.Region; -import com.microsoft.azure.management.resources.ResourceGroup; - -public class MediaTest extends TestBase { - protected static ResourceManager resourceManager; - protected static MediaManager mediaManager; - private static String rgName; - @Override - protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { - resourceManager = ResourceManager - .authenticate(restClient) - .withSubscription(defaultSubscription); - mediaManager = MediaManager - .authenticate(restClient, defaultSubscription); - } - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - @Test - public void firstTest() { - rgName = SdkContext.randomResourceName("rg", 20); - ResourceGroup group = resourceManager.resourceGroups() - .define(rgName) - .withRegion(Region.US_WEST.toString()) - .create(); - Assert.assertNotNull(group); - } -} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/pom.xml b/mediaservices/resource-manager/v2018_03_30_preview/pom.xml new file mode 100644 index 0000000000000..e2072d50fab09 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.mediaservices.v2018_03_30_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-media + 1.0.0-beta + jar + Microsoft Azure SDK for Media Management + This package contains Microsoft Media Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudio.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudio.java new file mode 100644 index 0000000000000..b5ab56ddfc655 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudio.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes Advanced Audio Codec (AAC) audio encoding settings. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AacAudio") +public class AacAudio extends Audio { + /** + * The encoding profile to be used when encoding audio with AAC. Possible + * values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + */ + @JsonProperty(value = "profile") + private AacAudioProfile profile; + + /** + * Get the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @return the profile value + */ + public AacAudioProfile profile() { + return this.profile; + } + + /** + * Set the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @param profile the profile value to set + * @return the AacAudio object itself. + */ + public AacAudio withProfile(AacAudioProfile profile) { + this.profile = profile; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudioProfile.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudioProfile.java new file mode 100644 index 0000000000000..f7c9ec2dd2867 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AacAudioProfile.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AacAudioProfile. + */ +public enum AacAudioProfile { + /** Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). */ + AAC_LC("AacLc"), + + /** Specifies that the output audio is to be encoded into HE-AAC v1 profile. */ + HE_AAC_V1("HeAacV1"), + + /** Specifies that the output audio is to be encoded into HE-AAC v2 profile. */ + HE_AAC_V2("HeAacV2"); + + /** The actual serialized value for a AacAudioProfile instance. */ + private String value; + + AacAudioProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AacAudioProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed AacAudioProfile object, or null if unable to parse. + */ + @JsonCreator + public static AacAudioProfile fromString(String value) { + AacAudioProfile[] items = AacAudioProfile.values(); + for (AacAudioProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiAccessControl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiAccessControl.java new file mode 100644 index 0000000000000..3968b25f6de32 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai access control. + */ +public class AkamaiAccessControl { + /** + * authentication key list. + */ + @JsonProperty(value = "akamaiSignatureHeaderAuthenticationKeyList") + private List akamaiSignatureHeaderAuthenticationKeyList; + + /** + * Get authentication key list. + * + * @return the akamaiSignatureHeaderAuthenticationKeyList value + */ + public List akamaiSignatureHeaderAuthenticationKeyList() { + return this.akamaiSignatureHeaderAuthenticationKeyList; + } + + /** + * Set authentication key list. + * + * @param akamaiSignatureHeaderAuthenticationKeyList the akamaiSignatureHeaderAuthenticationKeyList value to set + * @return the AkamaiAccessControl object itself. + */ + public AkamaiAccessControl withAkamaiSignatureHeaderAuthenticationKeyList(List akamaiSignatureHeaderAuthenticationKeyList) { + this.akamaiSignatureHeaderAuthenticationKeyList = akamaiSignatureHeaderAuthenticationKeyList; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiSignatureHeaderAuthenticationKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiSignatureHeaderAuthenticationKey.java new file mode 100644 index 0000000000000..6973310d8ceb2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AkamaiSignatureHeaderAuthenticationKey.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai Signature Header authentication key. + */ +public class AkamaiSignatureHeaderAuthenticationKey { + /** + * identifier of the key. + */ + @JsonProperty(value = "identifier") + private String identifier; + + /** + * authentication key. + */ + @JsonProperty(value = "base64Key") + private String base64Key; + + /** + * The exact time the authentication key. + */ + @JsonProperty(value = "expiration") + private DateTime expiration; + + /** + * Get identifier of the key. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set identifier of the key. + * + * @param identifier the identifier value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get authentication key. + * + * @return the base64Key value + */ + public String base64Key() { + return this.base64Key; + } + + /** + * Set authentication key. + * + * @param base64Key the base64Key value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withBase64Key(String base64Key) { + this.base64Key = base64Key; + return this; + } + + /** + * Get the exact time the authentication key. + * + * @return the expiration value + */ + public DateTime expiration() { + return this.expiration; + } + + /** + * Set the exact time the authentication key. + * + * @param expiration the expiration value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withExpiration(DateTime expiration) { + this.expiration = expiration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiError.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiError.java new file mode 100644 index 0000000000000..fdfd0a09185b8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiError.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The API error. + */ +public class ApiError { + /** + * The error properties. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get the error properties. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set the error properties. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiErrorException.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiErrorException.java new file mode 100644 index 0000000000000..35243bfe97ecb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Asset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Asset.java new file mode 100644 index 0000000000000..a92ae6659e2b8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Asset.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.AssetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; + +/** + * Type representing Asset. + */ +public interface Asset extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternateId value. + */ + String alternateId(); + + /** + * @return the assetId value. + */ + UUID assetId(); + + /** + * @return the container value. + */ + String container(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * @return the storageEncryptionFormat value. + */ + AssetStorageEncryptionFormat storageEncryptionFormat(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Asset definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of Asset definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Asset definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the asset definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the asset definition allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next definition stage + */ + WithCreate withAlternateId(String alternateId); + } + + /** + * The stage of the asset definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + * @param container The name of the asset blob container + * @return the next definition stage + */ + WithCreate withContainer(String container); + } + + /** + * The stage of the asset definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Asset description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the asset definition allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next definition stage + */ + WithCreate withStorageAccountName(String storageAccountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAlternateId, DefinitionStages.WithContainer, DefinitionStages.WithDescription, DefinitionStages.WithStorageAccountName { + } + } + /** + * The template for a Asset update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternateId, UpdateStages.WithContainer, UpdateStages.WithDescription, UpdateStages.WithStorageAccountName { + } + + /** + * Grouping of Asset update stages. + */ + interface UpdateStages { + /** + * The stage of the asset update allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next update stage + */ + Update withAlternateId(String alternateId); + } + + /** + * The stage of the asset update allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + * @param container The name of the asset blob container + * @return the next update stage + */ + Update withContainer(String container); + } + + /** + * The stage of the asset update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Asset description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the asset update allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next update stage + */ + Update withStorageAccountName(String storageAccountName); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerPermission.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerPermission.java new file mode 100644 index 0000000000000..06b7dd096876b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerPermission.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetContainerPermission. + */ +public enum AssetContainerPermission { + /** The SAS URL will allow read access to the container. */ + READ("Read"), + + /** The SAS URL will allow read and write access to the container. */ + READ_WRITE("ReadWrite"), + + /** The SAS URL will allow read, write and delete access to the container. */ + READ_WRITE_DELETE("ReadWriteDelete"); + + /** The actual serialized value for a AssetContainerPermission instance. */ + private String value; + + AssetContainerPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetContainerPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetContainerPermission object, or null if unable to parse. + */ + @JsonCreator + public static AssetContainerPermission fromString(String value) { + AssetContainerPermission[] items = AssetContainerPermission.values(); + for (AssetContainerPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerSas.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerSas.java new file mode 100644 index 0000000000000..80393f50f6ba4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetContainerSas.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.AssetContainerSasInner; +import java.util.List; + +/** + * Type representing AssetContainerSas. + */ +public interface AssetContainerSas extends HasInner, HasManager { + /** + * @return the assetContainerSasUrls value. + */ + List assetContainerSasUrls(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionFormat.java new file mode 100644 index 0000000000000..28062893e7fee --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionFormat.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetStorageEncryptionFormat. + */ +public enum AssetStorageEncryptionFormat { + /** The Asset does not use client-side storage encryption (this is the only allowed value for new Assets). */ + NONE("None"), + + /** The Asset is encrypted with Media Services client-side encryption. */ + MEDIA_STORAGE_CLIENT_ENCRYPTION("MediaStorageClientEncryption"); + + /** The actual serialized value for a AssetStorageEncryptionFormat instance. */ + private String value; + + AssetStorageEncryptionFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetStorageEncryptionFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetStorageEncryptionFormat object, or null if unable to parse. + */ + @JsonCreator + public static AssetStorageEncryptionFormat fromString(String value) { + AssetStorageEncryptionFormat[] items = AssetStorageEncryptionFormat.values(); + for (AssetStorageEncryptionFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionKey.java similarity index 78% rename from mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionKey.java rename to mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionKey.java index 6f338980d4ac3..a4b233f008ed5 100644 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionKey.java +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AssetStorageEncryptionKey.java @@ -6,12 +6,12 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.AssetStorageEncryptionKeyInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.AssetStorageEncryptionKeyInner; /** * Type representing AssetStorageEncryptionKey. diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Assets.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Assets.java new file mode 100644 index 0000000000000..6ae0a01944020 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Assets.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.AssetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Assets. + */ +public interface Assets extends SupportsCreating, HasInner { + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName); + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String assetName); + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String assetName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Audio.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Audio.java new file mode 100644 index 0000000000000..de254b7e6fbe1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Audio.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the common properties for all audio codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Audio") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AacAudio", value = AacAudio.class) +}) +public class Audio extends Codec { + /** + * The number of channels in the audio. + */ + @JsonProperty(value = "channels") + private Integer channels; + + /** + * The sampling rate to use for encoding in hertz. + */ + @JsonProperty(value = "samplingRate") + private Integer samplingRate; + + /** + * The bitrate, in bits per second, of the output encoded audio. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * Get the number of channels in the audio. + * + * @return the channels value + */ + public Integer channels() { + return this.channels; + } + + /** + * Set the number of channels in the audio. + * + * @param channels the channels value to set + * @return the Audio object itself. + */ + public Audio withChannels(Integer channels) { + this.channels = channels; + return this; + } + + /** + * Get the sampling rate to use for encoding in hertz. + * + * @return the samplingRate value + */ + public Integer samplingRate() { + return this.samplingRate; + } + + /** + * Set the sampling rate to use for encoding in hertz. + * + * @param samplingRate the samplingRate value to set + * @return the Audio object itself. + */ + public Audio withSamplingRate(Integer samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Get the bitrate, in bits per second, of the output encoded audio. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate, in bits per second, of the output encoded audio. + * + * @param bitrate the bitrate value to set + * @return the Audio object itself. + */ + public Audio withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioAnalyzerPreset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioAnalyzerPreset.java new file mode 100644 index 0000000000000..a5aad6e7719ac --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioAnalyzerPreset.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Audio Analyzer preset applies a pre-defined set of AI-based analysis + * operations, including speech transcription. Currently, the preset supports + * processing of content with a single audio track. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioAnalyzerPreset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoAnalyzerPreset", value = VideoAnalyzerPreset.class) +}) +public class AudioAnalyzerPreset extends Preset { + /** + * The language for the audio payload in the input using the BCP-47 format + * of 'language tag-region' (e.g: 'en-US'). The list of supported languages + * are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', + * 'pt-BR', 'zh-CN'. + */ + @JsonProperty(value = "audioLanguage") + private String audioLanguage; + + /** + * Get the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + * + * @return the audioLanguage value + */ + public String audioLanguage() { + return this.audioLanguage; + } + + /** + * Set the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + * + * @param audioLanguage the audioLanguage value to set + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withAudioLanguage(String audioLanguage) { + this.audioLanguage = audioLanguage; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioOverlay.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioOverlay.java new file mode 100644 index 0000000000000..268ea6fed2374 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/AudioOverlay.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of an audio overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioOverlay") +public class AudioOverlay extends Overlay { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/BuiltInStandardEncoderPreset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/BuiltInStandardEncoderPreset.java new file mode 100644 index 0000000000000..b7e3daecf12e4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/BuiltInStandardEncoderPreset.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a built-in preset for encoding the input video with the Standard + * Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.BuiltInStandardEncoderPreset") +public class BuiltInStandardEncoderPreset extends Preset { + /** + * The built-in preset to be used for encoding videos. Possible values + * include: 'AdaptiveStreaming', 'AACGoodQualityAudio', + * 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', + * 'H264MultipleBitrateSD'. + */ + @JsonProperty(value = "presetName", required = true) + private EncoderNamedPreset presetName; + + /** + * Get the built-in preset to be used for encoding videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @return the presetName value + */ + public EncoderNamedPreset presetName() { + return this.presetName; + } + + /** + * Set the built-in preset to be used for encoding videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @param presetName the presetName value to set + * @return the BuiltInStandardEncoderPreset object itself. + */ + public BuiltInStandardEncoderPreset withPresetName(EncoderNamedPreset presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CbcsDrmConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CbcsDrmConfiguration.java new file mode 100644 index 0000000000000..a37bfb2e2c8d9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CbcsDrmConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify drm configurations of CommonEncryptionCbcs scheme in + * Streaming Policy. + */ +public class CbcsDrmConfiguration { + /** + * Fairplay configurations. + */ + @JsonProperty(value = "fairPlay") + private StreamingPolicyFairPlayConfiguration fairPlay; + + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get fairplay configurations. + * + * @return the fairPlay value + */ + public StreamingPolicyFairPlayConfiguration fairPlay() { + return this.fairPlay; + } + + /** + * Set fairplay configurations. + * + * @param fairPlay the fairPlay value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withFairPlay(StreamingPolicyFairPlayConfiguration fairPlay) { + this.fairPlay = fairPlay; + return this; + } + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CencDrmConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CencDrmConfiguration.java new file mode 100644 index 0000000000000..3ecf7300fb7d5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CencDrmConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify drm configurations of CommonEncryptionCenc scheme in + * Streaming Policy. + */ +public class CencDrmConfiguration { + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CheckNameAvailabilityInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..40ce2cb9cefa8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CheckNameAvailabilityInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the check name availability request. + */ +public class CheckNameAvailabilityInput { + /** + * The account name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The account type. For a Media Services account, this should be + * 'MediaServices'. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the account name. + * + * @param name the name value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the account type. For a Media Services account, this should be 'MediaServices'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the account type. For a Media Services account, this should be 'MediaServices'. + * + * @param type the type value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(String type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Codec.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Codec.java new file mode 100644 index 0000000000000..a39140f2b6c24 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Codec.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties of all codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Codec") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Audio", value = Audio.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyVideo", value = CopyVideo.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.Video", value = Video.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyAudio", value = CopyAudio.class) +}) +public class Codec { + /** + * An optional label for the codec. The label can be used to control muxing + * behavior. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get an optional label for the codec. The label can be used to control muxing behavior. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set an optional label for the codec. The label can be used to control muxing behavior. + * + * @param label the label value to set + * @return the Codec object itself. + */ + public Codec withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCbcs.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCbcs.java new file mode 100644 index 0000000000000..abf78cf3e056b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCbcs.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for CommonEncryptionCbcs encryption scheme. + */ +public class CommonEncryptionCbcs { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for current encryption scheme. + */ + @JsonProperty(value = "drm") + private CbcsDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for current encryption scheme. + * + * @return the drm value + */ + public CbcsDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for current encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withDrm(CbcsDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCenc.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCenc.java new file mode 100644 index 0000000000000..e704ad98e8626 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CommonEncryptionCenc.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for envelope encryption scheme. + */ +public class CommonEncryptionCenc { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for CommonEncryptionCenc encryption scheme. + */ + @JsonProperty(value = "drm") + private CencDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @return the drm value + */ + public CencDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withDrm(CencDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicies.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicies.java new file mode 100644 index 0000000000000..e363cd93fbc08 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicies.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.ContentKeyPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContentKeyPolicies. + */ +public interface ContentKeyPolicies extends SupportsCreating, HasInner { + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicy.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicy.java new file mode 100644 index 0000000000000..199d71a56eab6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.ContentKeyPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing ContentKeyPolicy. + */ +public interface ContentKeyPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ContentKeyPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOptions, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContentKeyPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContentKeyPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithOptions withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options The Key Policy options + * @return the next definition stage + */ + WithCreate withOptions(List options); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for the Policy + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a ContentKeyPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of ContentKeyPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the contentkeypolicy update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for the Policy + * @return the next update stage + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyClearKeyConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyClearKeyConfiguration.java new file mode 100644 index 0000000000000..3852b1669e10f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyClearKeyConfiguration.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a configuration for non-DRM keys. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration") +public class ContentKeyPolicyClearKeyConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyConfiguration.java new file mode 100644 index 0000000000000..13fc2056a13a3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyConfiguration.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy configuration. A derived class must be + * used to create a configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration", value = ContentKeyPolicyClearKeyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration", value = ContentKeyPolicyUnknownConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration", value = ContentKeyPolicyWidevineConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration", value = ContentKeyPolicyPlayReadyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration", value = ContentKeyPolicyFairPlayConfiguration.class) +}) +public class ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayConfiguration.java new file mode 100644 index 0000000000000..d965fbe008a07 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayConfiguration.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for FairPlay licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration") +public class ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { + /** + * The key that must be used as FairPlay ASk. + */ + @JsonProperty(value = "ask", required = true) + private byte[] ask; + + /** + * The password encrypting FairPlay certificate in PKCS 12 (pfx) format. + */ + @JsonProperty(value = "fairPlayPfxPassword", required = true) + private String fairPlayPfxPassword; + + /** + * The Base64 representation of FairPlay certificate in PKCS 12 (pfx) + * format (including private key). + */ + @JsonProperty(value = "fairPlayPfx", required = true) + private String fairPlayPfx; + + /** + * The rental and lease key type. Possible values include: 'Unknown', + * 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + */ + @JsonProperty(value = "rentalAndLeaseKeyType", required = true) + private ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType; + + /** + * The rental duration. Must be greater than or equal to 0. + */ + @JsonProperty(value = "rentalDuration", required = true) + private long rentalDuration; + + /** + * Get the key that must be used as FairPlay ASk. + * + * @return the ask value + */ + public byte[] ask() { + return this.ask; + } + + /** + * Set the key that must be used as FairPlay ASk. + * + * @param ask the ask value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withAsk(byte[] ask) { + this.ask = ask; + return this; + } + + /** + * Get the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @return the fairPlayPfxPassword value + */ + public String fairPlayPfxPassword() { + return this.fairPlayPfxPassword; + } + + /** + * Set the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @param fairPlayPfxPassword the fairPlayPfxPassword value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfxPassword(String fairPlayPfxPassword) { + this.fairPlayPfxPassword = fairPlayPfxPassword; + return this; + } + + /** + * Get the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @return the fairPlayPfx value + */ + public String fairPlayPfx() { + return this.fairPlayPfx; + } + + /** + * Set the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @param fairPlayPfx the fairPlayPfx value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfx(String fairPlayPfx) { + this.fairPlayPfx = fairPlayPfx; + return this; + } + + /** + * Get the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @return the rentalAndLeaseKeyType value + */ + public ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType() { + return this.rentalAndLeaseKeyType; + } + + /** + * Set the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @param rentalAndLeaseKeyType the rentalAndLeaseKeyType value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalAndLeaseKeyType(ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType) { + this.rentalAndLeaseKeyType = rentalAndLeaseKeyType; + return this; + } + + /** + * Get the rental duration. Must be greater than or equal to 0. + * + * @return the rentalDuration value + */ + public long rentalDuration() { + return this.rentalDuration; + } + + /** + * Set the rental duration. Must be greater than or equal to 0. + * + * @param rentalDuration the rentalDuration value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalDuration(long rentalDuration) { + this.rentalDuration = rentalDuration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java new file mode 100644 index 0000000000000..da9ea4eb8a6a1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. + */ +public enum ContentKeyPolicyFairPlayRentalAndLeaseKeyType { + /** Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Key duration is not specified. */ + UNDEFINED("Undefined"), + + /** Content key can be persisted with an unlimited duration. */ + PERSISTENT_UNLIMITED("PersistentUnlimited"), + + /** Content key can be persisted and the valid duration is limited by the Rental Duration value. */ + PERSISTENT_LIMITED("PersistentLimited"); + + /** The actual serialized value for a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. */ + private String value; + + ContentKeyPolicyFairPlayRentalAndLeaseKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyFairPlayRentalAndLeaseKeyType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyFairPlayRentalAndLeaseKeyType fromString(String value) { + ContentKeyPolicyFairPlayRentalAndLeaseKeyType[] items = ContentKeyPolicyFairPlayRentalAndLeaseKeyType.values(); + for (ContentKeyPolicyFairPlayRentalAndLeaseKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOpenRestriction.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOpenRestriction.java new file mode 100644 index 0000000000000..f26290f94af80 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOpenRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an open restriction. License or key will be delivered on every + * request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyOpenRestriction") +public class ContentKeyPolicyOpenRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOption.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOption.java new file mode 100644 index 0000000000000..61c0d5b50810e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyOption.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a policy option. + */ +public class ContentKeyPolicyOption { + /** + * The legacy Policy Option ID. + */ + @JsonProperty(value = "policyOptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyOptionId; + + /** + * The Policy Option description. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The key delivery configuration. + */ + @JsonProperty(value = "configuration", required = true) + private ContentKeyPolicyConfiguration configuration; + + /** + * The requirements that must be met to deliver keys with this + * configuration. + */ + @JsonProperty(value = "restriction", required = true) + private ContentKeyPolicyRestriction restriction; + + /** + * Get the legacy Policy Option ID. + * + * @return the policyOptionId value + */ + public UUID policyOptionId() { + return this.policyOptionId; + } + + /** + * Get the Policy Option description. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Policy Option description. + * + * @param name the name value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withName(String name) { + this.name = name; + return this; + } + + /** + * Get the key delivery configuration. + * + * @return the configuration value + */ + public ContentKeyPolicyConfiguration configuration() { + return this.configuration; + } + + /** + * Set the key delivery configuration. + * + * @param configuration the configuration value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withConfiguration(ContentKeyPolicyConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the requirements that must be met to deliver keys with this configuration. + * + * @return the restriction value + */ + public ContentKeyPolicyRestriction restriction() { + return this.restriction; + } + + /** + * Set the requirements that must be met to deliver keys with this configuration. + * + * @param restriction the restriction value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withRestriction(ContentKeyPolicyRestriction restriction) { + this.restriction = restriction; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyConfiguration.java new file mode 100644 index 0000000000000..ab47cae1167c5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyConfiguration.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for PlayReady licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration") +public class ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicyConfiguration { + /** + * The PlayReady licenses. + */ + @JsonProperty(value = "licenses", required = true) + private List licenses; + + /** + * The custom response data. + */ + @JsonProperty(value = "responseCustomData") + private String responseCustomData; + + /** + * Get the PlayReady licenses. + * + * @return the licenses value + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the PlayReady licenses. + * + * @param licenses the licenses value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Get the custom response data. + * + * @return the responseCustomData value + */ + public String responseCustomData() { + return this.responseCustomData; + } + + /** + * Set the custom response data. + * + * @param responseCustomData the responseCustomData value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withResponseCustomData(String responseCustomData) { + this.responseCustomData = responseCustomData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java new file mode 100644 index 0000000000000..8fcd270beb04a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is in the PlayReady header. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader extends ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java new file mode 100644 index 0000000000000..3412e3ffe2921 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is specified in the PlayReady + * configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier extends ContentKeyPolicyPlayReadyContentKeyLocation { + /** + * The content key ID. + */ + @JsonProperty(value = "keyId", required = true) + private UUID keyId; + + /** + * Get the content key ID. + * + * @return the keyId value + */ + public UUID keyId() { + return this.keyId; + } + + /** + * Set the content key ID. + * + * @param keyId the keyId value to set + * @return the ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier object itself. + */ + public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier withKeyId(UUID keyId) { + this.keyId = keyId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java new file mode 100644 index 0000000000000..b78baaed48f5d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for content key ID location. A derived class must be used to + * represent the location. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyPlayReadyContentKeyLocation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class) +}) +public class ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentType.java new file mode 100644 index 0000000000000..1777806f8aa68 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyContentType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyContentType. + */ +public enum ContentKeyPolicyPlayReadyContentType { + /** Represents a ContentKeyPolicyPlayReadyContentType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Unspecified content type. */ + UNSPECIFIED("Unspecified"), + + /** Ultraviolet download content type. */ + ULTRA_VIOLET_DOWNLOAD("UltraVioletDownload"), + + /** Ultraviolet streaming content type. */ + ULTRA_VIOLET_STREAMING("UltraVioletStreaming"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyContentType instance. */ + private String value; + + ContentKeyPolicyPlayReadyContentType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyContentType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyContentType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyContentType fromString(String value) { + ContentKeyPolicyPlayReadyContentType[] items = ContentKeyPolicyPlayReadyContentType.values(); + for (ContentKeyPolicyPlayReadyContentType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java new file mode 100644 index 0000000000000..09e48986fbb9d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Explicit Analog Television Output Restriction control bits. + * For further details see the PlayReady Compliance Rules. + */ +public class ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { + /** + * Indicates whether this restriction is enforced on a Best Effort basis. + */ + @JsonProperty(value = "bestEffort", required = true) + private boolean bestEffort; + + /** + * Configures the restriction control bits. Must be between 0 and 3 + * inclusive. + */ + @JsonProperty(value = "configurationData", required = true) + private int configurationData; + + /** + * Get indicates whether this restriction is enforced on a Best Effort basis. + * + * @return the bestEffort value + */ + public boolean bestEffort() { + return this.bestEffort; + } + + /** + * Set indicates whether this restriction is enforced on a Best Effort basis. + * + * @param bestEffort the bestEffort value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withBestEffort(boolean bestEffort) { + this.bestEffort = bestEffort; + return this; + } + + /** + * Get configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @return the configurationData value + */ + public int configurationData() { + return this.configurationData; + } + + /** + * Set configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @param configurationData the configurationData value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withConfigurationData(int configurationData) { + this.configurationData = configurationData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicense.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicense.java new file mode 100644 index 0000000000000..f85902112b237 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicense.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PlayReady license. + */ +public class ContentKeyPolicyPlayReadyLicense { + /** + * A flag indicating whether test devices can use the license. + */ + @JsonProperty(value = "allowTestDevices", required = true) + private boolean allowTestDevices; + + /** + * The begin date of license. + */ + @JsonProperty(value = "beginDate") + private DateTime beginDate; + + /** + * The expiration date of license. + */ + @JsonProperty(value = "expirationDate") + private DateTime expirationDate; + + /** + * The relative begin date of license. + */ + @JsonProperty(value = "relativeBeginDate") + private Period relativeBeginDate; + + /** + * The relative expiration date of license. + */ + @JsonProperty(value = "relativeExpirationDate") + private Period relativeExpirationDate; + + /** + * The grace period of license. + */ + @JsonProperty(value = "gracePeriod") + private Period gracePeriod; + + /** + * The license PlayRight. + */ + @JsonProperty(value = "playRight") + private ContentKeyPolicyPlayReadyPlayRight playRight; + + /** + * The license type. Possible values include: 'Unknown', 'NonPersistent', + * 'Persistent'. + */ + @JsonProperty(value = "licenseType", required = true) + private ContentKeyPolicyPlayReadyLicenseType licenseType; + + /** + * The content key location. + */ + @JsonProperty(value = "contentKeyLocation", required = true) + private ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation; + + /** + * The PlayReady content type. Possible values include: 'Unknown', + * 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + */ + @JsonProperty(value = "contentType", required = true) + private ContentKeyPolicyPlayReadyContentType contentType; + + /** + * Get a flag indicating whether test devices can use the license. + * + * @return the allowTestDevices value + */ + public boolean allowTestDevices() { + return this.allowTestDevices; + } + + /** + * Set a flag indicating whether test devices can use the license. + * + * @param allowTestDevices the allowTestDevices value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withAllowTestDevices(boolean allowTestDevices) { + this.allowTestDevices = allowTestDevices; + return this; + } + + /** + * Get the begin date of license. + * + * @return the beginDate value + */ + public DateTime beginDate() { + return this.beginDate; + } + + /** + * Set the begin date of license. + * + * @param beginDate the beginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withBeginDate(DateTime beginDate) { + this.beginDate = beginDate; + return this; + } + + /** + * Get the expiration date of license. + * + * @return the expirationDate value + */ + public DateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expiration date of license. + * + * @param expirationDate the expirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withExpirationDate(DateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the relative begin date of license. + * + * @return the relativeBeginDate value + */ + public Period relativeBeginDate() { + return this.relativeBeginDate; + } + + /** + * Set the relative begin date of license. + * + * @param relativeBeginDate the relativeBeginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeBeginDate(Period relativeBeginDate) { + this.relativeBeginDate = relativeBeginDate; + return this; + } + + /** + * Get the relative expiration date of license. + * + * @return the relativeExpirationDate value + */ + public Period relativeExpirationDate() { + return this.relativeExpirationDate; + } + + /** + * Set the relative expiration date of license. + * + * @param relativeExpirationDate the relativeExpirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeExpirationDate(Period relativeExpirationDate) { + this.relativeExpirationDate = relativeExpirationDate; + return this; + } + + /** + * Get the grace period of license. + * + * @return the gracePeriod value + */ + public Period gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the grace period of license. + * + * @param gracePeriod the gracePeriod value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withGracePeriod(Period gracePeriod) { + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Get the license PlayRight. + * + * @return the playRight value + */ + public ContentKeyPolicyPlayReadyPlayRight playRight() { + return this.playRight; + } + + /** + * Set the license PlayRight. + * + * @param playRight the playRight value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withPlayRight(ContentKeyPolicyPlayReadyPlayRight playRight) { + this.playRight = playRight; + return this; + } + + /** + * Get the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @return the licenseType value + */ + public ContentKeyPolicyPlayReadyLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @param licenseType the licenseType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withLicenseType(ContentKeyPolicyPlayReadyLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the content key location. + * + * @return the contentKeyLocation value + */ + public ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation() { + return this.contentKeyLocation; + } + + /** + * Set the content key location. + * + * @param contentKeyLocation the contentKeyLocation value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentKeyLocation(ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation) { + this.contentKeyLocation = contentKeyLocation; + return this; + } + + /** + * Get the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @return the contentType value + */ + public ContentKeyPolicyPlayReadyContentType contentType() { + return this.contentType; + } + + /** + * Set the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @param contentType the contentType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentType(ContentKeyPolicyPlayReadyContentType contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicenseType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicenseType.java new file mode 100644 index 0000000000000..e0ca036f0d2bd --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyLicenseType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyLicenseType. + */ +public enum ContentKeyPolicyPlayReadyLicenseType { + /** Represents a ContentKeyPolicyPlayReadyLicenseType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Non persistent license. */ + NON_PERSISTENT("NonPersistent"), + + /** Persistent license. Allows offline playback. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyLicenseType instance. */ + private String value; + + ContentKeyPolicyPlayReadyLicenseType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyLicenseType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyLicenseType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyLicenseType fromString(String value) { + ContentKeyPolicyPlayReadyLicenseType[] items = ContentKeyPolicyPlayReadyLicenseType.values(); + for (ContentKeyPolicyPlayReadyLicenseType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyPlayRight.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyPlayRight.java new file mode 100644 index 0000000000000..8e2c955007eb4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyPlayRight.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Play Right in the PlayReady license. + */ +public class ContentKeyPolicyPlayReadyPlayRight { + /** + * The amount of time that the license is valid after the license is first + * used to play content. + */ + @JsonProperty(value = "firstPlayExpiration") + private Period firstPlayExpiration; + + /** + * Configures the Serial Copy Management System (SCMS) in the license. Must + * be between 0 and 3 inclusive. + */ + @JsonProperty(value = "scmsRestriction") + private Integer scmsRestriction; + + /** + * Configures Automatic Gain Control (AGC) and Color Stripe in the license. + * Must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "agcAndColorStripeRestriction") + private Integer agcAndColorStripeRestriction; + + /** + * Configures the Explicit Analog Television Output Restriction in the + * license. Configuration data must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "explicitAnalogTelevisionOutputRestriction") + private ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "digitalVideoOnlyContentRestriction", required = true) + private boolean digitalVideoOnlyContentRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComponentVideoRestriction", required = true) + private boolean imageConstraintForAnalogComponentVideoRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComputerMonitorRestriction", required = true) + private boolean imageConstraintForAnalogComputerMonitorRestriction; + + /** + * Configures Unknown output handling settings of the license. Possible + * values include: 'Unknown', 'NotAllowed', 'Allowed', + * 'AllowedWithVideoConstriction'. + */ + @JsonProperty(value = "allowPassingVideoContentToUnknownOutput", required = true) + private ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput; + + /** + * Specifies the output protection level for uncompressed digital video. + */ + @JsonProperty(value = "uncompressedDigitalVideoOpl") + private Integer uncompressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital video. + */ + @JsonProperty(value = "compressedDigitalVideoOpl") + private Integer compressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "analogVideoOpl") + private Integer analogVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "compressedDigitalAudioOpl") + private Integer compressedDigitalAudioOpl; + + /** + * Specifies the output protection level for uncompressed digital audio. + */ + @JsonProperty(value = "uncompressedDigitalAudioOpl") + private Integer uncompressedDigitalAudioOpl; + + /** + * Get the amount of time that the license is valid after the license is first used to play content. + * + * @return the firstPlayExpiration value + */ + public Period firstPlayExpiration() { + return this.firstPlayExpiration; + } + + /** + * Set the amount of time that the license is valid after the license is first used to play content. + * + * @param firstPlayExpiration the firstPlayExpiration value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withFirstPlayExpiration(Period firstPlayExpiration) { + this.firstPlayExpiration = firstPlayExpiration; + return this; + } + + /** + * Get configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @return the scmsRestriction value + */ + public Integer scmsRestriction() { + return this.scmsRestriction; + } + + /** + * Set configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @param scmsRestriction the scmsRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withScmsRestriction(Integer scmsRestriction) { + this.scmsRestriction = scmsRestriction; + return this; + } + + /** + * Get configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @return the agcAndColorStripeRestriction value + */ + public Integer agcAndColorStripeRestriction() { + return this.agcAndColorStripeRestriction; + } + + /** + * Set configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @param agcAndColorStripeRestriction the agcAndColorStripeRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAgcAndColorStripeRestriction(Integer agcAndColorStripeRestriction) { + this.agcAndColorStripeRestriction = agcAndColorStripeRestriction; + return this; + } + + /** + * Get configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @return the explicitAnalogTelevisionOutputRestriction value + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction() { + return this.explicitAnalogTelevisionOutputRestriction; + } + + /** + * Set configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @param explicitAnalogTelevisionOutputRestriction the explicitAnalogTelevisionOutputRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withExplicitAnalogTelevisionOutputRestriction(ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction) { + this.explicitAnalogTelevisionOutputRestriction = explicitAnalogTelevisionOutputRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the digitalVideoOnlyContentRestriction value + */ + public boolean digitalVideoOnlyContentRestriction() { + return this.digitalVideoOnlyContentRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param digitalVideoOnlyContentRestriction the digitalVideoOnlyContentRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withDigitalVideoOnlyContentRestriction(boolean digitalVideoOnlyContentRestriction) { + this.digitalVideoOnlyContentRestriction = digitalVideoOnlyContentRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComponentVideoRestriction value + */ + public boolean imageConstraintForAnalogComponentVideoRestriction() { + return this.imageConstraintForAnalogComponentVideoRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComponentVideoRestriction the imageConstraintForAnalogComponentVideoRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComponentVideoRestriction(boolean imageConstraintForAnalogComponentVideoRestriction) { + this.imageConstraintForAnalogComponentVideoRestriction = imageConstraintForAnalogComponentVideoRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComputerMonitorRestriction value + */ + public boolean imageConstraintForAnalogComputerMonitorRestriction() { + return this.imageConstraintForAnalogComputerMonitorRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComputerMonitorRestriction the imageConstraintForAnalogComputerMonitorRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComputerMonitorRestriction(boolean imageConstraintForAnalogComputerMonitorRestriction) { + this.imageConstraintForAnalogComputerMonitorRestriction = imageConstraintForAnalogComputerMonitorRestriction; + return this; + } + + /** + * Get configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @return the allowPassingVideoContentToUnknownOutput value + */ + public ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput() { + return this.allowPassingVideoContentToUnknownOutput; + } + + /** + * Set configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @param allowPassingVideoContentToUnknownOutput the allowPassingVideoContentToUnknownOutput value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAllowPassingVideoContentToUnknownOutput(ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput) { + this.allowPassingVideoContentToUnknownOutput = allowPassingVideoContentToUnknownOutput; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital video. + * + * @return the uncompressedDigitalVideoOpl value + */ + public Integer uncompressedDigitalVideoOpl() { + return this.uncompressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital video. + * + * @param uncompressedDigitalVideoOpl the uncompressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalVideoOpl(Integer uncompressedDigitalVideoOpl) { + this.uncompressedDigitalVideoOpl = uncompressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital video. + * + * @return the compressedDigitalVideoOpl value + */ + public Integer compressedDigitalVideoOpl() { + return this.compressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital video. + * + * @param compressedDigitalVideoOpl the compressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalVideoOpl(Integer compressedDigitalVideoOpl) { + this.compressedDigitalVideoOpl = compressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the analogVideoOpl value + */ + public Integer analogVideoOpl() { + return this.analogVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param analogVideoOpl the analogVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAnalogVideoOpl(Integer analogVideoOpl) { + this.analogVideoOpl = analogVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the compressedDigitalAudioOpl value + */ + public Integer compressedDigitalAudioOpl() { + return this.compressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param compressedDigitalAudioOpl the compressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalAudioOpl(Integer compressedDigitalAudioOpl) { + this.compressedDigitalAudioOpl = compressedDigitalAudioOpl; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital audio. + * + * @return the uncompressedDigitalAudioOpl value + */ + public Integer uncompressedDigitalAudioOpl() { + return this.uncompressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital audio. + * + * @param uncompressedDigitalAudioOpl the uncompressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalAudioOpl(Integer uncompressedDigitalAudioOpl) { + this.uncompressedDigitalAudioOpl = uncompressedDigitalAudioOpl; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java new file mode 100644 index 0000000000000..7766cf32f53e2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. + */ +public enum ContentKeyPolicyPlayReadyUnknownOutputPassingOption { + /** Represents a ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Passing the video portion of protected content to an Unknown Output is not allowed. */ + NOT_ALLOWED("NotAllowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed. */ + ALLOWED("Allowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed but with constrained resolution. */ + ALLOWED_WITH_VIDEO_CONSTRICTION("AllowedWithVideoConstriction"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. */ + private String value; + + ContentKeyPolicyPlayReadyUnknownOutputPassingOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyUnknownOutputPassingOption object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyUnknownOutputPassingOption fromString(String value) { + ContentKeyPolicyPlayReadyUnknownOutputPassingOption[] items = ContentKeyPolicyPlayReadyUnknownOutputPassingOption.values(); + for (ContentKeyPolicyPlayReadyUnknownOutputPassingOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyProperties.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyProperties.java new file mode 100644 index 0000000000000..435b9e9a307f7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyProperties.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.ContentKeyPolicyPropertiesInner; +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; + +/** + * Type representing ContentKeyPolicyProperties. + */ +public interface ContentKeyPolicyProperties extends HasInner, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestriction.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestriction.java new file mode 100644 index 0000000000000..da86b61bf1466 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestriction.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy restrictions. A derived class must be used + * to create a restriction. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestriction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyOpenRestriction", value = ContentKeyPolicyOpenRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction", value = ContentKeyPolicyUnknownRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyTokenRestriction", value = ContentKeyPolicyTokenRestriction.class) +}) +public class ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenKey.java new file mode 100644 index 0000000000000..b0b0a121fae5a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenKey.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy key for token validation. A derived class + * must be used to create a token key. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestrictionTokenKey") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey", value = ContentKeyPolicySymmetricTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey", value = ContentKeyPolicyRsaTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey", value = ContentKeyPolicyX509CertificateTokenKey.class) +}) +public class ContentKeyPolicyRestrictionTokenKey { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenType.java new file mode 100644 index 0000000000000..f7b2affbf7e6b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRestrictionTokenType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyRestrictionTokenType. + */ +public enum ContentKeyPolicyRestrictionTokenType { + /** Represents a ContentKeyPolicyRestrictionTokenType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Simple Web Token. */ + SWT("Swt"), + + /** JSON Web Token. */ + JWT("Jwt"); + + /** The actual serialized value for a ContentKeyPolicyRestrictionTokenType instance. */ + private String value; + + ContentKeyPolicyRestrictionTokenType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyRestrictionTokenType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyRestrictionTokenType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyRestrictionTokenType fromString(String value) { + ContentKeyPolicyRestrictionTokenType[] items = ContentKeyPolicyRestrictionTokenType.values(); + for (ContentKeyPolicyRestrictionTokenType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRsaTokenKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRsaTokenKey.java new file mode 100644 index 0000000000000..9e59b83c0ec8e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyRsaTokenKey.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a RSA key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyRsaTokenKey") +public class ContentKeyPolicyRsaTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The RSA Parameter exponent. + */ + @JsonProperty(value = "exponent", required = true) + private byte[] exponent; + + /** + * The RSA Parameter modulus. + */ + @JsonProperty(value = "modulus", required = true) + private byte[] modulus; + + /** + * Get the RSA Parameter exponent. + * + * @return the exponent value + */ + public byte[] exponent() { + return this.exponent; + } + + /** + * Set the RSA Parameter exponent. + * + * @param exponent the exponent value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withExponent(byte[] exponent) { + this.exponent = exponent; + return this; + } + + /** + * Get the RSA Parameter modulus. + * + * @return the modulus value + */ + public byte[] modulus() { + return this.modulus; + } + + /** + * Set the RSA Parameter modulus. + * + * @param modulus the modulus value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withModulus(byte[] modulus) { + this.modulus = modulus; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicySymmetricTokenKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicySymmetricTokenKey.java new file mode 100644 index 0000000000000..f1a36cf5eb0c3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicySymmetricTokenKey.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a symmetric key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey") +public class ContentKeyPolicySymmetricTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The key value of the key. + */ + @JsonProperty(value = "keyValue", required = true) + private byte[] keyValue; + + /** + * Get the key value of the key. + * + * @return the keyValue value + */ + public byte[] keyValue() { + return this.keyValue; + } + + /** + * Set the key value of the key. + * + * @param keyValue the keyValue value to set + * @return the ContentKeyPolicySymmetricTokenKey object itself. + */ + public ContentKeyPolicySymmetricTokenKey withKeyValue(byte[] keyValue) { + this.keyValue = keyValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenClaim.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenClaim.java new file mode 100644 index 0000000000000..d8e959a1c5bbd --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenClaim.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a token claim. + */ +public class ContentKeyPolicyTokenClaim { + /** + * Token claim type. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /** + * Token claim value. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * Get token claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Set token claim type. + * + * @param claimType the claimType value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimType(String claimType) { + this.claimType = claimType; + return this; + } + + /** + * Get token claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set token claim value. + * + * @param claimValue the claimValue value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenRestriction.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenRestriction.java new file mode 100644 index 0000000000000..8e69e1fedef3c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyTokenRestriction.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a token restriction. Provided token must match these requirements + * for successful license or key delivery. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyTokenRestriction") +public class ContentKeyPolicyTokenRestriction extends ContentKeyPolicyRestriction { + /** + * The token issuer. + */ + @JsonProperty(value = "issuer", required = true) + private String issuer; + + /** + * The audience for the token. + */ + @JsonProperty(value = "audience", required = true) + private String audience; + + /** + * The primary verification key. + */ + @JsonProperty(value = "primaryVerificationKey", required = true) + private ContentKeyPolicyRestrictionTokenKey primaryVerificationKey; + + /** + * A list of alternative verification keys. + */ + @JsonProperty(value = "alternateVerificationKeys") + private List alternateVerificationKeys; + + /** + * A list of required token claims. + */ + @JsonProperty(value = "requiredClaims") + private List requiredClaims; + + /** + * The type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + */ + @JsonProperty(value = "restrictionTokenType", required = true) + private ContentKeyPolicyRestrictionTokenType restrictionTokenType; + + /** + * The OpenID connect discovery document. + */ + @JsonProperty(value = "openIdConnectDiscoveryDocument") + private String openIdConnectDiscoveryDocument; + + /** + * Get the token issuer. + * + * @return the issuer value + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the token issuer. + * + * @param issuer the issuer value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the audience for the token. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience for the token. + * + * @param audience the audience value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the primary verification key. + * + * @return the primaryVerificationKey value + */ + public ContentKeyPolicyRestrictionTokenKey primaryVerificationKey() { + return this.primaryVerificationKey; + } + + /** + * Set the primary verification key. + * + * @param primaryVerificationKey the primaryVerificationKey value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withPrimaryVerificationKey(ContentKeyPolicyRestrictionTokenKey primaryVerificationKey) { + this.primaryVerificationKey = primaryVerificationKey; + return this; + } + + /** + * Get a list of alternative verification keys. + * + * @return the alternateVerificationKeys value + */ + public List alternateVerificationKeys() { + return this.alternateVerificationKeys; + } + + /** + * Set a list of alternative verification keys. + * + * @param alternateVerificationKeys the alternateVerificationKeys value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAlternateVerificationKeys(List alternateVerificationKeys) { + this.alternateVerificationKeys = alternateVerificationKeys; + return this; + } + + /** + * Get a list of required token claims. + * + * @return the requiredClaims value + */ + public List requiredClaims() { + return this.requiredClaims; + } + + /** + * Set a list of required token claims. + * + * @param requiredClaims the requiredClaims value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRequiredClaims(List requiredClaims) { + this.requiredClaims = requiredClaims; + return this; + } + + /** + * Get the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @return the restrictionTokenType value + */ + public ContentKeyPolicyRestrictionTokenType restrictionTokenType() { + return this.restrictionTokenType; + } + + /** + * Set the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @param restrictionTokenType the restrictionTokenType value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType restrictionTokenType) { + this.restrictionTokenType = restrictionTokenType; + return this; + } + + /** + * Get the OpenID connect discovery document. + * + * @return the openIdConnectDiscoveryDocument value + */ + public String openIdConnectDiscoveryDocument() { + return this.openIdConnectDiscoveryDocument; + } + + /** + * Set the OpenID connect discovery document. + * + * @param openIdConnectDiscoveryDocument the openIdConnectDiscoveryDocument value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withOpenIdConnectDiscoveryDocument(String openIdConnectDiscoveryDocument) { + this.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownConfiguration.java new file mode 100644 index 0000000000000..d42d6c7b454ce --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownConfiguration.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyConfiguration that is unavailable in the + * current API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownConfiguration") +public class ContentKeyPolicyUnknownConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownRestriction.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownRestriction.java new file mode 100644 index 0000000000000..3ef05a6453633 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyUnknownRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyRestriction that is unavailable in the current + * API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownRestriction") +public class ContentKeyPolicyUnknownRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyWidevineConfiguration.java new file mode 100644 index 0000000000000..f98abef925fc8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyWidevineConfiguration.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for Widevine licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration") +public class ContentKeyPolicyWidevineConfiguration extends ContentKeyPolicyConfiguration { + /** + * The Widevine template. + */ + @JsonProperty(value = "widevineTemplate", required = true) + private String widevineTemplate; + + /** + * Get the Widevine template. + * + * @return the widevineTemplate value + */ + public String widevineTemplate() { + return this.widevineTemplate; + } + + /** + * Set the Widevine template. + * + * @param widevineTemplate the widevineTemplate value to set + * @return the ContentKeyPolicyWidevineConfiguration object itself. + */ + public ContentKeyPolicyWidevineConfiguration withWidevineTemplate(String widevineTemplate) { + this.widevineTemplate = widevineTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyX509CertificateTokenKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyX509CertificateTokenKey.java new file mode 100644 index 0000000000000..8bb30c6175fb2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ContentKeyPolicyX509CertificateTokenKey.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a certificate for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey") +public class ContentKeyPolicyX509CertificateTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The raw data field of a certificate in PKCS 12 format (X509Certificate2 + * in .NET). + */ + @JsonProperty(value = "rawBody", required = true) + private byte[] rawBody; + + /** + * Get the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @return the rawBody value + */ + public byte[] rawBody() { + return this.rawBody; + } + + /** + * Set the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @param rawBody the rawBody value to set + * @return the ContentKeyPolicyX509CertificateTokenKey object itself. + */ + public ContentKeyPolicyX509CertificateTokenKey withRawBody(byte[] rawBody) { + this.rawBody = rawBody; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyAudio.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyAudio.java new file mode 100644 index 0000000000000..5e8a9c327dba2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyAudio.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input audio bitstream. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyAudio") +public class CopyAudio extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyVideo.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyVideo.java new file mode 100644 index 0000000000000..5f4d7ff1479fb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CopyVideo.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input video bitstream + * without re-encoding. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyVideo") +public class CopyVideo extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CrossSiteAccessPolicies.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CrossSiteAccessPolicies.java new file mode 100644 index 0000000000000..eaf41be5170b2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/CrossSiteAccessPolicies.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The client access policy. + */ +public class CrossSiteAccessPolicies { + /** + * The content of clientaccesspolicy.xml used by Silverlight. + */ + @JsonProperty(value = "clientAccessPolicy") + private String clientAccessPolicy; + + /** + * The content of crossdomain.xml used by Silverlight. + */ + @JsonProperty(value = "crossDomainPolicy") + private String crossDomainPolicy; + + /** + * Get the content of clientaccesspolicy.xml used by Silverlight. + * + * @return the clientAccessPolicy value + */ + public String clientAccessPolicy() { + return this.clientAccessPolicy; + } + + /** + * Set the content of clientaccesspolicy.xml used by Silverlight. + * + * @param clientAccessPolicy the clientAccessPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withClientAccessPolicy(String clientAccessPolicy) { + this.clientAccessPolicy = clientAccessPolicy; + return this; + } + + /** + * Get the content of crossdomain.xml used by Silverlight. + * + * @return the crossDomainPolicy value + */ + public String crossDomainPolicy() { + return this.crossDomainPolicy; + } + + /** + * Set the content of crossdomain.xml used by Silverlight. + * + * @param crossDomainPolicy the crossDomainPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withCrossDomainPolicy(String crossDomainPolicy) { + this.crossDomainPolicy = crossDomainPolicy; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DefaultKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DefaultKey.java new file mode 100644 index 0000000000000..fdd240e57d37e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DefaultKey.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of default content key for each encryption + * scheme. + */ +public class DefaultKey { + /** + * Label can be used to specify Content Key when creating Stremaing + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Default Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Get label can be used to specify Content Key when creating Stremaing Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating Stremaing Locator. + * + * @param label the label value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Default Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Default Key. + * + * @param policyName the policyName value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Deinterlace.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Deinterlace.java new file mode 100644 index 0000000000000..480df2d6e48b2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Deinterlace.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the de-interlacing settings. + */ +public class Deinterlace { + /** + * The field parity for de-interlacing, defaults to Auto. Possible values + * include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + */ + @JsonProperty(value = "parity") + private DeinterlaceParity parity; + + /** + * The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values + * include: 'Off', 'AutoPixelAdaptive'. + */ + @JsonProperty(value = "mode") + private DeinterlaceMode mode; + + /** + * Get the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @return the parity value + */ + public DeinterlaceParity parity() { + return this.parity; + } + + /** + * Set the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @param parity the parity value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withParity(DeinterlaceParity parity) { + this.parity = parity; + return this; + } + + /** + * Get the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @return the mode value + */ + public DeinterlaceMode mode() { + return this.mode; + } + + /** + * Set the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @param mode the mode value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withMode(DeinterlaceMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceMode.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceMode.java new file mode 100644 index 0000000000000..1b28c12854ef3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceMode. + */ +public enum DeinterlaceMode { + /** Disables de-interlacing of the source video. */ + OFF("Off"), + + /** Apply automatic pixel adaptive de-interlacing on each frame in the input video. */ + AUTO_PIXEL_ADAPTIVE("AutoPixelAdaptive"); + + /** The actual serialized value for a DeinterlaceMode instance. */ + private String value; + + DeinterlaceMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceMode instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceMode object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceMode fromString(String value) { + DeinterlaceMode[] items = DeinterlaceMode.values(); + for (DeinterlaceMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceParity.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceParity.java new file mode 100644 index 0000000000000..656d82e157529 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/DeinterlaceParity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceParity. + */ +public enum DeinterlaceParity { + /** Automatically detect the order of fields. */ + AUTO("Auto"), + + /** Apply top field first processing of input video. */ + TOP_FIELD_FIRST("TopFieldFirst"), + + /** Apply bottom field first processing of input video. */ + BOTTOM_FIELD_FIRST("BottomFieldFirst"); + + /** The actual serialized value for a DeinterlaceParity instance. */ + private String value; + + DeinterlaceParity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceParity instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceParity object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceParity fromString(String value) { + DeinterlaceParity[] items = DeinterlaceParity.values(); + for (DeinterlaceParity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnabledProtocols.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnabledProtocols.java new file mode 100644 index 0000000000000..28e7e10ed4b6e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnabledProtocols.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify which protocols are enabled. + */ +public class EnabledProtocols { + /** + * Enable Download protocol or not. + */ + @JsonProperty(value = "download", required = true) + private boolean download; + + /** + * Enable Dash protocol or not. + */ + @JsonProperty(value = "dash", required = true) + private boolean dash; + + /** + * Enable Hls protocol or not. + */ + @JsonProperty(value = "hls", required = true) + private boolean hls; + + /** + * Enable SmoothStreaming protocol or not. + */ + @JsonProperty(value = "smoothStreaming", required = true) + private boolean smoothStreaming; + + /** + * Get enable Download protocol or not. + * + * @return the download value + */ + public boolean download() { + return this.download; + } + + /** + * Set enable Download protocol or not. + * + * @param download the download value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withDownload(boolean download) { + this.download = download; + return this; + } + + /** + * Get enable Dash protocol or not. + * + * @return the dash value + */ + public boolean dash() { + return this.dash; + } + + /** + * Set enable Dash protocol or not. + * + * @param dash the dash value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withDash(boolean dash) { + this.dash = dash; + return this; + } + + /** + * Get enable Hls protocol or not. + * + * @return the hls value + */ + public boolean hls() { + return this.hls; + } + + /** + * Set enable Hls protocol or not. + * + * @param hls the hls value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withHls(boolean hls) { + this.hls = hls; + return this; + } + + /** + * Get enable SmoothStreaming protocol or not. + * + * @return the smoothStreaming value + */ + public boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set enable SmoothStreaming protocol or not. + * + * @param smoothStreaming the smoothStreaming value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) { + this.smoothStreaming = smoothStreaming; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncoderNamedPreset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncoderNamedPreset.java new file mode 100644 index 0000000000000..3d53602860560 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncoderNamedPreset.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncoderNamedPreset. + */ +public enum EncoderNamedPreset { + /** Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output will remain 720p at best, and will start at rates lower than 3 Mbps. The output will will have video and audio in separate MP4 files, which is optimal for adaptive streaming. */ + ADAPTIVE_STREAMING("AdaptiveStreaming"), + + /** Produces a single MP4 file containing only stereo audio encoded at 192 kbps. */ + AACGOOD_QUALITY_AUDIO("AACGoodQualityAudio"), + + /** Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. */ + H264MULTIPLE_BITRATE1080P("H264MultipleBitrate1080p"), + + /** Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 720p and goes down to 360p. */ + H264MULTIPLE_BITRATE720P("H264MultipleBitrate720p"), + + /** Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and stereo AAC audio. Resolution starts at 480p and goes down to 360p. */ + H264MULTIPLE_BITRATE_SD("H264MultipleBitrateSD"); + + /** The actual serialized value for a EncoderNamedPreset instance. */ + private String value; + + EncoderNamedPreset(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncoderNamedPreset instance. + * + * @param value the serialized value to parse. + * @return the parsed EncoderNamedPreset object, or null if unable to parse. + */ + @JsonCreator + public static EncoderNamedPreset fromString(String value) { + EncoderNamedPreset[] items = EncoderNamedPreset.values(); + for (EncoderNamedPreset item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncryptionScheme.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncryptionScheme.java new file mode 100644 index 0000000000000..57ed979f0bcc3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EncryptionScheme.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionScheme. + */ +public enum EncryptionScheme { + /** NoEncryption scheme. */ + NO_ENCRYPTION("NoEncryption"), + + /** EnvelopeEncryption scheme. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"), + + /** CommonEncryptionCenc scheme. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** CommonEncryptionCbcs scheme. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"); + + /** The actual serialized value for a EncryptionScheme instance. */ + private String value; + + EncryptionScheme(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionScheme instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionScheme object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionScheme fromString(String value) { + EncryptionScheme[] items = EncryptionScheme.values(); + for (EncryptionScheme item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntityNameAvailabilityCheckOutput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntityNameAvailabilityCheckOutput.java new file mode 100644 index 0000000000000..c31a16cb51214 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntityNameAvailabilityCheckOutput.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.EntityNameAvailabilityCheckOutputInner; + +/** + * Type representing EntityNameAvailabilityCheckOutput. + */ +public interface EntityNameAvailabilityCheckOutput extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntropyMode.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntropyMode.java new file mode 100644 index 0000000000000..42d6738631964 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EntropyMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntropyMode. + */ +public enum EntropyMode { + /** Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. */ + CABAC("Cabac"), + + /** Context Adaptive Variable Length Coder (CAVLC) entropy encoding. */ + CAVLC("Cavlc"); + + /** The actual serialized value for a EntropyMode instance. */ + private String value; + + EntropyMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntropyMode instance. + * + * @param value the serialized value to parse. + * @return the parsed EntropyMode object, or null if unable to parse. + */ + @JsonCreator + public static EntropyMode fromString(String value) { + EntropyMode[] items = EntropyMode.values(); + for (EntropyMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnvelopeEncryption.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnvelopeEncryption.java new file mode 100644 index 0000000000000..eb7901b6f4025 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/EnvelopeEncryption.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for EnvelopeEncryption encryption scheme. + */ +public class EnvelopeEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * LicenseAcquistionUrlTemplate is used to point to user speicified service + * to delivery content keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get licenseAcquistionUrlTemplate is used to point to user speicified service to delivery content keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set licenseAcquistionUrlTemplate is used to point to user speicified service to delivery content keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Filters.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Filters.java new file mode 100644 index 0000000000000..2b79103857412 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Filters.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes all the filtering operations, such as de-interlacing, rotation + * etc. that are to be applied to the input media before encoding. + */ +public class Filters { + /** + * The de-interlacing settings. + */ + @JsonProperty(value = "deinterlace") + private Deinterlace deinterlace; + + /** + * The rotation, if any, to be applied to the input video, before it is + * encoded. Default is Auto. Possible values include: 'Auto', 'None', + * 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + */ + @JsonProperty(value = "rotation") + private Rotation rotation; + + /** + * The parameters for the rectangular window with which to crop the input + * video. + */ + @JsonProperty(value = "crop") + private Rectangle crop; + + /** + * The properties of overlays to be applied to the input video. These could + * be audio, image or video overlays. + */ + @JsonProperty(value = "overlays") + private List overlays; + + /** + * Get the de-interlacing settings. + * + * @return the deinterlace value + */ + public Deinterlace deinterlace() { + return this.deinterlace; + } + + /** + * Set the de-interlacing settings. + * + * @param deinterlace the deinterlace value to set + * @return the Filters object itself. + */ + public Filters withDeinterlace(Deinterlace deinterlace) { + this.deinterlace = deinterlace; + return this; + } + + /** + * Get the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @return the rotation value + */ + public Rotation rotation() { + return this.rotation; + } + + /** + * Set the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @param rotation the rotation value to set + * @return the Filters object itself. + */ + public Filters withRotation(Rotation rotation) { + this.rotation = rotation; + return this; + } + + /** + * Get the parameters for the rectangular window with which to crop the input video. + * + * @return the crop value + */ + public Rectangle crop() { + return this.crop; + } + + /** + * Set the parameters for the rectangular window with which to crop the input video. + * + * @param crop the crop value to set + * @return the Filters object itself. + */ + public Filters withCrop(Rectangle crop) { + this.crop = crop; + return this; + } + + /** + * Get the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @return the overlays value + */ + public List overlays() { + return this.overlays; + } + + /** + * Set the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @param overlays the overlays value to set + * @return the Filters object itself. + */ + public Filters withOverlays(List overlays) { + this.overlays = overlays; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Format.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Format.java new file mode 100644 index 0000000000000..99d0b92911457 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Format.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for output. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Format") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) +}) +public class Format { + /** + * The pattern of the file names for the generated output files. The + * following macros are supported in the file name: {Basename} - The base + * name of the input video {Extension} - The appropriate extension for this + * format. {Label} - The label assigned to the codec/layer. {Index} - A + * unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - + * The audio/video bitrate. Not applicable to thumbnails. {Codec} - The + * type of the audio/video codec. Any unsubstituted macros will be + * collapsed and removed from the filename. + */ + @JsonProperty(value = "filenamePattern") + private String filenamePattern; + + /** + * Get the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @return the filenamePattern value + */ + public String filenamePattern() { + return this.filenamePattern; + } + + /** + * Set the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @param filenamePattern the filenamePattern value to set + * @return the Format object itself. + */ + public Format withFilenamePattern(String filenamePattern) { + this.filenamePattern = filenamePattern; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Complexity.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Complexity.java new file mode 100644 index 0000000000000..3bda8475a5007 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Complexity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264Complexity. + */ +public enum H264Complexity { + /** Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to decrease encoding time. */ + SPEED("Speed"), + + /** Tells the encoder to use settings that achieve a balance between speed and quality. */ + BALANCED("Balanced"), + + /** Tells the encoder to use settings that are optimized to produce higher quality output at the expense of slower overall encode time. */ + QUALITY("Quality"); + + /** The actual serialized value for a H264Complexity instance. */ + private String value; + + H264Complexity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264Complexity instance. + * + * @param value the serialized value to parse. + * @return the parsed H264Complexity object, or null if unable to parse. + */ + @JsonCreator + public static H264Complexity fromString(String value) { + H264Complexity[] items = H264Complexity.values(); + for (H264Complexity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Layer.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Layer.java new file mode 100644 index 0000000000000..7d86026ef9a2b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Layer.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer with the H.264 video codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Layer") +public class H264Layer extends VideoLayer { + /** + * Which profile of the H.264 standard should be used when encoding this + * layer. Default is Auto. Possible values include: 'Auto', 'Baseline', + * 'Main', 'High', 'High422', 'High444'. + */ + @JsonProperty(value = "profile") + private H264VideoProfile profile; + + /** + * Which level of the H.264 standard should be used when encoding this + * layer. The value can be Auto, or a number that matches the H.264 + * profile. If not specified, the default is Auto, which lets the encoder + * choose the Level that is appropriate for this layer. + */ + @JsonProperty(value = "level") + private String level; + + /** + * The VBV buffer window length. The value should be in ISO 8601 format. + * The value should be in the range [0.1-100] seconds. The default is 5 + * seconds (for example, PT5S). + */ + @JsonProperty(value = "bufferWindow") + private Period bufferWindow; + + /** + * The number of reference frames to be used when encoding this layer. If + * not specified, the encoder determines an appropriate number based on the + * encoder complexity setting. + */ + @JsonProperty(value = "referenceFrames") + private Integer referenceFrames; + + /** + * The entropy mode to be used for this layer. If not specified, the + * encoder chooses the mode that is appropriate for the profile and level. + * Possible values include: 'Cabac', 'Cavlc'. + */ + @JsonProperty(value = "entropyMode") + private EntropyMode entropyMode; + + /** + * Get which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @return the profile value + */ + public H264VideoProfile profile() { + return this.profile; + } + + /** + * Set which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @param profile the profile value to set + * @return the H264Layer object itself. + */ + public H264Layer withProfile(H264VideoProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @return the level value + */ + public String level() { + return this.level; + } + + /** + * Set which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @param level the level value to set + * @return the H264Layer object itself. + */ + public H264Layer withLevel(String level) { + this.level = level; + return this; + } + + /** + * Get the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @return the bufferWindow value + */ + public Period bufferWindow() { + return this.bufferWindow; + } + + /** + * Set the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @param bufferWindow the bufferWindow value to set + * @return the H264Layer object itself. + */ + public H264Layer withBufferWindow(Period bufferWindow) { + this.bufferWindow = bufferWindow; + return this; + } + + /** + * Get the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @return the referenceFrames value + */ + public Integer referenceFrames() { + return this.referenceFrames; + } + + /** + * Set the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @param referenceFrames the referenceFrames value to set + * @return the H264Layer object itself. + */ + public H264Layer withReferenceFrames(Integer referenceFrames) { + this.referenceFrames = referenceFrames; + return this; + } + + /** + * Get the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @return the entropyMode value + */ + public EntropyMode entropyMode() { + return this.entropyMode; + } + + /** + * Set the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @param entropyMode the entropyMode value to set + * @return the H264Layer object itself. + */ + public H264Layer withEntropyMode(EntropyMode entropyMode) { + this.entropyMode = entropyMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Video.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Video.java new file mode 100644 index 0000000000000..f0ef289eded14 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264Video.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the properties for encoding a video with the H.264 codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Video") +public class H264Video extends Video { + /** + * Whether or not the encoder should insert key frames at scene changes. If + * not specified, the default is false. This flag should be set to true + * only when the encoder is being configured to produce a single output + * video. + */ + @JsonProperty(value = "sceneChangeDetection") + private Boolean sceneChangeDetection; + + /** + * Tells the encoder how to choose its encoding settings. The default value + * is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + */ + @JsonProperty(value = "complexity") + private H264Complexity complexity; + + /** + * The collection of output H.264 layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @return the sceneChangeDetection value + */ + public Boolean sceneChangeDetection() { + return this.sceneChangeDetection; + } + + /** + * Set whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @param sceneChangeDetection the sceneChangeDetection value to set + * @return the H264Video object itself. + */ + public H264Video withSceneChangeDetection(Boolean sceneChangeDetection) { + this.sceneChangeDetection = sceneChangeDetection; + return this; + } + + /** + * Get tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @return the complexity value + */ + public H264Complexity complexity() { + return this.complexity; + } + + /** + * Set tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @param complexity the complexity value to set + * @return the H264Video object itself. + */ + public H264Video withComplexity(H264Complexity complexity) { + this.complexity = complexity; + return this; + } + + /** + * Get the collection of output H.264 layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set the collection of output H.264 layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the H264Video object itself. + */ + public H264Video withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264VideoProfile.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264VideoProfile.java new file mode 100644 index 0000000000000..422b2d3212547 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/H264VideoProfile.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264VideoProfile. + */ +public enum H264VideoProfile { + /** Tells the encoder to automatically determine the appropriate H.264 profile. */ + AUTO("Auto"), + + /** Baseline profile. */ + BASELINE("Baseline"), + + /** Main profile. */ + MAIN("Main"), + + /** High profile. */ + HIGH("High"), + + /** High 4:2:2 profile. */ + HIGH422("High422"), + + /** High 4:4:4 predictive profile. */ + HIGH444("High444"); + + /** The actual serialized value for a H264VideoProfile instance. */ + private String value; + + H264VideoProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264VideoProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed H264VideoProfile object, or null if unable to parse. + */ + @JsonCreator + public static H264VideoProfile fromString(String value) { + H264VideoProfile[] items = H264VideoProfile.values(); + for (H264VideoProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Hls.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Hls.java new file mode 100644 index 0000000000000..341b42c746973 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Hls.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HLS configuration. + */ +public class Hls { + /** + * The amount of fragments per HTTP Live Streaming (HLS) segment. + */ + @JsonProperty(value = "fragmentsPerTsSegment") + private Integer fragmentsPerTsSegment; + + /** + * Get the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @return the fragmentsPerTsSegment value + */ + public Integer fragmentsPerTsSegment() { + return this.fragmentsPerTsSegment; + } + + /** + * Set the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @param fragmentsPerTsSegment the fragmentsPerTsSegment value to set + * @return the Hls object itself. + */ + public Hls withFragmentsPerTsSegment(Integer fragmentsPerTsSegment) { + this.fragmentsPerTsSegment = fragmentsPerTsSegment; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPAccessControl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPAccessControl.java new file mode 100644 index 0000000000000..4782bbd3ea4b8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control. + */ +public class IPAccessControl { + /** + * The IP allow list. + */ + @JsonProperty(value = "allow") + private List allow; + + /** + * Get the IP allow list. + * + * @return the allow value + */ + public List allow() { + return this.allow; + } + + /** + * Set the IP allow list. + * + * @param allow the allow value to set + * @return the IPAccessControl object itself. + */ + public IPAccessControl withAllow(List allow) { + this.allow = allow; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPRange.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPRange.java new file mode 100644 index 0000000000000..3005303f3916a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/IPRange.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP address range in the CIDR scheme. + */ +public class IPRange { + /** + * The friendly name for the IP address range. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The IP address. + */ + @JsonProperty(value = "address") + private String address; + + /** + * The subnet mask prefix length (see CIDR notation). + */ + @JsonProperty(value = "subnetPrefixLength") + private Integer subnetPrefixLength; + + /** + * Get the friendly name for the IP address range. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the friendly name for the IP address range. + * + * @param name the name value to set + * @return the IPRange object itself. + */ + public IPRange withName(String name) { + this.name = name; + return this; + } + + /** + * Get the IP address. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address. + * + * @param address the address value to set + * @return the IPRange object itself. + */ + public IPRange withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the subnet mask prefix length (see CIDR notation). + * + * @return the subnetPrefixLength value + */ + public Integer subnetPrefixLength() { + return this.subnetPrefixLength; + } + + /** + * Set the subnet mask prefix length (see CIDR notation). + * + * @param subnetPrefixLength the subnetPrefixLength value to set + * @return the IPRange object itself. + */ + public IPRange withSubnetPrefixLength(Integer subnetPrefixLength) { + this.subnetPrefixLength = subnetPrefixLength; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Image.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Image.java new file mode 100644 index 0000000000000..f35134c32b233 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Image.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for generating thumbnails from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Image") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgImage", value = JpgImage.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngImage", value = PngImage.class) +}) +public class Image extends Video { + /** + * The position in the input video from where to start generating + * thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: + * PT05S), or a frame count (For example, 10 for the 10th frame), or a + * relative value (For example, 1%). Also supports a macro {Best}, which + * tells the encoder to select the best thumbnail from the first few + * seconds of the video. + */ + @JsonProperty(value = "start") + private String start; + + /** + * The intervals at which thumbnails are generated. The value can be in + * absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), + * or a frame count (For example, 30 for every 30 frames), or a relative + * value (For example, 1%). + */ + @JsonProperty(value = "step") + private String step; + + /** + * The position in the input video at which to stop generating thumbnails. + * The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop + * at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop + * at the 300th frame), or a relative value (For example, 100%). + */ + @JsonProperty(value = "range") + private String range; + + /** + * Get the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @return the start value + */ + public String start() { + return this.start; + } + + /** + * Set the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @param start the start value to set + * @return the Image object itself. + */ + public Image withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @return the step value + */ + public String step() { + return this.step; + } + + /** + * Set the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @param step the step value to set + * @return the Image object itself. + */ + public Image withStep(String step) { + this.step = step; + return this; + } + + /** + * Get the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @return the range value + */ + public String range() { + return this.range; + } + + /** + * Set the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @param range the range value to set + * @return the Image object itself. + */ + public Image withRange(String range) { + this.range = range; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ImageFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ImageFormat.java new file mode 100644 index 0000000000000..0fbe85e7190da --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ImageFormat.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for an output image file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ImageFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class) +}) +public class ImageFormat extends Format { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Job.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Job.java new file mode 100644 index 0000000000000..063a5e4f4ecf3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Job.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.JobInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Job. + */ +public interface Job extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + JobInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the priority value. + */ + Priority priority(); + + /** + * @return the state value. + */ + JobState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Job definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTransform, DefinitionStages.WithInput, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Job definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Job definition. + */ + interface Blank extends WithTransform { + } + + /** + * The stage of the job definition allowing to specify Transform. + */ + interface WithTransform { + /** + * Specifies resourceGroupName, accountName, transformName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param transformName The Transform name + * @return the next definition stage + */ + WithInput withExistingTransform(String resourceGroupName, String accountName, String transformName); + } + + /** + * The stage of the job definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + * @param input The inputs for the Job + * @return the next definition stage + */ + WithOutputs withInput(JobInput input); + } + + /** + * The stage of the job definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + * @param outputs The outputs for the Job + * @return the next definition stage + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the job definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the job definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next definition stage + */ + WithCreate withPriority(Priority priority); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithPriority { + } + } + /** + * The template for a Job update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithPriority { + } + + /** + * Grouping of Job update stages. + */ + interface UpdateStages { + /** + * The stage of the job update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the job update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next update stage + */ + Update withPriority(Priority priority); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobError.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobError.java new file mode 100644 index 0000000000000..4d43494dc4f0e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobError.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobError { + /** + * Error code describing the error. Possible values include: + * 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', + * 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', + * 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCode code; + + /** + * A human-readable language-dependent representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Helps with categorization of errors. Possible values include: 'Service', + * 'Download', 'Upload', 'Configuration', 'Content'. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCategory category; + + /** + * Indicates that it may be possible to retry the Job. If retry is + * unsuccessful, please contact Azure support via Azure Portal. Possible + * values include: 'DoNotRetry', 'MayRetry'. + */ + @JsonProperty(value = "retry", access = JsonProperty.Access.WRITE_ONLY) + private JobRetry retry; + + /** + * An array of details about specific errors that led to this reported + * error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + * + * @return the code value + */ + public JobErrorCode code() { + return this.code; + } + + /** + * Get a human-readable language-dependent representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get helps with categorization of errors. Possible values include: 'Service', 'Download', 'Upload', 'Configuration', 'Content'. + * + * @return the category value + */ + public JobErrorCategory category() { + return this.category; + } + + /** + * Get indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry'. + * + * @return the retry value + */ + public JobRetry retry() { + return this.retry; + } + + /** + * Get an array of details about specific errors that led to this reported error. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCategory.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCategory.java new file mode 100644 index 0000000000000..79a752c19cac6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCategory.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCategory. + */ +public enum JobErrorCategory { + /** The error is service related. */ + SERVICE("Service"), + + /** The error is download related. */ + DOWNLOAD("Download"), + + /** The error is upload related. */ + UPLOAD("Upload"), + + /** The error is configuration related. */ + CONFIGURATION("Configuration"), + + /** The error is related to data in the input files. */ + CONTENT("Content"); + + /** The actual serialized value for a JobErrorCategory instance. */ + private String value; + + JobErrorCategory(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCategory instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCategory object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCategory fromString(String value) { + JobErrorCategory[] items = JobErrorCategory.values(); + for (JobErrorCategory item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCode.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCode.java new file mode 100644 index 0000000000000..7aed5c1cfa6e9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorCode.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCode. + */ +public enum JobErrorCode { + /** Fatal service error, please contact support. */ + SERVICE_ERROR("ServiceError"), + + /** Transient error, please retry, if retry is unsuccessful, please contact support. */ + SERVICE_TRANSIENT_ERROR("ServiceTransientError"), + + /** While trying to download the input files, the files were not accessible, please check the availability of the source. */ + DOWNLOAD_NOT_ACCESSIBLE("DownloadNotAccessible"), + + /** While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. */ + DOWNLOAD_TRANSIENT_ERROR("DownloadTransientError"), + + /** While trying to upload the output files, the destination was not reachable, please check the availability of the destination. */ + UPLOAD_NOT_ACCESSIBLE("UploadNotAccessible"), + + /** While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. */ + UPLOAD_TRANSIENT_ERROR("UploadTransientError"), + + /** There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. */ + CONFIGURATION_UNSUPPORTED("ConfigurationUnsupported"), + + /** There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. */ + CONTENT_MALFORMED("ContentMalformed"), + + /** There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. */ + CONTENT_UNSUPPORTED("ContentUnsupported"); + + /** The actual serialized value for a JobErrorCode instance. */ + private String value; + + JobErrorCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCode instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCode object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCode fromString(String value) { + JobErrorCode[] items = JobErrorCode.values(); + for (JobErrorCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorDetail.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorDetail.java new file mode 100644 index 0000000000000..1b2b7852d5832 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobErrorDetail.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobErrorDetail { + /** + * Code describing the error detail. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * A human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get code describing the error detail. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get a human-readable representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInput.java new file mode 100644 index 0000000000000..d9a92b128336c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInput.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputClip", value = JobInputClip.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputs", value = JobInputs.class) +}) +public class JobInput { + /** + * A label that is assigned to a JobInput, that is used to satisfy a + * reference used in the Transform. For example, a Transform can be + * authored so as to take an image file with the label 'xyz' and apply it + * as an overlay onto the input video before it is encoded. When submitting + * a Job, exactly one of the JobInputs should be the image file, and it + * should have the label 'xyz'. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get a label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set a label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @param label the label value to set + * @return the JobInput object itself. + */ + public JobInput withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputAsset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputAsset.java new file mode 100644 index 0000000000000..b30b7ce152de1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset for input into a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputAsset") +public class JobInputAsset extends JobInputClip { + /** + * The name of the input Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the input Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the input Asset. + * + * @param assetName the assetName value to set + * @return the JobInputAsset object itself. + */ + public JobInputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputClip.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputClip.java new file mode 100644 index 0000000000000..aa7a3c2876e96 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputClip.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents input files for a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputClip") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputAsset", value = JobInputAsset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputHttp", value = JobInputHttp.class) +}) +public class JobInputClip extends JobInput { + /** + * List of files. Required for JobInputHttp. + */ + @JsonProperty(value = "files") + private List files; + + /** + * Get list of files. Required for JobInputHttp. + * + * @return the files value + */ + public List files() { + return this.files; + } + + /** + * Set list of files. Required for JobInputHttp. + * + * @param files the files value to set + * @return the JobInputClip object itself. + */ + public JobInputClip withFiles(List files) { + this.files = files; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputHttp.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputHttp.java new file mode 100644 index 0000000000000..85352da11a321 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputHttp.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents HTTPS job input. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputHttp") +public class JobInputHttp extends JobInputClip { + /** + * Base URI for HTTPS job input. It will be concatenated with provided file + * names. If no base uri is given, then the provided file list is assumed + * to be fully qualified uris. + */ + @JsonProperty(value = "baseUri") + private String baseUri; + + /** + * Get base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @return the baseUri value + */ + public String baseUri() { + return this.baseUri; + } + + /** + * Set base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @param baseUri the baseUri value to set + * @return the JobInputHttp object itself. + */ + public JobInputHttp withBaseUri(String baseUri) { + this.baseUri = baseUri; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputs.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputs.java new file mode 100644 index 0000000000000..4e843790d9d33 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobInputs.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a list of of inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputs") +public class JobInputs extends JobInput { + /** + * List of inputs to a Job. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /** + * Get list of inputs to a Job. + * + * @return the inputs value + */ + public List inputs() { + return this.inputs; + } + + /** + * Set list of inputs to a Job. + * + * @param inputs the inputs value to set + * @return the JobInputs object itself. + */ + public JobInputs withInputs(List inputs) { + this.inputs = inputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutput.java new file mode 100644 index 0000000000000..c162e88ab7b57 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutput.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes all the properties of a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobOutputAsset", value = JobOutputAsset.class) +}) +public class JobOutput { + /** + * If the JobOutput is in the Error state, it contains the details of the + * error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private JobError error; + + /** + * Describes the state of the JobOutput. Possible values include: + * 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', + * 'Scheduled'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * If the JobOutput is in a Processing state, this contains the job + * completion percentage. The value is an estimate and not intended to be + * used to predict job completion times. To determine if the JobOutput is + * complete, use the State property. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private int progress; + + /** + * Get if the JobOutput is in the Error state, it contains the details of the error. + * + * @return the error value + */ + public JobError error() { + return this.error; + } + + /** + * Get describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get if the JobOutput is in a Processing state, this contains the job completion percentage. The value is an estimate and not intended to be used to predict job completion times. To determine if the JobOutput is complete, use the State property. + * + * @return the progress value + */ + public int progress() { + return this.progress; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutputAsset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutputAsset.java new file mode 100644 index 0000000000000..7ebc480e43fa7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobOutputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset used as a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobOutputAsset") +public class JobOutputAsset extends JobOutput { + /** + * The name of the output Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the output Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the output Asset. + * + * @param assetName the assetName value to set + * @return the JobOutputAsset object itself. + */ + public JobOutputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobRetry.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobRetry.java new file mode 100644 index 0000000000000..23d02d3d4213e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobRetry.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobRetry. + */ +public enum JobRetry { + /** Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. */ + DO_NOT_RETRY("DoNotRetry"), + + /** Issue may be resolved after waiting for a period of time and resubmitting the same Job. */ + MAY_RETRY("MayRetry"); + + /** The actual serialized value for a JobRetry instance. */ + private String value; + + JobRetry(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobRetry instance. + * + * @param value the serialized value to parse. + * @return the parsed JobRetry object, or null if unable to parse. + */ + @JsonCreator + public static JobRetry fromString(String value) { + JobRetry[] items = JobRetry.values(); + for (JobRetry item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobState.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobState.java new file mode 100644 index 0000000000000..cdd84ecf13189 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JobState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** The job was canceled. This is a final state for the job. */ + CANCELED("Canceled"), + + /** The job is in the process of being canceled. This is a transient state for the job. */ + CANCELING("Canceling"), + + /** The job has encountered an error. This is a final state for the job. */ + ERROR("Error"), + + /** The job is finished. This is a final state for the job. */ + FINISHED("Finished"), + + /** The job is processing. This is a transient state for the job. */ + PROCESSING("Processing"), + + /** The job is in a queued state, waiting for resources to become available. This is a transient state. */ + QUEUED("Queued"), + + /** The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. */ + SCHEDULED("Scheduled"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromString(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Jobs.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Jobs.java new file mode 100644 index 0000000000000..06be2e983494b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Jobs.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends SupportsCreating, HasInner { + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String transformName); + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgFormat.java new file mode 100644 index 0000000000000..4cad6bb4cae8f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing JPEG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgFormat") +public class JpgFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgImage.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgImage.java new file mode 100644 index 0000000000000..50cd43b7bff06 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of JPEG images from the + * input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgImage") +public class JpgImage extends Image { + /** + * A collection of output JPEG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output JPEG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output JPEG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the JpgImage object itself. + */ + public JpgImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgLayer.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgLayer.java new file mode 100644 index 0000000000000..71685650c54fd --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/JpgLayer.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a JPEG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgLayer") +public class JpgLayer extends Layer { + /** + * The compression quality of the JPEG output. Range is from 0-100 and the + * default is 70. + */ + @JsonProperty(value = "quality") + private Integer quality; + + /** + * Get the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @return the quality value + */ + public Integer quality() { + return this.quality; + } + + /** + * Set the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @param quality the quality value to set + * @return the JpgLayer object itself. + */ + public JpgLayer withQuality(Integer quality) { + this.quality = quality; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Layer.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Layer.java new file mode 100644 index 0000000000000..3fda3d19eca24 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Layer.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The encoder can be configured to produce video and/or images (thumbnails) at + * different resolutions, by specifying a layer for each desired resolution. A + * layer represents the properties for the video or image at a resolution. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Layer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoLayer", value = VideoLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgLayer", value = JpgLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngLayer", value = PngLayer.class) +}) +public class Layer { + /** + * The width of the output video for this layer. The value can be absolute + * (in pixels) or relative (in percentage). For example 50% means the + * output video has half as many pixels in width as the input. + */ + @JsonProperty(value = "width") + private String width; + + /** + * The height of the output video for this layer. The value can be absolute + * (in pixels) or relative (in percentage). For example 50% means the + * output video has half as many pixels in height as the input. + */ + @JsonProperty(value = "height") + private String height; + + /** + * The alphanumeric label for this layer, which can be used in multiplexing + * different video and audio layers, or in naming the output file. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @return the width value + */ + public String width() { + return this.width; + } + + /** + * Set the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @param width the width value to set + * @return the Layer object itself. + */ + public Layer withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @return the height value + */ + public String height() { + return this.height; + } + + /** + * Set the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @param height the height value to set + * @return the Layer object itself. + */ + public Layer withHeight(String height) { + this.height = height; + return this; + } + + /** + * Get the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + * + * @param label the label value to set + * @return the Layer object itself. + */ + public Layer withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContainerSasInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContainerSasInput.java new file mode 100644 index 0000000000000..903f6b9507251 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContainerSasInput.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to the list SAS requet. + */ +public class ListContainerSasInput { + /** + * The permissions to set on the SAS URL. Possible values include: 'Read', + * 'ReadWrite', 'ReadWriteDelete'. + */ + @JsonProperty(value = "permissions") + private AssetContainerPermission permissions; + + /** + * The SAS URL expiration time. This must be less than 24 hours from the + * current time. + */ + @JsonProperty(value = "expiryTime") + private DateTime expiryTime; + + /** + * Get the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @return the permissions value + */ + public AssetContainerPermission permissions() { + return this.permissions; + } + + /** + * Set the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @param permissions the permissions value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withPermissions(AssetContainerPermission permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @return the expiryTime value + */ + public DateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @param expiryTime the expiryTime value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withExpiryTime(DateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContentKeysResponse.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContentKeysResponse.java new file mode 100644 index 0000000000000..6c9114cc9bcca --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListContentKeysResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.ListContentKeysResponseInner; +import java.util.List; + +/** + * Type representing ListContentKeysResponse. + */ +public interface ListContentKeysResponse extends HasInner, HasManager { + /** + * @return the contentKeys value. + */ + List contentKeys(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListPathsResponse.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListPathsResponse.java new file mode 100644 index 0000000000000..3b3db9e5f47d0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ListPathsResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.ListPathsResponseInner; +import java.util.List; + +/** + * Type representing ListPathsResponse. + */ +public interface ListPathsResponse extends HasInner, HasManager { + /** + * @return the downloadPaths value. + */ + List downloadPaths(); + + /** + * @return the streamingPaths value. + */ + List streamingPaths(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvent.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvent.java new file mode 100644 index 0000000000000..07f577c0fa4bb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvent.java @@ -0,0 +1,372 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.LiveEventInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing LiveEvent. + */ +public interface LiveEvent extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the encoding value. + */ + LiveEventEncoding encoding(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + LiveEventInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the preview value. + */ + LiveEventPreview preview(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveEventResourceState resourceState(); + + /** + * @return the streamOptions value. + */ + List streamOptions(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vanityUrl value. + */ + Boolean vanityUrl(); + + /** + * The entirety of the LiveEvent definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithInput, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveEvent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveEvent definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the liveevent definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the liveevent definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if auto start the Live Event + * @return the next definition stage + */ + WithInput withAutoStart(Boolean autoStart); + } + + /** + * The stage of the liveevent definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + * @param input The Live Event input + * @return the next definition stage + */ + WithCreate withInput(LiveEventInput input); + } + + /** + * The stage of the liveevent definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next definition stage + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Live Event description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveevent definition allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next definition stage + */ + WithCreate withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the liveevent definition allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + * @param preview The Live Event preview + * @return the next definition stage + */ + WithCreate withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent definition allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + * @param streamOptions The stream options + * @return the next definition stage + */ + WithCreate withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the liveevent definition allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + * @param vanityUrl The Live Event vanity URL flag + * @return the next definition stage + */ + WithCreate withVanityUrl(Boolean vanityUrl); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithDescription, DefinitionStages.WithEncoding, DefinitionStages.WithLocation, DefinitionStages.WithPreview, DefinitionStages.WithStreamOptions, DefinitionStages.WithTags, DefinitionStages.WithVanityUrl { + } + } + /** + * The template for a LiveEvent update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithDescription, UpdateStages.WithEncoding, UpdateStages.WithLocation, UpdateStages.WithPreview, UpdateStages.WithStreamOptions, UpdateStages.WithTags, UpdateStages.WithVanityUrl { + } + + /** + * Grouping of LiveEvent update stages. + */ + interface UpdateStages { + /** + * The stage of the liveevent update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next update stage + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Live Event description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the liveevent update allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next update stage + */ + Update withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the liveevent update allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + * @param preview The Live Event preview + * @return the next update stage + */ + Update withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent update allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + * @param streamOptions The stream options + * @return the next update stage + */ + Update withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the liveevent update allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + * @param vanityUrl The Live Event vanity URL flag + * @return the next update stage + */ + Update withVanityUrl(Boolean vanityUrl); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventActionInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventActionInput.java new file mode 100644 index 0000000000000..57d2a89c8967d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventActionInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LiveEvent action input parameter definition. + */ +public class LiveEventActionInput { + /** + * The flag indicates if remove LiveOutputs on Stop. + */ + @JsonProperty(value = "removeOutputsOnStop") + private Boolean removeOutputsOnStop; + + /** + * Get the flag indicates if remove LiveOutputs on Stop. + * + * @return the removeOutputsOnStop value + */ + public Boolean removeOutputsOnStop() { + return this.removeOutputsOnStop; + } + + /** + * Set the flag indicates if remove LiveOutputs on Stop. + * + * @param removeOutputsOnStop the removeOutputsOnStop value to set + * @return the LiveEventActionInput object itself. + */ + public LiveEventActionInput withRemoveOutputsOnStop(Boolean removeOutputsOnStop) { + this.removeOutputsOnStop = removeOutputsOnStop; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncoding.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncoding.java new file mode 100644 index 0000000000000..ce6212960eac9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncoding.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event encoding. + */ +public class LiveEventEncoding { + /** + * The encoding type for Live Event. Possible values include: 'None', + * 'Basic'. + */ + @JsonProperty(value = "encodingType") + private LiveEventEncodingType encodingType; + + /** + * The encoding preset name. + */ + @JsonProperty(value = "presetName") + private String presetName; + + /** + * Get the encoding type for Live Event. Possible values include: 'None', 'Basic'. + * + * @return the encodingType value + */ + public LiveEventEncodingType encodingType() { + return this.encodingType; + } + + /** + * Set the encoding type for Live Event. Possible values include: 'None', 'Basic'. + * + * @param encodingType the encodingType value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withEncodingType(LiveEventEncodingType encodingType) { + this.encodingType = encodingType; + return this; + } + + /** + * Get the encoding preset name. + * + * @return the presetName value + */ + public String presetName() { + return this.presetName; + } + + /** + * Set the encoding preset name. + * + * @param presetName the presetName value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withPresetName(String presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncodingType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncodingType.java new file mode 100644 index 0000000000000..1a85891e2f3e7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEncodingType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventEncodingType. + */ +public enum LiveEventEncodingType { + /** Enum value None. */ + NONE("None"), + + /** Enum value Basic. */ + BASIC("Basic"); + + /** The actual serialized value for a LiveEventEncodingType instance. */ + private String value; + + LiveEventEncodingType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventEncodingType instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventEncodingType object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventEncodingType fromString(String value) { + LiveEventEncodingType[] items = LiveEventEncodingType.values(); + for (LiveEventEncodingType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEndpoint.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEndpoint.java new file mode 100644 index 0000000000000..7854fc8fc5a18 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventEndpoint.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event endpoint. + */ +public class LiveEventEndpoint { + /** + * The endpoint protocol. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The endpoint URL. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Get the endpoint protocol. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the endpoint protocol. + * + * @param protocol the protocol value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the endpoint URL. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the endpoint URL. + * + * @param url the url value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInput.java new file mode 100644 index 0000000000000..1c27ac3a0fd0a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInput.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event input. + */ +public class LiveEventInput { + /** + * The streaming protocol for the Live Event. Possible values include: + * 'FragmentedMP4', 'RTMP'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private LiveEventInputProtocol streamingProtocol; + + /** + * ISO 8601 timespan duration of the key frame interval duration. + */ + @JsonProperty(value = "keyFrameIntervalDuration") + private String keyFrameIntervalDuration; + + /** + * The access token. + */ + @JsonProperty(value = "accessToken") + private String accessToken; + + /** + * The input endpoints for the Live Event. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * Get the streaming protocol for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @return the streamingProtocol value + */ + public LiveEventInputProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set the streaming protocol for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withStreamingProtocol(LiveEventInputProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get iSO 8601 timespan duration of the key frame interval duration. + * + * @return the keyFrameIntervalDuration value + */ + public String keyFrameIntervalDuration() { + return this.keyFrameIntervalDuration; + } + + /** + * Set iSO 8601 timespan duration of the key frame interval duration. + * + * @param keyFrameIntervalDuration the keyFrameIntervalDuration value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withKeyFrameIntervalDuration(String keyFrameIntervalDuration) { + this.keyFrameIntervalDuration = keyFrameIntervalDuration; + return this; + } + + /** + * Get the access token. + * + * @return the accessToken value + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Set the access token. + * + * @param accessToken the accessToken value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get the input endpoints for the Live Event. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the input endpoints for the Live Event. + * + * @param endpoints the endpoints value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInputProtocol.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInputProtocol.java new file mode 100644 index 0000000000000..0936e830e8598 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventInputProtocol.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventInputProtocol. + */ +public enum LiveEventInputProtocol { + /** Enum value FragmentedMP4. */ + FRAGMENTED_MP4("FragmentedMP4"), + + /** Enum value RTMP. */ + RTMP("RTMP"); + + /** The actual serialized value for a LiveEventInputProtocol instance. */ + private String value; + + LiveEventInputProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventInputProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventInputProtocol object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventInputProtocol fromString(String value) { + LiveEventInputProtocol[] items = LiveEventInputProtocol.values(); + for (LiveEventInputProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreview.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreview.java new file mode 100644 index 0000000000000..9f97539f91735 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreview.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event preview. + */ +public class LiveEventPreview { + /** + * The endpoints for preview. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * The access control for LiveEvent preview. + */ + @JsonProperty(value = "accessControl") + private LiveEventPreviewAccessControl accessControl; + + /** + * The preview locator Guid. + */ + @JsonProperty(value = "previewLocator") + private String previewLocator; + + /** + * The name of streaming policy used for LiveEvent preview. + */ + @JsonProperty(value = "streamingPolicyName") + private String streamingPolicyName; + + /** + * Get the endpoints for preview. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints for preview. + * + * @param endpoints the endpoints value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the access control for LiveEvent preview. + * + * @return the accessControl value + */ + public LiveEventPreviewAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control for LiveEvent preview. + * + * @param accessControl the accessControl value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withAccessControl(LiveEventPreviewAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the preview locator Guid. + * + * @return the previewLocator value + */ + public String previewLocator() { + return this.previewLocator; + } + + /** + * Set the preview locator Guid. + * + * @param previewLocator the previewLocator value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withPreviewLocator(String previewLocator) { + this.previewLocator = previewLocator; + return this; + } + + /** + * Get the name of streaming policy used for LiveEvent preview. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set the name of streaming policy used for LiveEvent preview. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreviewAccessControl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreviewAccessControl.java new file mode 100644 index 0000000000000..3ab8ff7c122f2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventPreviewAccessControl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control for Live Event preview. + */ +public class LiveEventPreviewAccessControl { + /** + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the IP access control properties. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control properties. + * + * @param ip the ip value to set + * @return the LiveEventPreviewAccessControl object itself. + */ + public LiveEventPreviewAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventResourceState.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventResourceState.java new file mode 100644 index 0000000000000..64484787ecda4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEventResourceState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventResourceState. + */ +public enum LiveEventResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveEventResourceState instance. */ + private String value; + + LiveEventResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventResourceState fromString(String value) { + LiveEventResourceState[] items = LiveEventResourceState.values(); + for (LiveEventResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvents.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvents.java new file mode 100644 index 0000000000000..e3fdd1b1058ac --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveEvents.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.LiveEventsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveEvents. + */ +public interface LiveEvents extends SupportsCreating, HasInner { + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutput.java new file mode 100644 index 0000000000000..e85d6028ff7f9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutput.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.LiveOutputInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import org.joda.time.Period; +import org.joda.time.DateTime; + +/** + * Type representing LiveOutput. + */ +public interface LiveOutput extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the archiveWindowLength value. + */ + Period archiveWindowLength(); + + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the hls value. + */ + Hls hls(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the manifestName value. + */ + String manifestName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputSnapTime value. + */ + Long outputSnapTime(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveOutputResourceState resourceState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the LiveOutput definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLiveEvent, DefinitionStages.WithArchiveWindowLength, DefinitionStages.WithAssetName, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveOutput definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveOutput definition. + */ + interface Blank extends WithLiveEvent { + } + + /** + * The stage of the liveoutput definition allowing to specify LiveEvent. + */ + interface WithLiveEvent { + /** + * Specifies resourceGroupName, accountName, liveEventName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param liveEventName The name of the Live Event + * @return the next definition stage + */ + WithArchiveWindowLength withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); + } + + /** + * The stage of the liveoutput definition allowing to specify ArchiveWindowLength. + */ + interface WithArchiveWindowLength { + /** + * Specifies archiveWindowLength. + * @param archiveWindowLength ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content + * @return the next definition stage + */ + WithAssetName withArchiveWindowLength(Period archiveWindowLength); + } + + /** + * The stage of the liveoutput definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + * @param assetName The asset name + * @return the next definition stage + */ + WithCreate withAssetName(String assetName); + } + + /** + * The stage of the liveoutput definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The description of the Live Output + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveoutput definition allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + * @param hls The HLS configuration + * @return the next definition stage + */ + WithCreate withHls(Hls hls); + } + + /** + * The stage of the liveoutput definition allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + * @param manifestName The manifest file name + * @return the next definition stage + */ + WithCreate withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput definition allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next definition stage + */ + WithCreate withOutputSnapTime(Long outputSnapTime); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithHls, DefinitionStages.WithManifestName, DefinitionStages.WithOutputSnapTime { + } + } + /** + * The template for a LiveOutput update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithHls, UpdateStages.WithManifestName, UpdateStages.WithOutputSnapTime { + } + + /** + * Grouping of LiveOutput update stages. + */ + interface UpdateStages { + /** + * The stage of the liveoutput update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The description of the Live Output + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the liveoutput update allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + * @param hls The HLS configuration + * @return the next update stage + */ + Update withHls(Hls hls); + } + + /** + * The stage of the liveoutput update allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + * @param manifestName The manifest file name + * @return the next update stage + */ + Update withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput update allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next update stage + */ + Update withOutputSnapTime(Long outputSnapTime); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputResourceState.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputResourceState.java new file mode 100644 index 0000000000000..04564d35ca120 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputResourceState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveOutputResourceState. + */ +public enum LiveOutputResourceState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveOutputResourceState instance. */ + private String value; + + LiveOutputResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveOutputResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveOutputResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveOutputResourceState fromString(String value) { + LiveOutputResourceState[] items = LiveOutputResourceState.values(); + for (LiveOutputResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputs.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputs.java new file mode 100644 index 0000000000000..b9e0bd6e4f7d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/LiveOutputs.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.LiveOutputsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveOutputs. + */ +public interface LiveOutputs extends SupportsCreating, HasInner { + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName); + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Locations.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Locations.java new file mode 100644 index 0000000000000..e3fb2cb838429 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Locations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName the String value + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MediaService.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MediaService.java new file mode 100644 index 0000000000000..2ae526276984d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MediaService.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaServiceInner; + +/** + * Type representing MediaService. + */ +public interface MediaService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * The entirety of the MediaService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of MediaService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MediaService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the MediaService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the mediaservice definition allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The storage accounts for this resource + * @return the next definition stage + */ + WithCreate withStorageAccounts(List storageAccounts); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithStorageAccounts { + } + } + /** + * The template for a MediaService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithStorageAccounts { + } + + /** + * Grouping of MediaService update stages. + */ + interface UpdateStages { + /** + * The stage of the mediaservice update allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The storage accounts for this resource + * @return the next update stage + */ + Update withStorageAccounts(List storageAccounts); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mediaservices.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mediaservices.java new file mode 100644 index 0000000000000..99eef9264c969 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mediaservices.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaservicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Mediaservices. + */ +public interface Mediaservices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable syncStorageKeysAsync(String resourceGroupName, String accountName); + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBySubscriptionAsync(String accountName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mp4Format.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mp4Format.java new file mode 100644 index 0000000000000..63332032070b5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Mp4Format.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for an output ISO MP4 file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Mp4Format") +public class Mp4Format extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MultiBitrateFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MultiBitrateFormat.java new file mode 100644 index 0000000000000..aaccd31209bef --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/MultiBitrateFormat.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for producing a collection of GOP aligned + * multi-bitrate files. The default behavior is to produce one output file for + * each video layer which is muxed together with all the audios. The exact + * output files produced can be controlled by specifying the outputFiles + * collection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.MultiBitrateFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Mp4Format", value = Mp4Format.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.TransportStreamFormat", value = TransportStreamFormat.class) +}) +public class MultiBitrateFormat extends Format { + /** + * The list of output files to produce. Each entry in the list is a set of + * audio and video layer labels to be muxed together . + */ + @JsonProperty(value = "outputFiles") + private List outputFiles; + + /** + * Get the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @return the outputFiles value + */ + public List outputFiles() { + return this.outputFiles; + } + + /** + * Set the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @param outputFiles the outputFiles value to set + * @return the MultiBitrateFormat object itself. + */ + public MultiBitrateFormat withOutputFiles(List outputFiles) { + this.outputFiles = outputFiles; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/NoEncryption.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/NoEncryption.java new file mode 100644 index 0000000000000..22b34b1d8c988 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/NoEncryption.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for NoEncryption scheme. + */ +public class NoEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the NoEncryption object itself. + */ + public NoEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ODataError.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ODataError.java new file mode 100644 index 0000000000000..5a4885f0f77d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/ODataError.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an error. + */ +public class ODataError { + /** + * A language-independent error name. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target of the error (for example, the name of the property in + * error). + */ + @JsonProperty(value = "target") + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get a language-independent error name. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set a language-independent error name. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the error (for example, the name of the property in error). + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the error (for example, the name of the property in error). + * + * @param target the target value to set + * @return the ODataError object itself. + */ + public ODataError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the error details. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OnErrorType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OnErrorType.java new file mode 100644 index 0000000000000..89f4512050451 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OnErrorType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OnErrorType. + */ +public enum OnErrorType { + /** Tells the service that if this TransformOutput fails, then any other incomplete TransformOutputs can be stopped. */ + STOP_PROCESSING_JOB("StopProcessingJob"), + + /** Tells the service that if this TransformOutput fails, then allow any other TransformOutput to continue. */ + CONTINUE_JOB("ContinueJob"); + + /** The actual serialized value for a OnErrorType instance. */ + private String value; + + OnErrorType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnErrorType instance. + * + * @param value the serialized value to parse. + * @return the parsed OnErrorType object, or null if unable to parse. + */ + @JsonCreator + public static OnErrorType fromString(String value) { + OnErrorType[] items = OnErrorType.values(); + for (OnErrorType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operation.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operation.java new file mode 100644 index 0000000000000..e777f2fcf8334 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OperationDisplay.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OperationDisplay.java new file mode 100644 index 0000000000000..02073e22457ec --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation details. + */ +public class OperationDisplay { + /** + * The service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the operation description. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operations.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operations.java new file mode 100644 index 0000000000000..a071ea0b5551a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OutputFile.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OutputFile.java new file mode 100644 index 0000000000000..e427e477da2a7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/OutputFile.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an output file produced. + */ +public class OutputFile { + /** + * The list of labels that describe how the encoder should multiplex video + * and audio into an output file. For example, if the encoder is producing + * two video layers with labels v1 and v2, and one audio layer with label + * a1, then an array like '[v1, a1]' tells the encoder to produce an output + * file with the video track represented by v1 and the audio track + * represented by a1. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Get the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @param labels the labels value to set + * @return the OutputFile object itself. + */ + public OutputFile withLabels(List labels) { + this.labels = labels; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Overlay.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Overlay.java new file mode 100644 index 0000000000000..2d70ec728d793 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Overlay.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all overlays - image, audio or video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Overlay") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioOverlay", value = AudioOverlay.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoOverlay", value = VideoOverlay.class) +}) +public class Overlay { + /** + * The label of the job input which is to be used as an overlay. The Input + * must specify exactly one file. You can specify an image file in JPG or + * PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or + * a video file. See https://aka.ms/mesformats for the complete list of + * supported audio and video file formats. + */ + @JsonProperty(value = "inputLabel") + private String inputLabel; + + /** + * The start position, with reference to the input video, at which the + * overlay starts. The value should be in ISO 8601 format. For example, + * PT05S to start the overlay at 5 seconds in to the input video. If not + * specified the overlay starts from the beginning of the input video. + */ + @JsonProperty(value = "start") + private Period start; + + /** + * The position in the input video at which the overlay ends. The value + * should be in ISO 8601 duration format. For example, PT30S to end the + * overlay at 30 seconds in to the input video. If not specified the + * overlay will be applied until the end of the input video if inputLoop is + * true. Else, if inputLoop is false, then overlay will last as long as the + * duration of the overlay media. + */ + @JsonProperty(value = "end") + private Period end; + + /** + * The duration over which the overlay fades in onto the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade in (same as PT0S). + */ + @JsonProperty(value = "fadeInDuration") + private Period fadeInDuration; + + /** + * The duration over which the overlay fades out of the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade out (same as PT0S). + */ + @JsonProperty(value = "fadeOutDuration") + private Period fadeOutDuration; + + /** + * The gain level of audio in the overlay. The value should be in the range + * [0, 1.0]. The default is 1.0. + */ + @JsonProperty(value = "audioGainLevel") + private Double audioGainLevel; + + /** + * Get the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @return the inputLabel value + */ + public String inputLabel() { + return this.inputLabel; + } + + /** + * Set the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @param inputLabel the inputLabel value to set + * @return the Overlay object itself. + */ + public Overlay withInputLabel(String inputLabel) { + this.inputLabel = inputLabel; + return this; + } + + /** + * Get the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @return the start value + */ + public Period start() { + return this.start; + } + + /** + * Set the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @param start the start value to set + * @return the Overlay object itself. + */ + public Overlay withStart(Period start) { + this.start = start; + return this; + } + + /** + * Get the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @return the end value + */ + public Period end() { + return this.end; + } + + /** + * Set the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @param end the end value to set + * @return the Overlay object itself. + */ + public Overlay withEnd(Period end) { + this.end = end; + return this; + } + + /** + * Get the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @return the fadeInDuration value + */ + public Period fadeInDuration() { + return this.fadeInDuration; + } + + /** + * Set the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @param fadeInDuration the fadeInDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeInDuration(Period fadeInDuration) { + this.fadeInDuration = fadeInDuration; + return this; + } + + /** + * Get the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @return the fadeOutDuration value + */ + public Period fadeOutDuration() { + return this.fadeOutDuration; + } + + /** + * Set the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @param fadeOutDuration the fadeOutDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeOutDuration(Period fadeOutDuration) { + this.fadeOutDuration = fadeOutDuration; + return this; + } + + /** + * Get the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @return the audioGainLevel value + */ + public Double audioGainLevel() { + return this.audioGainLevel; + } + + /** + * Set the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @param audioGainLevel the audioGainLevel value to set + * @return the Overlay object itself. + */ + public Overlay withAudioGainLevel(Double audioGainLevel) { + this.audioGainLevel = audioGainLevel; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngFormat.java new file mode 100644 index 0000000000000..81aa564d8af7a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing PNG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngFormat") +public class PngFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngImage.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngImage.java new file mode 100644 index 0000000000000..a584cff4101bc --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of PNG images from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngImage") +public class PngImage extends Image { + /** + * A collection of output PNG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output PNG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output PNG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the PngImage object itself. + */ + public PngImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngLayer.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngLayer.java new file mode 100644 index 0000000000000..ed7991304abde --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/PngLayer.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a PNG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngLayer") +public class PngLayer extends Layer { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Preset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Preset.java new file mode 100644 index 0000000000000..393aec8e1c012 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Preset.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all Presets, which define the recipe or instructions on how + * the input media files should be processed. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Preset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioAnalyzerPreset", value = AudioAnalyzerPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.BuiltInStandardEncoderPreset", value = BuiltInStandardEncoderPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.StandardEncoderPreset", value = StandardEncoderPreset.class) +}) +public class Preset { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Priority.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Priority.java new file mode 100644 index 0000000000000..7562f5b7c7cc4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Priority.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Priority. + */ +public enum Priority { + /** Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. */ + LOW("Low"), + + /** Used for TransformOutputs that can be generated at Normal priority. */ + NORMAL("Normal"), + + /** Used for TransformOutputs that should take precedence over others. */ + HIGH("High"); + + /** The actual serialized value for a Priority instance. */ + private String value; + + Priority(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Priority instance. + * + * @param value the serialized value to parse. + * @return the parsed Priority object, or null if unable to parse. + */ + @JsonCreator + public static Priority fromString(String value) { + Priority[] items = Priority.values(); + for (Priority item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Provider.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Provider.java new file mode 100644 index 0000000000000..15731386c5c6c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Provider.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource provider. + */ +public class Provider { + /** + * The provider name. + */ + @JsonProperty(value = "providerName", required = true) + private String providerName; + + /** + * Get the provider name. + * + * @return the providerName value + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the provider name. + * + * @param providerName the providerName value to set + * @return the Provider object itself. + */ + public Provider withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rectangle.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rectangle.java new file mode 100644 index 0000000000000..c6bd98651fbc8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rectangle.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a rectangular window applied to the input media + * before processing it. + */ +public class Rectangle { + /** + * The number of pixels from the left-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "left") + private String left; + + /** + * The number of pixels from the top-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "top") + private String top; + + /** + * The width of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "width") + private String width; + + /** + * The height of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "height") + private String height; + + /** + * Get the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the left value + */ + public String left() { + return this.left; + } + + /** + * Set the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param left the left value to set + * @return the Rectangle object itself. + */ + public Rectangle withLeft(String left) { + this.left = left; + return this; + } + + /** + * Get the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the top value + */ + public String top() { + return this.top; + } + + /** + * Set the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param top the top value to set + * @return the Rectangle object itself. + */ + public Rectangle withTop(String top) { + this.top = top; + return this; + } + + /** + * Get the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the width value + */ + public String width() { + return this.width; + } + + /** + * Set the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param width the width value to set + * @return the Rectangle object itself. + */ + public Rectangle withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the height value + */ + public String height() { + return this.height; + } + + /** + * Set the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param height the height value to set + * @return the Rectangle object itself. + */ + public Rectangle withHeight(String height) { + this.height = height; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rotation.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rotation.java new file mode 100644 index 0000000000000..2e8e0ff248d30 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Rotation.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Rotation. + */ +public enum Rotation { + /** Automatically detect and rotate as needed. */ + AUTO("Auto"), + + /** Do not rotate the video. If the output format supports it, any metadata about rotation is kept intact. */ + NONE("None"), + + /** Do not rotate the video but remove any metadata about the rotation. */ + ROTATE0("Rotate0"), + + /** Rotate 90 degrees clockwise. */ + ROTATE90("Rotate90"), + + /** Rotate 180 degrees clockwise. */ + ROTATE180("Rotate180"), + + /** Rotate 270 degrees clockwise. */ + ROTATE270("Rotate270"); + + /** The actual serialized value for a Rotation instance. */ + private String value; + + Rotation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Rotation instance. + * + * @param value the serialized value to parse. + * @return the parsed Rotation object, or null if unable to parse. + */ + @JsonCreator + public static Rotation fromString(String value) { + Rotation[] items = Rotation.values(); + for (Rotation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StandardEncoderPreset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StandardEncoderPreset.java new file mode 100644 index 0000000000000..9a0dec70a0e19 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StandardEncoderPreset.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the settings to be used when encoding the input video with the + * Standard Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.StandardEncoderPreset") +public class StandardEncoderPreset extends Preset { + /** + * One or more filtering operations that are applied to the input media + * before encoding. + */ + @JsonProperty(value = "filters") + private Filters filters; + + /** + * The list of codecs to be used when encoding the input video. + */ + @JsonProperty(value = "codecs") + private List codecs; + + /** + * The list of outputs to be produced by the encoder. + */ + @JsonProperty(value = "formats") + private List formats; + + /** + * Get one or more filtering operations that are applied to the input media before encoding. + * + * @return the filters value + */ + public Filters filters() { + return this.filters; + } + + /** + * Set one or more filtering operations that are applied to the input media before encoding. + * + * @param filters the filters value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFilters(Filters filters) { + this.filters = filters; + return this; + } + + /** + * Get the list of codecs to be used when encoding the input video. + * + * @return the codecs value + */ + public List codecs() { + return this.codecs; + } + + /** + * Set the list of codecs to be used when encoding the input video. + * + * @param codecs the codecs value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withCodecs(List codecs) { + this.codecs = codecs; + return this; + } + + /** + * Get the list of outputs to be produced by the encoder. + * + * @return the formats value + */ + public List formats() { + return this.formats; + } + + /** + * Set the list of outputs to be produced by the encoder. + * + * @param formats the formats value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFormats(List formats) { + this.formats = formats; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccount.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccount.java new file mode 100644 index 0000000000000..23b893b22eafc --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccount.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account details. + */ +public class StorageAccount { + /** + * The ID of the storage account resource. Media Services relies on tables + * and queues as well as blobs, so the primary storage account must be a + * Standard Storage account (either Microsoft.ClassicStorage or + * Microsoft.Storage). Blob only storage accounts can be added as secondary + * storage accounts. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The type of the storage account. Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "type", required = true) + private StorageAccountType type; + + /** + * Get the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @param id the id value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @return the type value + */ + public StorageAccountType type() { + return this.type; + } + + /** + * Set the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @param type the type value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withType(StorageAccountType type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccountType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccountType.java new file mode 100644 index 0000000000000..17300b439e51a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StorageAccountType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountType. + */ +public enum StorageAccountType { + /** The primary storage account for the Media Services account. */ + PRIMARY("Primary"), + + /** A secondary storage account for the Media Services account. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a StorageAccountType instance. */ + private String value; + + StorageAccountType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountType instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountType object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountType fromString(String value) { + StorageAccountType[] items = StorageAccountType.values(); + for (StorageAccountType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamOptionsFlag.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamOptionsFlag.java new file mode 100644 index 0000000000000..76240597a7590 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamOptionsFlag.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamOptionsFlag. + */ +public enum StreamOptionsFlag { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value LowLatency. */ + LOW_LATENCY("LowLatency"); + + /** The actual serialized value for a StreamOptionsFlag instance. */ + private String value; + + StreamOptionsFlag(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamOptionsFlag instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamOptionsFlag object, or null if unable to parse. + */ + @JsonCreator + public static StreamOptionsFlag fromString(String value) { + StreamOptionsFlag[] items = StreamOptionsFlag.values(); + for (StreamOptionsFlag item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoint.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoint.java new file mode 100644 index 0000000000000..dfc8d5fc3fc8d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoint.java @@ -0,0 +1,481 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingEndpointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing StreamingEndpoint. + */ +public interface StreamingEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessControl value. + */ + StreamingEndpointAccessControl accessControl(); + + /** + * @return the availabilitySetName value. + */ + String availabilitySetName(); + + /** + * @return the cdnEnabled value. + */ + Boolean cdnEnabled(); + + /** + * @return the cdnProfile value. + */ + String cdnProfile(); + + /** + * @return the cdnProvider value. + */ + String cdnProvider(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the customHostNames value. + */ + List customHostNames(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the freeTrialEndTime value. + */ + DateTime freeTrialEndTime(); + + /** + * @return the hostName value. + */ + String hostName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maxCacheAge value. + */ + Long maxCacheAge(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + StreamingEndpointResourceState resourceState(); + + /** + * @return the scaleUnits value. + */ + int scaleUnits(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingEndpoint definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingendpoint definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if auto start the Live Event + * @return the next definition stage + */ + WithCreate withAutoStart(Boolean autoStart); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next definition stage + */ + WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + * @param availabilitySetName AvailabilitySet name + * @return the next definition stage + */ + WithCreate withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next definition stage + */ + WithCreate withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next definition stage + */ + WithCreate withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next definition stage + */ + WithCreate withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next definition stage + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next definition stage + */ + WithCreate withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The StreamingEndpoint description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the streamingendpoint definition allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next definition stage + */ + WithCreate withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint definition allowing to specify ScaleUnits. + */ + interface WithScaleUnits { + /** + * Specifies scaleUnits. + * @param scaleUnits The number of scale units + * @return the next definition stage + */ + WithCreate withScaleUnits(int scaleUnits); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAccessControl, DefinitionStages.WithAvailabilitySetName, DefinitionStages.WithCdnEnabled, DefinitionStages.WithCdnProfile, DefinitionStages.WithCdnProvider, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithCustomHostNames, DefinitionStages.WithDescription, DefinitionStages.WithLocation, DefinitionStages.WithMaxCacheAge, DefinitionStages.WithScaleUnits, DefinitionStages.WithTags { + } + } + /** + * The template for a StreamingEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAccessControl, UpdateStages.WithAvailabilitySetName, UpdateStages.WithCdnEnabled, UpdateStages.WithCdnProfile, UpdateStages.WithCdnProvider, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithCustomHostNames, UpdateStages.WithDescription, UpdateStages.WithLocation, UpdateStages.WithMaxCacheAge, UpdateStages.WithScaleUnits, UpdateStages.WithTags { + } + + /** + * Grouping of StreamingEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingendpoint update allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next update stage + */ + Update withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint update allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + * @param availabilitySetName AvailabilitySet name + * @return the next update stage + */ + Update withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next update stage + */ + Update withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next update stage + */ + Update withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next update stage + */ + Update withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next update stage + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint update allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next update stage + */ + Update withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The StreamingEndpoint description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the streamingendpoint update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the streamingendpoint update allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next update stage + */ + Update withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint update allowing to specify ScaleUnits. + */ + interface WithScaleUnits { + /** + * Specifies scaleUnits. + * @param scaleUnits The number of scale units + * @return the next update stage + */ + Update withScaleUnits(int scaleUnits); + } + + /** + * The stage of the streamingendpoint update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointAccessControl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointAccessControl.java new file mode 100644 index 0000000000000..cea1e964eba1c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointAccessControl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * StreamingEndpoint access control definition. + */ +public class StreamingEndpointAccessControl { + /** + * The access control of Akamai. + */ + @JsonProperty(value = "akamai") + private AkamaiAccessControl akamai; + + /** + * The IP access control of the StreamingEndpoint. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the access control of Akamai. + * + * @return the akamai value + */ + public AkamaiAccessControl akamai() { + return this.akamai; + } + + /** + * Set the access control of Akamai. + * + * @param akamai the akamai value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withAkamai(AkamaiAccessControl akamai) { + this.akamai = akamai; + return this; + } + + /** + * Get the IP access control of the StreamingEndpoint. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control of the StreamingEndpoint. + * + * @param ip the ip value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointResourceState.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointResourceState.java new file mode 100644 index 0000000000000..7a0629544eb23 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpointResourceState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingEndpointResourceState. + */ +public enum StreamingEndpointResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Scaling. */ + SCALING("Scaling"); + + /** The actual serialized value for a StreamingEndpointResourceState instance. */ + private String value; + + StreamingEndpointResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingEndpointResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingEndpointResourceState object, or null if unable to parse. + */ + @JsonCreator + public static StreamingEndpointResourceState fromString(String value) { + StreamingEndpointResourceState[] items = StreamingEndpointResourceState.values(); + for (StreamingEndpointResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoints.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoints.java new file mode 100644 index 0000000000000..c54743f39da62 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEndpoints.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingEndpoints. + */ +public interface StreamingEndpoints extends SupportsCreating, HasInner { + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEntityScaleUnit.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEntityScaleUnit.java new file mode 100644 index 0000000000000..ad237c7545826 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingEntityScaleUnit.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * scale units definition. + */ +public class StreamingEntityScaleUnit { + /** + * ScaleUnit. + * The scale unit number of the StreamingEndpoint. + */ + @JsonProperty(value = "scaleUnit") + private Integer scaleUnit; + + /** + * Get the scale unit number of the StreamingEndpoint. + * + * @return the scaleUnit value + */ + public Integer scaleUnit() { + return this.scaleUnit; + } + + /** + * Set the scale unit number of the StreamingEndpoint. + * + * @param scaleUnit the scaleUnit value to set + * @return the StreamingEntityScaleUnit object itself. + */ + public StreamingEntityScaleUnit withScaleUnit(Integer scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocator.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocator.java new file mode 100644 index 0000000000000..40b58981b5029 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocator.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingLocatorInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; + +/** + * Type representing StreamingLocator. + */ +public interface StreamingLocator extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the contentKeys value. + */ + List contentKeys(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the streamingLocatorId value. + */ + UUID streamingLocatorId(); + + /** + * @return the streamingPolicyName value. + */ + String streamingPolicyName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingLocator definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAssetName, DefinitionStages.WithStreamingPolicyName, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingLocator definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingLocator definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streaminglocator definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAssetName withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streaminglocator definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + * @param assetName Asset Name + * @return the next definition stage + */ + WithStreamingPolicyName withAssetName(String assetName); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingPolicyName. + */ + interface WithStreamingPolicyName { + /** + * Specifies streamingPolicyName. + * @param streamingPolicyName Streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay' + * @return the next definition stage + */ + WithCreate withStreamingPolicyName(String streamingPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + * @param contentKeys ContentKeys used by this Streaming Locator + * @return the next definition stage + */ + WithCreate withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKeyPolicy used by this Streaming Locator + * @return the next definition stage + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + * @param endTime EndTime of Streaming Locator + * @return the next definition stage + */ + WithCreate withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + * @param startTime StartTime of Streaming Locator + * @return the next definition stage + */ + WithCreate withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + * @param streamingLocatorId StreamingLocatorId of Streaming Locator + * @return the next definition stage + */ + WithCreate withStreamingLocatorId(UUID streamingLocatorId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithContentKeys, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEndTime, DefinitionStages.WithStartTime, DefinitionStages.WithStreamingLocatorId { + } + } + /** + * The template for a StreamingLocator update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithContentKeys, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEndTime, UpdateStages.WithStartTime, UpdateStages.WithStreamingLocatorId { + } + + /** + * Grouping of StreamingLocator update stages. + */ + interface UpdateStages { + /** + * The stage of the streaminglocator update allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + * @param contentKeys ContentKeys used by this Streaming Locator + * @return the next update stage + */ + Update withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKeyPolicy used by this Streaming Locator + * @return the next update stage + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator update allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + * @param endTime EndTime of Streaming Locator + * @return the next update stage + */ + Update withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + * @param startTime StartTime of Streaming Locator + * @return the next update stage + */ + Update withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + * @param streamingLocatorId StreamingLocatorId of Streaming Locator + * @return the next update stage + */ + Update withStreamingLocatorId(UUID streamingLocatorId); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKey.java new file mode 100644 index 0000000000000..e6fec4e95142d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKey.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for content key in Streaming Locator. + */ +public class StreamingLocatorContentKey { + /** + * Label of Content Key. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Encryption type of Content Key. Possible values include: + * 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + */ + @JsonProperty(value = "type", required = true) + private StreamingLocatorContentKeyType type; + + /** + * ID of Content Key. + */ + @JsonProperty(value = "id", required = true) + private UUID id; + + /** + * Value of of Content Key. + */ + @JsonProperty(value = "value") + private String value; + + /** + * ContentKeyPolicy used by Content Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Tracks which use this Content Key. + */ + @JsonProperty(value = "tracks") + private List tracks; + + /** + * Get label of Content Key. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label of Content Key. + * + * @param label the label value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + * + * @return the type value + */ + public StreamingLocatorContentKeyType type() { + return this.type; + } + + /** + * Set encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + * + * @param type the type value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withType(StreamingLocatorContentKeyType type) { + this.type = type; + return this; + } + + /** + * Get iD of Content Key. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Set iD of Content Key. + * + * @param id the id value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get value of of Content Key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of of Content Key. + * + * @param value the value value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withValue(String value) { + this.value = value; + return this; + } + + /** + * Get contentKeyPolicy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set contentKeyPolicy used by Content Key. + * + * @param policyName the policyName value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get tracks which use this Content Key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set tracks which use this Content Key. + * + * @param tracks the tracks value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKeyType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKeyType.java new file mode 100644 index 0000000000000..148b7b20938df --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorContentKeyType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingLocatorContentKeyType. + */ +public enum StreamingLocatorContentKeyType { + /** Common Encryption using CENC. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** Common Encryption using CBCS. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"), + + /** Envelope Encryption. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"); + + /** The actual serialized value for a StreamingLocatorContentKeyType instance. */ + private String value; + + StreamingLocatorContentKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingLocatorContentKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingLocatorContentKeyType object, or null if unable to parse. + */ + @JsonCreator + public static StreamingLocatorContentKeyType fromString(String value) { + StreamingLocatorContentKeyType[] items = StreamingLocatorContentKeyType.values(); + for (StreamingLocatorContentKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorUserDefinedContentKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorUserDefinedContentKey.java similarity index 97% rename from mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorUserDefinedContentKey.java rename to mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorUserDefinedContentKey.java index a6212c3951ce8..0ae4306a39174 100644 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorUserDefinedContentKey.java +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocatorUserDefinedContentKey.java @@ -6,7 +6,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocators.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocators.java new file mode 100644 index 0000000000000..e5f7c2eaf5181 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingLocators.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingLocatorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingLocators. + */ +public interface StreamingLocators extends SupportsCreating, HasInner { + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPath.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPath.java new file mode 100644 index 0000000000000..64c1a460de0cb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPath.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of paths for streaming. + */ +public class StreamingPath { + /** + * Streaming protocol. Possible values include: 'Hls', 'Dash', + * 'SmoothStreaming', 'Download'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private StreamingPolicyStreamingProtocol streamingProtocol; + + /** + * Encryption scheme. Possible values include: 'NoEncryption', + * 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + */ + @JsonProperty(value = "encryptionScheme", required = true) + private EncryptionScheme encryptionScheme; + + /** + * Streaming paths for each protocol and encryptionScheme pair. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @return the streamingProtocol value + */ + public StreamingPolicyStreamingProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withStreamingProtocol(StreamingPolicyStreamingProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @return the encryptionScheme value + */ + public EncryptionScheme encryptionScheme() { + return this.encryptionScheme; + } + + /** + * Set encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @param encryptionScheme the encryptionScheme value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withEncryptionScheme(EncryptionScheme encryptionScheme) { + this.encryptionScheme = encryptionScheme; + return this; + } + + /** + * Get streaming paths for each protocol and encryptionScheme pair. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set streaming paths for each protocol and encryptionScheme pair. + * + * @param paths the paths value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withPaths(List paths) { + this.paths = paths; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicies.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicies.java new file mode 100644 index 0000000000000..92b2a44c9f5fb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicies.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingPolicies. + */ +public interface StreamingPolicies extends SupportsCreating, HasInner { + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicy.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicy.java new file mode 100644 index 0000000000000..0d6c87ee27980 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicy.java @@ -0,0 +1,239 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.StreamingPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import org.joda.time.DateTime; + +/** + * Type representing StreamingPolicy. + */ +public interface StreamingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the commonEncryptionCbcs value. + */ + CommonEncryptionCbcs commonEncryptionCbcs(); + + /** + * @return the commonEncryptionCenc value. + */ + CommonEncryptionCenc commonEncryptionCenc(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the envelopeEncryption value. + */ + EnvelopeEncryption envelopeEncryption(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the noEncryption value. + */ + NoEncryption noEncryption(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingpolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next definition stage + */ + WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next definition stage + */ + WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next definition stage + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next definition stage + */ + WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy definition allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + * @param noEncryption Configuations of NoEncryption + * @return the next definition stage + */ + WithCreate withNoEncryption(NoEncryption noEncryption); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCommonEncryptionCbcs, DefinitionStages.WithCommonEncryptionCenc, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEnvelopeEncryption, DefinitionStages.WithNoEncryption { + } + } + /** + * The template for a StreamingPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCommonEncryptionCbcs, UpdateStages.WithCommonEncryptionCenc, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEnvelopeEncryption, UpdateStages.WithNoEncryption { + } + + /** + * Grouping of StreamingPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next update stage + */ + Update withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next update stage + */ + Update withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next update stage + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy update allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next update stage + */ + Update withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy update allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + * @param noEncryption Configuations of NoEncryption + * @return the next update stage + */ + Update withNoEncryption(NoEncryption noEncryption); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKey.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKey.java new file mode 100644 index 0000000000000..ab6f82dc7186d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKey.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of content key. + */ +public class StreamingPolicyContentKey { + /** + * Label can be used to specify Content Key when creating Stremaing + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Content Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Tracks which use this content key. + */ + @JsonProperty(value = "tracks") + private List tracks; + + /** + * Get label can be used to specify Content Key when creating Stremaing Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating Stremaing Locator. + * + * @param label the label value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Content Key. + * + * @param policyName the policyName value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get tracks which use this content key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set tracks which use this content key. + * + * @param tracks the tracks value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKeys.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKeys.java new file mode 100644 index 0000000000000..6b30435e9bbdb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyContentKeys.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of all content keys in Streaming Policy. + */ +public class StreamingPolicyContentKeys { + /** + * Default content key for an encryption scheme. + */ + @JsonProperty(value = "defaultKey") + private DefaultKey defaultKey; + + /** + * Representing tracks needs sepearete content key. + */ + @JsonProperty(value = "keyToTrackMappings") + private List keyToTrackMappings; + + /** + * Get default content key for an encryption scheme. + * + * @return the defaultKey value + */ + public DefaultKey defaultKey() { + return this.defaultKey; + } + + /** + * Set default content key for an encryption scheme. + * + * @param defaultKey the defaultKey value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withDefaultKey(DefaultKey defaultKey) { + this.defaultKey = defaultKey; + return this; + } + + /** + * Get representing tracks needs sepearete content key. + * + * @return the keyToTrackMappings value + */ + public List keyToTrackMappings() { + return this.keyToTrackMappings; + } + + /** + * Set representing tracks needs sepearete content key. + * + * @param keyToTrackMappings the keyToTrackMappings value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withKeyToTrackMappings(List keyToTrackMappings) { + this.keyToTrackMappings = keyToTrackMappings; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyFairPlayConfiguration.java new file mode 100644 index 0000000000000..22a86154db1a7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyFairPlayConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of FairPlay in Streaming Policy. + */ +public class StreamingPolicyFairPlayConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * All license to be persistent or not. + */ + @JsonProperty(value = "allowPersistentLicense", required = true) + private boolean allowPersistentLicense; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get all license to be persistent or not. + * + * @return the allowPersistentLicense value + */ + public boolean allowPersistentLicense() { + return this.allowPersistentLicense; + } + + /** + * Set all license to be persistent or not. + * + * @param allowPersistentLicense the allowPersistentLicense value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withAllowPersistentLicense(boolean allowPersistentLicense) { + this.allowPersistentLicense = allowPersistentLicense; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyPlayReadyConfiguration.java new file mode 100644 index 0000000000000..1d5d9123dfed6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyPlayReadyConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of PlayReady in Streaming Policy. + */ +public class StreamingPolicyPlayReadyConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Custom attributes for PlayReady. + */ + @JsonProperty(value = "playReadyCustomAttributes") + private String playReadyCustomAttributes; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get custom attributes for PlayReady. + * + * @return the playReadyCustomAttributes value + */ + public String playReadyCustomAttributes() { + return this.playReadyCustomAttributes; + } + + /** + * Set custom attributes for PlayReady. + * + * @param playReadyCustomAttributes the playReadyCustomAttributes value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withPlayReadyCustomAttributes(String playReadyCustomAttributes) { + this.playReadyCustomAttributes = playReadyCustomAttributes; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyStreamingProtocol.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyStreamingProtocol.java new file mode 100644 index 0000000000000..12ae91b35cba6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyStreamingProtocol.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingPolicyStreamingProtocol. + */ +public enum StreamingPolicyStreamingProtocol { + /** HLS protocol. */ + HLS("Hls"), + + /** DASH protocol. */ + DASH("Dash"), + + /** SmoothStreaming protocol. */ + SMOOTH_STREAMING("SmoothStreaming"), + + /** Download protocol. */ + DOWNLOAD("Download"); + + /** The actual serialized value for a StreamingPolicyStreamingProtocol instance. */ + private String value; + + StreamingPolicyStreamingProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingPolicyStreamingProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingPolicyStreamingProtocol object, or null if unable to parse. + */ + @JsonCreator + public static StreamingPolicyStreamingProtocol fromString(String value) { + StreamingPolicyStreamingProtocol[] items = StreamingPolicyStreamingProtocol.values(); + for (StreamingPolicyStreamingProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyWidevineConfiguration.java new file mode 100644 index 0000000000000..8ef791ace3e3a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StreamingPolicyWidevineConfiguration.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of Widevine in Streaming Policy. + */ +public class StreamingPolicyWidevineConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyWidevineConfiguration object itself. + */ + public StreamingPolicyWidevineConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StretchMode.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StretchMode.java new file mode 100644 index 0000000000000..837b2be6acb0e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/StretchMode.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StretchMode. + */ +public enum StretchMode { + /** Strictly respect the output resolution without considering the pixel aspect ratio or display aspect ratio of the input video. */ + NONE("None"), + + /** Override the output resolution, and change it to match the display aspect ratio of the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which maintains the input aspect ratio of 16:9. */ + AUTO_SIZE("AutoSize"), + + /** Pad the output (with either letterbox or pillar box) to honor the output resolution, while ensuring that the active video region in the output has the same aspect ratio as the input. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box regions 280 pixels wide at the left and right. */ + AUTO_FIT("AutoFit"); + + /** The actual serialized value for a StretchMode instance. */ + private String value; + + StretchMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StretchMode instance. + * + * @param value the serialized value to parse. + * @return the parsed StretchMode object, or null if unable to parse. + */ + @JsonCreator + public static StretchMode fromString(String value) { + StretchMode[] items = StretchMode.values(); + for (StretchMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SubscriptionMediaService.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SubscriptionMediaService.java new file mode 100644 index 0000000000000..271bf2ae49405 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SubscriptionMediaService.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.SubscriptionMediaServiceInner; +import java.util.UUID; +import java.util.List; +import java.util.Map; + +/** + * Type representing SubscriptionMediaService. + */ +public interface SubscriptionMediaService extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SyncStorageKeysInput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SyncStorageKeysInput.java new file mode 100644 index 0000000000000..477f9c657d794 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/SyncStorageKeysInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the sync storage keys request. + */ +public class SyncStorageKeysInput { + /** + * The ID of the storage account resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ID of the storage account resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. + * + * @param id the id value to set + * @return the SyncStorageKeysInput object itself. + */ + public SyncStorageKeysInput withId(String id) { + this.id = id; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCompareOperation.java new file mode 100644 index 0000000000000..89c1f38e65cc8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCompareOperation.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyCompareOperation. + */ +public enum TrackPropertyCompareOperation { + /** Unknown track property compare operation. */ + UNKNOWN("Unknown"), + + /** Equal operation. */ + EQUAL("Equal"); + + /** The actual serialized value for a TrackPropertyCompareOperation instance. */ + private String value; + + TrackPropertyCompareOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyCompareOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyCompareOperation object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyCompareOperation fromString(String value) { + TrackPropertyCompareOperation[] items = TrackPropertyCompareOperation.values(); + for (TrackPropertyCompareOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCondition.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCondition.java new file mode 100644 index 0000000000000..ab44d40d1235e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyCondition.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify one track property condition. + */ +public class TrackPropertyCondition { + /** + * Track property type. Possible values include: 'Unknown', 'FourCC'. + */ + @JsonProperty(value = "property", required = true) + private TrackPropertyType property; + + /** + * Track property condition operation. Possible values include: 'Unknown', + * 'Equal'. + */ + @JsonProperty(value = "operation", required = true) + private TrackPropertyCompareOperation operation; + + /** + * Track proprty value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @return the property value + */ + public TrackPropertyType property() { + return this.property; + } + + /** + * Set track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @param property the property value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withProperty(TrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @return the operation value + */ + public TrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @param operation the operation value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withOperation(TrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + + /** + * Get track proprty value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set track proprty value. + * + * @param value the value value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyType.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyType.java new file mode 100644 index 0000000000000..552aa78e4ca68 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackPropertyType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyType. + */ +public enum TrackPropertyType { + /** Unknown track property. */ + UNKNOWN("Unknown"), + + /** Track FourCC. */ + FOUR_CC("FourCC"); + + /** The actual serialized value for a TrackPropertyType instance. */ + private String value; + + TrackPropertyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyType instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyType object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyType fromString(String value) { + TrackPropertyType[] items = TrackPropertyType.values(); + for (TrackPropertyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackSelection.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackSelection.java new file mode 100644 index 0000000000000..a3bdc2f481cb1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TrackSelection.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to select a track. + */ +public class TrackSelection { + /** + * TrackSelections is a track property condition list which can specify + * track(s). + */ + @JsonProperty(value = "trackSelections") + private List trackSelections; + + /** + * Get trackSelections is a track property condition list which can specify track(s). + * + * @return the trackSelections value + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set trackSelections is a track property condition list which can specify track(s). + * + * @param trackSelections the trackSelections value to set + * @return the TrackSelection object itself. + */ + public TrackSelection withTrackSelections(List trackSelections) { + this.trackSelections = trackSelections; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transform.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transform.java new file mode 100644 index 0000000000000..c81e679cb47aa --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transform.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.TransformInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Transform. + */ +public interface Transform extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Transform definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Transform definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Transform definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the transform definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithOutputs withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the transform definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + * @param outputs An array of one or more TransformOutputs that the Transform should generate + * @return the next definition stage + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the transform definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a Transform update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of Transform update stages. + */ + interface UpdateStages { + /** + * The stage of the transform update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next update stage + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransformOutput.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransformOutput.java new file mode 100644 index 0000000000000..92aaf9220b0f1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransformOutput.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a TransformOutput, which are the rules to be + * applied while generating the desired output. + */ +public class TransformOutput { + /** + * A Transform can define more than one outputs. This property defines what + * the service should do when one output fails - either continue to produce + * other outputs, or, stop the other outputs. The default is stop. Possible + * values include: 'StopProcessingJob', 'ContinueJob'. + */ + @JsonProperty(value = "onError") + private OnErrorType onError; + + /** + * Sets the relative priority of the TransformOutputs within a Transform. + * This sets the priority that the service uses for processing + * TransformOutputs. The default priority is Normal. Possible values + * include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "relativePriority") + private Priority relativePriority; + + /** + * Preset that describes the operations that will be used to modify, + * transcode, or extract insights from the source file to generate the + * output. + */ + @JsonProperty(value = "preset", required = true) + private Preset preset; + + /** + * Get a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @return the onError value + */ + public OnErrorType onError() { + return this.onError; + } + + /** + * Set a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @param onError the onError value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withOnError(OnErrorType onError) { + this.onError = onError; + return this; + } + + /** + * Get sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the relativePriority value + */ + public Priority relativePriority() { + return this.relativePriority; + } + + /** + * Set sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param relativePriority the relativePriority value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withRelativePriority(Priority relativePriority) { + this.relativePriority = relativePriority; + return this; + } + + /** + * Get preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @return the preset value + */ + public Preset preset() { + return this.preset; + } + + /** + * Set preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @param preset the preset value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withPreset(Preset preset) { + this.preset = preset; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transforms.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transforms.java new file mode 100644 index 0000000000000..a8a5df41a7b20 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Transforms.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation.TransformsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Transforms. + */ +public interface Transforms extends SupportsCreating, HasInner { + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName); + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName); + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransportStreamFormat.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransportStreamFormat.java new file mode 100644 index 0000000000000..dadd182b15049 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/TransportStreamFormat.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC + * 13818-1) output video file(s). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.TransportStreamFormat") +public class TransportStreamFormat extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Video.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Video.java new file mode 100644 index 0000000000000..69eb0ed96964f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/Video.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for encoding the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Video") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Image", value = Image.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Video", value = H264Video.class) +}) +public class Video extends Codec { + /** + * The distance between two key frames, thereby defining a group of + * pictures (GOP). The value should be a non-zero integer in the range [1, + * 30] seconds, specified in ISO 8601 format. The default is 2 seconds + * (PT2S). + */ + @JsonProperty(value = "keyFrameInterval") + private Period keyFrameInterval; + + /** + * The resizing mode - how the input video will be resized to fit the + * desired output resolution(s). Default is AutoSize. Possible values + * include: 'None', 'AutoSize', 'AutoFit'. + */ + @JsonProperty(value = "stretchMode") + private StretchMode stretchMode; + + /** + * Get the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @return the keyFrameInterval value + */ + public Period keyFrameInterval() { + return this.keyFrameInterval; + } + + /** + * Set the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @param keyFrameInterval the keyFrameInterval value to set + * @return the Video object itself. + */ + public Video withKeyFrameInterval(Period keyFrameInterval) { + this.keyFrameInterval = keyFrameInterval; + return this; + } + + /** + * Get the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @return the stretchMode value + */ + public StretchMode stretchMode() { + return this.stretchMode; + } + + /** + * Set the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @param stretchMode the stretchMode value to set + * @return the Video object itself. + */ + public Video withStretchMode(StretchMode stretchMode) { + this.stretchMode = stretchMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoAnalyzerPreset.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoAnalyzerPreset.java new file mode 100644 index 0000000000000..5c41f8262e4ea --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoAnalyzerPreset.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A video analyzer preset that extracts insights (rich metadata) from both + * audio and video, and outputs a JSON format file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoAnalyzerPreset") +public class VideoAnalyzerPreset extends AudioAnalyzerPreset { + /** + * Whether to only extract audio insights when processing a video file. + */ + @JsonProperty(value = "audioInsightsOnly") + private Boolean audioInsightsOnly; + + /** + * Get whether to only extract audio insights when processing a video file. + * + * @return the audioInsightsOnly value + */ + public Boolean audioInsightsOnly() { + return this.audioInsightsOnly; + } + + /** + * Set whether to only extract audio insights when processing a video file. + * + * @param audioInsightsOnly the audioInsightsOnly value to set + * @return the VideoAnalyzerPreset object itself. + */ + public VideoAnalyzerPreset withAudioInsightsOnly(Boolean audioInsightsOnly) { + this.audioInsightsOnly = audioInsightsOnly; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoLayer.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoLayer.java new file mode 100644 index 0000000000000..76bc34c2a93ab --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoLayer.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoLayer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Layer", value = H264Layer.class) +}) +public class VideoLayer extends Layer { + /** + * The average bitrate in bits per second at which to encode the input + * video when generating this layer. This is a required field. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * The maximum bitrate (in bits per second), at which the VBV buffer should + * be assumed to refill. If not specified, defaults to the same value as + * bitrate. + */ + @JsonProperty(value = "maxBitrate") + private Integer maxBitrate; + + /** + * The number of B-frames to be used when encoding this layer. If not + * specified, the encoder chooses an appropriate number based on the video + * profile and level. + */ + @JsonProperty(value = "bFrames") + private Integer bFrames; + + /** + * The frame rate (in frames per second) at which to encode this layer. The + * value can be in the form of M/N where M and N are integers (For example, + * 30000/1001), or in the form of a number (For example, 30, or 29.97). The + * encoder enforces constraints on allowed frame rates based on the profile + * and level. If it is not specified, the encoder will use the same frame + * rate as the input video. + */ + @JsonProperty(value = "frameRate") + private String frameRate; + + /** + * The number of slices to be used when encoding this layer. If not + * specified, default is zero, which means that encoder will use a single + * slice for each frame. + */ + @JsonProperty(value = "slices") + private Integer slices; + + /** + * Whether or not adaptive B-frames are to be used when encoding this + * layer. If not specified, the encoder will turn it on whenever the video + * profile permits its use. + */ + @JsonProperty(value = "adaptiveBFrame") + private Boolean adaptiveBFrame; + + /** + * Get the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @param bitrate the bitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @return the maxBitrate value + */ + public Integer maxBitrate() { + return this.maxBitrate; + } + + /** + * Set the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @param maxBitrate the maxBitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withMaxBitrate(Integer maxBitrate) { + this.maxBitrate = maxBitrate; + return this; + } + + /** + * Get the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @return the bFrames value + */ + public Integer bFrames() { + return this.bFrames; + } + + /** + * Set the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @param bFrames the bFrames value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBFrames(Integer bFrames) { + this.bFrames = bFrames; + return this; + } + + /** + * Get the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @return the frameRate value + */ + public String frameRate() { + return this.frameRate; + } + + /** + * Set the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @param frameRate the frameRate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withFrameRate(String frameRate) { + this.frameRate = frameRate; + return this; + } + + /** + * Get the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @return the slices value + */ + public Integer slices() { + return this.slices; + } + + /** + * Set the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @param slices the slices value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withSlices(Integer slices) { + this.slices = slices; + return this; + } + + /** + * Get whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @return the adaptiveBFrame value + */ + public Boolean adaptiveBFrame() { + return this.adaptiveBFrame; + } + + /** + * Set whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @param adaptiveBFrame the adaptiveBFrame value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withAdaptiveBFrame(Boolean adaptiveBFrame) { + this.adaptiveBFrame = adaptiveBFrame; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoOverlay.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoOverlay.java new file mode 100644 index 0000000000000..347186545299c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/VideoOverlay.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of a video overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoOverlay") +public class VideoOverlay extends Overlay { + /** + * The location in the input video where the overlay is applied. + */ + @JsonProperty(value = "position") + private Rectangle position; + + /** + * The opacity of the overlay. This is a value in the range [0 - 1.0]. + * Default is 1.0 which mean the overlay is opaque. + */ + @JsonProperty(value = "opacity") + private Double opacity; + + /** + * An optional rectangular window used to crop the overlay image or video. + */ + @JsonProperty(value = "cropRectangle") + private Rectangle cropRectangle; + + /** + * Get the location in the input video where the overlay is applied. + * + * @return the position value + */ + public Rectangle position() { + return this.position; + } + + /** + * Set the location in the input video where the overlay is applied. + * + * @param position the position value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withPosition(Rectangle position) { + this.position = position; + return this; + } + + /** + * Get the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @return the opacity value + */ + public Double opacity() { + return this.opacity; + } + + /** + * Set the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @param opacity the opacity value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withOpacity(Double opacity) { + this.opacity = opacity; + return this; + } + + /** + * Get an optional rectangular window used to crop the overlay image or video. + * + * @return the cropRectangle value + */ + public Rectangle cropRectangle() { + return this.cropRectangle; + } + + /** + * Set an optional rectangular window used to crop the overlay image or video. + * + * @param cropRectangle the cropRectangle value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withCropRectangle(Rectangle cropRectangle) { + this.cropRectangle = cropRectangle; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasImpl.java new file mode 100644 index 0000000000000..7b7ca15faed0f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetContainerSas; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class AssetContainerSasImpl extends WrapperImpl implements AssetContainerSas { + private final MediaManager manager; + AssetContainerSasImpl(AssetContainerSasInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List assetContainerSasUrls() { + return this.inner().assetContainerSasUrls(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasInner.java new file mode 100644 index 0000000000000..c386a969383fd --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetContainerSasInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Asset Storage container SAS URLs. + */ +public class AssetContainerSasInner { + /** + * The list of Asset container SAS URLs. + */ + @JsonProperty(value = "assetContainerSasUrls") + private List assetContainerSasUrls; + + /** + * Get the list of Asset container SAS URLs. + * + * @return the assetContainerSasUrls value + */ + public List assetContainerSasUrls() { + return this.assetContainerSasUrls; + } + + /** + * Set the list of Asset container SAS URLs. + * + * @param assetContainerSasUrls the assetContainerSasUrls value to set + * @return the AssetContainerSasInner object itself. + */ + public AssetContainerSasInner withAssetContainerSasUrls(List assetContainerSasUrls) { + this.assetContainerSasUrls = assetContainerSasUrls; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetImpl.java new file mode 100644 index 0000000000000..0bed0cf9d8d77 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Asset; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetStorageEncryptionFormat; + +class AssetImpl extends CreatableUpdatableImpl implements Asset, Asset.Definition, Asset.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String assetName; + + AssetImpl(String name, MediaManager manager) { + super(name, new AssetInner()); + this.manager = manager; + // Set resource name + this.assetName = name; + // + } + + AssetImpl(AssetInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.assetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.getAsync(this.resourceGroupName, this.accountName, this.assetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternateId() { + return this.inner().alternateId(); + } + + @Override + public UUID assetId() { + return this.inner().assetId(); + } + + @Override + public String container() { + return this.inner().container(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String storageAccountName() { + return this.inner().storageAccountName(); + } + + @Override + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.inner().storageEncryptionFormat(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AssetImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public AssetImpl withAlternateId(String alternateId) { + this.inner().withAlternateId(alternateId); + return this; + } + + @Override + public AssetImpl withContainer(String container) { + this.inner().withContainer(container); + return this; + } + + @Override + public AssetImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public AssetImpl withStorageAccountName(String storageAccountName) { + this.inner().withStorageAccountName(storageAccountName); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetInner.java new file mode 100644 index 0000000000000..6f2b21393a351 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetInner.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetStorageEncryptionFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Asset. + */ +@JsonFlatten +public class AssetInner extends ProxyResource { + /** + * The Asset ID. + */ + @JsonProperty(value = "properties.assetId", access = JsonProperty.Access.WRITE_ONLY) + private UUID assetId; + + /** + * The creation date of the Asset. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Asset. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The alternate ID of the Asset. + */ + @JsonProperty(value = "properties.alternateId") + private String alternateId; + + /** + * The Asset description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The name of the asset blob container. + */ + @JsonProperty(value = "properties.container") + private String container; + + /** + * The name of the storage account. + */ + @JsonProperty(value = "properties.storageAccountName") + private String storageAccountName; + + /** + * The Asset encryption format. One of None or MediaStorageEncryption. + * Possible values include: 'None', 'MediaStorageClientEncryption'. + */ + @JsonProperty(value = "properties.storageEncryptionFormat", access = JsonProperty.Access.WRITE_ONLY) + private AssetStorageEncryptionFormat storageEncryptionFormat; + + /** + * Get the Asset ID. + * + * @return the assetId value + */ + public UUID assetId() { + return this.assetId; + } + + /** + * Get the creation date of the Asset. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Asset. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the alternate ID of the Asset. + * + * @return the alternateId value + */ + public String alternateId() { + return this.alternateId; + } + + /** + * Set the alternate ID of the Asset. + * + * @param alternateId the alternateId value to set + * @return the AssetInner object itself. + */ + public AssetInner withAlternateId(String alternateId) { + this.alternateId = alternateId; + return this; + } + + /** + * Get the Asset description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Asset description. + * + * @param description the description value to set + * @return the AssetInner object itself. + */ + public AssetInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name of the asset blob container. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the name of the asset blob container. + * + * @param container the container value to set + * @return the AssetInner object itself. + */ + public AssetInner withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the name of the storage account. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account. + * + * @param storageAccountName the storageAccountName value to set + * @return the AssetInner object itself. + */ + public AssetInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption'. + * + * @return the storageEncryptionFormat value + */ + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.storageEncryptionFormat; + } + +} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyImpl.java similarity index 87% rename from mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyImpl.java rename to mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyImpl.java index b2a4303998e47..714c0db8826f2 100644 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyImpl.java +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyImpl.java @@ -6,9 +6,9 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetStorageEncryptionKey; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetStorageEncryptionKey; import com.microsoft.azure.arm.model.implementation.WrapperImpl; class AssetStorageEncryptionKeyImpl extends WrapperImpl implements AssetStorageEncryptionKey { diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyInner.java similarity index 94% rename from mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyInner.java rename to mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyInner.java index 336f15392f10b..03feda13ec54f 100644 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetStorageEncryptionKeyInner.java +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetStorageEncryptionKeyInner.java @@ -6,7 +6,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsImpl.java new file mode 100644 index 0000000000000..42018648199aa --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetContainerSas; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.AssetStorageEncryptionKey; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListContainerSasInput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Asset; + +class AssetsImpl extends WrapperImpl implements Assets { + private final MediaManager manager; + + AssetsImpl(MediaManager manager) { + super(manager.inner().assets()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AssetImpl define(String name) { + return wrapModel(name); + } + + private AssetImpl wrapModel(AssetInner inner) { + return new AssetImpl(inner, manager()); + } + + private AssetImpl wrapModel(String name) { + return new AssetImpl(name, this.manager()); + } + + @Override + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + AssetsInner client = this.inner(); + return client.listContainerSasAsync(resourceGroupName, accountName, assetName, parameters) + .map(new Func1() { + @Override + public AssetContainerSas call(AssetContainerSasInner inner) { + return new AssetContainerSasImpl(inner, manager()); + } + }); + } + + @Override + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getEncryptionKeyAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public AssetStorageEncryptionKey call(AssetStorageEncryptionKeyInner inner) { + return new AssetStorageEncryptionKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + AssetsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, assetName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsInner.java new file mode 100644 index 0000000000000..0aff9df3477a5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AssetsInner.java @@ -0,0 +1,1092 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListContainerSasInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Assets. + */ +public class AssetsInner { + /** The Retrofit service to perform REST calls. */ + private AssetsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AssetsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AssetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Assets to be + * used by Retrofit to perform actually REST calls. + */ + interface AssetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets listContainerSas" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listContainerSas") + Observable> listContainerSas(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body ListContainerSasInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets getEncryptionKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/getEncryptionKey") + Observable> getEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner get(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner createOrUpdate(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String assetName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String assetName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetContainerSasInner object if successful. + */ + public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetContainerSasInner>() { + @Override + public AssetContainerSasInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable> listContainerSasWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listContainerSas(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContainerSasDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContainerSasDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetStorageEncryptionKeyInner object if successful. + */ + public AssetStorageEncryptionKeyInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetStorageEncryptionKeyInner object + */ + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetStorageEncryptionKeyInner>() { + @Override + public AssetStorageEncryptionKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetStorageEncryptionKeyInner object + */ + public Observable> getEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getEncryptionKey(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEncryptionKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEncryptionKeyDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AzureMediaServicesImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AzureMediaServicesImpl.java new file mode 100644 index 0000000000000..bedb2897d2d37 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/AzureMediaServicesImpl.java @@ -0,0 +1,350 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AzureMediaServicesImpl class. + */ +public class AzureMediaServicesImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The unique identifier for a Microsoft Azure subscription. */ + private String subscriptionId; + + /** + * Gets The unique identifier for a Microsoft Azure subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The unique identifier for a Microsoft Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets The Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AzureMediaServicesImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AzureMediaServicesImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The MediaservicesInner object to access its operations. + */ + private MediaservicesInner mediaservices; + + /** + * Gets the MediaservicesInner object to access its operations. + * @return the MediaservicesInner object. + */ + public MediaservicesInner mediaservices() { + return this.mediaservices; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The AssetsInner object to access its operations. + */ + private AssetsInner assets; + + /** + * Gets the AssetsInner object to access its operations. + * @return the AssetsInner object. + */ + public AssetsInner assets() { + return this.assets; + } + + /** + * The ContentKeyPoliciesInner object to access its operations. + */ + private ContentKeyPoliciesInner contentKeyPolicies; + + /** + * Gets the ContentKeyPoliciesInner object to access its operations. + * @return the ContentKeyPoliciesInner object. + */ + public ContentKeyPoliciesInner contentKeyPolicies() { + return this.contentKeyPolicies; + } + + /** + * The TransformsInner object to access its operations. + */ + private TransformsInner transforms; + + /** + * Gets the TransformsInner object to access its operations. + * @return the TransformsInner object. + */ + public TransformsInner transforms() { + return this.transforms; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The StreamingPoliciesInner object to access its operations. + */ + private StreamingPoliciesInner streamingPolicies; + + /** + * Gets the StreamingPoliciesInner object to access its operations. + * @return the StreamingPoliciesInner object. + */ + public StreamingPoliciesInner streamingPolicies() { + return this.streamingPolicies; + } + + /** + * The StreamingLocatorsInner object to access its operations. + */ + private StreamingLocatorsInner streamingLocators; + + /** + * Gets the StreamingLocatorsInner object to access its operations. + * @return the StreamingLocatorsInner object. + */ + public StreamingLocatorsInner streamingLocators() { + return this.streamingLocators; + } + + /** + * The LiveEventsInner object to access its operations. + */ + private LiveEventsInner liveEvents; + + /** + * Gets the LiveEventsInner object to access its operations. + * @return the LiveEventsInner object. + */ + public LiveEventsInner liveEvents() { + return this.liveEvents; + } + + /** + * The LiveOutputsInner object to access its operations. + */ + private LiveOutputsInner liveOutputs; + + /** + * Gets the LiveOutputsInner object to access its operations. + * @return the LiveOutputsInner object. + */ + public LiveOutputsInner liveOutputs() { + return this.liveOutputs; + } + + /** + * The StreamingEndpointsInner object to access its operations. + */ + private StreamingEndpointsInner streamingEndpoints; + + /** + * Gets the StreamingEndpointsInner object to access its operations. + * @return the StreamingEndpointsInner object. + */ + public StreamingEndpointsInner streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureMediaServicesImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-03-30-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.mediaservices = new MediaservicesInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.assets = new AssetsInner(restClient().retrofit(), this); + this.contentKeyPolicies = new ContentKeyPoliciesInner(restClient().retrofit(), this); + this.transforms = new TransformsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.streamingPolicies = new StreamingPoliciesInner(restClient().retrofit(), this); + this.streamingLocators = new StreamingLocatorsInner(restClient().retrofit(), this); + this.liveEvents = new LiveEventsInner(restClient().retrofit(), this); + this.liveOutputs = new LiveOutputsInner(restClient().retrofit(), this); + this.streamingEndpoints = new StreamingEndpointsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AzureMediaServices", "2018-03-30-preview"); + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesImpl.java new file mode 100644 index 0000000000000..43c34c2655853 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyProperties; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicy; + +class ContentKeyPoliciesImpl extends WrapperImpl implements ContentKeyPolicies { + private final MediaManager manager; + + ContentKeyPoliciesImpl(MediaManager manager) { + super(manager.inner().contentKeyPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public ContentKeyPolicyImpl define(String name) { + return wrapModel(name); + } + + private ContentKeyPolicyImpl wrapModel(ContentKeyPolicyInner inner) { + return new ContentKeyPolicyImpl(inner, manager()); + } + + private ContentKeyPolicyImpl wrapModel(String name) { + return new ContentKeyPolicyImpl(name, this.manager()); + } + + @Override + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getPolicyPropertiesWithSecretsAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicyProperties call(ContentKeyPolicyPropertiesInner inner) { + return new ContentKeyPolicyPropertiesImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + ContentKeyPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, contentKeyPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesInner.java new file mode 100644 index 0000000000000..792268149fb28 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPoliciesInner.java @@ -0,0 +1,983 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContentKeyPolicies. + */ +public class ContentKeyPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ContentKeyPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of ContentKeyPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContentKeyPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(ContentKeyPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContentKeyPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ContentKeyPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies getPolicyPropertiesWithSecrets" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets") + Observable> getPolicyPropertiesWithSecrets(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner update(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyPropertiesInner object if successful. + */ + public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyPropertiesInner>() { + @Override + public ContentKeyPolicyPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable> getPolicyPropertiesWithSecretsWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPolicyPropertiesWithSecrets(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPolicyPropertiesWithSecretsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPolicyPropertiesWithSecretsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyImpl.java new file mode 100644 index 0000000000000..62a8af116267f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyOption; + +class ContentKeyPolicyImpl extends CreatableUpdatableImpl implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String contentKeyPolicyName; + + ContentKeyPolicyImpl(String name, MediaManager manager) { + super(name, new ContentKeyPolicyInner()); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = name; + // + } + + ContentKeyPolicyImpl(ContentKeyPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.contentKeyPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "contentKeyPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ContentKeyPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ContentKeyPolicyImpl withOptions(List options) { + this.inner().withOptions(options); + return this; + } + + @Override + public ContentKeyPolicyImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyInner.java new file mode 100644 index 0000000000000..4f693556fa83b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Content Key Policy resource. + */ +@JsonFlatten +public class ContentKeyPolicyInner extends ProxyResource { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "properties.options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java new file mode 100644 index 0000000000000..6f1bd775610cc --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyOption; +import java.util.UUID; + +class ContentKeyPolicyPropertiesImpl extends WrapperImpl implements ContentKeyPolicyProperties { + private final MediaManager manager; + ContentKeyPolicyPropertiesImpl(ContentKeyPolicyPropertiesInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesInner.java new file mode 100644 index 0000000000000..cc08d7e9c35ad --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ContentKeyPolicyPropertiesInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Content Key Policy. + */ +public class ContentKeyPolicyPropertiesInner { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java new file mode 100644 index 0000000000000..65f1d10a4f5c1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EntityNameAvailabilityCheckOutputImpl extends WrapperImpl implements EntityNameAvailabilityCheckOutput { + private final MediaManager manager; + EntityNameAvailabilityCheckOutputImpl(EntityNameAvailabilityCheckOutputInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java new file mode 100644 index 0000000000000..2730b11455c58 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the check name availability request. + */ +public class EntityNameAvailabilityCheckOutputInner { + /** + * Specifies if the name is available. + */ + @JsonProperty(value = "nameAvailable", required = true) + private boolean nameAvailable; + + /** + * Specifies the reason if the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Specifies the detailed reason if the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get specifies if the name is available. + * + * @return the nameAvailable value + */ + public boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies if the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withNameAvailable(boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get specifies the reason if the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set specifies the reason if the name is not available. + * + * @param reason the reason value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get specifies the detailed reason if the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set specifies the detailed reason if the name is not available. + * + * @param message the message value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/IdParsingUtils.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..afd77847f8859 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobImpl.java new file mode 100644 index 0000000000000..b958fc8485dc6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Job; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Priority; + +class JobImpl extends CreatableUpdatableImpl implements Job, Job.Definition, Job.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + private String jobName; + + JobImpl(String name, MediaManager manager) { + super(name, new JobInner()); + this.manager = manager; + // Set resource name + this.jobName = name; + // + } + + JobImpl(JobInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.jobName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public JobInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public Priority priority() { + return this.inner().priority(); + } + + @Override + public JobState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public JobImpl withExistingTransform(String resourceGroupName, String accountName, String transformName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.transformName = transformName; + return this; + } + + @Override + public JobImpl withInput(JobInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public JobImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public JobImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public JobImpl withPriority(Priority priority) { + this.inner().withPriority(priority); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobInner.java new file mode 100644 index 0000000000000..1e481313e8340 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobInner.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Priority; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Job resource type. The progress and state can be obtained by polling a Job + * or subscribing to events using EventGrid. + */ +@JsonFlatten +public class JobInner extends ProxyResource { + /** + * The UTC date and time when the Job was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The current state of the job. Possible values include: 'Canceled', + * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * Optional customer supplied description of the Job. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The inputs for the Job. + */ + @JsonProperty(value = "properties.input", required = true) + private JobInput input; + + /** + * The UTC date and time when the Job was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The outputs for the Job. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Priority with which the job should be processed. Higher priority jobs + * are processed before lower priority jobs. If not set, the default is + * normal. Possible values include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "properties.priority") + private Priority priority; + + /** + * Get the UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get optional customer supplied description of the Job. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set optional customer supplied description of the Job. + * + * @param description the description value to set + * @return the JobInner object itself. + */ + public JobInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the inputs for the Job. + * + * @return the input value + */ + public JobInput input() { + return this.input; + } + + /** + * Set the inputs for the Job. + * + * @param input the input value to set + * @return the JobInner object itself. + */ + public JobInner withInput(JobInput input) { + this.input = input; + return this; + } + + /** + * Get the UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the outputs for the Job. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs for the Job. + * + * @param outputs the outputs value to set + * @return the JobInner object itself. + */ + public JobInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the priority value + */ + public Priority priority() { + return this.priority; + } + + /** + * Set priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param priority the priority value to set + * @return the JobInner object itself. + */ + public JobInner withPriority(Priority priority) { + this.priority = priority; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsImpl.java new file mode 100644 index 0000000000000..c21f773676a2e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Job; + +class JobsImpl extends WrapperImpl implements Jobs { + private final MediaManager manager; + + JobsImpl(MediaManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public JobImpl define(String name) { + return wrapModel(name); + } + + private JobImpl wrapModel(JobInner inner) { + return new JobImpl(inner, manager()); + } + + private JobImpl wrapModel(String name) { + return new JobImpl(name, this.manager()); + } + + @Override + public Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.cancelJobAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String transformName) { + JobsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, transformName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName, jobName) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsInner.java new file mode 100644 index 0000000000000..419a58c73caca --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/JobsInner.java @@ -0,0 +1,914 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs cancelJob" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob") + Observable> cancelJob(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listSinglePageAsync(resourceGroupName, accountName, transformName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param transformName The Transform name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner create(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { + cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelJobWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancelJob(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelJobDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseImpl.java new file mode 100644 index 0000000000000..146f3fe16ca05 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListContentKeysResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocatorContentKey; + +class ListContentKeysResponseImpl extends WrapperImpl implements ListContentKeysResponse { + private final MediaManager manager; + ListContentKeysResponseImpl(ListContentKeysResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseInner.java new file mode 100644 index 0000000000000..bd43b48c463bd --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListContentKeysResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listContentKeys action. + */ +public class ListContentKeysResponseInner { + /** + * ContentKeys used by current Streaming Locator. + */ + @JsonProperty(value = "contentKeys") + private List contentKeys; + + /** + * Get contentKeys used by current Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set contentKeys used by current Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the ListContentKeysResponseInner object itself. + */ + public ListContentKeysResponseInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseImpl.java new file mode 100644 index 0000000000000..35f134998024c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListPathsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPath; + +class ListPathsResponseImpl extends WrapperImpl implements ListPathsResponse { + private final MediaManager manager; + ListPathsResponseImpl(ListPathsResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List downloadPaths() { + return this.inner().downloadPaths(); + } + + @Override + public List streamingPaths() { + return this.inner().streamingPaths(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseInner.java new file mode 100644 index 0000000000000..56f1cf9853019 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/ListPathsResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPath; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listPaths action. + */ +public class ListPathsResponseInner { + /** + * Streaming Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "streamingPaths") + private List streamingPaths; + + /** + * Download Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "downloadPaths") + private List downloadPaths; + + /** + * Get streaming Paths supported by current Streaming Locator. + * + * @return the streamingPaths value + */ + public List streamingPaths() { + return this.streamingPaths; + } + + /** + * Set streaming Paths supported by current Streaming Locator. + * + * @param streamingPaths the streamingPaths value to set + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withStreamingPaths(List streamingPaths) { + this.streamingPaths = streamingPaths; + return this; + } + + /** + * Get download Paths supported by current Streaming Locator. + * + * @return the downloadPaths value + */ + public List downloadPaths() { + return this.downloadPaths; + } + + /** + * Set download Paths supported by current Streaming Locator. + * + * @param downloadPaths the downloadPaths value to set + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withDownloadPaths(List downloadPaths) { + this.downloadPaths = downloadPaths; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventImpl.java new file mode 100644 index 0000000000000..aba7382f3c181 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvent; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamOptionsFlag; +import org.joda.time.DateTime; + +class LiveEventImpl extends CreatableUpdatableImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + private Boolean cautoStart; + + LiveEventImpl(String name, MediaManager manager) { + super(name, new LiveEventInner()); + this.manager = manager; + // Set resource name + this.liveEventName = name; + // + } + + LiveEventImpl(LiveEventInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveEventName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner(), this.cautoStart) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public LiveEventEncoding encoding() { + return this.inner().encoding(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public LiveEventInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public LiveEventPreview preview() { + return this.inner().preview(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveEventResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public List streamOptions() { + return this.inner().streamOptions(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean vanityUrl() { + return this.inner().vanityUrl(); + } + + @Override + public LiveEventImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public LiveEventImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + + @Override + public LiveEventImpl withInput(LiveEventInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public LiveEventImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public LiveEventImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveEventImpl withEncoding(LiveEventEncoding encoding) { + this.inner().withEncoding(encoding); + return this; + } + + @Override + public LiveEventImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public LiveEventImpl withPreview(LiveEventPreview preview) { + this.inner().withPreview(preview); + return this; + } + + @Override + public LiveEventImpl withStreamOptions(List streamOptions) { + this.inner().withStreamOptions(streamOptions); + return this; + } + + @Override + public LiveEventImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public LiveEventImpl withVanityUrl(Boolean vanityUrl) { + this.inner().withVanityUrl(vanityUrl); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventInner.java new file mode 100644 index 0000000000000..b773bc59246c1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventInner.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamOptionsFlag; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The Live Event. + */ +@JsonFlatten +@SkipParentValidation +public class LiveEventInner extends Resource { + /** + * The Live Event description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Live Event input. + */ + @JsonProperty(value = "properties.input", required = true) + private LiveEventInput input; + + /** + * The Live Event preview. + */ + @JsonProperty(value = "properties.preview") + private LiveEventPreview preview; + + /** + * The Live Event encoding. + */ + @JsonProperty(value = "properties.encoding") + private LiveEventEncoding encoding; + + /** + * The provisioning state of the Live Event. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Event. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveEventResourceState resourceState; + + /** + * The Live Event access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * The Live Event vanity URL flag. + */ + @JsonProperty(value = "properties.vanityUrl") + private Boolean vanityUrl; + + /** + * The stream options. + */ + @JsonProperty(value = "properties.streamOptions") + private List streamOptions; + + /** + * The exact time the Live Event was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Event was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the Live Event description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Live Event description. + * + * @param description the description value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Live Event input. + * + * @return the input value + */ + public LiveEventInput input() { + return this.input; + } + + /** + * Set the Live Event input. + * + * @param input the input value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withInput(LiveEventInput input) { + this.input = input; + return this; + } + + /** + * Get the Live Event preview. + * + * @return the preview value + */ + public LiveEventPreview preview() { + return this.preview; + } + + /** + * Set the Live Event preview. + * + * @param preview the preview value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withPreview(LiveEventPreview preview) { + this.preview = preview; + return this; + } + + /** + * Get the Live Event encoding. + * + * @return the encoding value + */ + public LiveEventEncoding encoding() { + return this.encoding; + } + + /** + * Set the Live Event encoding. + * + * @param encoding the encoding value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withEncoding(LiveEventEncoding encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the provisioning state of the Live Event. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + * + * @return the resourceState value + */ + public LiveEventResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the Live Event access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the Live Event access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get the Live Event vanity URL flag. + * + * @return the vanityUrl value + */ + public Boolean vanityUrl() { + return this.vanityUrl; + } + + /** + * Set the Live Event vanity URL flag. + * + * @param vanityUrl the vanityUrl value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withVanityUrl(Boolean vanityUrl) { + this.vanityUrl = vanityUrl; + return this; + } + + /** + * Get the stream options. + * + * @return the streamOptions value + */ + public List streamOptions() { + return this.streamOptions; + } + + /** + * Set the stream options. + * + * @param streamOptions the streamOptions value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withStreamOptions(List streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get the exact time the Live Event was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Event was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsImpl.java new file mode 100644 index 0000000000000..f6783e14d237f --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvent; + +class LiveEventsImpl extends WrapperImpl implements LiveEvents { + private final MediaManager manager; + + LiveEventsImpl(MediaManager manager) { + super(manager.inner().liveEvents()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveEventImpl define(String name) { + return wrapModel(name); + } + + private LiveEventImpl wrapModel(LiveEventInner inner) { + return new LiveEventImpl(inner, manager()); + } + + private LiveEventImpl wrapModel(String name) { + return new LiveEventImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.resetAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + LiveEventsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsInner.java new file mode 100644 index 0000000000000..84456142e1191 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveEventsInner.java @@ -0,0 +1,1936 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEventActionInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveEvents. + */ +public class LiveEventsInner { + /** The Retrofit service to perform REST calls. */ + private LiveEventsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveEventsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveEventsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveEventsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveEvents to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveEventsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> reset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> beginReset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner get(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner update(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String liveEventName) { + startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String liveEventName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String liveEventName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reset(String resourceGroupName, String accountName, String liveEventName) { + resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.reset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginReset(String resourceGroupName, String accountName, String liveEventName) { + beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginReset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputImpl.java new file mode 100644 index 0000000000000..23f5d999d54b9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputImpl.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutput; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputResourceState; + +class LiveOutputImpl extends CreatableUpdatableImpl implements LiveOutput, LiveOutput.Definition, LiveOutput.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + private String liveOutputName; + + LiveOutputImpl(String name, MediaManager manager) { + super(name, new LiveOutputInner()); + this.manager = manager; + // Set resource name + this.liveOutputName = name; + // + } + + LiveOutputImpl(LiveOutputInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveOutputName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + this.liveOutputName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveOutputs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Period archiveWindowLength() { + return this.inner().archiveWindowLength(); + } + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public Hls hls() { + return this.inner().hls(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String manifestName() { + return this.inner().manifestName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long outputSnapTime() { + return this.inner().outputSnapTime(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveOutputResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public LiveOutputImpl withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.liveEventName = liveEventName; + return this; + } + + @Override + public LiveOutputImpl withArchiveWindowLength(Period archiveWindowLength) { + this.inner().withArchiveWindowLength(archiveWindowLength); + return this; + } + + @Override + public LiveOutputImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public LiveOutputImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveOutputImpl withHls(Hls hls) { + this.inner().withHls(hls); + return this; + } + + @Override + public LiveOutputImpl withManifestName(String manifestName) { + this.inner().withManifestName(manifestName); + return this; + } + + @Override + public LiveOutputImpl withOutputSnapTime(Long outputSnapTime) { + this.inner().withOutputSnapTime(outputSnapTime); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputInner.java new file mode 100644 index 0000000000000..4686e76c724af --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Live Output. + */ +@JsonFlatten +public class LiveOutputInner extends ProxyResource { + /** + * The description of the Live Output. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The asset name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * ISO 8601 timespan duration of the archive window length. This is + * duration that customer want to retain the recorded content. + */ + @JsonProperty(value = "properties.archiveWindowLength", required = true) + private Period archiveWindowLength; + + /** + * The manifest file name. + */ + @JsonProperty(value = "properties.manifestName") + private String manifestName; + + /** + * The HLS configuration. + */ + @JsonProperty(value = "properties.hls") + private Hls hls; + + /** + * The output snapshot time. + */ + @JsonProperty(value = "properties.outputSnapTime") + private Long outputSnapTime; + + /** + * The exact time the Live Output was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Output was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The provisioning state of the Live Output. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Output. Possible values include: + * 'Creating', 'Running', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveOutputResourceState resourceState; + + /** + * Get the description of the Live Output. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the Live Output. + * + * @param description the description value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the asset name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the asset name. + * + * @param assetName the assetName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @return the archiveWindowLength value + */ + public Period archiveWindowLength() { + return this.archiveWindowLength; + } + + /** + * Set iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @param archiveWindowLength the archiveWindowLength value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withArchiveWindowLength(Period archiveWindowLength) { + this.archiveWindowLength = archiveWindowLength; + return this; + } + + /** + * Get the manifest file name. + * + * @return the manifestName value + */ + public String manifestName() { + return this.manifestName; + } + + /** + * Set the manifest file name. + * + * @param manifestName the manifestName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withManifestName(String manifestName) { + this.manifestName = manifestName; + return this; + } + + /** + * Get the HLS configuration. + * + * @return the hls value + */ + public Hls hls() { + return this.hls; + } + + /** + * Set the HLS configuration. + * + * @param hls the hls value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withHls(Hls hls) { + this.hls = hls; + return this; + } + + /** + * Get the output snapshot time. + * + * @return the outputSnapTime value + */ + public Long outputSnapTime() { + return this.outputSnapTime; + } + + /** + * Set the output snapshot time. + * + * @param outputSnapTime the outputSnapTime value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withOutputSnapTime(Long outputSnapTime) { + this.outputSnapTime = outputSnapTime; + return this; + } + + /** + * Get the exact time the Live Output was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Output was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the provisioning state of the Live Output. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Output. Possible values include: 'Creating', 'Running', 'Deleting'. + * + * @return the resourceState value + */ + public LiveOutputResourceState resourceState() { + return this.resourceState; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsImpl.java new file mode 100644 index 0000000000000..19349c7d21c1c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutput; + +class LiveOutputsImpl extends WrapperImpl implements LiveOutputs { + private final MediaManager manager; + + LiveOutputsImpl(MediaManager manager) { + super(manager.inner().liveOutputs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveOutputImpl define(String name) { + return wrapModel(name); + } + + private LiveOutputImpl wrapModel(LiveOutputInner inner) { + return new LiveOutputImpl(inner, manager()); + } + + private LiveOutputImpl wrapModel(String name) { + return new LiveOutputImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + LiveOutputsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, liveEventName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName, liveOutputName) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java new file mode 100644 index 0000000000000..7913fb71030fa --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java @@ -0,0 +1,850 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveOutputs. + */ +public class LiveOutputsInner { + /** The Retrofit service to perform REST calls. */ + private LiveOutputsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveOutputsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveOutputsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveOutputsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveOutputs to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveOutputsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String liveEventName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, liveEventName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String liveEventName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, liveEventName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listSinglePageAsync(resourceGroupName, accountName, liveEventName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner create(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner beginCreate(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().last().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationInner.java new file mode 100644 index 0000000000000..b05de4d7ffd84 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LocationInner model. + */ +public class LocationInner { + /** + * The name property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the LocationInner object itself. + */ + public LocationInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..2f626917729c3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CheckNameAvailabilityInput; + +class LocationsImpl extends WrapperImpl implements Locations { + private final MediaManager manager; + + LocationsImpl(MediaManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + LocationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(locationName, parameters) + .map(new Func1() { + @Override + public EntityNameAvailabilityCheckOutput call(EntityNameAvailabilityCheckOutputInner inner) { + return new EntityNameAvailabilityCheckOutputImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsInner.java new file mode 100644 index 0000000000000..95a961025f69a --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LocationsInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CheckNameAvailabilityInput; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Locations checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Body CheckNameAvailabilityInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName the String value + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EntityNameAvailabilityCheckOutputInner object if successful. + */ + public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName the String value + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, parameters), serviceCallback); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName the String value + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).map(new Func1, EntityNameAvailabilityCheckOutputInner>() { + @Override + public EntityNameAvailabilityCheckOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName the String value + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, CheckNameAvailabilityInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), locationName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaManager.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaManager.java new file mode 100644 index 0000000000000..f3d4c186332a1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaManager.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operations; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Locations; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Assets; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ContentKeyPolicies; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Jobs; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveEvents; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.LiveOutputs; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Media resource management. + */ +public final class MediaManager extends ManagerCore { + private Operations operations; + private Mediaservices mediaservices; + private Locations locations; + private Assets assets; + private ContentKeyPolicies contentKeyPolicies; + private Transforms transforms; + private Jobs jobs; + private StreamingPolicies streamingPolicies; + private StreamingLocators streamingLocators; + private LiveEvents liveEvents; + private LiveOutputs liveOutputs; + private StreamingEndpoints streamingEndpoints; + /** + * Get a Configurable instance that can be used to create MediaManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new MediaManager.ConfigurableImpl(); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new MediaManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(RestClient restClient, String subscriptionId) { + return new MediaManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of MediaManager that exposes Media management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Media management API entry points that work across subscriptions + */ + MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Mediaservices. + */ + public Mediaservices mediaservices() { + if (this.mediaservices == null) { + this.mediaservices = new MediaservicesImpl(this); + } + return this.mediaservices; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Assets. + */ + public Assets assets() { + if (this.assets == null) { + this.assets = new AssetsImpl(this); + } + return this.assets; + } + + /** + * @return Entry point to manage ContentKeyPolicies. + */ + public ContentKeyPolicies contentKeyPolicies() { + if (this.contentKeyPolicies == null) { + this.contentKeyPolicies = new ContentKeyPoliciesImpl(this); + } + return this.contentKeyPolicies; + } + + /** + * @return Entry point to manage Transforms. + */ + public Transforms transforms() { + if (this.transforms == null) { + this.transforms = new TransformsImpl(this); + } + return this.transforms; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * @return Entry point to manage StreamingPolicies. + */ + public StreamingPolicies streamingPolicies() { + if (this.streamingPolicies == null) { + this.streamingPolicies = new StreamingPoliciesImpl(this); + } + return this.streamingPolicies; + } + + /** + * @return Entry point to manage StreamingLocators. + */ + public StreamingLocators streamingLocators() { + if (this.streamingLocators == null) { + this.streamingLocators = new StreamingLocatorsImpl(this); + } + return this.streamingLocators; + } + + /** + * @return Entry point to manage LiveEvents. + */ + public LiveEvents liveEvents() { + if (this.liveEvents == null) { + this.liveEvents = new LiveEventsImpl(this); + } + return this.liveEvents; + } + + /** + * @return Entry point to manage LiveOutputs. + */ + public LiveOutputs liveOutputs() { + if (this.liveOutputs == null) { + this.liveOutputs = new LiveOutputsImpl(this); + } + return this.liveOutputs; + } + + /** + * @return Entry point to manage StreamingEndpoints. + */ + public StreamingEndpoints streamingEndpoints() { + if (this.streamingEndpoints == null) { + this.streamingEndpoints = new StreamingEndpointsImpl(this); + } + return this.streamingEndpoints; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return MediaManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private MediaManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureMediaServicesImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceImpl.java new file mode 100644 index 0000000000000..bf8a6c68532a3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.MediaService; +import rx.Observable; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StorageAccount; + +class MediaServiceImpl extends GroupableResourceCoreImpl implements MediaService, MediaService.Definition, MediaService.Update { + MediaServiceImpl(String name, MediaServiceInner inner, MediaManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public MediaServiceImpl withStorageAccounts(List storageAccounts) { + this.inner().withStorageAccounts(storageAccounts); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceInner.java new file mode 100644 index 0000000000000..3a48dc7a5e57b --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class MediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesImpl.java new file mode 100644 index 0000000000000..46284eaafb7c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.MediaService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.SubscriptionMediaService; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class MediaservicesImpl extends GroupableResourcesCoreImpl implements Mediaservices { + protected MediaservicesImpl(MediaManager manager) { + super(manager.inner().mediaservices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MediaservicesInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(SubscriptionMediaServiceInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + MediaservicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public MediaServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable syncStorageKeysAsync(String resourceGroupName, String accountName) { + MediaservicesInner client = this.inner(); + return client.syncStorageKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable getBySubscriptionAsync(String accountName) { + MediaservicesInner client = this.inner(); + return client.getBySubscriptionAsync(accountName) + .map(new Func1() { + @Override + public SubscriptionMediaService call(SubscriptionMediaServiceInner inner) { + return new SubscriptionMediaServiceImpl(inner, manager()); + } + }); + } + + @Override + protected MediaServiceImpl wrapModel(MediaServiceInner inner) { + return new MediaServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected MediaServiceImpl wrapModel(String name) { + return new MediaServiceImpl(name, new MediaServiceInner(), this.manager()); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesInner.java new file mode 100644 index 0000000000000..80b69fc7c35d4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/MediaservicesInner.java @@ -0,0 +1,1214 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.SyncStorageKeysInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Mediaservices. + */ +public class MediaservicesInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private MediaservicesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of MediaservicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MediaservicesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(MediaservicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Mediaservices to be + * used by Retrofit to perform actually REST calls. + */ + interface MediaservicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices syncStorageKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys") + Observable> syncStorageKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SyncStorageKeysInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices getBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getBySubscription(@Path("subscriptionId") String subscriptionId, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Mediaservices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner createOrUpdate(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(null); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName, String id) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName, String id) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String id) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(id); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse syncStorageKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubscriptionMediaServiceInner object if successful. + */ + public SubscriptionMediaServiceInner getBySubscription(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBySubscriptionAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBySubscriptionWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable getBySubscriptionAsync(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).map(new Func1, SubscriptionMediaServiceInner>() { + @Override + public SubscriptionMediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable> getBySubscriptionWithServiceResponseAsync(String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getBySubscription(this.client.subscriptionId(), accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBySubscriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBySubscriptionDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..ae97cd431beed --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final MediaManager manager; + OperationImpl(OperationInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..1a73137314be7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation. + */ +public class OperationInner { + /** + * The operation name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The operation display name. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operation display name. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the operation display name. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..63da890f5783c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final MediaManager manager; + + OperationsImpl(MediaManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..302d17afee65c --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operations list" }) + @GET("providers/Microsoft.Media/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/PageImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..8dfcc398e91cb --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("@odata.nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointImpl.java new file mode 100644 index 0000000000000..92b185a981588 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoint; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CrossSiteAccessPolicies; +import org.joda.time.DateTime; + +class StreamingEndpointImpl extends CreatableUpdatableImpl implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingEndpointName; + private Boolean cautoStart; + + StreamingEndpointImpl(String name, MediaManager manager) { + super(name, new StreamingEndpointInner()); + this.manager = manager; + // Set resource name + this.streamingEndpointName = name; + // + } + + StreamingEndpointImpl(StreamingEndpointInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingEndpointName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.streamingEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingEndpoints"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner(), this.cautoStart) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public StreamingEndpointAccessControl accessControl() { + return this.inner().accessControl(); + } + + @Override + public String availabilitySetName() { + return this.inner().availabilitySetName(); + } + + @Override + public Boolean cdnEnabled() { + return this.inner().cdnEnabled(); + } + + @Override + public String cdnProfile() { + return this.inner().cdnProfile(); + } + + @Override + public String cdnProvider() { + return this.inner().cdnProvider(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public List customHostNames() { + return this.inner().customHostNames(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime freeTrialEndTime() { + return this.inner().freeTrialEndTime(); + } + + @Override + public String hostName() { + return this.inner().hostName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Long maxCacheAge() { + return this.inner().maxCacheAge(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public StreamingEndpointResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public int scaleUnits() { + return this.inner().scaleUnits(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingEndpointImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + + @Override + public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { + this.inner().withAccessControl(accessControl); + return this; + } + + @Override + public StreamingEndpointImpl withAvailabilitySetName(String availabilitySetName) { + this.inner().withAvailabilitySetName(availabilitySetName); + return this; + } + + @Override + public StreamingEndpointImpl withCdnEnabled(Boolean cdnEnabled) { + this.inner().withCdnEnabled(cdnEnabled); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProfile(String cdnProfile) { + this.inner().withCdnProfile(cdnProfile); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProvider(String cdnProvider) { + this.inner().withCdnProvider(cdnProvider); + return this; + } + + @Override + public StreamingEndpointImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public StreamingEndpointImpl withCustomHostNames(List customHostNames) { + this.inner().withCustomHostNames(customHostNames); + return this; + } + + @Override + public StreamingEndpointImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public StreamingEndpointImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public StreamingEndpointImpl withMaxCacheAge(Long maxCacheAge) { + this.inner().withMaxCacheAge(maxCacheAge); + return this; + } + + @Override + public StreamingEndpointImpl withScaleUnits(int scaleUnits) { + this.inner().withScaleUnits(scaleUnits); + return this; + } + + @Override + public StreamingEndpointImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointInner.java new file mode 100644 index 0000000000000..b884cbce89ca8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointInner.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CrossSiteAccessPolicies; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The StreamingEndpoint. + */ +@JsonFlatten +@SkipParentValidation +public class StreamingEndpointInner extends Resource { + /** + * The StreamingEndpoint description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The number of scale units. + */ + @JsonProperty(value = "properties.scaleUnits") + private int scaleUnits; + + /** + * AvailabilitySet name. + */ + @JsonProperty(value = "properties.availabilitySetName") + private String availabilitySetName; + + /** + * The access control definition of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.accessControl") + private StreamingEndpointAccessControl accessControl; + + /** + * Max cache age. + */ + @JsonProperty(value = "properties.maxCacheAge") + private Long maxCacheAge; + + /** + * The custom host names of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.customHostNames") + private List customHostNames; + + /** + * The StreamingEndpoint host name. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The CDN enabled flag. + */ + @JsonProperty(value = "properties.cdnEnabled") + private Boolean cdnEnabled; + + /** + * The CDN provider name. + */ + @JsonProperty(value = "properties.cdnProvider") + private String cdnProvider; + + /** + * The CDN profile name. + */ + @JsonProperty(value = "properties.cdnProfile") + private String cdnProfile; + + /** + * The provisioning state of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the StreamingEndpoint. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private StreamingEndpointResourceState resourceState; + + /** + * The StreamingEndpoint access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * The free trial expiration time. + */ + @JsonProperty(value = "properties.freeTrialEndTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime freeTrialEndTime; + + /** + * The exact time the StreamingEndpoint was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the StreamingEndpoint was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the StreamingEndpoint description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the StreamingEndpoint description. + * + * @param description the description value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of scale units. + * + * @return the scaleUnits value + */ + public int scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the number of scale units. + * + * @param scaleUnits the scaleUnits value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withScaleUnits(int scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Get availabilitySet name. + * + * @return the availabilitySetName value + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set availabilitySet name. + * + * @param availabilitySetName the availabilitySetName value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the access control definition of the StreamingEndpoint. + * + * @return the accessControl value + */ + public StreamingEndpointAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control definition of the StreamingEndpoint. + * + * @param accessControl the accessControl value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAccessControl(StreamingEndpointAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get max cache age. + * + * @return the maxCacheAge value + */ + public Long maxCacheAge() { + return this.maxCacheAge; + } + + /** + * Set max cache age. + * + * @param maxCacheAge the maxCacheAge value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withMaxCacheAge(Long maxCacheAge) { + this.maxCacheAge = maxCacheAge; + return this; + } + + /** + * Get the custom host names of the StreamingEndpoint. + * + * @return the customHostNames value + */ + public List customHostNames() { + return this.customHostNames; + } + + /** + * Set the custom host names of the StreamingEndpoint. + * + * @param customHostNames the customHostNames value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCustomHostNames(List customHostNames) { + this.customHostNames = customHostNames; + return this; + } + + /** + * Get the StreamingEndpoint host name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the CDN enabled flag. + * + * @return the cdnEnabled value + */ + public Boolean cdnEnabled() { + return this.cdnEnabled; + } + + /** + * Set the CDN enabled flag. + * + * @param cdnEnabled the cdnEnabled value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnEnabled(Boolean cdnEnabled) { + this.cdnEnabled = cdnEnabled; + return this; + } + + /** + * Get the CDN provider name. + * + * @return the cdnProvider value + */ + public String cdnProvider() { + return this.cdnProvider; + } + + /** + * Set the CDN provider name. + * + * @param cdnProvider the cdnProvider value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProvider(String cdnProvider) { + this.cdnProvider = cdnProvider; + return this; + } + + /** + * Get the CDN profile name. + * + * @return the cdnProfile value + */ + public String cdnProfile() { + return this.cdnProfile; + } + + /** + * Set the CDN profile name. + * + * @param cdnProfile the cdnProfile value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProfile(String cdnProfile) { + this.cdnProfile = cdnProfile; + return this; + } + + /** + * Get the provisioning state of the StreamingEndpoint. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the StreamingEndpoint. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + * + * @return the resourceState value + */ + public StreamingEndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the StreamingEndpoint access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the StreamingEndpoint access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get the free trial expiration time. + * + * @return the freeTrialEndTime value + */ + public DateTime freeTrialEndTime() { + return this.freeTrialEndTime; + } + + /** + * Get the exact time the StreamingEndpoint was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the StreamingEndpoint was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsImpl.java new file mode 100644 index 0000000000000..1bb2d0ef72826 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoint; + +class StreamingEndpointsImpl extends WrapperImpl implements StreamingEndpoints { + private final MediaManager manager; + + StreamingEndpointsImpl(MediaManager manager) { + super(manager.inner().streamingEndpoints()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingEndpointImpl define(String name) { + return wrapModel(name); + } + + private StreamingEndpointImpl wrapModel(StreamingEndpointInner inner) { + return new StreamingEndpointImpl(inner, manager()); + } + + private StreamingEndpointImpl wrapModel(String name) { + return new StreamingEndpointImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.scaleAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingEndpointsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingEndpointName) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsInner.java new file mode 100644 index 0000000000000..73c11de0317ae --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingEndpointsInner.java @@ -0,0 +1,1944 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEntityScaleUnit; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingEndpoints. + */ +public class StreamingEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingEndpointsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingEndpointsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints scale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> scale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints beginScale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> beginScale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if auto start the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner update(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginUpdate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String streamingEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String streamingEndpointName) { + startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScaleDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorImpl.java new file mode 100644 index 0000000000000..78e3927fed858 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorImpl.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocator; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocatorUserDefinedContentKey; + +class StreamingLocatorImpl extends CreatableUpdatableImpl implements StreamingLocator, StreamingLocator.Definition, StreamingLocator.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingLocatorName; + + StreamingLocatorImpl(String name, MediaManager manager) { + super(name, new StreamingLocatorInner()); + this.manager = manager; + // Set resource name + this.streamingLocatorName = name; + // + } + + StreamingLocatorImpl(StreamingLocatorInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingLocatorName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingLocatorName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingLocators"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public UUID streamingLocatorId() { + return this.inner().streamingLocatorId(); + } + + @Override + public String streamingPolicyName() { + return this.inner().streamingPolicyName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingLocatorImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingLocatorImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingPolicyName(String streamingPolicyName) { + this.inner().withStreamingPolicyName(streamingPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withContentKeys(List contentKeys) { + this.inner().withContentKeys(contentKeys); + return this; + } + + @Override + public StreamingLocatorImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withEndTime(DateTime endTime) { + this.inner().withEndTime(endTime); + return this; + } + + @Override + public StreamingLocatorImpl withStartTime(DateTime startTime) { + this.inner().withStartTime(startTime); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingLocatorId(UUID streamingLocatorId) { + this.inner().withStreamingLocatorId(streamingLocatorId); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorInner.java new file mode 100644 index 0000000000000..79b586743dfe2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorInner.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocatorUserDefinedContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Locator resource. + */ +@JsonFlatten +public class StreamingLocatorInner extends ProxyResource { + /** + * Asset Name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * Creation time of Streaming Locator. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * StartTime of Streaming Locator. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * EndTime of Streaming Locator. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * StreamingLocatorId of Streaming Locator. + */ + @JsonProperty(value = "properties.streamingLocatorId") + private UUID streamingLocatorId; + + /** + * Streaming policy name used by this streaming locator. Either specify the + * name of streaming policy you created or use one of the predefined + * streaming polices. The predefined streaming policies available are: + * 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', + * 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', + * 'Predefined_SecureStreaming' and + * 'Predefined_SecureStreamingWithFairPlay'. + */ + @JsonProperty(value = "properties.streamingPolicyName", required = true) + private String streamingPolicyName; + + /** + * Default ContentKeyPolicy used by this Streaming Locator. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * ContentKeys used by this Streaming Locator. + */ + @JsonProperty(value = "properties.contentKeys") + private List contentKeys; + + /** + * Get asset Name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set asset Name. + * + * @param assetName the assetName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get creation time of Streaming Locator. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get startTime of Streaming Locator. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set startTime of Streaming Locator. + * + * @param startTime the startTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get endTime of Streaming Locator. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set endTime of Streaming Locator. + * + * @param endTime the endTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get streamingLocatorId of Streaming Locator. + * + * @return the streamingLocatorId value + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Set streamingLocatorId of Streaming Locator. + * + * @param streamingLocatorId the streamingLocatorId value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingLocatorId(UUID streamingLocatorId) { + this.streamingLocatorId = streamingLocatorId; + return this; + } + + /** + * Get streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay'. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay'. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + + /** + * Get default ContentKeyPolicy used by this Streaming Locator. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set default ContentKeyPolicy used by this Streaming Locator. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get contentKeys used by this Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set contentKeys used by this Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsImpl.java new file mode 100644 index 0000000000000..76d2f671fcaba --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListContentKeysResponse; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ListPathsResponse; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocator; + +class StreamingLocatorsImpl extends WrapperImpl implements StreamingLocators { + private final MediaManager manager; + + StreamingLocatorsImpl(MediaManager manager) { + super(manager.inner().streamingLocators()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingLocatorImpl define(String name) { + return wrapModel(name); + } + + private StreamingLocatorImpl wrapModel(StreamingLocatorInner inner) { + return new StreamingLocatorImpl(inner, manager()); + } + + private StreamingLocatorImpl wrapModel(String name) { + return new StreamingLocatorImpl(name, this.manager()); + } + + @Override + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listContentKeysAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListContentKeysResponse call(ListContentKeysResponseInner inner) { + return new ListContentKeysResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listPathsAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListPathsResponse call(ListPathsResponseInner inner) { + return new ListPathsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingLocatorsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingLocatorName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsInner.java new file mode 100644 index 0000000000000..7e35b633d1e2d --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingLocatorsInner.java @@ -0,0 +1,972 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingLocators. + */ +public class StreamingLocatorsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingLocatorsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingLocatorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingLocatorsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingLocatorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingLocators to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingLocatorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Body StreamingLocatorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators listContentKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys") + Observable> listContentKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators listPaths" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths") + Observable> listPaths(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingLocators listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner create(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters), serviceCallback); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListContentKeysResponseInner object if successful. + */ + public ListContentKeysResponseInner listContentKeys(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListContentKeysResponseInner>() { + @Override + public ListContentKeysResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable> listContentKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listContentKeys(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContentKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContentKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListPathsResponseInner object if successful. + */ + public ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListPathsResponseInner>() { + @Override + public ListPathsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable> listPathsWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPaths(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listPathsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listPathsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesImpl.java new file mode 100644 index 0000000000000..7848e18dd62ea --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicy; + +class StreamingPoliciesImpl extends WrapperImpl implements StreamingPolicies { + private final MediaManager manager; + + StreamingPoliciesImpl(MediaManager manager) { + super(manager.inner().streamingPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingPolicyImpl define(String name) { + return wrapModel(name); + } + + private StreamingPolicyImpl wrapModel(StreamingPolicyInner inner) { + return new StreamingPolicyImpl(inner, manager()); + } + + private StreamingPolicyImpl wrapModel(String name) { + return new StreamingPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingPolicyName) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesInner.java new file mode 100644 index 0000000000000..031bdc6a85731 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPoliciesInner.java @@ -0,0 +1,769 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingPolicies. + */ +public class StreamingPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private StreamingPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Body StreamingPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner create(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters), serviceCallback); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyImpl.java new file mode 100644 index 0000000000000..90cd56e86c6ce --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyImpl.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StreamingPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.NoEncryption; + +class StreamingPolicyImpl extends CreatableUpdatableImpl implements StreamingPolicy, StreamingPolicy.Definition, StreamingPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingPolicyName; + + StreamingPolicyImpl(String name, MediaManager manager) { + super(name, new StreamingPolicyInner()); + this.manager = manager; + // Set resource name + this.streamingPolicyName = name; + // + } + + StreamingPolicyImpl(StreamingPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.inner().commonEncryptionCbcs(); + } + + @Override + public CommonEncryptionCenc commonEncryptionCenc() { + return this.inner().commonEncryptionCenc(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public EnvelopeEncryption envelopeEncryption() { + return this.inner().envelopeEncryption(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NoEncryption noEncryption() { + return this.inner().noEncryption(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.inner().withCommonEncryptionCbcs(commonEncryptionCbcs); + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.inner().withCommonEncryptionCenc(commonEncryptionCenc); + return this; + } + + @Override + public StreamingPolicyImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingPolicyImpl withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.inner().withEnvelopeEncryption(envelopeEncryption); + return this; + } + + @Override + public StreamingPolicyImpl withNoEncryption(NoEncryption noEncryption) { + this.inner().withNoEncryption(noEncryption); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyInner.java new file mode 100644 index 0000000000000..f13d66b0d653e --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/StreamingPolicyInner.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.NoEncryption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Policy resource. + */ +@JsonFlatten +public class StreamingPolicyInner extends ProxyResource { + /** + * Creation time of Streaming Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Default ContentKey used by current Streaming Policy. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * Configuration of EnvelopeEncryption. + */ + @JsonProperty(value = "properties.envelopeEncryption") + private EnvelopeEncryption envelopeEncryption; + + /** + * Configuration of CommonEncryptionCenc. + */ + @JsonProperty(value = "properties.commonEncryptionCenc") + private CommonEncryptionCenc commonEncryptionCenc; + + /** + * Configuration of CommonEncryptionCbcs. + */ + @JsonProperty(value = "properties.commonEncryptionCbcs") + private CommonEncryptionCbcs commonEncryptionCbcs; + + /** + * Configuations of NoEncryption. + */ + @JsonProperty(value = "properties.noEncryption") + private NoEncryption noEncryption; + + /** + * Get creation time of Streaming Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get default ContentKey used by current Streaming Policy. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set default ContentKey used by current Streaming Policy. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get configuration of EnvelopeEncryption. + * + * @return the envelopeEncryption value + */ + public EnvelopeEncryption envelopeEncryption() { + return this.envelopeEncryption; + } + + /** + * Set configuration of EnvelopeEncryption. + * + * @param envelopeEncryption the envelopeEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.envelopeEncryption = envelopeEncryption; + return this; + } + + /** + * Get configuration of CommonEncryptionCenc. + * + * @return the commonEncryptionCenc value + */ + public CommonEncryptionCenc commonEncryptionCenc() { + return this.commonEncryptionCenc; + } + + /** + * Set configuration of CommonEncryptionCenc. + * + * @param commonEncryptionCenc the commonEncryptionCenc value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.commonEncryptionCenc = commonEncryptionCenc; + return this; + } + + /** + * Get configuration of CommonEncryptionCbcs. + * + * @return the commonEncryptionCbcs value + */ + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.commonEncryptionCbcs; + } + + /** + * Set configuration of CommonEncryptionCbcs. + * + * @param commonEncryptionCbcs the commonEncryptionCbcs value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.commonEncryptionCbcs = commonEncryptionCbcs; + return this; + } + + /** + * Get configuations of NoEncryption. + * + * @return the noEncryption value + */ + public NoEncryption noEncryption() { + return this.noEncryption; + } + + /** + * Set configuations of NoEncryption. + * + * @param noEncryption the noEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withNoEncryption(NoEncryption noEncryption) { + this.noEncryption = noEncryption; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceImpl.java new file mode 100644 index 0000000000000..365fdebaca1a5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.SubscriptionMediaService; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StorageAccount; +import java.util.Map; + +class SubscriptionMediaServiceImpl extends WrapperImpl implements SubscriptionMediaService { + private final MediaManager manager; + SubscriptionMediaServiceImpl(SubscriptionMediaServiceInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceInner.java new file mode 100644 index 0000000000000..cfaffe8bd1c15 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/SubscriptionMediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class SubscriptionMediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the SubscriptionMediaServiceInner object itself. + */ + public SubscriptionMediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformImpl.java new file mode 100644 index 0000000000000..3c10fa7307da2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transform; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.TransformOutput; + +class TransformImpl extends CreatableUpdatableImpl implements Transform, Transform.Definition, Transform.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + + TransformImpl(String name, MediaManager manager) { + super(name, new TransformInner()); + this.manager = manager; + // Set resource name + this.transformName = name; + // + } + + TransformImpl(TransformInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.transformName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TransformImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TransformImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public TransformImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformInner.java new file mode 100644 index 0000000000000..bce315636a135 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.TransformOutput; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Transform encapsulates the rules or instructions for generating desired + * outputs from input media, such as by transcoding or by extracting insights. + * After the Transform is created, it can be applied to input media by creating + * Jobs. + */ +@JsonFlatten +public class TransformInner extends ProxyResource { + /** + * The UTC date and time when the Transform was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * An optional verbose description of the Transform. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The UTC date and time when the Transform was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * An array of one or more TransformOutputs that the Transform should + * generate. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Get the UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get an optional verbose description of the Transform. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set an optional verbose description of the Transform. + * + * @param description the description value to set + * @return the TransformInner object itself. + */ + public TransformInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get an array of one or more TransformOutputs that the Transform should generate. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set an array of one or more TransformOutputs that the Transform should generate. + * + * @param outputs the outputs value to set + * @return the TransformInner object itself. + */ + public TransformInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsImpl.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsImpl.java new file mode 100644 index 0000000000000..c124423b92a35 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transform; + +class TransformsImpl extends WrapperImpl implements Transforms { + private final MediaManager manager; + + TransformsImpl(MediaManager manager) { + super(manager.inner().transforms()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public TransformImpl define(String name) { + return wrapModel(name); + } + + private TransformImpl wrapModel(TransformInner inner) { + return new TransformImpl(inner, manager()); + } + + private TransformImpl wrapModel(String name) { + return new TransformImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + TransformsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java new file mode 100644 index 0000000000000..6315e886a9b02 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java @@ -0,0 +1,880 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_03_30_preview.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Transforms. + */ +public class TransformsInner { + /** The Retrofit service to perform REST calls. */ + private TransformsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of TransformsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TransformsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(TransformsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Transforms to be + * used by Retrofit to perform actually REST calls. + */ + interface TransformsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_03_30_preview.Transforms listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner get(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner createOrUpdate(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner update(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/package-info.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/package-info.java new file mode 100644 index 0000000000000..266349fedb9b3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview.implementation; diff --git a/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/package-info.java b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/package-info.java new file mode 100644 index 0000000000000..2b5ed61486db6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_03_30_preview; diff --git a/mediaservices/resource-manager/v2018_06_01_preview/pom.xml b/mediaservices/resource-manager/v2018_06_01_preview/pom.xml index 27f8f2e07af95..9f7a6cae0b95b 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/pom.xml +++ b/mediaservices/resource-manager/v2018_06_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-media @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Media Management This package contains Microsoft Media Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Asset.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Asset.java index 53fe0e66f013c..f544627921c11 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Asset.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Asset.java @@ -101,6 +101,9 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ WithCreate withExistingMediaservice(String resourceGroupName, String accountName); } @@ -111,6 +114,8 @@ interface WithMediaservice { interface WithAlternateId { /** * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next definition stage */ WithCreate withAlternateId(String alternateId); } @@ -121,6 +126,8 @@ interface WithAlternateId { interface WithContainer { /** * Specifies container. + * @param container The name of the asset blob container + * @return the next definition stage */ WithCreate withContainer(String container); } @@ -131,6 +138,8 @@ interface WithContainer { interface WithDescription { /** * Specifies description. + * @param description The Asset description + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -141,6 +150,8 @@ interface WithDescription { interface WithStorageAccountName { /** * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next definition stage */ WithCreate withStorageAccountName(String storageAccountName); } @@ -169,6 +180,8 @@ interface UpdateStages { interface WithAlternateId { /** * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next update stage */ Update withAlternateId(String alternateId); } @@ -179,6 +192,8 @@ interface WithAlternateId { interface WithContainer { /** * Specifies container. + * @param container The name of the asset blob container + * @return the next update stage */ Update withContainer(String container); } @@ -189,6 +204,8 @@ interface WithContainer { interface WithDescription { /** * Specifies description. + * @param description The Asset description + * @return the next update stage */ Update withDescription(String description); } @@ -199,6 +216,8 @@ interface WithDescription { interface WithStorageAccountName { /** * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next update stage */ Update withStorageAccountName(String storageAccountName); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/ContentKeyPolicy.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/ContentKeyPolicy.java index a2d9471b21da5..811383fd4e044 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/ContentKeyPolicy.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/ContentKeyPolicy.java @@ -87,6 +87,9 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ WithOptions withExistingMediaservice(String resourceGroupName, String accountName); } @@ -97,6 +100,8 @@ interface WithMediaservice { interface WithOptions { /** * Specifies options. + * @param options The Key Policy options + * @return the next definition stage */ WithCreate withOptions(List options); } @@ -107,6 +112,8 @@ interface WithOptions { interface WithDescription { /** * Specifies description. + * @param description A description for the Policy + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -135,6 +142,8 @@ interface UpdateStages { interface WithDescription { /** * Specifies description. + * @param description A description for the Policy + * @return the next update stage */ Update withDescription(String description); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Job.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Job.java index 56be787019ca8..fafedd6d00ba8 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Job.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Job.java @@ -102,6 +102,10 @@ interface Blank extends WithTransform { interface WithTransform { /** * Specifies resourceGroupName, accountName, transformName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param transformName The Transform name + * @return the next definition stage */ WithInput withExistingTransform(String resourceGroupName, String accountName, String transformName); } @@ -112,6 +116,8 @@ interface WithTransform { interface WithInput { /** * Specifies input. + * @param input The inputs for the Job + * @return the next definition stage */ WithOutputs withInput(JobInput input); } @@ -122,6 +128,8 @@ interface WithInput { interface WithOutputs { /** * Specifies outputs. + * @param outputs The outputs for the Job + * @return the next definition stage */ WithCreate withOutputs(List outputs); } @@ -132,6 +140,8 @@ interface WithOutputs { interface WithCorrelationData { /** * Specifies correlationData. + * @param correlationData Customer provided correlation data that will be returned in Job completed events + * @return the next definition stage */ WithCreate withCorrelationData(Map correlationData); } @@ -142,6 +152,8 @@ interface WithCorrelationData { interface WithDescription { /** * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -152,6 +164,8 @@ interface WithDescription { interface WithPriority { /** * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next definition stage */ WithCreate withPriority(Priority priority); } @@ -180,6 +194,8 @@ interface UpdateStages { interface WithCorrelationData { /** * Specifies correlationData. + * @param correlationData Customer provided correlation data that will be returned in Job completed events + * @return the next update stage */ Update withCorrelationData(Map correlationData); } @@ -190,6 +206,8 @@ interface WithCorrelationData { interface WithDescription { /** * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next update stage */ Update withDescription(String description); } @@ -200,6 +218,8 @@ interface WithDescription { interface WithPriority { /** * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next update stage */ Update withPriority(Priority priority); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveEvent.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveEvent.java index 2b07aa6f90776..f9c811e152aef 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveEvent.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveEvent.java @@ -108,7 +108,7 @@ public interface LiveEvent extends HasInner, Indexable, Refresha /** * The entirety of the LiveEvent definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithInput, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithInput, DefinitionStages.WithCreate { } /** @@ -127,8 +127,23 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ - WithInput withExistingMediaservice(String resourceGroupName, String accountName); + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the liveevent definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if auto start the Live Event + * @return the next definition stage + */ + WithInput withAutoStart(Boolean autoStart); } /** @@ -137,6 +152,8 @@ interface WithMediaservice { interface WithInput { /** * Specifies input. + * @param input The Live Event input + * @return the next definition stage */ WithCreate withInput(LiveEventInput input); } @@ -147,6 +164,8 @@ interface WithInput { interface WithCrossSiteAccessPolicies { /** * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next definition stage */ WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); } @@ -157,6 +176,8 @@ interface WithCrossSiteAccessPolicies { interface WithDescription { /** * Specifies description. + * @param description The Live Event description + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -167,6 +188,8 @@ interface WithDescription { interface WithEncoding { /** * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next definition stage */ WithCreate withEncoding(LiveEventEncoding encoding); } @@ -177,6 +200,8 @@ interface WithEncoding { interface WithLocation { /** * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage */ WithCreate withLocation(String location); } @@ -187,6 +212,8 @@ interface WithLocation { interface WithPreview { /** * Specifies preview. + * @param preview The Live Event preview + * @return the next definition stage */ WithCreate withPreview(LiveEventPreview preview); } @@ -197,6 +224,8 @@ interface WithPreview { interface WithStreamOptions { /** * Specifies streamOptions. + * @param streamOptions The stream options + * @return the next definition stage */ WithCreate withStreamOptions(List streamOptions); } @@ -207,6 +236,8 @@ interface WithStreamOptions { interface WithTags { /** * Specifies tags. + * @param tags Resource tags + * @return the next definition stage */ WithCreate withTags(Map tags); } @@ -217,6 +248,8 @@ interface WithTags { interface WithVanityUrl { /** * Specifies vanityUrl. + * @param vanityUrl The Live Event vanity URL flag + * @return the next definition stage */ WithCreate withVanityUrl(Boolean vanityUrl); } @@ -245,6 +278,8 @@ interface UpdateStages { interface WithCrossSiteAccessPolicies { /** * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next update stage */ Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); } @@ -255,6 +290,8 @@ interface WithCrossSiteAccessPolicies { interface WithDescription { /** * Specifies description. + * @param description The Live Event description + * @return the next update stage */ Update withDescription(String description); } @@ -265,6 +302,8 @@ interface WithDescription { interface WithEncoding { /** * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next update stage */ Update withEncoding(LiveEventEncoding encoding); } @@ -275,6 +314,8 @@ interface WithEncoding { interface WithLocation { /** * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage */ Update withLocation(String location); } @@ -285,6 +326,8 @@ interface WithLocation { interface WithPreview { /** * Specifies preview. + * @param preview The Live Event preview + * @return the next update stage */ Update withPreview(LiveEventPreview preview); } @@ -295,6 +338,8 @@ interface WithPreview { interface WithStreamOptions { /** * Specifies streamOptions. + * @param streamOptions The stream options + * @return the next update stage */ Update withStreamOptions(List streamOptions); } @@ -305,6 +350,8 @@ interface WithStreamOptions { interface WithTags { /** * Specifies tags. + * @param tags Resource tags + * @return the next update stage */ Update withTags(Map tags); } @@ -315,6 +362,8 @@ interface WithTags { interface WithVanityUrl { /** * Specifies vanityUrl. + * @param vanityUrl The Live Event vanity URL flag + * @return the next update stage */ Update withVanityUrl(Boolean vanityUrl); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveOutput.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveOutput.java index c665bf08d3ad0..d5e51d9738166 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveOutput.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/LiveOutput.java @@ -111,6 +111,10 @@ interface Blank extends WithLiveEvent { interface WithLiveEvent { /** * Specifies resourceGroupName, accountName, liveEventName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param liveEventName The name of the Live Event + * @return the next definition stage */ WithArchiveWindowLength withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); } @@ -121,6 +125,8 @@ interface WithLiveEvent { interface WithArchiveWindowLength { /** * Specifies archiveWindowLength. + * @param archiveWindowLength ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content + * @return the next definition stage */ WithAssetName withArchiveWindowLength(Period archiveWindowLength); } @@ -131,6 +137,8 @@ interface WithArchiveWindowLength { interface WithAssetName { /** * Specifies assetName. + * @param assetName The asset name + * @return the next definition stage */ WithCreate withAssetName(String assetName); } @@ -141,6 +149,8 @@ interface WithAssetName { interface WithDescription { /** * Specifies description. + * @param description The description of the Live Output + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -151,6 +161,8 @@ interface WithDescription { interface WithHls { /** * Specifies hls. + * @param hls The HLS configuration + * @return the next definition stage */ WithCreate withHls(Hls hls); } @@ -161,6 +173,8 @@ interface WithHls { interface WithManifestName { /** * Specifies manifestName. + * @param manifestName The manifest file name + * @return the next definition stage */ WithCreate withManifestName(String manifestName); } @@ -171,6 +185,8 @@ interface WithManifestName { interface WithOutputSnapTime { /** * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next definition stage */ WithCreate withOutputSnapTime(Long outputSnapTime); } @@ -199,6 +215,8 @@ interface UpdateStages { interface WithDescription { /** * Specifies description. + * @param description The description of the Live Output + * @return the next update stage */ Update withDescription(String description); } @@ -209,6 +227,8 @@ interface WithDescription { interface WithHls { /** * Specifies hls. + * @param hls The HLS configuration + * @return the next update stage */ Update withHls(Hls hls); } @@ -219,6 +239,8 @@ interface WithHls { interface WithManifestName { /** * Specifies manifestName. + * @param manifestName The manifest file name + * @return the next update stage */ Update withManifestName(String manifestName); } @@ -229,6 +251,8 @@ interface WithManifestName { interface WithOutputSnapTime { /** * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next update stage */ Update withOutputSnapTime(Long outputSnapTime); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/MediaService.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/MediaService.java index 941a5c77353a9..d15ecb99a9d5f 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/MediaService.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/MediaService.java @@ -59,11 +59,13 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup storageAccounts); } @@ -87,11 +89,13 @@ interface Update extends Appliable, Resource.UpdateWithTags storageAccounts); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingEndpoint.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingEndpoint.java index 3ea1db4a168df..7d4675d556bcc 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingEndpoint.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingEndpoint.java @@ -133,7 +133,7 @@ public interface StreamingEndpoint extends HasInner, Ind /** * The entirety of the StreamingEndpoint definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithCreate { } /** @@ -152,8 +152,23 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ - WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if auto start the Live Event + * @return the next definition stage + */ + WithCreate withAutoStart(Boolean autoStart); } /** @@ -162,6 +177,8 @@ interface WithMediaservice { interface WithAccessControl { /** * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next definition stage */ WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); } @@ -172,6 +189,8 @@ interface WithAccessControl { interface WithAvailabilitySetName { /** * Specifies availabilitySetName. + * @param availabilitySetName AvailabilitySet name + * @return the next definition stage */ WithCreate withAvailabilitySetName(String availabilitySetName); } @@ -182,6 +201,8 @@ interface WithAvailabilitySetName { interface WithCdnEnabled { /** * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next definition stage */ WithCreate withCdnEnabled(Boolean cdnEnabled); } @@ -192,6 +213,8 @@ interface WithCdnEnabled { interface WithCdnProfile { /** * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next definition stage */ WithCreate withCdnProfile(String cdnProfile); } @@ -202,6 +225,8 @@ interface WithCdnProfile { interface WithCdnProvider { /** * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next definition stage */ WithCreate withCdnProvider(String cdnProvider); } @@ -212,6 +237,8 @@ interface WithCdnProvider { interface WithCrossSiteAccessPolicies { /** * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next definition stage */ WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); } @@ -222,6 +249,8 @@ interface WithCrossSiteAccessPolicies { interface WithCustomHostNames { /** * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next definition stage */ WithCreate withCustomHostNames(List customHostNames); } @@ -232,6 +261,8 @@ interface WithCustomHostNames { interface WithDescription { /** * Specifies description. + * @param description The StreamingEndpoint description + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -242,6 +273,8 @@ interface WithDescription { interface WithLocation { /** * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage */ WithCreate withLocation(String location); } @@ -252,6 +285,8 @@ interface WithLocation { interface WithMaxCacheAge { /** * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next definition stage */ WithCreate withMaxCacheAge(Long maxCacheAge); } @@ -262,6 +297,8 @@ interface WithMaxCacheAge { interface WithScaleUnits { /** * Specifies scaleUnits. + * @param scaleUnits The number of scale units + * @return the next definition stage */ WithCreate withScaleUnits(int scaleUnits); } @@ -272,6 +309,8 @@ interface WithScaleUnits { interface WithTags { /** * Specifies tags. + * @param tags Resource tags + * @return the next definition stage */ WithCreate withTags(Map tags); } @@ -300,6 +339,8 @@ interface UpdateStages { interface WithAccessControl { /** * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next update stage */ Update withAccessControl(StreamingEndpointAccessControl accessControl); } @@ -310,6 +351,8 @@ interface WithAccessControl { interface WithAvailabilitySetName { /** * Specifies availabilitySetName. + * @param availabilitySetName AvailabilitySet name + * @return the next update stage */ Update withAvailabilitySetName(String availabilitySetName); } @@ -320,6 +363,8 @@ interface WithAvailabilitySetName { interface WithCdnEnabled { /** * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next update stage */ Update withCdnEnabled(Boolean cdnEnabled); } @@ -330,6 +375,8 @@ interface WithCdnEnabled { interface WithCdnProfile { /** * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next update stage */ Update withCdnProfile(String cdnProfile); } @@ -340,6 +387,8 @@ interface WithCdnProfile { interface WithCdnProvider { /** * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next update stage */ Update withCdnProvider(String cdnProvider); } @@ -350,6 +399,8 @@ interface WithCdnProvider { interface WithCrossSiteAccessPolicies { /** * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next update stage */ Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); } @@ -360,6 +411,8 @@ interface WithCrossSiteAccessPolicies { interface WithCustomHostNames { /** * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next update stage */ Update withCustomHostNames(List customHostNames); } @@ -370,6 +423,8 @@ interface WithCustomHostNames { interface WithDescription { /** * Specifies description. + * @param description The StreamingEndpoint description + * @return the next update stage */ Update withDescription(String description); } @@ -380,6 +435,8 @@ interface WithDescription { interface WithLocation { /** * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage */ Update withLocation(String location); } @@ -390,6 +447,8 @@ interface WithLocation { interface WithMaxCacheAge { /** * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next update stage */ Update withMaxCacheAge(Long maxCacheAge); } @@ -400,6 +459,8 @@ interface WithMaxCacheAge { interface WithScaleUnits { /** * Specifies scaleUnits. + * @param scaleUnits The number of scale units + * @return the next update stage */ Update withScaleUnits(int scaleUnits); } @@ -410,6 +471,8 @@ interface WithScaleUnits { interface WithTags { /** * Specifies tags. + * @param tags Resource tags + * @return the next update stage */ Update withTags(Map tags); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingLocator.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingLocator.java index 871422a313c49..15ea3c90b144d 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingLocator.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingLocator.java @@ -107,6 +107,9 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ WithAssetName withExistingMediaservice(String resourceGroupName, String accountName); } @@ -117,6 +120,8 @@ interface WithMediaservice { interface WithAssetName { /** * Specifies assetName. + * @param assetName Asset Name + * @return the next definition stage */ WithStreamingPolicyName withAssetName(String assetName); } @@ -127,6 +132,8 @@ interface WithAssetName { interface WithStreamingPolicyName { /** * Specifies streamingPolicyName. + * @param streamingPolicyName Streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay' + * @return the next definition stage */ WithCreate withStreamingPolicyName(String streamingPolicyName); } @@ -137,6 +144,8 @@ interface WithStreamingPolicyName { interface WithAlternativeMediaId { /** * Specifies alternativeMediaId. + * @param alternativeMediaId An Alternative Media Identifier associated with the StreamingLocator. This identifier can be used to distinguish different StreamingLocators for the same Asset for authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field + * @return the next definition stage */ WithCreate withAlternativeMediaId(String alternativeMediaId); } @@ -147,6 +156,8 @@ interface WithAlternativeMediaId { interface WithContentKeys { /** * Specifies contentKeys. + * @param contentKeys ContentKeys used by this Streaming Locator + * @return the next definition stage */ WithCreate withContentKeys(List contentKeys); } @@ -157,6 +168,8 @@ interface WithContentKeys { interface WithDefaultContentKeyPolicyName { /** * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKeyPolicy used by this Streaming Locator + * @return the next definition stage */ WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); } @@ -167,6 +180,8 @@ interface WithDefaultContentKeyPolicyName { interface WithEndTime { /** * Specifies endTime. + * @param endTime EndTime of Streaming Locator + * @return the next definition stage */ WithCreate withEndTime(DateTime endTime); } @@ -177,6 +192,8 @@ interface WithEndTime { interface WithStartTime { /** * Specifies startTime. + * @param startTime StartTime of Streaming Locator + * @return the next definition stage */ WithCreate withStartTime(DateTime startTime); } @@ -187,6 +204,8 @@ interface WithStartTime { interface WithStreamingLocatorId { /** * Specifies streamingLocatorId. + * @param streamingLocatorId StreamingLocatorId of Streaming Locator + * @return the next definition stage */ WithCreate withStreamingLocatorId(UUID streamingLocatorId); } @@ -215,6 +234,8 @@ interface UpdateStages { interface WithAlternativeMediaId { /** * Specifies alternativeMediaId. + * @param alternativeMediaId An Alternative Media Identifier associated with the StreamingLocator. This identifier can be used to distinguish different StreamingLocators for the same Asset for authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field + * @return the next update stage */ Update withAlternativeMediaId(String alternativeMediaId); } @@ -225,6 +246,8 @@ interface WithAlternativeMediaId { interface WithContentKeys { /** * Specifies contentKeys. + * @param contentKeys ContentKeys used by this Streaming Locator + * @return the next update stage */ Update withContentKeys(List contentKeys); } @@ -235,6 +258,8 @@ interface WithContentKeys { interface WithDefaultContentKeyPolicyName { /** * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKeyPolicy used by this Streaming Locator + * @return the next update stage */ Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); } @@ -245,6 +270,8 @@ interface WithDefaultContentKeyPolicyName { interface WithEndTime { /** * Specifies endTime. + * @param endTime EndTime of Streaming Locator + * @return the next update stage */ Update withEndTime(DateTime endTime); } @@ -255,6 +282,8 @@ interface WithEndTime { interface WithStartTime { /** * Specifies startTime. + * @param startTime StartTime of Streaming Locator + * @return the next update stage */ Update withStartTime(DateTime startTime); } @@ -265,6 +294,8 @@ interface WithStartTime { interface WithStreamingLocatorId { /** * Specifies streamingLocatorId. + * @param streamingLocatorId StreamingLocatorId of Streaming Locator + * @return the next update stage */ Update withStreamingLocatorId(UUID streamingLocatorId); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingPolicy.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingPolicy.java index b9edaccb12da1..56d251f960b72 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingPolicy.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/StreamingPolicy.java @@ -90,6 +90,9 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ WithCreate withExistingMediaservice(String resourceGroupName, String accountName); } @@ -100,6 +103,8 @@ interface WithMediaservice { interface WithCommonEncryptionCbcs { /** * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next definition stage */ WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); } @@ -110,6 +115,8 @@ interface WithCommonEncryptionCbcs { interface WithCommonEncryptionCenc { /** * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next definition stage */ WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); } @@ -120,6 +127,8 @@ interface WithCommonEncryptionCenc { interface WithDefaultContentKeyPolicyName { /** * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next definition stage */ WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); } @@ -130,6 +139,8 @@ interface WithDefaultContentKeyPolicyName { interface WithEnvelopeEncryption { /** * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next definition stage */ WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); } @@ -140,6 +151,8 @@ interface WithEnvelopeEncryption { interface WithNoEncryption { /** * Specifies noEncryption. + * @param noEncryption Configurations of NoEncryption + * @return the next definition stage */ WithCreate withNoEncryption(NoEncryption noEncryption); } @@ -168,6 +181,8 @@ interface UpdateStages { interface WithCommonEncryptionCbcs { /** * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next update stage */ Update withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); } @@ -178,6 +193,8 @@ interface WithCommonEncryptionCbcs { interface WithCommonEncryptionCenc { /** * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next update stage */ Update withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); } @@ -188,6 +205,8 @@ interface WithCommonEncryptionCenc { interface WithDefaultContentKeyPolicyName { /** * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next update stage */ Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); } @@ -198,6 +217,8 @@ interface WithDefaultContentKeyPolicyName { interface WithEnvelopeEncryption { /** * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next update stage */ Update withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); } @@ -208,6 +229,8 @@ interface WithEnvelopeEncryption { interface WithNoEncryption { /** * Specifies noEncryption. + * @param noEncryption Configurations of NoEncryption + * @return the next update stage */ Update withNoEncryption(NoEncryption noEncryption); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Transform.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Transform.java index b86ad5e439b0c..9dc4ab7cca0b8 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Transform.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/Transform.java @@ -81,6 +81,9 @@ interface Blank extends WithMediaservice { interface WithMediaservice { /** * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage */ WithOutputs withExistingMediaservice(String resourceGroupName, String accountName); } @@ -91,6 +94,8 @@ interface WithMediaservice { interface WithOutputs { /** * Specifies outputs. + * @param outputs An array of one or more TransformOutputs that the Transform should generate + * @return the next definition stage */ WithCreate withOutputs(List outputs); } @@ -101,6 +106,8 @@ interface WithOutputs { interface WithDescription { /** * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next definition stage */ WithCreate withDescription(String description); } @@ -129,6 +136,8 @@ interface UpdateStages { interface WithDescription { /** * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next update stage */ Update withDescription(String description); } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetImpl.java index cd925467813c0..33d33c2a9fb69 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetImpl.java @@ -34,7 +34,7 @@ class AssetImpl extends CreatableUpdatableImpl imp this.manager = manager; // Set resource name this.assetName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AzureMediaServicesImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AzureMediaServicesImpl.java index 06489a3f851f1..36b0e3bb2dacb 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AzureMediaServicesImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AzureMediaServicesImpl.java @@ -345,6 +345,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "AzureMediaServices", "2018-06-01-preview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AzureMediaServices", "2018-06-01-preview"); } } diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/ContentKeyPolicyImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/ContentKeyPolicyImpl.java index 6661b0c141f39..9d34a4cdf80cc 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/ContentKeyPolicyImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/ContentKeyPolicyImpl.java @@ -35,7 +35,7 @@ class ContentKeyPolicyImpl extends CreatableUpdatableImpl implements this.manager = manager; // Set resource name this.jobName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventImpl.java index 2ec9a9d1b3a97..5dbae73f0b265 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventImpl.java @@ -26,6 +26,7 @@ class LiveEventImpl extends CreatableUpdatableImpl createResourceAsync() { LiveEventsInner client = this.manager().inner().liveEvents(); - return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner(), this.cautoStart) .map(innerToFluentMap(this)); } @@ -165,6 +166,12 @@ public LiveEventImpl withExistingMediaservice(String resourceGroupName, String a return this; } + @Override + public LiveEventImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + @Override public LiveEventImpl withInput(LiveEventInput input) { this.inner().withInput(input); diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveOutputImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveOutputImpl.java index 425300a839d6d..d2c7bba0277b6 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveOutputImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveOutputImpl.java @@ -36,7 +36,7 @@ class LiveOutputImpl extends CreatableUpdatableImpl createResourceAsync() { StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner(), this.cautoStart) .map(innerToFluentMap(this)); } @@ -187,6 +188,12 @@ public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, return this; } + @Override + public StreamingEndpointImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + @Override public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { this.inner().withAccessControl(accessControl); diff --git a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/StreamingLocatorImpl.java b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/StreamingLocatorImpl.java index 1fab9934fe4f1..fa046cc570f05 100644 --- a/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/StreamingLocatorImpl.java +++ b/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/StreamingLocatorImpl.java @@ -35,7 +35,7 @@ class StreamingLocatorImpl extends CreatableUpdatableImpl + + 4.0.0 + com.microsoft.azure.mediaservices.v2018_07_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-media + 1.0.0-beta + jar + Microsoft Azure SDK for Media Management + This package contains Microsoft Media Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java new file mode 100644 index 0000000000000..a49a3e4b0578c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes Advanced Audio Codec (AAC) audio encoding settings. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AacAudio") +public class AacAudio extends Audio { + /** + * The encoding profile to be used when encoding audio with AAC. Possible + * values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + */ + @JsonProperty(value = "profile") + private AacAudioProfile profile; + + /** + * Get the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @return the profile value + */ + public AacAudioProfile profile() { + return this.profile; + } + + /** + * Set the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @param profile the profile value to set + * @return the AacAudio object itself. + */ + public AacAudio withProfile(AacAudioProfile profile) { + this.profile = profile; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java new file mode 100644 index 0000000000000..f83145b882e02 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AacAudioProfile. + */ +public enum AacAudioProfile { + /** Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). */ + AAC_LC("AacLc"), + + /** Specifies that the output audio is to be encoded into HE-AAC v1 profile. */ + HE_AAC_V1("HeAacV1"), + + /** Specifies that the output audio is to be encoded into HE-AAC v2 profile. */ + HE_AAC_V2("HeAacV2"); + + /** The actual serialized value for a AacAudioProfile instance. */ + private String value; + + AacAudioProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AacAudioProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed AacAudioProfile object, or null if unable to parse. + */ + @JsonCreator + public static AacAudioProfile fromString(String value) { + AacAudioProfile[] items = AacAudioProfile.values(); + for (AacAudioProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java new file mode 100644 index 0000000000000..6bd5149c74112 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AccountFilterInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.List; + +/** + * Type representing AccountFilter. + */ +public interface AccountFilter extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * @return the tracks value. + */ + List tracks(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AccountFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of AccountFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AccountFilter definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the accountfilter definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the accountfilter definition allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + * @param firstQuality The first quality + * @return the next definition stage + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the accountfilter definition allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + * @param presentationTimeRange The presentation time range + * @return the next definition stage + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the accountfilter definition allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + * @param tracks The tracks selection conditions + * @return the next definition stage + */ + WithCreate withTracks(List tracks); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithFirstQuality, DefinitionStages.WithPresentationTimeRange, DefinitionStages.WithTracks { + } + } + /** + * The template for a AccountFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithFirstQuality, UpdateStages.WithPresentationTimeRange, UpdateStages.WithTracks { + } + + /** + * Grouping of AccountFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the accountfilter update allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + * @param firstQuality The first quality + * @return the next update stage + */ + Update withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the accountfilter update allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + * @param presentationTimeRange The presentation time range + * @return the next update stage + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the accountfilter update allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + * @param tracks The tracks selection conditions + * @return the next update stage + */ + Update withTracks(List tracks); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java new file mode 100644 index 0000000000000..6b93c63646c24 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AccountFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AccountFilters. + */ +public interface AccountFilters extends SupportsCreating, HasInner { + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String filterName); + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String filterName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java new file mode 100644 index 0000000000000..b7e7ed230de57 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai access control. + */ +public class AkamaiAccessControl { + /** + * authentication key list. + */ + @JsonProperty(value = "akamaiSignatureHeaderAuthenticationKeyList") + private List akamaiSignatureHeaderAuthenticationKeyList; + + /** + * Get authentication key list. + * + * @return the akamaiSignatureHeaderAuthenticationKeyList value + */ + public List akamaiSignatureHeaderAuthenticationKeyList() { + return this.akamaiSignatureHeaderAuthenticationKeyList; + } + + /** + * Set authentication key list. + * + * @param akamaiSignatureHeaderAuthenticationKeyList the akamaiSignatureHeaderAuthenticationKeyList value to set + * @return the AkamaiAccessControl object itself. + */ + public AkamaiAccessControl withAkamaiSignatureHeaderAuthenticationKeyList(List akamaiSignatureHeaderAuthenticationKeyList) { + this.akamaiSignatureHeaderAuthenticationKeyList = akamaiSignatureHeaderAuthenticationKeyList; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java new file mode 100644 index 0000000000000..9e290c776d119 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai Signature Header authentication key. + */ +public class AkamaiSignatureHeaderAuthenticationKey { + /** + * identifier of the key. + */ + @JsonProperty(value = "identifier") + private String identifier; + + /** + * authentication key. + */ + @JsonProperty(value = "base64Key") + private String base64Key; + + /** + * The expiration time of the authentication key. + */ + @JsonProperty(value = "expiration") + private DateTime expiration; + + /** + * Get identifier of the key. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set identifier of the key. + * + * @param identifier the identifier value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get authentication key. + * + * @return the base64Key value + */ + public String base64Key() { + return this.base64Key; + } + + /** + * Set authentication key. + * + * @param base64Key the base64Key value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withBase64Key(String base64Key) { + this.base64Key = base64Key; + return this; + } + + /** + * Get the expiration time of the authentication key. + * + * @return the expiration value + */ + public DateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration time of the authentication key. + * + * @param expiration the expiration value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withExpiration(DateTime expiration) { + this.expiration = expiration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java new file mode 100644 index 0000000000000..f86736836d38e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The API error. + */ +public class ApiError { + /** + * ApiError. + * The error properties. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get the error properties. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set the error properties. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java new file mode 100644 index 0000000000000..115ee7ebb7ba0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java new file mode 100644 index 0000000000000..c15d64683e363 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; + +/** + * Type representing Asset. + */ +public interface Asset extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternateId value. + */ + String alternateId(); + + /** + * @return the assetId value. + */ + UUID assetId(); + + /** + * @return the container value. + */ + String container(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * @return the storageEncryptionFormat value. + */ + AssetStorageEncryptionFormat storageEncryptionFormat(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Asset definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of Asset definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Asset definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the asset definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the asset definition allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next definition stage + */ + WithCreate withAlternateId(String alternateId); + } + + /** + * The stage of the asset definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + * @param container The name of the asset blob container + * @return the next definition stage + */ + WithCreate withContainer(String container); + } + + /** + * The stage of the asset definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Asset description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the asset definition allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next definition stage + */ + WithCreate withStorageAccountName(String storageAccountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAlternateId, DefinitionStages.WithContainer, DefinitionStages.WithDescription, DefinitionStages.WithStorageAccountName { + } + } + /** + * The template for a Asset update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternateId, UpdateStages.WithContainer, UpdateStages.WithDescription, UpdateStages.WithStorageAccountName { + } + + /** + * Grouping of Asset update stages. + */ + interface UpdateStages { + /** + * The stage of the asset update allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + * @param alternateId The alternate ID of the Asset + * @return the next update stage + */ + Update withAlternateId(String alternateId); + } + + /** + * The stage of the asset update allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + * @param container The name of the asset blob container + * @return the next update stage + */ + Update withContainer(String container); + } + + /** + * The stage of the asset update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Asset description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the asset update allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + * @param storageAccountName The name of the storage account + * @return the next update stage + */ + Update withStorageAccountName(String storageAccountName); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java new file mode 100644 index 0000000000000..eb64cdf793c8d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetContainerPermission. + */ +public enum AssetContainerPermission { + /** The SAS URL will allow read access to the container. */ + READ("Read"), + + /** The SAS URL will allow read and write access to the container. */ + READ_WRITE("ReadWrite"), + + /** The SAS URL will allow read, write and delete access to the container. */ + READ_WRITE_DELETE("ReadWriteDelete"); + + /** The actual serialized value for a AssetContainerPermission instance. */ + private String value; + + AssetContainerPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetContainerPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetContainerPermission object, or null if unable to parse. + */ + @JsonCreator + public static AssetContainerPermission fromString(String value) { + AssetContainerPermission[] items = AssetContainerPermission.values(); + for (AssetContainerPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java new file mode 100644 index 0000000000000..420b002bca002 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetContainerSasInner; +import java.util.List; + +/** + * Type representing AssetContainerSas. + */ +public interface AssetContainerSas extends HasInner, HasManager { + /** + * @return the assetContainerSasUrls value. + */ + List assetContainerSasUrls(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java new file mode 100644 index 0000000000000..de9f56429b936 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Asset File Storage encryption metadata. + */ +public class AssetFileEncryptionMetadata { + /** + * The Asset File initialization vector. + */ + @JsonProperty(value = "initializationVector") + private String initializationVector; + + /** + * The Asset File name. + */ + @JsonProperty(value = "assetFileName") + private String assetFileName; + + /** + * The Asset File Id. + */ + @JsonProperty(value = "assetFileId", required = true) + private UUID assetFileId; + + /** + * Get the Asset File initialization vector. + * + * @return the initializationVector value + */ + public String initializationVector() { + return this.initializationVector; + } + + /** + * Set the Asset File initialization vector. + * + * @param initializationVector the initializationVector value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withInitializationVector(String initializationVector) { + this.initializationVector = initializationVector; + return this; + } + + /** + * Get the Asset File name. + * + * @return the assetFileName value + */ + public String assetFileName() { + return this.assetFileName; + } + + /** + * Set the Asset File name. + * + * @param assetFileName the assetFileName value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withAssetFileName(String assetFileName) { + this.assetFileName = assetFileName; + return this; + } + + /** + * Get the Asset File Id. + * + * @return the assetFileId value + */ + public UUID assetFileId() { + return this.assetFileId; + } + + /** + * Set the Asset File Id. + * + * @param assetFileId the assetFileId value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withAssetFileId(UUID assetFileId) { + this.assetFileId = assetFileId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java new file mode 100644 index 0000000000000..29d0b53bc2472 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetFilterInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.List; + +/** + * Type representing AssetFilter. + */ +public interface AssetFilter extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * @return the tracks value. + */ + List tracks(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AssetFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAsset, DefinitionStages.WithCreate { + } + + /** + * Grouping of AssetFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AssetFilter definition. + */ + interface Blank extends WithAsset { + } + + /** + * The stage of the assetfilter definition allowing to specify Asset. + */ + interface WithAsset { + /** + * Specifies resourceGroupName, accountName, assetName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param assetName The Asset name + * @return the next definition stage + */ + WithCreate withExistingAsset(String resourceGroupName, String accountName, String assetName); + } + + /** + * The stage of the assetfilter definition allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + * @param firstQuality The first quality + * @return the next definition stage + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the assetfilter definition allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + * @param presentationTimeRange The presentation time range + * @return the next definition stage + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the assetfilter definition allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + * @param tracks The tracks selection conditions + * @return the next definition stage + */ + WithCreate withTracks(List tracks); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithFirstQuality, DefinitionStages.WithPresentationTimeRange, DefinitionStages.WithTracks { + } + } + /** + * The template for a AssetFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithFirstQuality, UpdateStages.WithPresentationTimeRange, UpdateStages.WithTracks { + } + + /** + * Grouping of AssetFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the assetfilter update allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + * @param firstQuality The first quality + * @return the next update stage + */ + Update withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the assetfilter update allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + * @param presentationTimeRange The presentation time range + * @return the next update stage + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the assetfilter update allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + * @param tracks The tracks selection conditions + * @return the next update stage + */ + Update withTracks(List tracks); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java new file mode 100644 index 0000000000000..76ce8661bf86f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AssetFilters. + */ +public interface AssetFilters extends SupportsCreating, HasInner { + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String assetName); + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java new file mode 100644 index 0000000000000..2dee5fc05ab1d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetStorageEncryptionFormat. + */ +public enum AssetStorageEncryptionFormat { + /** The Asset does not use client-side storage encryption (this is the only allowed value for new Assets). */ + NONE("None"), + + /** The Asset is encrypted with Media Services client-side encryption. */ + MEDIA_STORAGE_CLIENT_ENCRYPTION("MediaStorageClientEncryption"); + + /** The actual serialized value for a AssetStorageEncryptionFormat instance. */ + private String value; + + AssetStorageEncryptionFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetStorageEncryptionFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetStorageEncryptionFormat object, or null if unable to parse. + */ + @JsonCreator + public static AssetStorageEncryptionFormat fromString(String value) { + AssetStorageEncryptionFormat[] items = AssetStorageEncryptionFormat.values(); + for (AssetStorageEncryptionFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java new file mode 100644 index 0000000000000..58774074213b7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Streaming Locator. + */ +public class AssetStreamingLocator { + /** + * Streaming Locator name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Asset Name. + */ + @JsonProperty(value = "assetName", access = JsonProperty.Access.WRITE_ONLY) + private String assetName; + + /** + * The creation time of the Streaming Locator. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * StreamingLocatorId of the Streaming Locator. + */ + @JsonProperty(value = "streamingLocatorId", access = JsonProperty.Access.WRITE_ONLY) + private UUID streamingLocatorId; + + /** + * Name of the Streaming Policy used by this Streaming Locator. + */ + @JsonProperty(value = "streamingPolicyName", access = JsonProperty.Access.WRITE_ONLY) + private String streamingPolicyName; + + /** + * Name of the default ContentKeyPolicy used by this Streaming Locator. + */ + @JsonProperty(value = "defaultContentKeyPolicyName", access = JsonProperty.Access.WRITE_ONLY) + private String defaultContentKeyPolicyName; + + /** + * Get streaming Locator name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get asset Name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Get the creation time of the Streaming Locator. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the start time of the Streaming Locator. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the end time of the Streaming Locator. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get streamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Get name of the Streaming Policy used by this Streaming Locator. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Get name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java new file mode 100644 index 0000000000000..a8765f4244cdf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Assets. + */ +public interface Assets extends SupportsCreating, HasInner { + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName); + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName); + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String assetName); + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String assetName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java new file mode 100644 index 0000000000000..6def69e0c7091 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the common properties for all audio codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Audio") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AacAudio", value = AacAudio.class) +}) +public class Audio extends Codec { + /** + * The number of channels in the audio. + */ + @JsonProperty(value = "channels") + private Integer channels; + + /** + * The sampling rate to use for encoding in hertz. + */ + @JsonProperty(value = "samplingRate") + private Integer samplingRate; + + /** + * The bitrate, in bits per second, of the output encoded audio. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * Get the number of channels in the audio. + * + * @return the channels value + */ + public Integer channels() { + return this.channels; + } + + /** + * Set the number of channels in the audio. + * + * @param channels the channels value to set + * @return the Audio object itself. + */ + public Audio withChannels(Integer channels) { + this.channels = channels; + return this; + } + + /** + * Get the sampling rate to use for encoding in hertz. + * + * @return the samplingRate value + */ + public Integer samplingRate() { + return this.samplingRate; + } + + /** + * Set the sampling rate to use for encoding in hertz. + * + * @param samplingRate the samplingRate value to set + * @return the Audio object itself. + */ + public Audio withSamplingRate(Integer samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Get the bitrate, in bits per second, of the output encoded audio. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate, in bits per second, of the output encoded audio. + * + * @param bitrate the bitrate value to set + * @return the Audio object itself. + */ + public Audio withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java new file mode 100644 index 0000000000000..c1da8da065d3e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Audio Analyzer preset applies a pre-defined set of AI-based analysis + * operations, including speech transcription. Currently, the preset supports + * processing of content with a single audio track. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioAnalyzerPreset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoAnalyzerPreset", value = VideoAnalyzerPreset.class) +}) +public class AudioAnalyzerPreset extends Preset { + /** + * The language for the audio payload in the input using the BCP-47 format + * of 'language tag-region' (e.g: 'en-US'). The list of supported languages + * are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', + * 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, + * automatic language detection would be employed. This feature currently + * supports English, Chinese, French, German, Italian, Japanese, Spanish, + * Russian, and Portuguese. The automatic detection works best with audio + * recordings with clearly discernable speech. If automatic detection fails + * to find the language, transcription would fallback to English. + */ + @JsonProperty(value = "audioLanguage") + private String audioLanguage; + + /** + * Get the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, automatic language detection would be employed. This feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to English. + * + * @return the audioLanguage value + */ + public String audioLanguage() { + return this.audioLanguage; + } + + /** + * Set the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, automatic language detection would be employed. This feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to English. + * + * @param audioLanguage the audioLanguage value to set + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withAudioLanguage(String audioLanguage) { + this.audioLanguage = audioLanguage; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java new file mode 100644 index 0000000000000..a886804ec19f4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of an audio overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioOverlay") +public class AudioOverlay extends Overlay { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java new file mode 100644 index 0000000000000..7d77ef5c547f1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a built-in preset for encoding the input video with the Standard + * Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.BuiltInStandardEncoderPreset") +public class BuiltInStandardEncoderPreset extends Preset { + /** + * The built-in preset to be used for encoding videos. Possible values + * include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', + * 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', + * 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', + * 'H264MultipleBitrateSD'. + */ + @JsonProperty(value = "presetName", required = true) + private EncoderNamedPreset presetName; + + /** + * Get the built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @return the presetName value + */ + public EncoderNamedPreset presetName() { + return this.presetName; + } + + /** + * Set the built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @param presetName the presetName value to set + * @return the BuiltInStandardEncoderPreset object itself. + */ + public BuiltInStandardEncoderPreset withPresetName(EncoderNamedPreset presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java new file mode 100644 index 0000000000000..4cad4b31f9fad --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify DRM configurations of CommonEncryptionCbcs scheme in + * Streaming Policy. + */ +public class CbcsDrmConfiguration { + /** + * FairPlay configurations. + */ + @JsonProperty(value = "fairPlay") + private StreamingPolicyFairPlayConfiguration fairPlay; + + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get fairPlay configurations. + * + * @return the fairPlay value + */ + public StreamingPolicyFairPlayConfiguration fairPlay() { + return this.fairPlay; + } + + /** + * Set fairPlay configurations. + * + * @param fairPlay the fairPlay value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withFairPlay(StreamingPolicyFairPlayConfiguration fairPlay) { + this.fairPlay = fairPlay; + return this; + } + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java new file mode 100644 index 0000000000000..d2f4c6d1aa34b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify DRM configurations of CommonEncryptionCenc scheme in + * Streaming Policy. + */ +public class CencDrmConfiguration { + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..bfff683363fa4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the check name availability request. + */ +public class CheckNameAvailabilityInput { + /** + * The account name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The account type. For a Media Services account, this should be + * 'MediaServices'. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the account name. + * + * @param name the name value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the account type. For a Media Services account, this should be 'MediaServices'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the account type. For a Media Services account, this should be 'MediaServices'. + * + * @param type the type value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(String type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java new file mode 100644 index 0000000000000..6d0ae5d293c5d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties of all codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Codec") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Audio", value = Audio.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyVideo", value = CopyVideo.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.Video", value = Video.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyAudio", value = CopyAudio.class) +}) +public class Codec { + /** + * An optional label for the codec. The label can be used to control muxing + * behavior. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get an optional label for the codec. The label can be used to control muxing behavior. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set an optional label for the codec. The label can be used to control muxing behavior. + * + * @param label the label value to set + * @return the Codec object itself. + */ + public Codec withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java new file mode 100644 index 0000000000000..20f55a8b3fb2c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for CommonEncryptionCbcs encryption scheme. + */ +public class CommonEncryptionCbcs { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for current encryption scheme. + */ + @JsonProperty(value = "drm") + private CbcsDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for current encryption scheme. + * + * @return the drm value + */ + public CbcsDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for current encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withDrm(CbcsDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java new file mode 100644 index 0000000000000..95720f3a56b37 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for envelope encryption scheme. + */ +public class CommonEncryptionCenc { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for CommonEncryptionCenc encryption scheme. + */ + @JsonProperty(value = "drm") + private CencDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @return the drm value + */ + public CencDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withDrm(CencDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java new file mode 100644 index 0000000000000..abf2c7686b398 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContentKeyPolicies. + */ +public interface ContentKeyPolicies extends SupportsCreating, HasInner { + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java new file mode 100644 index 0000000000000..527965700ff81 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing ContentKeyPolicy. + */ +public interface ContentKeyPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ContentKeyPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOptions, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContentKeyPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContentKeyPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithOptions withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options The Key Policy options + * @return the next definition stage + */ + WithCreate withOptions(List options); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for the Policy + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a ContentKeyPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of ContentKeyPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the contentkeypolicy update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for the Policy + * @return the next update stage + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java new file mode 100644 index 0000000000000..fc9d9ea468b78 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a configuration for non-DRM keys. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration") +public class ContentKeyPolicyClearKeyConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java new file mode 100644 index 0000000000000..609588af127a2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy configuration. A derived class must be + * used to create a configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration", value = ContentKeyPolicyClearKeyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration", value = ContentKeyPolicyUnknownConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration", value = ContentKeyPolicyWidevineConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration", value = ContentKeyPolicyPlayReadyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration", value = ContentKeyPolicyFairPlayConfiguration.class) +}) +public class ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java new file mode 100644 index 0000000000000..2a15d7b724edb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for FairPlay licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration") +public class ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { + /** + * The key that must be used as FairPlay Application Secret key. + */ + @JsonProperty(value = "ask", required = true) + private byte[] ask; + + /** + * The password encrypting FairPlay certificate in PKCS 12 (pfx) format. + */ + @JsonProperty(value = "fairPlayPfxPassword", required = true) + private String fairPlayPfxPassword; + + /** + * The Base64 representation of FairPlay certificate in PKCS 12 (pfx) + * format (including private key). + */ + @JsonProperty(value = "fairPlayPfx", required = true) + private String fairPlayPfx; + + /** + * The rental and lease key type. Possible values include: 'Unknown', + * 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + */ + @JsonProperty(value = "rentalAndLeaseKeyType", required = true) + private ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType; + + /** + * The rental duration. Must be greater than or equal to 0. + */ + @JsonProperty(value = "rentalDuration", required = true) + private long rentalDuration; + + /** + * Get the key that must be used as FairPlay Application Secret key. + * + * @return the ask value + */ + public byte[] ask() { + return this.ask; + } + + /** + * Set the key that must be used as FairPlay Application Secret key. + * + * @param ask the ask value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withAsk(byte[] ask) { + this.ask = ask; + return this; + } + + /** + * Get the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @return the fairPlayPfxPassword value + */ + public String fairPlayPfxPassword() { + return this.fairPlayPfxPassword; + } + + /** + * Set the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @param fairPlayPfxPassword the fairPlayPfxPassword value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfxPassword(String fairPlayPfxPassword) { + this.fairPlayPfxPassword = fairPlayPfxPassword; + return this; + } + + /** + * Get the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @return the fairPlayPfx value + */ + public String fairPlayPfx() { + return this.fairPlayPfx; + } + + /** + * Set the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @param fairPlayPfx the fairPlayPfx value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfx(String fairPlayPfx) { + this.fairPlayPfx = fairPlayPfx; + return this; + } + + /** + * Get the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @return the rentalAndLeaseKeyType value + */ + public ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType() { + return this.rentalAndLeaseKeyType; + } + + /** + * Set the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @param rentalAndLeaseKeyType the rentalAndLeaseKeyType value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalAndLeaseKeyType(ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType) { + this.rentalAndLeaseKeyType = rentalAndLeaseKeyType; + return this; + } + + /** + * Get the rental duration. Must be greater than or equal to 0. + * + * @return the rentalDuration value + */ + public long rentalDuration() { + return this.rentalDuration; + } + + /** + * Set the rental duration. Must be greater than or equal to 0. + * + * @param rentalDuration the rentalDuration value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalDuration(long rentalDuration) { + this.rentalDuration = rentalDuration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java new file mode 100644 index 0000000000000..51a342ae0afcc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. + */ +public enum ContentKeyPolicyFairPlayRentalAndLeaseKeyType { + /** Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Key duration is not specified. */ + UNDEFINED("Undefined"), + + /** Content key can be persisted with an unlimited duration. */ + PERSISTENT_UNLIMITED("PersistentUnlimited"), + + /** Content key can be persisted and the valid duration is limited by the Rental Duration value. */ + PERSISTENT_LIMITED("PersistentLimited"); + + /** The actual serialized value for a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. */ + private String value; + + ContentKeyPolicyFairPlayRentalAndLeaseKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyFairPlayRentalAndLeaseKeyType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyFairPlayRentalAndLeaseKeyType fromString(String value) { + ContentKeyPolicyFairPlayRentalAndLeaseKeyType[] items = ContentKeyPolicyFairPlayRentalAndLeaseKeyType.values(); + for (ContentKeyPolicyFairPlayRentalAndLeaseKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java new file mode 100644 index 0000000000000..44620732dc5d7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an open restriction. License or key will be delivered on every + * request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyOpenRestriction") +public class ContentKeyPolicyOpenRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java new file mode 100644 index 0000000000000..58d8fba5a07ee --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a policy option. + */ +public class ContentKeyPolicyOption { + /** + * The legacy Policy Option ID. + */ + @JsonProperty(value = "policyOptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyOptionId; + + /** + * The Policy Option description. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The key delivery configuration. + */ + @JsonProperty(value = "configuration", required = true) + private ContentKeyPolicyConfiguration configuration; + + /** + * The requirements that must be met to deliver keys with this + * configuration. + */ + @JsonProperty(value = "restriction", required = true) + private ContentKeyPolicyRestriction restriction; + + /** + * Get the legacy Policy Option ID. + * + * @return the policyOptionId value + */ + public UUID policyOptionId() { + return this.policyOptionId; + } + + /** + * Get the Policy Option description. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Policy Option description. + * + * @param name the name value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withName(String name) { + this.name = name; + return this; + } + + /** + * Get the key delivery configuration. + * + * @return the configuration value + */ + public ContentKeyPolicyConfiguration configuration() { + return this.configuration; + } + + /** + * Set the key delivery configuration. + * + * @param configuration the configuration value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withConfiguration(ContentKeyPolicyConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the requirements that must be met to deliver keys with this configuration. + * + * @return the restriction value + */ + public ContentKeyPolicyRestriction restriction() { + return this.restriction; + } + + /** + * Set the requirements that must be met to deliver keys with this configuration. + * + * @param restriction the restriction value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withRestriction(ContentKeyPolicyRestriction restriction) { + this.restriction = restriction; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java new file mode 100644 index 0000000000000..c312fe3297004 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for PlayReady licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration") +public class ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicyConfiguration { + /** + * The PlayReady licenses. + */ + @JsonProperty(value = "licenses", required = true) + private List licenses; + + /** + * The custom response data. + */ + @JsonProperty(value = "responseCustomData") + private String responseCustomData; + + /** + * Get the PlayReady licenses. + * + * @return the licenses value + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the PlayReady licenses. + * + * @param licenses the licenses value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Get the custom response data. + * + * @return the responseCustomData value + */ + public String responseCustomData() { + return this.responseCustomData; + } + + /** + * Set the custom response data. + * + * @param responseCustomData the responseCustomData value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withResponseCustomData(String responseCustomData) { + this.responseCustomData = responseCustomData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java new file mode 100644 index 0000000000000..674a7245b8302 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is in the PlayReady header. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader extends ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java new file mode 100644 index 0000000000000..0f3e6f638e161 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is specified in the PlayReady + * configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier extends ContentKeyPolicyPlayReadyContentKeyLocation { + /** + * The content key ID. + */ + @JsonProperty(value = "keyId", required = true) + private UUID keyId; + + /** + * Get the content key ID. + * + * @return the keyId value + */ + public UUID keyId() { + return this.keyId; + } + + /** + * Set the content key ID. + * + * @param keyId the keyId value to set + * @return the ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier object itself. + */ + public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier withKeyId(UUID keyId) { + this.keyId = keyId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java new file mode 100644 index 0000000000000..04bb5d8e89c6b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for content key ID location. A derived class must be used to + * represent the location. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyPlayReadyContentKeyLocation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class) +}) +public class ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java new file mode 100644 index 0000000000000..fc40894ab01b9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyContentType. + */ +public enum ContentKeyPolicyPlayReadyContentType { + /** Represents a ContentKeyPolicyPlayReadyContentType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Unspecified content type. */ + UNSPECIFIED("Unspecified"), + + /** Ultraviolet download content type. */ + ULTRA_VIOLET_DOWNLOAD("UltraVioletDownload"), + + /** Ultraviolet streaming content type. */ + ULTRA_VIOLET_STREAMING("UltraVioletStreaming"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyContentType instance. */ + private String value; + + ContentKeyPolicyPlayReadyContentType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyContentType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyContentType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyContentType fromString(String value) { + ContentKeyPolicyPlayReadyContentType[] items = ContentKeyPolicyPlayReadyContentType.values(); + for (ContentKeyPolicyPlayReadyContentType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java new file mode 100644 index 0000000000000..ba1b7e978c7d1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Explicit Analog Television Output Restriction control bits. + * For further details see the PlayReady Compliance Rules. + */ +public class ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { + /** + * Indicates whether this restriction is enforced on a Best Effort basis. + */ + @JsonProperty(value = "bestEffort", required = true) + private boolean bestEffort; + + /** + * Configures the restriction control bits. Must be between 0 and 3 + * inclusive. + */ + @JsonProperty(value = "configurationData", required = true) + private int configurationData; + + /** + * Get indicates whether this restriction is enforced on a Best Effort basis. + * + * @return the bestEffort value + */ + public boolean bestEffort() { + return this.bestEffort; + } + + /** + * Set indicates whether this restriction is enforced on a Best Effort basis. + * + * @param bestEffort the bestEffort value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withBestEffort(boolean bestEffort) { + this.bestEffort = bestEffort; + return this; + } + + /** + * Get configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @return the configurationData value + */ + public int configurationData() { + return this.configurationData; + } + + /** + * Set configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @param configurationData the configurationData value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withConfigurationData(int configurationData) { + this.configurationData = configurationData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java new file mode 100644 index 0000000000000..6b00b103d08eb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PlayReady license. + */ +public class ContentKeyPolicyPlayReadyLicense { + /** + * A flag indicating whether test devices can use the license. + */ + @JsonProperty(value = "allowTestDevices", required = true) + private boolean allowTestDevices; + + /** + * The begin date of license. + */ + @JsonProperty(value = "beginDate") + private DateTime beginDate; + + /** + * The expiration date of license. + */ + @JsonProperty(value = "expirationDate") + private DateTime expirationDate; + + /** + * The relative begin date of license. + */ + @JsonProperty(value = "relativeBeginDate") + private Period relativeBeginDate; + + /** + * The relative expiration date of license. + */ + @JsonProperty(value = "relativeExpirationDate") + private Period relativeExpirationDate; + + /** + * The grace period of license. + */ + @JsonProperty(value = "gracePeriod") + private Period gracePeriod; + + /** + * The license PlayRight. + */ + @JsonProperty(value = "playRight") + private ContentKeyPolicyPlayReadyPlayRight playRight; + + /** + * The license type. Possible values include: 'Unknown', 'NonPersistent', + * 'Persistent'. + */ + @JsonProperty(value = "licenseType", required = true) + private ContentKeyPolicyPlayReadyLicenseType licenseType; + + /** + * The content key location. + */ + @JsonProperty(value = "contentKeyLocation", required = true) + private ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation; + + /** + * The PlayReady content type. Possible values include: 'Unknown', + * 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + */ + @JsonProperty(value = "contentType", required = true) + private ContentKeyPolicyPlayReadyContentType contentType; + + /** + * Get a flag indicating whether test devices can use the license. + * + * @return the allowTestDevices value + */ + public boolean allowTestDevices() { + return this.allowTestDevices; + } + + /** + * Set a flag indicating whether test devices can use the license. + * + * @param allowTestDevices the allowTestDevices value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withAllowTestDevices(boolean allowTestDevices) { + this.allowTestDevices = allowTestDevices; + return this; + } + + /** + * Get the begin date of license. + * + * @return the beginDate value + */ + public DateTime beginDate() { + return this.beginDate; + } + + /** + * Set the begin date of license. + * + * @param beginDate the beginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withBeginDate(DateTime beginDate) { + this.beginDate = beginDate; + return this; + } + + /** + * Get the expiration date of license. + * + * @return the expirationDate value + */ + public DateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expiration date of license. + * + * @param expirationDate the expirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withExpirationDate(DateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the relative begin date of license. + * + * @return the relativeBeginDate value + */ + public Period relativeBeginDate() { + return this.relativeBeginDate; + } + + /** + * Set the relative begin date of license. + * + * @param relativeBeginDate the relativeBeginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeBeginDate(Period relativeBeginDate) { + this.relativeBeginDate = relativeBeginDate; + return this; + } + + /** + * Get the relative expiration date of license. + * + * @return the relativeExpirationDate value + */ + public Period relativeExpirationDate() { + return this.relativeExpirationDate; + } + + /** + * Set the relative expiration date of license. + * + * @param relativeExpirationDate the relativeExpirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeExpirationDate(Period relativeExpirationDate) { + this.relativeExpirationDate = relativeExpirationDate; + return this; + } + + /** + * Get the grace period of license. + * + * @return the gracePeriod value + */ + public Period gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the grace period of license. + * + * @param gracePeriod the gracePeriod value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withGracePeriod(Period gracePeriod) { + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Get the license PlayRight. + * + * @return the playRight value + */ + public ContentKeyPolicyPlayReadyPlayRight playRight() { + return this.playRight; + } + + /** + * Set the license PlayRight. + * + * @param playRight the playRight value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withPlayRight(ContentKeyPolicyPlayReadyPlayRight playRight) { + this.playRight = playRight; + return this; + } + + /** + * Get the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @return the licenseType value + */ + public ContentKeyPolicyPlayReadyLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @param licenseType the licenseType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withLicenseType(ContentKeyPolicyPlayReadyLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the content key location. + * + * @return the contentKeyLocation value + */ + public ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation() { + return this.contentKeyLocation; + } + + /** + * Set the content key location. + * + * @param contentKeyLocation the contentKeyLocation value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentKeyLocation(ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation) { + this.contentKeyLocation = contentKeyLocation; + return this; + } + + /** + * Get the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @return the contentType value + */ + public ContentKeyPolicyPlayReadyContentType contentType() { + return this.contentType; + } + + /** + * Set the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @param contentType the contentType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentType(ContentKeyPolicyPlayReadyContentType contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java new file mode 100644 index 0000000000000..d781d03b75f1b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyLicenseType. + */ +public enum ContentKeyPolicyPlayReadyLicenseType { + /** Represents a ContentKeyPolicyPlayReadyLicenseType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Non persistent license. */ + NON_PERSISTENT("NonPersistent"), + + /** Persistent license. Allows offline playback. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyLicenseType instance. */ + private String value; + + ContentKeyPolicyPlayReadyLicenseType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyLicenseType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyLicenseType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyLicenseType fromString(String value) { + ContentKeyPolicyPlayReadyLicenseType[] items = ContentKeyPolicyPlayReadyLicenseType.values(); + for (ContentKeyPolicyPlayReadyLicenseType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java new file mode 100644 index 0000000000000..748f989bcc675 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Play Right in the PlayReady license. + */ +public class ContentKeyPolicyPlayReadyPlayRight { + /** + * The amount of time that the license is valid after the license is first + * used to play content. + */ + @JsonProperty(value = "firstPlayExpiration") + private Period firstPlayExpiration; + + /** + * Configures the Serial Copy Management System (SCMS) in the license. Must + * be between 0 and 3 inclusive. + */ + @JsonProperty(value = "scmsRestriction") + private Integer scmsRestriction; + + /** + * Configures Automatic Gain Control (AGC) and Color Stripe in the license. + * Must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "agcAndColorStripeRestriction") + private Integer agcAndColorStripeRestriction; + + /** + * Configures the Explicit Analog Television Output Restriction in the + * license. Configuration data must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "explicitAnalogTelevisionOutputRestriction") + private ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "digitalVideoOnlyContentRestriction", required = true) + private boolean digitalVideoOnlyContentRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComponentVideoRestriction", required = true) + private boolean imageConstraintForAnalogComponentVideoRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComputerMonitorRestriction", required = true) + private boolean imageConstraintForAnalogComputerMonitorRestriction; + + /** + * Configures Unknown output handling settings of the license. Possible + * values include: 'Unknown', 'NotAllowed', 'Allowed', + * 'AllowedWithVideoConstriction'. + */ + @JsonProperty(value = "allowPassingVideoContentToUnknownOutput", required = true) + private ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput; + + /** + * Specifies the output protection level for uncompressed digital video. + */ + @JsonProperty(value = "uncompressedDigitalVideoOpl") + private Integer uncompressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital video. + */ + @JsonProperty(value = "compressedDigitalVideoOpl") + private Integer compressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "analogVideoOpl") + private Integer analogVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "compressedDigitalAudioOpl") + private Integer compressedDigitalAudioOpl; + + /** + * Specifies the output protection level for uncompressed digital audio. + */ + @JsonProperty(value = "uncompressedDigitalAudioOpl") + private Integer uncompressedDigitalAudioOpl; + + /** + * Get the amount of time that the license is valid after the license is first used to play content. + * + * @return the firstPlayExpiration value + */ + public Period firstPlayExpiration() { + return this.firstPlayExpiration; + } + + /** + * Set the amount of time that the license is valid after the license is first used to play content. + * + * @param firstPlayExpiration the firstPlayExpiration value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withFirstPlayExpiration(Period firstPlayExpiration) { + this.firstPlayExpiration = firstPlayExpiration; + return this; + } + + /** + * Get configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @return the scmsRestriction value + */ + public Integer scmsRestriction() { + return this.scmsRestriction; + } + + /** + * Set configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @param scmsRestriction the scmsRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withScmsRestriction(Integer scmsRestriction) { + this.scmsRestriction = scmsRestriction; + return this; + } + + /** + * Get configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @return the agcAndColorStripeRestriction value + */ + public Integer agcAndColorStripeRestriction() { + return this.agcAndColorStripeRestriction; + } + + /** + * Set configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @param agcAndColorStripeRestriction the agcAndColorStripeRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAgcAndColorStripeRestriction(Integer agcAndColorStripeRestriction) { + this.agcAndColorStripeRestriction = agcAndColorStripeRestriction; + return this; + } + + /** + * Get configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @return the explicitAnalogTelevisionOutputRestriction value + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction() { + return this.explicitAnalogTelevisionOutputRestriction; + } + + /** + * Set configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @param explicitAnalogTelevisionOutputRestriction the explicitAnalogTelevisionOutputRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withExplicitAnalogTelevisionOutputRestriction(ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction) { + this.explicitAnalogTelevisionOutputRestriction = explicitAnalogTelevisionOutputRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the digitalVideoOnlyContentRestriction value + */ + public boolean digitalVideoOnlyContentRestriction() { + return this.digitalVideoOnlyContentRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param digitalVideoOnlyContentRestriction the digitalVideoOnlyContentRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withDigitalVideoOnlyContentRestriction(boolean digitalVideoOnlyContentRestriction) { + this.digitalVideoOnlyContentRestriction = digitalVideoOnlyContentRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComponentVideoRestriction value + */ + public boolean imageConstraintForAnalogComponentVideoRestriction() { + return this.imageConstraintForAnalogComponentVideoRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComponentVideoRestriction the imageConstraintForAnalogComponentVideoRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComponentVideoRestriction(boolean imageConstraintForAnalogComponentVideoRestriction) { + this.imageConstraintForAnalogComponentVideoRestriction = imageConstraintForAnalogComponentVideoRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComputerMonitorRestriction value + */ + public boolean imageConstraintForAnalogComputerMonitorRestriction() { + return this.imageConstraintForAnalogComputerMonitorRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComputerMonitorRestriction the imageConstraintForAnalogComputerMonitorRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComputerMonitorRestriction(boolean imageConstraintForAnalogComputerMonitorRestriction) { + this.imageConstraintForAnalogComputerMonitorRestriction = imageConstraintForAnalogComputerMonitorRestriction; + return this; + } + + /** + * Get configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @return the allowPassingVideoContentToUnknownOutput value + */ + public ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput() { + return this.allowPassingVideoContentToUnknownOutput; + } + + /** + * Set configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @param allowPassingVideoContentToUnknownOutput the allowPassingVideoContentToUnknownOutput value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAllowPassingVideoContentToUnknownOutput(ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput) { + this.allowPassingVideoContentToUnknownOutput = allowPassingVideoContentToUnknownOutput; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital video. + * + * @return the uncompressedDigitalVideoOpl value + */ + public Integer uncompressedDigitalVideoOpl() { + return this.uncompressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital video. + * + * @param uncompressedDigitalVideoOpl the uncompressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalVideoOpl(Integer uncompressedDigitalVideoOpl) { + this.uncompressedDigitalVideoOpl = uncompressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital video. + * + * @return the compressedDigitalVideoOpl value + */ + public Integer compressedDigitalVideoOpl() { + return this.compressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital video. + * + * @param compressedDigitalVideoOpl the compressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalVideoOpl(Integer compressedDigitalVideoOpl) { + this.compressedDigitalVideoOpl = compressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the analogVideoOpl value + */ + public Integer analogVideoOpl() { + return this.analogVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param analogVideoOpl the analogVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAnalogVideoOpl(Integer analogVideoOpl) { + this.analogVideoOpl = analogVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the compressedDigitalAudioOpl value + */ + public Integer compressedDigitalAudioOpl() { + return this.compressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param compressedDigitalAudioOpl the compressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalAudioOpl(Integer compressedDigitalAudioOpl) { + this.compressedDigitalAudioOpl = compressedDigitalAudioOpl; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital audio. + * + * @return the uncompressedDigitalAudioOpl value + */ + public Integer uncompressedDigitalAudioOpl() { + return this.uncompressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital audio. + * + * @param uncompressedDigitalAudioOpl the uncompressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalAudioOpl(Integer uncompressedDigitalAudioOpl) { + this.uncompressedDigitalAudioOpl = uncompressedDigitalAudioOpl; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java new file mode 100644 index 0000000000000..51485d465ee02 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. + */ +public enum ContentKeyPolicyPlayReadyUnknownOutputPassingOption { + /** Represents a ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Passing the video portion of protected content to an Unknown Output is not allowed. */ + NOT_ALLOWED("NotAllowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed. */ + ALLOWED("Allowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed but with constrained resolution. */ + ALLOWED_WITH_VIDEO_CONSTRICTION("AllowedWithVideoConstriction"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. */ + private String value; + + ContentKeyPolicyPlayReadyUnknownOutputPassingOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyUnknownOutputPassingOption object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyUnknownOutputPassingOption fromString(String value) { + ContentKeyPolicyPlayReadyUnknownOutputPassingOption[] items = ContentKeyPolicyPlayReadyUnknownOutputPassingOption.values(); + for (ContentKeyPolicyPlayReadyUnknownOutputPassingOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java new file mode 100644 index 0000000000000..c38dee8fc852e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPolicyPropertiesInner; +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; + +/** + * Type representing ContentKeyPolicyProperties. + */ +public interface ContentKeyPolicyProperties extends HasInner, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java new file mode 100644 index 0000000000000..08344b5085c25 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy restrictions. A derived class must be used + * to create a restriction. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestriction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyOpenRestriction", value = ContentKeyPolicyOpenRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction", value = ContentKeyPolicyUnknownRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyTokenRestriction", value = ContentKeyPolicyTokenRestriction.class) +}) +public class ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java new file mode 100644 index 0000000000000..7787544ebea33 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy key for token validation. A derived class + * must be used to create a token key. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestrictionTokenKey") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey", value = ContentKeyPolicySymmetricTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey", value = ContentKeyPolicyRsaTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey", value = ContentKeyPolicyX509CertificateTokenKey.class) +}) +public class ContentKeyPolicyRestrictionTokenKey { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java new file mode 100644 index 0000000000000..47db389c970fb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyRestrictionTokenType. + */ +public enum ContentKeyPolicyRestrictionTokenType { + /** Represents a ContentKeyPolicyRestrictionTokenType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Simple Web Token. */ + SWT("Swt"), + + /** JSON Web Token. */ + JWT("Jwt"); + + /** The actual serialized value for a ContentKeyPolicyRestrictionTokenType instance. */ + private String value; + + ContentKeyPolicyRestrictionTokenType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyRestrictionTokenType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyRestrictionTokenType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyRestrictionTokenType fromString(String value) { + ContentKeyPolicyRestrictionTokenType[] items = ContentKeyPolicyRestrictionTokenType.values(); + for (ContentKeyPolicyRestrictionTokenType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java new file mode 100644 index 0000000000000..17351317bf751 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a RSA key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyRsaTokenKey") +public class ContentKeyPolicyRsaTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The RSA Parameter exponent. + */ + @JsonProperty(value = "exponent", required = true) + private byte[] exponent; + + /** + * The RSA Parameter modulus. + */ + @JsonProperty(value = "modulus", required = true) + private byte[] modulus; + + /** + * Get the RSA Parameter exponent. + * + * @return the exponent value + */ + public byte[] exponent() { + return this.exponent; + } + + /** + * Set the RSA Parameter exponent. + * + * @param exponent the exponent value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withExponent(byte[] exponent) { + this.exponent = exponent; + return this; + } + + /** + * Get the RSA Parameter modulus. + * + * @return the modulus value + */ + public byte[] modulus() { + return this.modulus; + } + + /** + * Set the RSA Parameter modulus. + * + * @param modulus the modulus value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withModulus(byte[] modulus) { + this.modulus = modulus; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java new file mode 100644 index 0000000000000..a59fef8bb0dd0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a symmetric key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey") +public class ContentKeyPolicySymmetricTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The key value of the key. + */ + @JsonProperty(value = "keyValue", required = true) + private byte[] keyValue; + + /** + * Get the key value of the key. + * + * @return the keyValue value + */ + public byte[] keyValue() { + return this.keyValue; + } + + /** + * Set the key value of the key. + * + * @param keyValue the keyValue value to set + * @return the ContentKeyPolicySymmetricTokenKey object itself. + */ + public ContentKeyPolicySymmetricTokenKey withKeyValue(byte[] keyValue) { + this.keyValue = keyValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java new file mode 100644 index 0000000000000..05e76c4db778e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a token claim. + */ +public class ContentKeyPolicyTokenClaim { + /** + * Token claim type. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /** + * Token claim value. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * Get token claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Set token claim type. + * + * @param claimType the claimType value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimType(String claimType) { + this.claimType = claimType; + return this; + } + + /** + * Get token claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set token claim value. + * + * @param claimValue the claimValue value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java new file mode 100644 index 0000000000000..0ff78798f6093 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a token restriction. Provided token must match these requirements + * for successful license or key delivery. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyTokenRestriction") +public class ContentKeyPolicyTokenRestriction extends ContentKeyPolicyRestriction { + /** + * The token issuer. + */ + @JsonProperty(value = "issuer", required = true) + private String issuer; + + /** + * The audience for the token. + */ + @JsonProperty(value = "audience", required = true) + private String audience; + + /** + * The primary verification key. + */ + @JsonProperty(value = "primaryVerificationKey", required = true) + private ContentKeyPolicyRestrictionTokenKey primaryVerificationKey; + + /** + * A list of alternative verification keys. + */ + @JsonProperty(value = "alternateVerificationKeys") + private List alternateVerificationKeys; + + /** + * A list of required token claims. + */ + @JsonProperty(value = "requiredClaims") + private List requiredClaims; + + /** + * The type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + */ + @JsonProperty(value = "restrictionTokenType", required = true) + private ContentKeyPolicyRestrictionTokenType restrictionTokenType; + + /** + * The OpenID connect discovery document. + */ + @JsonProperty(value = "openIdConnectDiscoveryDocument") + private String openIdConnectDiscoveryDocument; + + /** + * Get the token issuer. + * + * @return the issuer value + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the token issuer. + * + * @param issuer the issuer value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the audience for the token. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience for the token. + * + * @param audience the audience value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the primary verification key. + * + * @return the primaryVerificationKey value + */ + public ContentKeyPolicyRestrictionTokenKey primaryVerificationKey() { + return this.primaryVerificationKey; + } + + /** + * Set the primary verification key. + * + * @param primaryVerificationKey the primaryVerificationKey value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withPrimaryVerificationKey(ContentKeyPolicyRestrictionTokenKey primaryVerificationKey) { + this.primaryVerificationKey = primaryVerificationKey; + return this; + } + + /** + * Get a list of alternative verification keys. + * + * @return the alternateVerificationKeys value + */ + public List alternateVerificationKeys() { + return this.alternateVerificationKeys; + } + + /** + * Set a list of alternative verification keys. + * + * @param alternateVerificationKeys the alternateVerificationKeys value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAlternateVerificationKeys(List alternateVerificationKeys) { + this.alternateVerificationKeys = alternateVerificationKeys; + return this; + } + + /** + * Get a list of required token claims. + * + * @return the requiredClaims value + */ + public List requiredClaims() { + return this.requiredClaims; + } + + /** + * Set a list of required token claims. + * + * @param requiredClaims the requiredClaims value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRequiredClaims(List requiredClaims) { + this.requiredClaims = requiredClaims; + return this; + } + + /** + * Get the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @return the restrictionTokenType value + */ + public ContentKeyPolicyRestrictionTokenType restrictionTokenType() { + return this.restrictionTokenType; + } + + /** + * Set the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @param restrictionTokenType the restrictionTokenType value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType restrictionTokenType) { + this.restrictionTokenType = restrictionTokenType; + return this; + } + + /** + * Get the OpenID connect discovery document. + * + * @return the openIdConnectDiscoveryDocument value + */ + public String openIdConnectDiscoveryDocument() { + return this.openIdConnectDiscoveryDocument; + } + + /** + * Set the OpenID connect discovery document. + * + * @param openIdConnectDiscoveryDocument the openIdConnectDiscoveryDocument value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withOpenIdConnectDiscoveryDocument(String openIdConnectDiscoveryDocument) { + this.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java new file mode 100644 index 0000000000000..789867eb0cbd6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyConfiguration that is unavailable in the + * current API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownConfiguration") +public class ContentKeyPolicyUnknownConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java new file mode 100644 index 0000000000000..380053ec70749 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyRestriction that is unavailable in the current + * API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownRestriction") +public class ContentKeyPolicyUnknownRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java new file mode 100644 index 0000000000000..71ab8635eefa9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for Widevine licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration") +public class ContentKeyPolicyWidevineConfiguration extends ContentKeyPolicyConfiguration { + /** + * The Widevine template. + */ + @JsonProperty(value = "widevineTemplate", required = true) + private String widevineTemplate; + + /** + * Get the Widevine template. + * + * @return the widevineTemplate value + */ + public String widevineTemplate() { + return this.widevineTemplate; + } + + /** + * Set the Widevine template. + * + * @param widevineTemplate the widevineTemplate value to set + * @return the ContentKeyPolicyWidevineConfiguration object itself. + */ + public ContentKeyPolicyWidevineConfiguration withWidevineTemplate(String widevineTemplate) { + this.widevineTemplate = widevineTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java new file mode 100644 index 0000000000000..297df2d5f798d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a certificate for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey") +public class ContentKeyPolicyX509CertificateTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The raw data field of a certificate in PKCS 12 format (X509Certificate2 + * in .NET). + */ + @JsonProperty(value = "rawBody", required = true) + private byte[] rawBody; + + /** + * Get the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @return the rawBody value + */ + public byte[] rawBody() { + return this.rawBody; + } + + /** + * Set the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @param rawBody the rawBody value to set + * @return the ContentKeyPolicyX509CertificateTokenKey object itself. + */ + public ContentKeyPolicyX509CertificateTokenKey withRawBody(byte[] rawBody) { + this.rawBody = rawBody; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java new file mode 100644 index 0000000000000..2408271aca29c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input audio bitstream. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyAudio") +public class CopyAudio extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java new file mode 100644 index 0000000000000..87fd4c4758df3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input video bitstream + * without re-encoding. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyVideo") +public class CopyVideo extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java new file mode 100644 index 0000000000000..f5a4633fa5c2a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The client access policy. + */ +public class CrossSiteAccessPolicies { + /** + * The content of clientaccesspolicy.xml used by Silverlight. + */ + @JsonProperty(value = "clientAccessPolicy") + private String clientAccessPolicy; + + /** + * The content of crossdomain.xml used by Silverlight. + */ + @JsonProperty(value = "crossDomainPolicy") + private String crossDomainPolicy; + + /** + * Get the content of clientaccesspolicy.xml used by Silverlight. + * + * @return the clientAccessPolicy value + */ + public String clientAccessPolicy() { + return this.clientAccessPolicy; + } + + /** + * Set the content of clientaccesspolicy.xml used by Silverlight. + * + * @param clientAccessPolicy the clientAccessPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withClientAccessPolicy(String clientAccessPolicy) { + this.clientAccessPolicy = clientAccessPolicy; + return this; + } + + /** + * Get the content of crossdomain.xml used by Silverlight. + * + * @return the crossDomainPolicy value + */ + public String crossDomainPolicy() { + return this.crossDomainPolicy; + } + + /** + * Set the content of crossdomain.xml used by Silverlight. + * + * @param crossDomainPolicy the crossDomainPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withCrossDomainPolicy(String crossDomainPolicy) { + this.crossDomainPolicy = crossDomainPolicy; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java new file mode 100644 index 0000000000000..5ad5ac32cd5df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of default content key for each encryption + * scheme. + */ +public class DefaultKey { + /** + * Label can be used to specify Content Key when creating a Streaming + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Default Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Get label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating a Streaming Locator. + * + * @param label the label value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Default Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Default Key. + * + * @param policyName the policyName value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java new file mode 100644 index 0000000000000..dce6fcd89df6b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the de-interlacing settings. + */ +public class Deinterlace { + /** + * The field parity for de-interlacing, defaults to Auto. Possible values + * include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + */ + @JsonProperty(value = "parity") + private DeinterlaceParity parity; + + /** + * The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values + * include: 'Off', 'AutoPixelAdaptive'. + */ + @JsonProperty(value = "mode") + private DeinterlaceMode mode; + + /** + * Get the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @return the parity value + */ + public DeinterlaceParity parity() { + return this.parity; + } + + /** + * Set the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @param parity the parity value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withParity(DeinterlaceParity parity) { + this.parity = parity; + return this; + } + + /** + * Get the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @return the mode value + */ + public DeinterlaceMode mode() { + return this.mode; + } + + /** + * Set the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @param mode the mode value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withMode(DeinterlaceMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java new file mode 100644 index 0000000000000..5a1ef00070a63 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceMode. + */ +public enum DeinterlaceMode { + /** Disables de-interlacing of the source video. */ + OFF("Off"), + + /** Apply automatic pixel adaptive de-interlacing on each frame in the input video. */ + AUTO_PIXEL_ADAPTIVE("AutoPixelAdaptive"); + + /** The actual serialized value for a DeinterlaceMode instance. */ + private String value; + + DeinterlaceMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceMode instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceMode object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceMode fromString(String value) { + DeinterlaceMode[] items = DeinterlaceMode.values(); + for (DeinterlaceMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java new file mode 100644 index 0000000000000..60e6c71eb91da --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceParity. + */ +public enum DeinterlaceParity { + /** Automatically detect the order of fields. */ + AUTO("Auto"), + + /** Apply top field first processing of input video. */ + TOP_FIELD_FIRST("TopFieldFirst"), + + /** Apply bottom field first processing of input video. */ + BOTTOM_FIELD_FIRST("BottomFieldFirst"); + + /** The actual serialized value for a DeinterlaceParity instance. */ + private String value; + + DeinterlaceParity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceParity instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceParity object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceParity fromString(String value) { + DeinterlaceParity[] items = DeinterlaceParity.values(); + for (DeinterlaceParity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java new file mode 100644 index 0000000000000..def04c72f0bb1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify which protocols are enabled. + */ +public class EnabledProtocols { + /** + * Enable Download protocol or not. + */ + @JsonProperty(value = "download", required = true) + private boolean download; + + /** + * Enable DASH protocol or not. + */ + @JsonProperty(value = "dash", required = true) + private boolean dash; + + /** + * Enable HLS protocol or not. + */ + @JsonProperty(value = "hls", required = true) + private boolean hls; + + /** + * Enable SmoothStreaming protocol or not. + */ + @JsonProperty(value = "smoothStreaming", required = true) + private boolean smoothStreaming; + + /** + * Get enable Download protocol or not. + * + * @return the download value + */ + public boolean download() { + return this.download; + } + + /** + * Set enable Download protocol or not. + * + * @param download the download value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withDownload(boolean download) { + this.download = download; + return this; + } + + /** + * Get enable DASH protocol or not. + * + * @return the dash value + */ + public boolean dash() { + return this.dash; + } + + /** + * Set enable DASH protocol or not. + * + * @param dash the dash value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withDash(boolean dash) { + this.dash = dash; + return this; + } + + /** + * Get enable HLS protocol or not. + * + * @return the hls value + */ + public boolean hls() { + return this.hls; + } + + /** + * Set enable HLS protocol or not. + * + * @param hls the hls value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withHls(boolean hls) { + this.hls = hls; + return this; + } + + /** + * Get enable SmoothStreaming protocol or not. + * + * @return the smoothStreaming value + */ + public boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set enable SmoothStreaming protocol or not. + * + * @param smoothStreaming the smoothStreaming value to set + * @return the EnabledProtocols object itself. + */ + public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) { + this.smoothStreaming = smoothStreaming; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java new file mode 100644 index 0000000000000..a6612f6896949 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncoderNamedPreset. + */ +public enum EncoderNamedPreset { + /** Produces an MP4 file where the video is encoded with H.264 codec at 2200 kbps and a picture height of 480 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE_SD("H264SingleBitrateSD"), + + /** Produces an MP4 file where the video is encoded with H.264 codec at 4500 kbps and a picture height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE720P("H264SingleBitrate720p"), + + /** Produces an MP4 file where the video is encoded with H.264 codec at 6750 kbps and a picture height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE1080P("H264SingleBitrate1080p"), + + /** Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output will remain 720p at best, and will start at rates lower than 3 Mbps. The output will will have video and audio in separate MP4 files, which is optimal for adaptive streaming. */ + ADAPTIVE_STREAMING("AdaptiveStreaming"), + + /** Produces a single MP4 file containing only stereo audio encoded at 192 kbps. */ + AACGOOD_QUALITY_AUDIO("AACGoodQualityAudio"), + + /** Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. */ + H264MULTIPLE_BITRATE1080P("H264MultipleBitrate1080p"), + + /** Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 720p and goes down to 360p. */ + H264MULTIPLE_BITRATE720P("H264MultipleBitrate720p"), + + /** Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and stereo AAC audio. Resolution starts at 480p and goes down to 360p. */ + H264MULTIPLE_BITRATE_SD("H264MultipleBitrateSD"); + + /** The actual serialized value for a EncoderNamedPreset instance. */ + private String value; + + EncoderNamedPreset(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncoderNamedPreset instance. + * + * @param value the serialized value to parse. + * @return the parsed EncoderNamedPreset object, or null if unable to parse. + */ + @JsonCreator + public static EncoderNamedPreset fromString(String value) { + EncoderNamedPreset[] items = EncoderNamedPreset.values(); + for (EncoderNamedPreset item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java new file mode 100644 index 0000000000000..098dfe82f9581 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionScheme. + */ +public enum EncryptionScheme { + /** NoEncryption scheme. */ + NO_ENCRYPTION("NoEncryption"), + + /** EnvelopeEncryption scheme. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"), + + /** CommonEncryptionCenc scheme. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** CommonEncryptionCbcs scheme. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"); + + /** The actual serialized value for a EncryptionScheme instance. */ + private String value; + + EncryptionScheme(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionScheme instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionScheme object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionScheme fromString(String value) { + EncryptionScheme[] items = EncryptionScheme.values(); + for (EncryptionScheme item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java new file mode 100644 index 0000000000000..8c096ad42aa9f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.EntityNameAvailabilityCheckOutputInner; + +/** + * Type representing EntityNameAvailabilityCheckOutput. + */ +public interface EntityNameAvailabilityCheckOutput extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java new file mode 100644 index 0000000000000..bc6c28e73a824 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntropyMode. + */ +public enum EntropyMode { + /** Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. */ + CABAC("Cabac"), + + /** Context Adaptive Variable Length Coder (CAVLC) entropy encoding. */ + CAVLC("Cavlc"); + + /** The actual serialized value for a EntropyMode instance. */ + private String value; + + EntropyMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntropyMode instance. + * + * @param value the serialized value to parse. + * @return the parsed EntropyMode object, or null if unable to parse. + */ + @JsonCreator + public static EntropyMode fromString(String value) { + EntropyMode[] items = EntropyMode.values(); + for (EntropyMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java new file mode 100644 index 0000000000000..df5a9118ee2a6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for EnvelopeEncryption encryption scheme. + */ +public class EnvelopeEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * KeyAcquistionUrlTemplate is used to point to user specified service to + * delivery content keys. + */ + @JsonProperty(value = "customKeyAcquisitionUrlTemplate") + private String customKeyAcquisitionUrlTemplate; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get keyAcquistionUrlTemplate is used to point to user specified service to delivery content keys. + * + * @return the customKeyAcquisitionUrlTemplate value + */ + public String customKeyAcquisitionUrlTemplate() { + return this.customKeyAcquisitionUrlTemplate; + } + + /** + * Set keyAcquistionUrlTemplate is used to point to user specified service to delivery content keys. + * + * @param customKeyAcquisitionUrlTemplate the customKeyAcquisitionUrlTemplate value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withCustomKeyAcquisitionUrlTemplate(String customKeyAcquisitionUrlTemplate) { + this.customKeyAcquisitionUrlTemplate = customKeyAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java new file mode 100644 index 0000000000000..a4bcf8b0cbd72 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FilterTrackPropertyCompareOperation. + */ +public enum FilterTrackPropertyCompareOperation { + /** The equal operation. */ + EQUAL("Equal"), + + /** The not equal operation. */ + NOT_EQUAL("NotEqual"); + + /** The actual serialized value for a FilterTrackPropertyCompareOperation instance. */ + private String value; + + FilterTrackPropertyCompareOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterTrackPropertyCompareOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterTrackPropertyCompareOperation object, or null if unable to parse. + */ + @JsonCreator + public static FilterTrackPropertyCompareOperation fromString(String value) { + FilterTrackPropertyCompareOperation[] items = FilterTrackPropertyCompareOperation.values(); + for (FilterTrackPropertyCompareOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java new file mode 100644 index 0000000000000..1e0b4b315e766 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The class to specify one track property condition. + */ +public class FilterTrackPropertyCondition { + /** + * The track property type. Possible values include: 'Unknown', 'Type', + * 'Name', 'Language', 'FourCC', 'Bitrate'. + */ + @JsonProperty(value = "property", required = true) + private FilterTrackPropertyType property; + + /** + * The track proprty value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * The track property condition operation. Possible values include: + * 'Equal', 'NotEqual'. + */ + @JsonProperty(value = "operation", required = true) + private FilterTrackPropertyCompareOperation operation; + + /** + * Get the track property type. Possible values include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate'. + * + * @return the property value + */ + public FilterTrackPropertyType property() { + return this.property; + } + + /** + * Set the track property type. Possible values include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate'. + * + * @param property the property value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withProperty(FilterTrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get the track proprty value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the track proprty value. + * + * @param value the value value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the track property condition operation. Possible values include: 'Equal', 'NotEqual'. + * + * @return the operation value + */ + public FilterTrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set the track property condition operation. Possible values include: 'Equal', 'NotEqual'. + * + * @param operation the operation value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withOperation(FilterTrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java new file mode 100644 index 0000000000000..1684ff394bd41 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FilterTrackPropertyType. + */ +public enum FilterTrackPropertyType { + /** The unknown track property type. */ + UNKNOWN("Unknown"), + + /** The type. */ + TYPE("Type"), + + /** The name. */ + NAME("Name"), + + /** The language. */ + LANGUAGE("Language"), + + /** The fourCC. */ + FOUR_CC("FourCC"), + + /** The bitrate. */ + BITRATE("Bitrate"); + + /** The actual serialized value for a FilterTrackPropertyType instance. */ + private String value; + + FilterTrackPropertyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterTrackPropertyType instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterTrackPropertyType object, or null if unable to parse. + */ + @JsonCreator + public static FilterTrackPropertyType fromString(String value) { + FilterTrackPropertyType[] items = FilterTrackPropertyType.values(); + for (FilterTrackPropertyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java new file mode 100644 index 0000000000000..8f01d125d797e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Representing a list of FilterTrackPropertyConditions to select a track. The + * filters are combined using a logical AND operation. + */ +public class FilterTrackSelection { + /** + * The track selections. + */ + @JsonProperty(value = "trackSelections", required = true) + private List trackSelections; + + /** + * Get the track selections. + * + * @return the trackSelections value + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set the track selections. + * + * @param trackSelections the trackSelections value to set + * @return the FilterTrackSelection object itself. + */ + public FilterTrackSelection withTrackSelections(List trackSelections) { + this.trackSelections = trackSelections; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java new file mode 100644 index 0000000000000..741b644eb11ce --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes all the filtering operations, such as de-interlacing, rotation + * etc. that are to be applied to the input media before encoding. + */ +public class Filters { + /** + * The de-interlacing settings. + */ + @JsonProperty(value = "deinterlace") + private Deinterlace deinterlace; + + /** + * The rotation, if any, to be applied to the input video, before it is + * encoded. Default is Auto. Possible values include: 'Auto', 'None', + * 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + */ + @JsonProperty(value = "rotation") + private Rotation rotation; + + /** + * The parameters for the rectangular window with which to crop the input + * video. + */ + @JsonProperty(value = "crop") + private Rectangle crop; + + /** + * The properties of overlays to be applied to the input video. These could + * be audio, image or video overlays. + */ + @JsonProperty(value = "overlays") + private List overlays; + + /** + * Get the de-interlacing settings. + * + * @return the deinterlace value + */ + public Deinterlace deinterlace() { + return this.deinterlace; + } + + /** + * Set the de-interlacing settings. + * + * @param deinterlace the deinterlace value to set + * @return the Filters object itself. + */ + public Filters withDeinterlace(Deinterlace deinterlace) { + this.deinterlace = deinterlace; + return this; + } + + /** + * Get the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @return the rotation value + */ + public Rotation rotation() { + return this.rotation; + } + + /** + * Set the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @param rotation the rotation value to set + * @return the Filters object itself. + */ + public Filters withRotation(Rotation rotation) { + this.rotation = rotation; + return this; + } + + /** + * Get the parameters for the rectangular window with which to crop the input video. + * + * @return the crop value + */ + public Rectangle crop() { + return this.crop; + } + + /** + * Set the parameters for the rectangular window with which to crop the input video. + * + * @param crop the crop value to set + * @return the Filters object itself. + */ + public Filters withCrop(Rectangle crop) { + this.crop = crop; + return this; + } + + /** + * Get the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @return the overlays value + */ + public List overlays() { + return this.overlays; + } + + /** + * Set the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @param overlays the overlays value to set + * @return the Filters object itself. + */ + public Filters withOverlays(List overlays) { + this.overlays = overlays; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java new file mode 100644 index 0000000000000..381834909641a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter First Quality. + */ +public class FirstQuality { + /** + * The first quality bitrate. + */ + @JsonProperty(value = "bitrate", required = true) + private int bitrate; + + /** + * Get the first quality bitrate. + * + * @return the bitrate value + */ + public int bitrate() { + return this.bitrate; + } + + /** + * Set the first quality bitrate. + * + * @param bitrate the bitrate value to set + * @return the FirstQuality object itself. + */ + public FirstQuality withBitrate(int bitrate) { + this.bitrate = bitrate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java new file mode 100644 index 0000000000000..79563db7ba576 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for output. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Format") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) +}) +public class Format { + /** + * The pattern of the file names for the generated output files. The + * following macros are supported in the file name: {Basename} - The base + * name of the input video {Extension} - The appropriate extension for this + * format. {Label} - The label assigned to the codec/layer. {Index} - A + * unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - + * The audio/video bitrate. Not applicable to thumbnails. {Codec} - The + * type of the audio/video codec. Any unsubstituted macros will be + * collapsed and removed from the filename. + */ + @JsonProperty(value = "filenamePattern") + private String filenamePattern; + + /** + * Get the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @return the filenamePattern value + */ + public String filenamePattern() { + return this.filenamePattern; + } + + /** + * Set the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @param filenamePattern the filenamePattern value to set + * @return the Format object itself. + */ + public Format withFilenamePattern(String filenamePattern) { + this.filenamePattern = filenamePattern; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java new file mode 100644 index 0000000000000..e11f78b3dc9bd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264Complexity. + */ +public enum H264Complexity { + /** Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to decrease encoding time. */ + SPEED("Speed"), + + /** Tells the encoder to use settings that achieve a balance between speed and quality. */ + BALANCED("Balanced"), + + /** Tells the encoder to use settings that are optimized to produce higher quality output at the expense of slower overall encode time. */ + QUALITY("Quality"); + + /** The actual serialized value for a H264Complexity instance. */ + private String value; + + H264Complexity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264Complexity instance. + * + * @param value the serialized value to parse. + * @return the parsed H264Complexity object, or null if unable to parse. + */ + @JsonCreator + public static H264Complexity fromString(String value) { + H264Complexity[] items = H264Complexity.values(); + for (H264Complexity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java new file mode 100644 index 0000000000000..6ccbf112cb02f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer with the H.264 video codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Layer") +public class H264Layer extends VideoLayer { + /** + * Which profile of the H.264 standard should be used when encoding this + * layer. Default is Auto. Possible values include: 'Auto', 'Baseline', + * 'Main', 'High', 'High422', 'High444'. + */ + @JsonProperty(value = "profile") + private H264VideoProfile profile; + + /** + * Which level of the H.264 standard should be used when encoding this + * layer. The value can be Auto, or a number that matches the H.264 + * profile. If not specified, the default is Auto, which lets the encoder + * choose the Level that is appropriate for this layer. + */ + @JsonProperty(value = "level") + private String level; + + /** + * The VBV buffer window length. The value should be in ISO 8601 format. + * The value should be in the range [0.1-100] seconds. The default is 5 + * seconds (for example, PT5S). + */ + @JsonProperty(value = "bufferWindow") + private Period bufferWindow; + + /** + * The number of reference frames to be used when encoding this layer. If + * not specified, the encoder determines an appropriate number based on the + * encoder complexity setting. + */ + @JsonProperty(value = "referenceFrames") + private Integer referenceFrames; + + /** + * The entropy mode to be used for this layer. If not specified, the + * encoder chooses the mode that is appropriate for the profile and level. + * Possible values include: 'Cabac', 'Cavlc'. + */ + @JsonProperty(value = "entropyMode") + private EntropyMode entropyMode; + + /** + * Get which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @return the profile value + */ + public H264VideoProfile profile() { + return this.profile; + } + + /** + * Set which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @param profile the profile value to set + * @return the H264Layer object itself. + */ + public H264Layer withProfile(H264VideoProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @return the level value + */ + public String level() { + return this.level; + } + + /** + * Set which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @param level the level value to set + * @return the H264Layer object itself. + */ + public H264Layer withLevel(String level) { + this.level = level; + return this; + } + + /** + * Get the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @return the bufferWindow value + */ + public Period bufferWindow() { + return this.bufferWindow; + } + + /** + * Set the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @param bufferWindow the bufferWindow value to set + * @return the H264Layer object itself. + */ + public H264Layer withBufferWindow(Period bufferWindow) { + this.bufferWindow = bufferWindow; + return this; + } + + /** + * Get the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @return the referenceFrames value + */ + public Integer referenceFrames() { + return this.referenceFrames; + } + + /** + * Set the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @param referenceFrames the referenceFrames value to set + * @return the H264Layer object itself. + */ + public H264Layer withReferenceFrames(Integer referenceFrames) { + this.referenceFrames = referenceFrames; + return this; + } + + /** + * Get the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @return the entropyMode value + */ + public EntropyMode entropyMode() { + return this.entropyMode; + } + + /** + * Set the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @param entropyMode the entropyMode value to set + * @return the H264Layer object itself. + */ + public H264Layer withEntropyMode(EntropyMode entropyMode) { + this.entropyMode = entropyMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java new file mode 100644 index 0000000000000..372c142ebc3d9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the properties for encoding a video with the H.264 codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Video") +public class H264Video extends Video { + /** + * Whether or not the encoder should insert key frames at scene changes. If + * not specified, the default is false. This flag should be set to true + * only when the encoder is being configured to produce a single output + * video. + */ + @JsonProperty(value = "sceneChangeDetection") + private Boolean sceneChangeDetection; + + /** + * Tells the encoder how to choose its encoding settings. The default value + * is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + */ + @JsonProperty(value = "complexity") + private H264Complexity complexity; + + /** + * The collection of output H.264 layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @return the sceneChangeDetection value + */ + public Boolean sceneChangeDetection() { + return this.sceneChangeDetection; + } + + /** + * Set whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @param sceneChangeDetection the sceneChangeDetection value to set + * @return the H264Video object itself. + */ + public H264Video withSceneChangeDetection(Boolean sceneChangeDetection) { + this.sceneChangeDetection = sceneChangeDetection; + return this; + } + + /** + * Get tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @return the complexity value + */ + public H264Complexity complexity() { + return this.complexity; + } + + /** + * Set tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @param complexity the complexity value to set + * @return the H264Video object itself. + */ + public H264Video withComplexity(H264Complexity complexity) { + this.complexity = complexity; + return this; + } + + /** + * Get the collection of output H.264 layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set the collection of output H.264 layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the H264Video object itself. + */ + public H264Video withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java new file mode 100644 index 0000000000000..5f3178cb92a08 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264VideoProfile. + */ +public enum H264VideoProfile { + /** Tells the encoder to automatically determine the appropriate H.264 profile. */ + AUTO("Auto"), + + /** Baseline profile. */ + BASELINE("Baseline"), + + /** Main profile. */ + MAIN("Main"), + + /** High profile. */ + HIGH("High"), + + /** High 4:2:2 profile. */ + HIGH422("High422"), + + /** High 4:4:4 predictive profile. */ + HIGH444("High444"); + + /** The actual serialized value for a H264VideoProfile instance. */ + private String value; + + H264VideoProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264VideoProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed H264VideoProfile object, or null if unable to parse. + */ + @JsonCreator + public static H264VideoProfile fromString(String value) { + H264VideoProfile[] items = H264VideoProfile.values(); + for (H264VideoProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java new file mode 100644 index 0000000000000..84b7e8b40dde2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HLS configuration. + */ +public class Hls { + /** + * The amount of fragments per HTTP Live Streaming (HLS) segment. + */ + @JsonProperty(value = "fragmentsPerTsSegment") + private Integer fragmentsPerTsSegment; + + /** + * Get the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @return the fragmentsPerTsSegment value + */ + public Integer fragmentsPerTsSegment() { + return this.fragmentsPerTsSegment; + } + + /** + * Set the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @param fragmentsPerTsSegment the fragmentsPerTsSegment value to set + * @return the Hls object itself. + */ + public Hls withFragmentsPerTsSegment(Integer fragmentsPerTsSegment) { + this.fragmentsPerTsSegment = fragmentsPerTsSegment; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java new file mode 100644 index 0000000000000..768d2a875d2c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control. + */ +public class IPAccessControl { + /** + * The IP allow list. + */ + @JsonProperty(value = "allow") + private List allow; + + /** + * Get the IP allow list. + * + * @return the allow value + */ + public List allow() { + return this.allow; + } + + /** + * Set the IP allow list. + * + * @param allow the allow value to set + * @return the IPAccessControl object itself. + */ + public IPAccessControl withAllow(List allow) { + this.allow = allow; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java new file mode 100644 index 0000000000000..ce7c522c33922 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP address range in the CIDR scheme. + */ +public class IPRange { + /** + * The friendly name for the IP address range. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The IP address. + */ + @JsonProperty(value = "address") + private String address; + + /** + * The subnet mask prefix length (see CIDR notation). + */ + @JsonProperty(value = "subnetPrefixLength") + private Integer subnetPrefixLength; + + /** + * Get the friendly name for the IP address range. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the friendly name for the IP address range. + * + * @param name the name value to set + * @return the IPRange object itself. + */ + public IPRange withName(String name) { + this.name = name; + return this; + } + + /** + * Get the IP address. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address. + * + * @param address the address value to set + * @return the IPRange object itself. + */ + public IPRange withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the subnet mask prefix length (see CIDR notation). + * + * @return the subnetPrefixLength value + */ + public Integer subnetPrefixLength() { + return this.subnetPrefixLength; + } + + /** + * Set the subnet mask prefix length (see CIDR notation). + * + * @param subnetPrefixLength the subnetPrefixLength value to set + * @return the IPRange object itself. + */ + public IPRange withSubnetPrefixLength(Integer subnetPrefixLength) { + this.subnetPrefixLength = subnetPrefixLength; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java new file mode 100644 index 0000000000000..da31483ebb56a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for generating thumbnails from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Image") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgImage", value = JpgImage.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngImage", value = PngImage.class) +}) +public class Image extends Video { + /** + * The position in the input video from where to start generating + * thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: + * PT05S), or a frame count (For example, 10 for the 10th frame), or a + * relative value (For example, 1%). Also supports a macro {Best}, which + * tells the encoder to select the best thumbnail from the first few + * seconds of the video. + */ + @JsonProperty(value = "start") + private String start; + + /** + * The intervals at which thumbnails are generated. The value can be in + * absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), + * or a frame count (For example, 30 for every 30 frames), or a relative + * value (For example, 1%). + */ + @JsonProperty(value = "step") + private String step; + + /** + * The position in the input video at which to stop generating thumbnails. + * The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop + * at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop + * at the 300th frame), or a relative value (For example, 100%). + */ + @JsonProperty(value = "range") + private String range; + + /** + * Get the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @return the start value + */ + public String start() { + return this.start; + } + + /** + * Set the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @param start the start value to set + * @return the Image object itself. + */ + public Image withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @return the step value + */ + public String step() { + return this.step; + } + + /** + * Set the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @param step the step value to set + * @return the Image object itself. + */ + public Image withStep(String step) { + this.step = step; + return this; + } + + /** + * Get the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @return the range value + */ + public String range() { + return this.range; + } + + /** + * Set the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @param range the range value to set + * @return the Image object itself. + */ + public Image withRange(String range) { + this.range = range; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java new file mode 100644 index 0000000000000..a76ba06d071e2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for an output image file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ImageFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class) +}) +public class ImageFormat extends Format { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java new file mode 100644 index 0000000000000..9cab233c0e339 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for InsightsType. + */ +public enum InsightsType { + /** Generate audio only insights. Ignore video even if present. Fails if no audio is present. */ + AUDIO_INSIGHTS_ONLY("AudioInsightsOnly"), + + /** Generate video only insights. Ignore audio if present. Fails if no video is present. */ + VIDEO_INSIGHTS_ONLY("VideoInsightsOnly"), + + /** Generate both audio and video insights. Fails if either audio or video Insights fail. */ + ALL_INSIGHTS("AllInsights"); + + /** The actual serialized value for a InsightsType instance. */ + private String value; + + InsightsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InsightsType instance. + * + * @param value the serialized value to parse. + * @return the parsed InsightsType object, or null if unable to parse. + */ + @JsonCreator + public static InsightsType fromString(String value) { + InsightsType[] items = InsightsType.values(); + for (InsightsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java new file mode 100644 index 0000000000000..e21bf342bedde --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.JobInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; +import java.util.Map; + +/** + * Type representing Job. + */ +public interface Job extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the correlationData value. + */ + Map correlationData(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + JobInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the priority value. + */ + Priority priority(); + + /** + * @return the state value. + */ + JobState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Job definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTransform, DefinitionStages.WithInput, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Job definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Job definition. + */ + interface Blank extends WithTransform { + } + + /** + * The stage of the job definition allowing to specify Transform. + */ + interface WithTransform { + /** + * Specifies resourceGroupName, accountName, transformName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param transformName The Transform name + * @return the next definition stage + */ + WithInput withExistingTransform(String resourceGroupName, String accountName, String transformName); + } + + /** + * The stage of the job definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + * @param input The inputs for the Job + * @return the next definition stage + */ + WithOutputs withInput(JobInput input); + } + + /** + * The stage of the job definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + * @param outputs The outputs for the Job + * @return the next definition stage + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the job definition allowing to specify CorrelationData. + */ + interface WithCorrelationData { + /** + * Specifies correlationData. + * @param correlationData Customer provided correlation data that will be returned in Job and JobOutput state events + * @return the next definition stage + */ + WithCreate withCorrelationData(Map correlationData); + } + + /** + * The stage of the job definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the job definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next definition stage + */ + WithCreate withPriority(Priority priority); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCorrelationData, DefinitionStages.WithDescription, DefinitionStages.WithPriority { + } + } + /** + * The template for a Job update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCorrelationData, UpdateStages.WithDescription, UpdateStages.WithPriority { + } + + /** + * Grouping of Job update stages. + */ + interface UpdateStages { + /** + * The stage of the job update allowing to specify CorrelationData. + */ + interface WithCorrelationData { + /** + * Specifies correlationData. + * @param correlationData Customer provided correlation data that will be returned in Job and JobOutput state events + * @return the next update stage + */ + Update withCorrelationData(Map correlationData); + } + + /** + * The stage of the job update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Optional customer supplied description of the Job + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the job update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + * @return the next update stage + */ + Update withPriority(Priority priority); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java new file mode 100644 index 0000000000000..61754e01728fa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobError { + /** + * Error code describing the error. Possible values include: + * 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', + * 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', + * 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCode code; + + /** + * A human-readable language-dependent representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Helps with categorization of errors. Possible values include: 'Service', + * 'Download', 'Upload', 'Configuration', 'Content'. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCategory category; + + /** + * Indicates that it may be possible to retry the Job. If retry is + * unsuccessful, please contact Azure support via Azure Portal. Possible + * values include: 'DoNotRetry', 'MayRetry'. + */ + @JsonProperty(value = "retry", access = JsonProperty.Access.WRITE_ONLY) + private JobRetry retry; + + /** + * An array of details about specific errors that led to this reported + * error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + * + * @return the code value + */ + public JobErrorCode code() { + return this.code; + } + + /** + * Get a human-readable language-dependent representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get helps with categorization of errors. Possible values include: 'Service', 'Download', 'Upload', 'Configuration', 'Content'. + * + * @return the category value + */ + public JobErrorCategory category() { + return this.category; + } + + /** + * Get indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry'. + * + * @return the retry value + */ + public JobRetry retry() { + return this.retry; + } + + /** + * Get an array of details about specific errors that led to this reported error. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java new file mode 100644 index 0000000000000..80ed5a269a788 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCategory. + */ +public enum JobErrorCategory { + /** The error is service related. */ + SERVICE("Service"), + + /** The error is download related. */ + DOWNLOAD("Download"), + + /** The error is upload related. */ + UPLOAD("Upload"), + + /** The error is configuration related. */ + CONFIGURATION("Configuration"), + + /** The error is related to data in the input files. */ + CONTENT("Content"); + + /** The actual serialized value for a JobErrorCategory instance. */ + private String value; + + JobErrorCategory(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCategory instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCategory object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCategory fromString(String value) { + JobErrorCategory[] items = JobErrorCategory.values(); + for (JobErrorCategory item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java new file mode 100644 index 0000000000000..f98c797beb5fe --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCode. + */ +public enum JobErrorCode { + /** Fatal service error, please contact support. */ + SERVICE_ERROR("ServiceError"), + + /** Transient error, please retry, if retry is unsuccessful, please contact support. */ + SERVICE_TRANSIENT_ERROR("ServiceTransientError"), + + /** While trying to download the input files, the files were not accessible, please check the availability of the source. */ + DOWNLOAD_NOT_ACCESSIBLE("DownloadNotAccessible"), + + /** While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. */ + DOWNLOAD_TRANSIENT_ERROR("DownloadTransientError"), + + /** While trying to upload the output files, the destination was not reachable, please check the availability of the destination. */ + UPLOAD_NOT_ACCESSIBLE("UploadNotAccessible"), + + /** While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. */ + UPLOAD_TRANSIENT_ERROR("UploadTransientError"), + + /** There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. */ + CONFIGURATION_UNSUPPORTED("ConfigurationUnsupported"), + + /** There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. */ + CONTENT_MALFORMED("ContentMalformed"), + + /** There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. */ + CONTENT_UNSUPPORTED("ContentUnsupported"); + + /** The actual serialized value for a JobErrorCode instance. */ + private String value; + + JobErrorCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCode instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCode object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCode fromString(String value) { + JobErrorCode[] items = JobErrorCode.values(); + for (JobErrorCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java new file mode 100644 index 0000000000000..1994c85e775ff --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobErrorDetail { + /** + * Code describing the error detail. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * A human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get code describing the error detail. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get a human-readable representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java new file mode 100644 index 0000000000000..87d6d424a6e79 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputClip", value = JobInputClip.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputs", value = JobInputs.class) +}) +public class JobInput { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java new file mode 100644 index 0000000000000..471f36a5f1412 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset for input into a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputAsset") +public class JobInputAsset extends JobInputClip { + /** + * The name of the input Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the input Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the input Asset. + * + * @param assetName the assetName value to set + * @return the JobInputAsset object itself. + */ + public JobInputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java new file mode 100644 index 0000000000000..5d487948ee561 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents input files for a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputClip") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputAsset", value = JobInputAsset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputHttp", value = JobInputHttp.class) +}) +public class JobInputClip extends JobInput { + /** + * List of files. Required for JobInputHttp. + */ + @JsonProperty(value = "files") + private List files; + + /** + * A label that is assigned to a JobInputClip, that is used to satisfy a + * reference used in the Transform. For example, a Transform can be + * authored so as to take an image file with the label 'xyz' and apply it + * as an overlay onto the input video before it is encoded. When submitting + * a Job, exactly one of the JobInputs should be the image file, and it + * should have the label 'xyz'. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get list of files. Required for JobInputHttp. + * + * @return the files value + */ + public List files() { + return this.files; + } + + /** + * Set list of files. Required for JobInputHttp. + * + * @param files the files value to set + * @return the JobInputClip object itself. + */ + public JobInputClip withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get a label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set a label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @param label the label value to set + * @return the JobInputClip object itself. + */ + public JobInputClip withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java new file mode 100644 index 0000000000000..71d04fd88fe4c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents HTTPS job input. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputHttp") +public class JobInputHttp extends JobInputClip { + /** + * Base URI for HTTPS job input. It will be concatenated with provided file + * names. If no base uri is given, then the provided file list is assumed + * to be fully qualified uris. + */ + @JsonProperty(value = "baseUri") + private String baseUri; + + /** + * Get base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @return the baseUri value + */ + public String baseUri() { + return this.baseUri; + } + + /** + * Set base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @param baseUri the baseUri value to set + * @return the JobInputHttp object itself. + */ + public JobInputHttp withBaseUri(String baseUri) { + this.baseUri = baseUri; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java new file mode 100644 index 0000000000000..881f802e53189 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a list of of inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputs") +public class JobInputs extends JobInput { + /** + * List of inputs to a Job. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /** + * Get list of inputs to a Job. + * + * @return the inputs value + */ + public List inputs() { + return this.inputs; + } + + /** + * Set list of inputs to a Job. + * + * @param inputs the inputs value to set + * @return the JobInputs object itself. + */ + public JobInputs withInputs(List inputs) { + this.inputs = inputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java new file mode 100644 index 0000000000000..335c8559a91ac --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes all the properties of a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobOutputAsset", value = JobOutputAsset.class) +}) +public class JobOutput { + /** + * If the JobOutput is in the Error state, it contains the details of the + * error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private JobError error; + + /** + * Describes the state of the JobOutput. Possible values include: + * 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', + * 'Scheduled'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * If the JobOutput is in a Processing state, this contains the Job + * completion percentage. The value is an estimate and not intended to be + * used to predict Job completion times. To determine if the JobOutput is + * complete, use the State property. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private int progress; + + /** + * A label that is assigned to a JobOutput in order to help uniquely + * identify it. This is useful when your Transform has more than one + * TransformOutput, whereby your Job has more than one JobOutput. In such + * cases, when you submit the Job, you will add two or more JobOutputs, in + * the same order as TransformOutputs in the Transform. Subsequently, when + * you retrieve the Job, either through events or on a GET request, you can + * use the label to easily identify the JobOutput. If a label is not + * provided, a default value of '{presetName}_{outputIndex}' will be used, + * where the preset name is the name of the preset in the corresponding + * TransformOutput and the output index is the relative index of the this + * JobOutput within the Job. Note that this index is the same as the + * relative index of the corresponding TransformOutput within its + * Transform. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get if the JobOutput is in the Error state, it contains the details of the error. + * + * @return the error value + */ + public JobError error() { + return this.error; + } + + /** + * Get describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get if the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property. + * + * @return the progress value + */ + public int progress() { + return this.progress; + } + + /** + * Get a label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set a label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. + * + * @param label the label value to set + * @return the JobOutput object itself. + */ + public JobOutput withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java new file mode 100644 index 0000000000000..1d07b4c86f7e4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset used as a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobOutputAsset") +public class JobOutputAsset extends JobOutput { + /** + * The name of the output Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the output Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the output Asset. + * + * @param assetName the assetName value to set + * @return the JobOutputAsset object itself. + */ + public JobOutputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java new file mode 100644 index 0000000000000..ee7995f3eb339 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobRetry. + */ +public enum JobRetry { + /** Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. */ + DO_NOT_RETRY("DoNotRetry"), + + /** Issue may be resolved after waiting for a period of time and resubmitting the same Job. */ + MAY_RETRY("MayRetry"); + + /** The actual serialized value for a JobRetry instance. */ + private String value; + + JobRetry(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobRetry instance. + * + * @param value the serialized value to parse. + * @return the parsed JobRetry object, or null if unable to parse. + */ + @JsonCreator + public static JobRetry fromString(String value) { + JobRetry[] items = JobRetry.values(); + for (JobRetry item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java new file mode 100644 index 0000000000000..57f686d3a3b36 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** The job was canceled. This is a final state for the job. */ + CANCELED("Canceled"), + + /** The job is in the process of being canceled. This is a transient state for the job. */ + CANCELING("Canceling"), + + /** The job has encountered an error. This is a final state for the job. */ + ERROR("Error"), + + /** The job is finished. This is a final state for the job. */ + FINISHED("Finished"), + + /** The job is processing. This is a transient state for the job. */ + PROCESSING("Processing"), + + /** The job is in a queued state, waiting for resources to become available. This is a transient state. */ + QUEUED("Queued"), + + /** The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. */ + SCHEDULED("Scheduled"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromString(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java new file mode 100644 index 0000000000000..a2ee4f7aa0f7b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends SupportsCreating, HasInner { + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String transformName); + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java new file mode 100644 index 0000000000000..28dc9bcdf32ee --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing JPEG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgFormat") +public class JpgFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java new file mode 100644 index 0000000000000..118f7868cbe35 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of JPEG images from the + * input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgImage") +public class JpgImage extends Image { + /** + * A collection of output JPEG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output JPEG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output JPEG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the JpgImage object itself. + */ + public JpgImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java new file mode 100644 index 0000000000000..7da9a93faa6de --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a JPEG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgLayer") +public class JpgLayer extends Layer { + /** + * The compression quality of the JPEG output. Range is from 0-100 and the + * default is 70. + */ + @JsonProperty(value = "quality") + private Integer quality; + + /** + * Get the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @return the quality value + */ + public Integer quality() { + return this.quality; + } + + /** + * Set the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @param quality the quality value to set + * @return the JpgLayer object itself. + */ + public JpgLayer withQuality(Integer quality) { + this.quality = quality; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java new file mode 100644 index 0000000000000..5a623bdd496c9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The encoder can be configured to produce video and/or images (thumbnails) at + * different resolutions, by specifying a layer for each desired resolution. A + * layer represents the properties for the video or image at a resolution. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Layer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoLayer", value = VideoLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgLayer", value = JpgLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngLayer", value = PngLayer.class) +}) +public class Layer { + /** + * The width of the output video for this layer. The value can be absolute + * (in pixels) or relative (in percentage). For example 50% means the + * output video has half as many pixels in width as the input. + */ + @JsonProperty(value = "width") + private String width; + + /** + * The height of the output video for this layer. The value can be absolute + * (in pixels) or relative (in percentage). For example 50% means the + * output video has half as many pixels in height as the input. + */ + @JsonProperty(value = "height") + private String height; + + /** + * The alphanumeric label for this layer, which can be used in multiplexing + * different video and audio layers, or in naming the output file. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @return the width value + */ + public String width() { + return this.width; + } + + /** + * Set the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @param width the width value to set + * @return the Layer object itself. + */ + public Layer withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @return the height value + */ + public String height() { + return this.height; + } + + /** + * Set the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @param height the height value to set + * @return the Layer object itself. + */ + public Layer withHeight(String height) { + this.height = height; + return this; + } + + /** + * Get the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + * + * @param label the label value to set + * @return the Layer object itself. + */ + public Layer withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java new file mode 100644 index 0000000000000..6464abeb16f3f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to the list SAS request. + */ +public class ListContainerSasInput { + /** + * The permissions to set on the SAS URL. Possible values include: 'Read', + * 'ReadWrite', 'ReadWriteDelete'. + */ + @JsonProperty(value = "permissions") + private AssetContainerPermission permissions; + + /** + * The SAS URL expiration time. This must be less than 24 hours from the + * current time. + */ + @JsonProperty(value = "expiryTime") + private DateTime expiryTime; + + /** + * Get the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @return the permissions value + */ + public AssetContainerPermission permissions() { + return this.permissions; + } + + /** + * Set the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @param permissions the permissions value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withPermissions(AssetContainerPermission permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @return the expiryTime value + */ + public DateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @param expiryTime the expiryTime value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withExpiryTime(DateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java new file mode 100644 index 0000000000000..d8859c213b164 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListContentKeysResponseInner; +import java.util.List; + +/** + * Type representing ListContentKeysResponse. + */ +public interface ListContentKeysResponse extends HasInner, HasManager { + /** + * @return the contentKeys value. + */ + List contentKeys(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java new file mode 100644 index 0000000000000..add01e3e9e0fc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListPathsResponseInner; +import java.util.List; + +/** + * Type representing ListPathsResponse. + */ +public interface ListPathsResponse extends HasInner, HasManager { + /** + * @return the downloadPaths value. + */ + List downloadPaths(); + + /** + * @return the streamingPaths value. + */ + List streamingPaths(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java new file mode 100644 index 0000000000000..6ecec1cbb6b7c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListStreamingLocatorsResponseInner; +import java.util.List; + +/** + * Type representing ListStreamingLocatorsResponse. + */ +public interface ListStreamingLocatorsResponse extends HasInner, HasManager { + /** + * @return the streamingLocators value. + */ + List streamingLocators(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java new file mode 100644 index 0000000000000..f54691cb982c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java @@ -0,0 +1,372 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveEventInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing LiveEvent. + */ +public interface LiveEvent extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the encoding value. + */ + LiveEventEncoding encoding(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + LiveEventInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the preview value. + */ + LiveEventPreview preview(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveEventResourceState resourceState(); + + /** + * @return the streamOptions value. + */ + List streamOptions(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vanityUrl value. + */ + Boolean vanityUrl(); + + /** + * The entirety of the LiveEvent definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithInput, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveEvent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveEvent definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the liveevent definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the liveevent definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if the resource should be automatically started on creation + * @return the next definition stage + */ + WithInput withAutoStart(Boolean autoStart); + } + + /** + * The stage of the liveevent definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + * @param input The Live Event input + * @return the next definition stage + */ + WithCreate withInput(LiveEventInput input); + } + + /** + * The stage of the liveevent definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next definition stage + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Live Event description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveevent definition allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next definition stage + */ + WithCreate withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the liveevent definition allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + * @param preview The Live Event preview + * @return the next definition stage + */ + WithCreate withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent definition allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + * @param streamOptions The options to use for the LiveEvent. This value is specified at creation time and cannot be updated + * @return the next definition stage + */ + WithCreate withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the liveevent definition allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + * @param vanityUrl Specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated + * @return the next definition stage + */ + WithCreate withVanityUrl(Boolean vanityUrl); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithDescription, DefinitionStages.WithEncoding, DefinitionStages.WithLocation, DefinitionStages.WithPreview, DefinitionStages.WithStreamOptions, DefinitionStages.WithTags, DefinitionStages.WithVanityUrl { + } + } + /** + * The template for a LiveEvent update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithDescription, UpdateStages.WithEncoding, UpdateStages.WithLocation, UpdateStages.WithPreview, UpdateStages.WithStreamOptions, UpdateStages.WithTags, UpdateStages.WithVanityUrl { + } + + /** + * Grouping of LiveEvent update stages. + */ + interface UpdateStages { + /** + * The stage of the liveevent update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The Live Event access policies + * @return the next update stage + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Live Event description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the liveevent update allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + * @param encoding The Live Event encoding + * @return the next update stage + */ + Update withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the liveevent update allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + * @param preview The Live Event preview + * @return the next update stage + */ + Update withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent update allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + * @param streamOptions The options to use for the LiveEvent. This value is specified at creation time and cannot be updated + * @return the next update stage + */ + Update withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the liveevent update allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + * @param vanityUrl Specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated + * @return the next update stage + */ + Update withVanityUrl(Boolean vanityUrl); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java new file mode 100644 index 0000000000000..06e11a34a4e40 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LiveEvent action input parameter definition. + */ +public class LiveEventActionInput { + /** + * The flag indicates if remove LiveOutputs on Stop. + */ + @JsonProperty(value = "removeOutputsOnStop") + private Boolean removeOutputsOnStop; + + /** + * Get the flag indicates if remove LiveOutputs on Stop. + * + * @return the removeOutputsOnStop value + */ + public Boolean removeOutputsOnStop() { + return this.removeOutputsOnStop; + } + + /** + * Set the flag indicates if remove LiveOutputs on Stop. + * + * @param removeOutputsOnStop the removeOutputsOnStop value to set + * @return the LiveEventActionInput object itself. + */ + public LiveEventActionInput withRemoveOutputsOnStop(Boolean removeOutputsOnStop) { + this.removeOutputsOnStop = removeOutputsOnStop; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java new file mode 100644 index 0000000000000..a97cbad894620 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event encoding. + */ +public class LiveEventEncoding { + /** + * The encoding type for Live Event. This value is specified at creation + * time and cannot be updated. Possible values include: 'None', 'Basic'. + */ + @JsonProperty(value = "encodingType") + private LiveEventEncodingType encodingType; + + /** + * The encoding preset name. This value is specified at creation time and + * cannot be updated. + */ + @JsonProperty(value = "presetName") + private String presetName; + + /** + * Get the encoding type for Live Event. This value is specified at creation time and cannot be updated. Possible values include: 'None', 'Basic'. + * + * @return the encodingType value + */ + public LiveEventEncodingType encodingType() { + return this.encodingType; + } + + /** + * Set the encoding type for Live Event. This value is specified at creation time and cannot be updated. Possible values include: 'None', 'Basic'. + * + * @param encodingType the encodingType value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withEncodingType(LiveEventEncodingType encodingType) { + this.encodingType = encodingType; + return this; + } + + /** + * Get the encoding preset name. This value is specified at creation time and cannot be updated. + * + * @return the presetName value + */ + public String presetName() { + return this.presetName; + } + + /** + * Set the encoding preset name. This value is specified at creation time and cannot be updated. + * + * @param presetName the presetName value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withPresetName(String presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java new file mode 100644 index 0000000000000..a3d42eeede630 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventEncodingType. + */ +public enum LiveEventEncodingType { + /** Enum value None. */ + NONE("None"), + + /** Enum value Basic. */ + BASIC("Basic"); + + /** The actual serialized value for a LiveEventEncodingType instance. */ + private String value; + + LiveEventEncodingType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventEncodingType instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventEncodingType object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventEncodingType fromString(String value) { + LiveEventEncodingType[] items = LiveEventEncodingType.values(); + for (LiveEventEncodingType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java new file mode 100644 index 0000000000000..df202c3215c47 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event endpoint. + */ +public class LiveEventEndpoint { + /** + * The endpoint protocol. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The endpoint URL. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Get the endpoint protocol. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the endpoint protocol. + * + * @param protocol the protocol value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the endpoint URL. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the endpoint URL. + * + * @param url the url value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java new file mode 100644 index 0000000000000..89963cd75e8ab --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event input. + */ +public class LiveEventInput { + /** + * The streaming protocol for the Live Event. This is specified at + * creation time and cannot be updated. Possible values include: + * 'FragmentedMP4', 'RTMP'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private LiveEventInputProtocol streamingProtocol; + + /** + * The access control for LiveEvent Input. + */ + @JsonProperty(value = "accessControl") + private LiveEventInputAccessControl accessControl; + + /** + * ISO 8601 timespan duration of the key frame interval duration. + */ + @JsonProperty(value = "keyFrameIntervalDuration") + private String keyFrameIntervalDuration; + + /** + * A unique identifier for a stream. This can be specified at creation + * time but cannot be updated. If omitted, the service will generate a + * unique value. + */ + @JsonProperty(value = "accessToken") + private String accessToken; + + /** + * The input endpoints for the Live Event. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * Get the streaming protocol for the Live Event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @return the streamingProtocol value + */ + public LiveEventInputProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set the streaming protocol for the Live Event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withStreamingProtocol(LiveEventInputProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get the access control for LiveEvent Input. + * + * @return the accessControl value + */ + public LiveEventInputAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control for LiveEvent Input. + * + * @param accessControl the accessControl value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessControl(LiveEventInputAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get iSO 8601 timespan duration of the key frame interval duration. + * + * @return the keyFrameIntervalDuration value + */ + public String keyFrameIntervalDuration() { + return this.keyFrameIntervalDuration; + } + + /** + * Set iSO 8601 timespan duration of the key frame interval duration. + * + * @param keyFrameIntervalDuration the keyFrameIntervalDuration value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withKeyFrameIntervalDuration(String keyFrameIntervalDuration) { + this.keyFrameIntervalDuration = keyFrameIntervalDuration; + return this; + } + + /** + * Get a unique identifier for a stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value. + * + * @return the accessToken value + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Set a unique identifier for a stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value. + * + * @param accessToken the accessToken value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get the input endpoints for the Live Event. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the input endpoints for the Live Event. + * + * @param endpoints the endpoints value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java new file mode 100644 index 0000000000000..a2eb0847a5d5e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control for Live Event Input. + */ +public class LiveEventInputAccessControl { + /** + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the IP access control properties. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control properties. + * + * @param ip the ip value to set + * @return the LiveEventInputAccessControl object itself. + */ + public LiveEventInputAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java new file mode 100644 index 0000000000000..7beb4d75c648c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventInputProtocol. + */ +public enum LiveEventInputProtocol { + /** Enum value FragmentedMP4. */ + FRAGMENTED_MP4("FragmentedMP4"), + + /** Enum value RTMP. */ + RTMP("RTMP"); + + /** The actual serialized value for a LiveEventInputProtocol instance. */ + private String value; + + LiveEventInputProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventInputProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventInputProtocol object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventInputProtocol fromString(String value) { + LiveEventInputProtocol[] items = LiveEventInputProtocol.values(); + for (LiveEventInputProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java new file mode 100644 index 0000000000000..a44c01d19e507 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event preview. + */ +public class LiveEventPreview { + /** + * The endpoints for preview. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * The access control for LiveEvent preview. + */ + @JsonProperty(value = "accessControl") + private LiveEventPreviewAccessControl accessControl; + + /** + * The identifier of the preview locator in Guid format. Specifying this + * at creation time allows the caller to know the preview locator url + * before the event is created. If omitted, the service will generate a + * random identifier. This value cannot be updated once the live event is + * created. + */ + @JsonProperty(value = "previewLocator") + private String previewLocator; + + /** + * The name of streaming policy used for the LiveEvent preview. This value + * is specified at creation time and cannot be updated. + */ + @JsonProperty(value = "streamingPolicyName") + private String streamingPolicyName; + + /** + * An Alternative Media Identifier associated with the StreamingLocator + * created for the preview. This value is specified at creation time and + * cannot be updated. The identifier can be used in the + * CustomLicenseAcquisitionUrlTemplate or the + * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the + * StreamingPolicyName field. + */ + @JsonProperty(value = "alternativeMediaId") + private String alternativeMediaId; + + /** + * Get the endpoints for preview. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints for preview. + * + * @param endpoints the endpoints value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the access control for LiveEvent preview. + * + * @return the accessControl value + */ + public LiveEventPreviewAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control for LiveEvent preview. + * + * @param accessControl the accessControl value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withAccessControl(LiveEventPreviewAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. + * + * @return the previewLocator value + */ + public String previewLocator() { + return this.previewLocator; + } + + /** + * Set the identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. + * + * @param previewLocator the previewLocator value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withPreviewLocator(String previewLocator) { + this.previewLocator = previewLocator; + return this; + } + + /** + * Get the name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set the name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + + /** + * Get an Alternative Media Identifier associated with the StreamingLocator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + * + * @return the alternativeMediaId value + */ + public String alternativeMediaId() { + return this.alternativeMediaId; + } + + /** + * Set an Alternative Media Identifier associated with the StreamingLocator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + * + * @param alternativeMediaId the alternativeMediaId value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withAlternativeMediaId(String alternativeMediaId) { + this.alternativeMediaId = alternativeMediaId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java new file mode 100644 index 0000000000000..cfea5dd674ea0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control for Live Event preview. + */ +public class LiveEventPreviewAccessControl { + /** + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the IP access control properties. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control properties. + * + * @param ip the ip value to set + * @return the LiveEventPreviewAccessControl object itself. + */ + public LiveEventPreviewAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java new file mode 100644 index 0000000000000..8e0f75fb89e3a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventResourceState. + */ +public enum LiveEventResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveEventResourceState instance. */ + private String value; + + LiveEventResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventResourceState fromString(String value) { + LiveEventResourceState[] items = LiveEventResourceState.values(); + for (LiveEventResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java new file mode 100644 index 0000000000000..7133b972a395f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveEventsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveEvents. + */ +public interface LiveEvents extends SupportsCreating, HasInner { + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java new file mode 100644 index 0000000000000..120f4626319df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveOutputInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.Period; +import org.joda.time.DateTime; + +/** + * Type representing LiveOutput. + */ +public interface LiveOutput extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the archiveWindowLength value. + */ + Period archiveWindowLength(); + + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the hls value. + */ + Hls hls(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the manifestName value. + */ + String manifestName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputSnapTime value. + */ + Long outputSnapTime(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveOutputResourceState resourceState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the LiveOutput definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLiveEvent, DefinitionStages.WithArchiveWindowLength, DefinitionStages.WithAssetName, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveOutput definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveOutput definition. + */ + interface Blank extends WithLiveEvent { + } + + /** + * The stage of the liveoutput definition allowing to specify LiveEvent. + */ + interface WithLiveEvent { + /** + * Specifies resourceGroupName, accountName, liveEventName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @param liveEventName The name of the Live Event + * @return the next definition stage + */ + WithArchiveWindowLength withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); + } + + /** + * The stage of the liveoutput definition allowing to specify ArchiveWindowLength. + */ + interface WithArchiveWindowLength { + /** + * Specifies archiveWindowLength. + * @param archiveWindowLength ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content + * @return the next definition stage + */ + WithAssetName withArchiveWindowLength(Period archiveWindowLength); + } + + /** + * The stage of the liveoutput definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + * @param assetName The asset name + * @return the next definition stage + */ + WithCreate withAssetName(String assetName); + } + + /** + * The stage of the liveoutput definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The description of the Live Output + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveoutput definition allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + * @param hls The HLS configuration + * @return the next definition stage + */ + WithCreate withHls(Hls hls); + } + + /** + * The stage of the liveoutput definition allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + * @param manifestName The manifest file name. If not provided, the service will generate one automatically + * @return the next definition stage + */ + WithCreate withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput definition allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next definition stage + */ + WithCreate withOutputSnapTime(Long outputSnapTime); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithHls, DefinitionStages.WithManifestName, DefinitionStages.WithOutputSnapTime { + } + } + /** + * The template for a LiveOutput update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithHls, UpdateStages.WithManifestName, UpdateStages.WithOutputSnapTime { + } + + /** + * Grouping of LiveOutput update stages. + */ + interface UpdateStages { + /** + * The stage of the liveoutput update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The description of the Live Output + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the liveoutput update allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + * @param hls The HLS configuration + * @return the next update stage + */ + Update withHls(Hls hls); + } + + /** + * The stage of the liveoutput update allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + * @param manifestName The manifest file name. If not provided, the service will generate one automatically + * @return the next update stage + */ + Update withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput update allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + * @param outputSnapTime The output snapshot time + * @return the next update stage + */ + Update withOutputSnapTime(Long outputSnapTime); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java new file mode 100644 index 0000000000000..8a3b4e2b65803 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveOutputResourceState. + */ +public enum LiveOutputResourceState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveOutputResourceState instance. */ + private String value; + + LiveOutputResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveOutputResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveOutputResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveOutputResourceState fromString(String value) { + LiveOutputResourceState[] items = LiveOutputResourceState.values(); + for (LiveOutputResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java new file mode 100644 index 0000000000000..4c06ce4b560e4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveOutputsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveOutputs. + */ +public interface LiveOutputs extends SupportsCreating, HasInner { + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName); + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java new file mode 100644 index 0000000000000..370c6da702312 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java new file mode 100644 index 0000000000000..4aa54725667dd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaServiceInner; + +/** + * Type representing MediaService. + */ +public interface MediaService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * The entirety of the MediaService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of MediaService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MediaService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the MediaService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the mediaservice definition allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The storage accounts for this resource + * @return the next definition stage + */ + WithCreate withStorageAccounts(List storageAccounts); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithStorageAccounts { + } + } + /** + * The template for a MediaService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithStorageAccounts { + } + + /** + * Grouping of MediaService update stages. + */ + interface UpdateStages { + /** + * The stage of the mediaservice update allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + * @param storageAccounts The storage accounts for this resource + * @return the next update stage + */ + Update withStorageAccounts(List storageAccounts); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java new file mode 100644 index 0000000000000..b7fef66a027a8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaservicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Mediaservices. + */ +public interface Mediaservices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable syncStorageKeysAsync(String resourceGroupName, String accountName); + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBySubscriptionAsync(String accountName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java new file mode 100644 index 0000000000000..4ea532380cedc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric emitted by service. + */ +public class Metric { + /** + * The metric name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The metric display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The metric display description. + */ + @JsonProperty(value = "displayDescription", access = JsonProperty.Access.WRITE_ONLY) + private String displayDescription; + + /** + * The metric unit. Possible values include: 'Bytes', 'Count', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private MetricUnit unit; + + /** + * The metric aggregation type. Possible values include: 'Average', + * 'Count', 'Total'. + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private MetricAggregationType aggregationType; + + /** + * The metric dimensions. + */ + @JsonProperty(value = "dimensions", access = JsonProperty.Access.WRITE_ONLY) + private List dimensions; + + /** + * Get the metric name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the metric display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the metric display description. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Get the metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @return the unit value + */ + public MetricUnit unit() { + return this.unit; + } + + /** + * Get the metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. + * + * @return the aggregationType value + */ + public MetricAggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Get the metric dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java new file mode 100644 index 0000000000000..46af6201497fe --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MetricAggregationType. + */ +public enum MetricAggregationType { + /** The average. */ + AVERAGE("Average"), + + /** The count of a number of items, usually requests. */ + COUNT("Count"), + + /** The sum. */ + TOTAL("Total"); + + /** The actual serialized value for a MetricAggregationType instance. */ + private String value; + + MetricAggregationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MetricAggregationType instance. + * + * @param value the serialized value to parse. + * @return the parsed MetricAggregationType object, or null if unable to parse. + */ + @JsonCreator + public static MetricAggregationType fromString(String value) { + MetricAggregationType[] items = MetricAggregationType.values(); + for (MetricAggregationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java new file mode 100644 index 0000000000000..309c07a84ea45 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric dimension. + */ +public class MetricDimension { + /** + * The metric dimension name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display name for the dimension. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Whether to export metric to shoebox. + */ + @JsonProperty(value = "toBeExportedForShoebox", access = JsonProperty.Access.WRITE_ONLY) + private boolean toBeExportedForShoebox; + + /** + * Get the metric dimension name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display name for the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get whether to export metric to shoebox. + * + * @return the toBeExportedForShoebox value + */ + public boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java new file mode 100644 index 0000000000000..a4f5f2442e918 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric properties. + */ +public class MetricProperties { + /** + * The service specifications. + */ + @JsonProperty(value = "serviceSpecification", access = JsonProperty.Access.WRITE_ONLY) + private ServiceSpecification serviceSpecification; + + /** + * Get the service specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java new file mode 100644 index 0000000000000..02d2259f4c3b5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MetricUnit. + */ +public enum MetricUnit { + /** The number of bytes. */ + BYTES("Bytes"), + + /** The count. */ + COUNT("Count"), + + /** The number of milliseconds. */ + MILLISECONDS("Milliseconds"); + + /** The actual serialized value for a MetricUnit instance. */ + private String value; + + MetricUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MetricUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed MetricUnit object, or null if unable to parse. + */ + @JsonCreator + public static MetricUnit fromString(String value) { + MetricUnit[] items = MetricUnit.values(); + for (MetricUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java new file mode 100644 index 0000000000000..09015d97b5a2b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for an output ISO MP4 file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Mp4Format") +public class Mp4Format extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java new file mode 100644 index 0000000000000..923d1935e660a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for producing a collection of GOP aligned + * multi-bitrate files. The default behavior is to produce one output file for + * each video layer which is muxed together with all the audios. The exact + * output files produced can be controlled by specifying the outputFiles + * collection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.MultiBitrateFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Mp4Format", value = Mp4Format.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.TransportStreamFormat", value = TransportStreamFormat.class) +}) +public class MultiBitrateFormat extends Format { + /** + * The list of output files to produce. Each entry in the list is a set of + * audio and video layer labels to be muxed together . + */ + @JsonProperty(value = "outputFiles") + private List outputFiles; + + /** + * Get the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @return the outputFiles value + */ + public List outputFiles() { + return this.outputFiles; + } + + /** + * Set the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @param outputFiles the outputFiles value to set + * @return the MultiBitrateFormat object itself. + */ + public MultiBitrateFormat withOutputFiles(List outputFiles) { + this.outputFiles = outputFiles; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java new file mode 100644 index 0000000000000..841179ab89b41 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for NoEncryption scheme. + */ +public class NoEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the NoEncryption object itself. + */ + public NoEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java new file mode 100644 index 0000000000000..89dd1b158601c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an error. + */ +public class ODataError { + /** + * A language-independent error name. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target of the error (for example, the name of the property in + * error). + */ + @JsonProperty(value = "target") + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get a language-independent error name. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set a language-independent error name. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the error (for example, the name of the property in error). + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the error (for example, the name of the property in error). + * + * @param target the target value to set + * @return the ODataError object itself. + */ + public ODataError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the error details. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java new file mode 100644 index 0000000000000..e1a82fea51097 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OnErrorType. + */ +public enum OnErrorType { + /** Tells the service that if this TransformOutput fails, then any other incomplete TransformOutputs can be stopped. */ + STOP_PROCESSING_JOB("StopProcessingJob"), + + /** Tells the service that if this TransformOutput fails, then allow any other TransformOutput to continue. */ + CONTINUE_JOB("ContinueJob"); + + /** The actual serialized value for a OnErrorType instance. */ + private String value; + + OnErrorType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnErrorType instance. + * + * @param value the serialized value to parse. + * @return the parsed OnErrorType object, or null if unable to parse. + */ + @JsonCreator + public static OnErrorType fromString(String value) { + OnErrorType[] items = OnErrorType.values(); + for (OnErrorType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java new file mode 100644 index 0000000000000..225fd4e8de14c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + MetricProperties properties(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java new file mode 100644 index 0000000000000..88347d5829278 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation details. + */ +public class OperationDisplay { + /** + * The service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the operation description. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java new file mode 100644 index 0000000000000..0205807425e3b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java new file mode 100644 index 0000000000000..3f9f7e34556d5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an output file produced. + */ +public class OutputFile { + /** + * The list of labels that describe how the encoder should multiplex video + * and audio into an output file. For example, if the encoder is producing + * two video layers with labels v1 and v2, and one audio layer with label + * a1, then an array like '[v1, a1]' tells the encoder to produce an output + * file with the video track represented by v1 and the audio track + * represented by a1. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Get the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @param labels the labels value to set + * @return the OutputFile object itself. + */ + public OutputFile withLabels(List labels) { + this.labels = labels; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java new file mode 100644 index 0000000000000..6926b28bb2114 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all overlays - image, audio or video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Overlay") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioOverlay", value = AudioOverlay.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoOverlay", value = VideoOverlay.class) +}) +public class Overlay { + /** + * The label of the job input which is to be used as an overlay. The Input + * must specify exactly one file. You can specify an image file in JPG or + * PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or + * a video file. See https://aka.ms/mesformats for the complete list of + * supported audio and video file formats. + */ + @JsonProperty(value = "inputLabel") + private String inputLabel; + + /** + * The start position, with reference to the input video, at which the + * overlay starts. The value should be in ISO 8601 format. For example, + * PT05S to start the overlay at 5 seconds in to the input video. If not + * specified the overlay starts from the beginning of the input video. + */ + @JsonProperty(value = "start") + private Period start; + + /** + * The position in the input video at which the overlay ends. The value + * should be in ISO 8601 duration format. For example, PT30S to end the + * overlay at 30 seconds in to the input video. If not specified the + * overlay will be applied until the end of the input video if inputLoop is + * true. Else, if inputLoop is false, then overlay will last as long as the + * duration of the overlay media. + */ + @JsonProperty(value = "end") + private Period end; + + /** + * The duration over which the overlay fades in onto the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade in (same as PT0S). + */ + @JsonProperty(value = "fadeInDuration") + private Period fadeInDuration; + + /** + * The duration over which the overlay fades out of the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade out (same as PT0S). + */ + @JsonProperty(value = "fadeOutDuration") + private Period fadeOutDuration; + + /** + * The gain level of audio in the overlay. The value should be in the range + * [0, 1.0]. The default is 1.0. + */ + @JsonProperty(value = "audioGainLevel") + private Double audioGainLevel; + + /** + * Get the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @return the inputLabel value + */ + public String inputLabel() { + return this.inputLabel; + } + + /** + * Set the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @param inputLabel the inputLabel value to set + * @return the Overlay object itself. + */ + public Overlay withInputLabel(String inputLabel) { + this.inputLabel = inputLabel; + return this; + } + + /** + * Get the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @return the start value + */ + public Period start() { + return this.start; + } + + /** + * Set the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @param start the start value to set + * @return the Overlay object itself. + */ + public Overlay withStart(Period start) { + this.start = start; + return this; + } + + /** + * Get the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @return the end value + */ + public Period end() { + return this.end; + } + + /** + * Set the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @param end the end value to set + * @return the Overlay object itself. + */ + public Overlay withEnd(Period end) { + this.end = end; + return this; + } + + /** + * Get the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @return the fadeInDuration value + */ + public Period fadeInDuration() { + return this.fadeInDuration; + } + + /** + * Set the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @param fadeInDuration the fadeInDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeInDuration(Period fadeInDuration) { + this.fadeInDuration = fadeInDuration; + return this; + } + + /** + * Get the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @return the fadeOutDuration value + */ + public Period fadeOutDuration() { + return this.fadeOutDuration; + } + + /** + * Set the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @param fadeOutDuration the fadeOutDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeOutDuration(Period fadeOutDuration) { + this.fadeOutDuration = fadeOutDuration; + return this; + } + + /** + * Get the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @return the audioGainLevel value + */ + public Double audioGainLevel() { + return this.audioGainLevel; + } + + /** + * Set the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @param audioGainLevel the audioGainLevel value to set + * @return the Overlay object itself. + */ + public Overlay withAudioGainLevel(Double audioGainLevel) { + this.audioGainLevel = audioGainLevel; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java new file mode 100644 index 0000000000000..467f8c1488c50 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing PNG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngFormat") +public class PngFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java new file mode 100644 index 0000000000000..a52a249ed6437 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of PNG images from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngImage") +public class PngImage extends Image { + /** + * A collection of output PNG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output PNG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output PNG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the PngImage object itself. + */ + public PngImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java new file mode 100644 index 0000000000000..74a73599294a3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a PNG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngLayer") +public class PngLayer extends Layer { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java new file mode 100644 index 0000000000000..f2e34d8c91cf6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The presentation time range, this is asset related and not recommended for + * Account Filter. + */ +public class PresentationTimeRange { + /** + * The absolute start time boundary. + */ + @JsonProperty(value = "startTimestamp", required = true) + private long startTimestamp; + + /** + * The absolute end time boundary. + */ + @JsonProperty(value = "endTimestamp", required = true) + private long endTimestamp; + + /** + * The relative to end sliding window. + */ + @JsonProperty(value = "presentationWindowDuration", required = true) + private long presentationWindowDuration; + + /** + * The relative to end right edge. + */ + @JsonProperty(value = "liveBackoffDuration", required = true) + private long liveBackoffDuration; + + /** + * The time scale of time stamps. + */ + @JsonProperty(value = "timescale", required = true) + private long timescale; + + /** + * The indicator of forcing exsiting of end time stamp. + */ + @JsonProperty(value = "forceEndTimestamp", required = true) + private boolean forceEndTimestamp; + + /** + * Get the absolute start time boundary. + * + * @return the startTimestamp value + */ + public long startTimestamp() { + return this.startTimestamp; + } + + /** + * Set the absolute start time boundary. + * + * @param startTimestamp the startTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withStartTimestamp(long startTimestamp) { + this.startTimestamp = startTimestamp; + return this; + } + + /** + * Get the absolute end time boundary. + * + * @return the endTimestamp value + */ + public long endTimestamp() { + return this.endTimestamp; + } + + /** + * Set the absolute end time boundary. + * + * @param endTimestamp the endTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withEndTimestamp(long endTimestamp) { + this.endTimestamp = endTimestamp; + return this; + } + + /** + * Get the relative to end sliding window. + * + * @return the presentationWindowDuration value + */ + public long presentationWindowDuration() { + return this.presentationWindowDuration; + } + + /** + * Set the relative to end sliding window. + * + * @param presentationWindowDuration the presentationWindowDuration value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withPresentationWindowDuration(long presentationWindowDuration) { + this.presentationWindowDuration = presentationWindowDuration; + return this; + } + + /** + * Get the relative to end right edge. + * + * @return the liveBackoffDuration value + */ + public long liveBackoffDuration() { + return this.liveBackoffDuration; + } + + /** + * Set the relative to end right edge. + * + * @param liveBackoffDuration the liveBackoffDuration value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withLiveBackoffDuration(long liveBackoffDuration) { + this.liveBackoffDuration = liveBackoffDuration; + return this; + } + + /** + * Get the time scale of time stamps. + * + * @return the timescale value + */ + public long timescale() { + return this.timescale; + } + + /** + * Set the time scale of time stamps. + * + * @param timescale the timescale value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withTimescale(long timescale) { + this.timescale = timescale; + return this; + } + + /** + * Get the indicator of forcing exsiting of end time stamp. + * + * @return the forceEndTimestamp value + */ + public boolean forceEndTimestamp() { + return this.forceEndTimestamp; + } + + /** + * Set the indicator of forcing exsiting of end time stamp. + * + * @param forceEndTimestamp the forceEndTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withForceEndTimestamp(boolean forceEndTimestamp) { + this.forceEndTimestamp = forceEndTimestamp; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java new file mode 100644 index 0000000000000..f377ef73d793d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all Presets, which define the recipe or instructions on how + * the input media files should be processed. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Preset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioAnalyzerPreset", value = AudioAnalyzerPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.BuiltInStandardEncoderPreset", value = BuiltInStandardEncoderPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.StandardEncoderPreset", value = StandardEncoderPreset.class) +}) +public class Preset { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java new file mode 100644 index 0000000000000..773e3b884b5c6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Priority. + */ +public enum Priority { + /** Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. */ + LOW("Low"), + + /** Used for TransformOutputs that can be generated at Normal priority. */ + NORMAL("Normal"), + + /** Used for TransformOutputs that should take precedence over others. */ + HIGH("High"); + + /** The actual serialized value for a Priority instance. */ + private String value; + + Priority(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Priority instance. + * + * @param value the serialized value to parse. + * @return the parsed Priority object, or null if unable to parse. + */ + @JsonCreator + public static Priority fromString(String value) { + Priority[] items = Priority.values(); + for (Priority item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java new file mode 100644 index 0000000000000..2ceb10e757077 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource provider. + */ +public class Provider { + /** + * The provider name. + */ + @JsonProperty(value = "providerName", required = true) + private String providerName; + + /** + * Get the provider name. + * + * @return the providerName value + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the provider name. + * + * @param providerName the providerName value to set + * @return the Provider object itself. + */ + public Provider withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java new file mode 100644 index 0000000000000..b6f231f8920d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a rectangular window applied to the input media + * before processing it. + */ +public class Rectangle { + /** + * The number of pixels from the left-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "left") + private String left; + + /** + * The number of pixels from the top-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "top") + private String top; + + /** + * The width of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "width") + private String width; + + /** + * The height of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "height") + private String height; + + /** + * Get the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the left value + */ + public String left() { + return this.left; + } + + /** + * Set the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param left the left value to set + * @return the Rectangle object itself. + */ + public Rectangle withLeft(String left) { + this.left = left; + return this; + } + + /** + * Get the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the top value + */ + public String top() { + return this.top; + } + + /** + * Set the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param top the top value to set + * @return the Rectangle object itself. + */ + public Rectangle withTop(String top) { + this.top = top; + return this; + } + + /** + * Get the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the width value + */ + public String width() { + return this.width; + } + + /** + * Set the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param width the width value to set + * @return the Rectangle object itself. + */ + public Rectangle withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the height value + */ + public String height() { + return this.height; + } + + /** + * Set the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param height the height value to set + * @return the Rectangle object itself. + */ + public Rectangle withHeight(String height) { + this.height = height; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java new file mode 100644 index 0000000000000..c48903fb6bb82 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Rotation. + */ +public enum Rotation { + /** Automatically detect and rotate as needed. */ + AUTO("Auto"), + + /** Do not rotate the video. If the output format supports it, any metadata about rotation is kept intact. */ + NONE("None"), + + /** Do not rotate the video but remove any metadata about the rotation. */ + ROTATE0("Rotate0"), + + /** Rotate 90 degrees clockwise. */ + ROTATE90("Rotate90"), + + /** Rotate 180 degrees clockwise. */ + ROTATE180("Rotate180"), + + /** Rotate 270 degrees clockwise. */ + ROTATE270("Rotate270"); + + /** The actual serialized value for a Rotation instance. */ + private String value; + + Rotation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Rotation instance. + * + * @param value the serialized value to parse. + * @return the parsed Rotation object, or null if unable to parse. + */ + @JsonCreator + public static Rotation fromString(String value) { + Rotation[] items = Rotation.values(); + for (Rotation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java new file mode 100644 index 0000000000000..edc902d5db89d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service metric specifications. + */ +public class ServiceSpecification { + /** + * List of metric specifications. + */ + @JsonProperty(value = "metricSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List metricSpecifications; + + /** + * Get list of metric specifications. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java new file mode 100644 index 0000000000000..869e3a4f290fa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the settings to be used when encoding the input video with the + * Standard Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.StandardEncoderPreset") +public class StandardEncoderPreset extends Preset { + /** + * One or more filtering operations that are applied to the input media + * before encoding. + */ + @JsonProperty(value = "filters") + private Filters filters; + + /** + * The list of codecs to be used when encoding the input video. + */ + @JsonProperty(value = "codecs") + private List codecs; + + /** + * The list of outputs to be produced by the encoder. + */ + @JsonProperty(value = "formats") + private List formats; + + /** + * Get one or more filtering operations that are applied to the input media before encoding. + * + * @return the filters value + */ + public Filters filters() { + return this.filters; + } + + /** + * Set one or more filtering operations that are applied to the input media before encoding. + * + * @param filters the filters value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFilters(Filters filters) { + this.filters = filters; + return this; + } + + /** + * Get the list of codecs to be used when encoding the input video. + * + * @return the codecs value + */ + public List codecs() { + return this.codecs; + } + + /** + * Set the list of codecs to be used when encoding the input video. + * + * @param codecs the codecs value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withCodecs(List codecs) { + this.codecs = codecs; + return this; + } + + /** + * Get the list of outputs to be produced by the encoder. + * + * @return the formats value + */ + public List formats() { + return this.formats; + } + + /** + * Set the list of outputs to be produced by the encoder. + * + * @param formats the formats value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFormats(List formats) { + this.formats = formats; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java new file mode 100644 index 0000000000000..c65dfdb6303bb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account details. + */ +public class StorageAccount { + /** + * The ID of the storage account resource. Media Services relies on tables + * and queues as well as blobs, so the primary storage account must be a + * Standard Storage account (either Microsoft.ClassicStorage or + * Microsoft.Storage). Blob only storage accounts can be added as secondary + * storage accounts. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The type of the storage account. Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "type", required = true) + private StorageAccountType type; + + /** + * Get the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @param id the id value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @return the type value + */ + public StorageAccountType type() { + return this.type; + } + + /** + * Set the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @param type the type value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withType(StorageAccountType type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java new file mode 100644 index 0000000000000..70c3b6d9a0003 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountType. + */ +public enum StorageAccountType { + /** The primary storage account for the Media Services account. */ + PRIMARY("Primary"), + + /** A secondary storage account for the Media Services account. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a StorageAccountType instance. */ + private String value; + + StorageAccountType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountType instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountType object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountType fromString(String value) { + StorageAccountType[] items = StorageAccountType.values(); + for (StorageAccountType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java new file mode 100644 index 0000000000000..202ff3be87567 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StorageEncryptedAssetDecryptionDataInner; +import java.util.List; + +/** + * Type representing StorageEncryptedAssetDecryptionData. + */ +public interface StorageEncryptedAssetDecryptionData extends HasInner, HasManager { + /** + * @return the assetFileEncryptionMetadata value. + */ + List assetFileEncryptionMetadata(); + + /** + * @return the key value. + */ + byte[] keyVal(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java new file mode 100644 index 0000000000000..0175cb8065e15 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamOptionsFlag. + */ +public enum StreamOptionsFlag { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value LowLatency. */ + LOW_LATENCY("LowLatency"); + + /** The actual serialized value for a StreamOptionsFlag instance. */ + private String value; + + StreamOptionsFlag(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamOptionsFlag instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamOptionsFlag object, or null if unable to parse. + */ + @JsonCreator + public static StreamOptionsFlag fromString(String value) { + StreamOptionsFlag[] items = StreamOptionsFlag.values(); + for (StreamOptionsFlag item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java new file mode 100644 index 0000000000000..e477cf3fbad62 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java @@ -0,0 +1,469 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingEndpointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing StreamingEndpoint. + */ +public interface StreamingEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessControl value. + */ + StreamingEndpointAccessControl accessControl(); + + /** + * @return the availabilitySetName value. + */ + String availabilitySetName(); + + /** + * @return the cdnEnabled value. + */ + Boolean cdnEnabled(); + + /** + * @return the cdnProfile value. + */ + String cdnProfile(); + + /** + * @return the cdnProvider value. + */ + String cdnProvider(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the customHostNames value. + */ + List customHostNames(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the freeTrialEndTime value. + */ + DateTime freeTrialEndTime(); + + /** + * @return the hostName value. + */ + String hostName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maxCacheAge value. + */ + Long maxCacheAge(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + StreamingEndpointResourceState resourceState(); + + /** + * @return the scaleUnits value. + */ + int scaleUnits(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAutoStart, DefinitionStages.WithScaleUnits, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingEndpoint definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingendpoint definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAutoStart withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart The flag indicates if the resource should be automatically started on creation + * @return the next definition stage + */ + WithScaleUnits withAutoStart(Boolean autoStart); + } + + /** + * The stage of the streamingendpoint definition allowing to specify ScaleUnits. + */ + interface WithScaleUnits { + /** + * Specifies scaleUnits. + * @param scaleUnits The number of scale units. Use the Scale operation to adjust this value + * @return the next definition stage + */ + WithCreate withScaleUnits(int scaleUnits); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next definition stage + */ + WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + * @param availabilitySetName The name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time + * @return the next definition stage + */ + WithCreate withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next definition stage + */ + WithCreate withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next definition stage + */ + WithCreate withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next definition stage + */ + WithCreate withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next definition stage + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next definition stage + */ + WithCreate withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The StreamingEndpoint description + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the streamingendpoint definition allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next definition stage + */ + WithCreate withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAccessControl, DefinitionStages.WithAvailabilitySetName, DefinitionStages.WithCdnEnabled, DefinitionStages.WithCdnProfile, DefinitionStages.WithCdnProvider, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithCustomHostNames, DefinitionStages.WithDescription, DefinitionStages.WithLocation, DefinitionStages.WithMaxCacheAge, DefinitionStages.WithTags { + } + } + /** + * The template for a StreamingEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAccessControl, UpdateStages.WithAvailabilitySetName, UpdateStages.WithCdnEnabled, UpdateStages.WithCdnProfile, UpdateStages.WithCdnProvider, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithCustomHostNames, UpdateStages.WithDescription, UpdateStages.WithLocation, UpdateStages.WithMaxCacheAge, UpdateStages.WithTags { + } + + /** + * Grouping of StreamingEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingendpoint update allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + * @param accessControl The access control definition of the StreamingEndpoint + * @return the next update stage + */ + Update withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint update allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + * @param availabilitySetName The name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time + * @return the next update stage + */ + Update withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + * @param cdnEnabled The CDN enabled flag + * @return the next update stage + */ + Update withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + * @param cdnProfile The CDN profile name + * @return the next update stage + */ + Update withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + * @param cdnProvider The CDN provider name + * @return the next update stage + */ + Update withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + * @param crossSiteAccessPolicies The StreamingEndpoint access policies + * @return the next update stage + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint update allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + * @param customHostNames The custom host names of the StreamingEndpoint + * @return the next update stage + */ + Update withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The StreamingEndpoint description + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the streamingendpoint update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the streamingendpoint update allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + * @param maxCacheAge Max cache age + * @return the next update stage + */ + Update withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java new file mode 100644 index 0000000000000..516f0223148d4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * StreamingEndpoint access control definition. + */ +public class StreamingEndpointAccessControl { + /** + * The access control of Akamai. + */ + @JsonProperty(value = "akamai") + private AkamaiAccessControl akamai; + + /** + * The IP access control of the StreamingEndpoint. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the access control of Akamai. + * + * @return the akamai value + */ + public AkamaiAccessControl akamai() { + return this.akamai; + } + + /** + * Set the access control of Akamai. + * + * @param akamai the akamai value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withAkamai(AkamaiAccessControl akamai) { + this.akamai = akamai; + return this; + } + + /** + * Get the IP access control of the StreamingEndpoint. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control of the StreamingEndpoint. + * + * @param ip the ip value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java new file mode 100644 index 0000000000000..18a922254a7c0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingEndpointResourceState. + */ +public enum StreamingEndpointResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Scaling. */ + SCALING("Scaling"); + + /** The actual serialized value for a StreamingEndpointResourceState instance. */ + private String value; + + StreamingEndpointResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingEndpointResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingEndpointResourceState object, or null if unable to parse. + */ + @JsonCreator + public static StreamingEndpointResourceState fromString(String value) { + StreamingEndpointResourceState[] items = StreamingEndpointResourceState.values(); + for (StreamingEndpointResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java new file mode 100644 index 0000000000000..5f5dc9c986e1b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingEndpoints. + */ +public interface StreamingEndpoints extends SupportsCreating, HasInner { + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java new file mode 100644 index 0000000000000..cffcf254c7330 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * scale units definition. + */ +public class StreamingEntityScaleUnit { + /** + * The scale unit number of the StreamingEndpoint. + */ + @JsonProperty(value = "scaleUnit") + private Integer scaleUnit; + + /** + * Get the scale unit number of the StreamingEndpoint. + * + * @return the scaleUnit value + */ + public Integer scaleUnit() { + return this.scaleUnit; + } + + /** + * Set the scale unit number of the StreamingEndpoint. + * + * @param scaleUnit the scaleUnit value to set + * @return the StreamingEntityScaleUnit object itself. + */ + public StreamingEntityScaleUnit withScaleUnit(Integer scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java new file mode 100644 index 0000000000000..49428c66f339e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingLocatorInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; + +/** + * Type representing StreamingLocator. + */ +public interface StreamingLocator extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternativeMediaId value. + */ + String alternativeMediaId(); + + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the contentKeys value. + */ + List contentKeys(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the streamingLocatorId value. + */ + UUID streamingLocatorId(); + + /** + * @return the streamingPolicyName value. + */ + String streamingPolicyName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingLocator definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAssetName, DefinitionStages.WithStreamingPolicyName, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingLocator definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingLocator definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streaminglocator definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithAssetName withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streaminglocator definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + * @param assetName Asset Name + * @return the next definition stage + */ + WithStreamingPolicyName withAssetName(String assetName); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingPolicyName. + */ + interface WithStreamingPolicyName { + /** + * Specifies streamingPolicyName. + * @param streamingPolicyName Name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming' + * @return the next definition stage + */ + WithCreate withStreamingPolicyName(String streamingPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify AlternativeMediaId. + */ + interface WithAlternativeMediaId { + /** + * Specifies alternativeMediaId. + * @param alternativeMediaId Alternative Media ID of this Streaming Locator + * @return the next definition stage + */ + WithCreate withAlternativeMediaId(String alternativeMediaId); + } + + /** + * The stage of the streaminglocator definition allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + * @param contentKeys The ContentKeys used by this Streaming Locator + * @return the next definition stage + */ + WithCreate withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Name of the default ContentKeyPolicy used by this Streaming Locator + * @return the next definition stage + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + * @param endTime The end time of the Streaming Locator + * @return the next definition stage + */ + WithCreate withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + * @param startTime The start time of the Streaming Locator + * @return the next definition stage + */ + WithCreate withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + * @param streamingLocatorId The StreamingLocatorId of the Streaming Locator + * @return the next definition stage + */ + WithCreate withStreamingLocatorId(UUID streamingLocatorId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAlternativeMediaId, DefinitionStages.WithContentKeys, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEndTime, DefinitionStages.WithStartTime, DefinitionStages.WithStreamingLocatorId { + } + } + /** + * The template for a StreamingLocator update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternativeMediaId, UpdateStages.WithContentKeys, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEndTime, UpdateStages.WithStartTime, UpdateStages.WithStreamingLocatorId { + } + + /** + * Grouping of StreamingLocator update stages. + */ + interface UpdateStages { + /** + * The stage of the streaminglocator update allowing to specify AlternativeMediaId. + */ + interface WithAlternativeMediaId { + /** + * Specifies alternativeMediaId. + * @param alternativeMediaId Alternative Media ID of this Streaming Locator + * @return the next update stage + */ + Update withAlternativeMediaId(String alternativeMediaId); + } + + /** + * The stage of the streaminglocator update allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + * @param contentKeys The ContentKeys used by this Streaming Locator + * @return the next update stage + */ + Update withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Name of the default ContentKeyPolicy used by this Streaming Locator + * @return the next update stage + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator update allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + * @param endTime The end time of the Streaming Locator + * @return the next update stage + */ + Update withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + * @param startTime The start time of the Streaming Locator + * @return the next update stage + */ + Update withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + * @param streamingLocatorId The StreamingLocatorId of the Streaming Locator + * @return the next update stage + */ + Update withStreamingLocatorId(UUID streamingLocatorId); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java new file mode 100644 index 0000000000000..bb4e9cb2fc526 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for content key in Streaming Locator. + */ +public class StreamingLocatorContentKey { + /** + * ID of Content Key. + */ + @JsonProperty(value = "id", required = true) + private UUID id; + + /** + * Encryption type of Content Key. Possible values include: + * 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private StreamingLocatorContentKeyType type; + + /** + * Label of Content Key as specified in the Streaming Policy. + */ + @JsonProperty(value = "labelReferenceInStreamingPolicy") + private String labelReferenceInStreamingPolicy; + + /** + * Value of of Content Key. + */ + @JsonProperty(value = "value") + private String value; + + /** + * ContentKeyPolicy used by Content Key. + */ + @JsonProperty(value = "policyName", access = JsonProperty.Access.WRITE_ONLY) + private String policyName; + + /** + * Tracks which use this Content Key. + */ + @JsonProperty(value = "tracks", access = JsonProperty.Access.WRITE_ONLY) + private List tracks; + + /** + * Get iD of Content Key. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Set iD of Content Key. + * + * @param id the id value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + * + * @return the type value + */ + public StreamingLocatorContentKeyType type() { + return this.type; + } + + /** + * Get label of Content Key as specified in the Streaming Policy. + * + * @return the labelReferenceInStreamingPolicy value + */ + public String labelReferenceInStreamingPolicy() { + return this.labelReferenceInStreamingPolicy; + } + + /** + * Set label of Content Key as specified in the Streaming Policy. + * + * @param labelReferenceInStreamingPolicy the labelReferenceInStreamingPolicy value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withLabelReferenceInStreamingPolicy(String labelReferenceInStreamingPolicy) { + this.labelReferenceInStreamingPolicy = labelReferenceInStreamingPolicy; + return this; + } + + /** + * Get value of of Content Key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of of Content Key. + * + * @param value the value value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withValue(String value) { + this.value = value; + return this; + } + + /** + * Get contentKeyPolicy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Get tracks which use this Content Key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java new file mode 100644 index 0000000000000..249f8d72c30e3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingLocatorContentKeyType. + */ +public enum StreamingLocatorContentKeyType { + /** Common Encryption using CENC. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** Common Encryption using CBCS. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"), + + /** Envelope Encryption. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"); + + /** The actual serialized value for a StreamingLocatorContentKeyType instance. */ + private String value; + + StreamingLocatorContentKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingLocatorContentKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingLocatorContentKeyType object, or null if unable to parse. + */ + @JsonCreator + public static StreamingLocatorContentKeyType fromString(String value) { + StreamingLocatorContentKeyType[] items = StreamingLocatorContentKeyType.values(); + for (StreamingLocatorContentKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java new file mode 100644 index 0000000000000..4a5460d5c4f18 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingLocatorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingLocators. + */ +public interface StreamingLocators extends SupportsCreating, HasInner { + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java new file mode 100644 index 0000000000000..6d474bdb6e818 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of paths for streaming. + */ +public class StreamingPath { + /** + * Streaming protocol. Possible values include: 'Hls', 'Dash', + * 'SmoothStreaming', 'Download'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private StreamingPolicyStreamingProtocol streamingProtocol; + + /** + * Encryption scheme. Possible values include: 'NoEncryption', + * 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + */ + @JsonProperty(value = "encryptionScheme", required = true) + private EncryptionScheme encryptionScheme; + + /** + * Streaming paths for each protocol and encryptionScheme pair. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @return the streamingProtocol value + */ + public StreamingPolicyStreamingProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withStreamingProtocol(StreamingPolicyStreamingProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @return the encryptionScheme value + */ + public EncryptionScheme encryptionScheme() { + return this.encryptionScheme; + } + + /** + * Set encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @param encryptionScheme the encryptionScheme value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withEncryptionScheme(EncryptionScheme encryptionScheme) { + this.encryptionScheme = encryptionScheme; + return this; + } + + /** + * Get streaming paths for each protocol and encryptionScheme pair. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set streaming paths for each protocol and encryptionScheme pair. + * + * @param paths the paths value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withPaths(List paths) { + this.paths = paths; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java new file mode 100644 index 0000000000000..d0533f2f0773f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingPolicies. + */ +public interface StreamingPolicies extends SupportsCreating, HasInner { + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java new file mode 100644 index 0000000000000..61e19863a2d91 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java @@ -0,0 +1,239 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; + +/** + * Type representing StreamingPolicy. + */ +public interface StreamingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the commonEncryptionCbcs value. + */ + CommonEncryptionCbcs commonEncryptionCbcs(); + + /** + * @return the commonEncryptionCenc value. + */ + CommonEncryptionCenc commonEncryptionCenc(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the envelopeEncryption value. + */ + EnvelopeEncryption envelopeEncryption(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the noEncryption value. + */ + NoEncryption noEncryption(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingpolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next definition stage + */ + WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next definition stage + */ + WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next definition stage + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next definition stage + */ + WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy definition allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + * @param noEncryption Configurations of NoEncryption + * @return the next definition stage + */ + WithCreate withNoEncryption(NoEncryption noEncryption); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCommonEncryptionCbcs, DefinitionStages.WithCommonEncryptionCenc, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEnvelopeEncryption, DefinitionStages.WithNoEncryption { + } + } + /** + * The template for a StreamingPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCommonEncryptionCbcs, UpdateStages.WithCommonEncryptionCenc, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEnvelopeEncryption, UpdateStages.WithNoEncryption { + } + + /** + * Grouping of StreamingPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs + * @return the next update stage + */ + Update withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc + * @return the next update stage + */ + Update withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy + * @return the next update stage + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy update allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + * @param envelopeEncryption Configuration of EnvelopeEncryption + * @return the next update stage + */ + Update withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy update allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + * @param noEncryption Configurations of NoEncryption + * @return the next update stage + */ + Update withNoEncryption(NoEncryption noEncryption); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java new file mode 100644 index 0000000000000..44bc99463a8e0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of content key. + */ +public class StreamingPolicyContentKey { + /** + * Label can be used to specify Content Key when creating a Streaming + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Content Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Tracks which use this content key. + */ + @JsonProperty(value = "tracks") + private List tracks; + + /** + * Get label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating a Streaming Locator. + * + * @param label the label value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Content Key. + * + * @param policyName the policyName value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get tracks which use this content key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set tracks which use this content key. + * + * @param tracks the tracks value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java new file mode 100644 index 0000000000000..470ff7df8fa96 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of all content keys in Streaming Policy. + */ +public class StreamingPolicyContentKeys { + /** + * Default content key for an encryption scheme. + */ + @JsonProperty(value = "defaultKey") + private DefaultKey defaultKey; + + /** + * Representing tracks needs separate content key. + */ + @JsonProperty(value = "keyToTrackMappings") + private List keyToTrackMappings; + + /** + * Get default content key for an encryption scheme. + * + * @return the defaultKey value + */ + public DefaultKey defaultKey() { + return this.defaultKey; + } + + /** + * Set default content key for an encryption scheme. + * + * @param defaultKey the defaultKey value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withDefaultKey(DefaultKey defaultKey) { + this.defaultKey = defaultKey; + return this; + } + + /** + * Get representing tracks needs separate content key. + * + * @return the keyToTrackMappings value + */ + public List keyToTrackMappings() { + return this.keyToTrackMappings; + } + + /** + * Set representing tracks needs separate content key. + * + * @param keyToTrackMappings the keyToTrackMappings value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withKeyToTrackMappings(List keyToTrackMappings) { + this.keyToTrackMappings = keyToTrackMappings; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java new file mode 100644 index 0000000000000..d95cc3bc7da0b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of FairPlay in Streaming Policy. + */ +public class StreamingPolicyFairPlayConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * All license to be persistent or not. + */ + @JsonProperty(value = "allowPersistentLicense", required = true) + private boolean allowPersistentLicense; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get all license to be persistent or not. + * + * @return the allowPersistentLicense value + */ + public boolean allowPersistentLicense() { + return this.allowPersistentLicense; + } + + /** + * Set all license to be persistent or not. + * + * @param allowPersistentLicense the allowPersistentLicense value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withAllowPersistentLicense(boolean allowPersistentLicense) { + this.allowPersistentLicense = allowPersistentLicense; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java new file mode 100644 index 0000000000000..4d99c82141542 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of PlayReady in Streaming Policy. + */ +public class StreamingPolicyPlayReadyConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Custom attributes for PlayReady. + */ + @JsonProperty(value = "playReadyCustomAttributes") + private String playReadyCustomAttributes; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get custom attributes for PlayReady. + * + * @return the playReadyCustomAttributes value + */ + public String playReadyCustomAttributes() { + return this.playReadyCustomAttributes; + } + + /** + * Set custom attributes for PlayReady. + * + * @param playReadyCustomAttributes the playReadyCustomAttributes value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withPlayReadyCustomAttributes(String playReadyCustomAttributes) { + this.playReadyCustomAttributes = playReadyCustomAttributes; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java new file mode 100644 index 0000000000000..4b621ae04d472 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingPolicyStreamingProtocol. + */ +public enum StreamingPolicyStreamingProtocol { + /** HLS protocol. */ + HLS("Hls"), + + /** DASH protocol. */ + DASH("Dash"), + + /** SmoothStreaming protocol. */ + SMOOTH_STREAMING("SmoothStreaming"), + + /** Download protocol. */ + DOWNLOAD("Download"); + + /** The actual serialized value for a StreamingPolicyStreamingProtocol instance. */ + private String value; + + StreamingPolicyStreamingProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingPolicyStreamingProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingPolicyStreamingProtocol object, or null if unable to parse. + */ + @JsonCreator + public static StreamingPolicyStreamingProtocol fromString(String value) { + StreamingPolicyStreamingProtocol[] items = StreamingPolicyStreamingProtocol.values(); + for (StreamingPolicyStreamingProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java new file mode 100644 index 0000000000000..225795bdadbe5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of Widevine in Streaming Policy. + */ +public class StreamingPolicyWidevineConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyWidevineConfiguration object itself. + */ + public StreamingPolicyWidevineConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java new file mode 100644 index 0000000000000..9dcc8bd6942cd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StretchMode. + */ +public enum StretchMode { + /** Strictly respect the output resolution without considering the pixel aspect ratio or display aspect ratio of the input video. */ + NONE("None"), + + /** Override the output resolution, and change it to match the display aspect ratio of the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which maintains the input aspect ratio of 16:9. */ + AUTO_SIZE("AutoSize"), + + /** Pad the output (with either letterbox or pillar box) to honor the output resolution, while ensuring that the active video region in the output has the same aspect ratio as the input. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box regions 280 pixels wide at the left and right. */ + AUTO_FIT("AutoFit"); + + /** The actual serialized value for a StretchMode instance. */ + private String value; + + StretchMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StretchMode instance. + * + * @param value the serialized value to parse. + * @return the parsed StretchMode object, or null if unable to parse. + */ + @JsonCreator + public static StretchMode fromString(String value) { + StretchMode[] items = StretchMode.values(); + for (StretchMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java new file mode 100644 index 0000000000000..4c4342a33d4bd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.SubscriptionMediaServiceInner; +import java.util.UUID; +import java.util.List; +import java.util.Map; + +/** + * Type representing SubscriptionMediaService. + */ +public interface SubscriptionMediaService extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java new file mode 100644 index 0000000000000..6915bf0705a6c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the sync storage keys request. + */ +public class SyncStorageKeysInput { + /** + * The ID of the storage account resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ID of the storage account resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. + * + * @param id the id value to set + * @return the SyncStorageKeysInput object itself. + */ + public SyncStorageKeysInput withId(String id) { + this.id = id; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java new file mode 100644 index 0000000000000..668632edce63c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyCompareOperation. + */ +public enum TrackPropertyCompareOperation { + /** Unknown track property compare operation. */ + UNKNOWN("Unknown"), + + /** Equal operation. */ + EQUAL("Equal"); + + /** The actual serialized value for a TrackPropertyCompareOperation instance. */ + private String value; + + TrackPropertyCompareOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyCompareOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyCompareOperation object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyCompareOperation fromString(String value) { + TrackPropertyCompareOperation[] items = TrackPropertyCompareOperation.values(); + for (TrackPropertyCompareOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java new file mode 100644 index 0000000000000..30770116b29d6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify one track property condition. + */ +public class TrackPropertyCondition { + /** + * Track property type. Possible values include: 'Unknown', 'FourCC'. + */ + @JsonProperty(value = "property", required = true) + private TrackPropertyType property; + + /** + * Track property condition operation. Possible values include: 'Unknown', + * 'Equal'. + */ + @JsonProperty(value = "operation", required = true) + private TrackPropertyCompareOperation operation; + + /** + * Track property value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @return the property value + */ + public TrackPropertyType property() { + return this.property; + } + + /** + * Set track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @param property the property value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withProperty(TrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @return the operation value + */ + public TrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @param operation the operation value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withOperation(TrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + + /** + * Get track property value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set track property value. + * + * @param value the value value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java new file mode 100644 index 0000000000000..938ed8add6d5e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyType. + */ +public enum TrackPropertyType { + /** Unknown track property. */ + UNKNOWN("Unknown"), + + /** Track FourCC. */ + FOUR_CC("FourCC"); + + /** The actual serialized value for a TrackPropertyType instance. */ + private String value; + + TrackPropertyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyType instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyType object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyType fromString(String value) { + TrackPropertyType[] items = TrackPropertyType.values(); + for (TrackPropertyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java new file mode 100644 index 0000000000000..ff3c76c41305e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to select a track. + */ +public class TrackSelection { + /** + * TrackSelections is a track property condition list which can specify + * track(s). + */ + @JsonProperty(value = "trackSelections") + private List trackSelections; + + /** + * Get trackSelections is a track property condition list which can specify track(s). + * + * @return the trackSelections value + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set trackSelections is a track property condition list which can specify track(s). + * + * @param trackSelections the trackSelections value to set + * @return the TrackSelection object itself. + */ + public TrackSelection withTrackSelections(List trackSelections) { + this.trackSelections = trackSelections; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java new file mode 100644 index 0000000000000..4f2a60985da1a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.TransformInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Transform. + */ +public interface Transform extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Transform definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Transform definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Transform definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the transform definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the Azure subscription + * @param accountName The Media Services account name + * @return the next definition stage + */ + WithOutputs withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the transform definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + * @param outputs An array of one or more TransformOutputs that the Transform should generate + * @return the next definition stage + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the transform definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a Transform update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of Transform update stages. + */ + interface UpdateStages { + /** + * The stage of the transform update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description An optional verbose description of the Transform + * @return the next update stage + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java new file mode 100644 index 0000000000000..a36c04c8712cf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a TransformOutput, which are the rules to be + * applied while generating the desired output. + */ +public class TransformOutput { + /** + * A Transform can define more than one outputs. This property defines what + * the service should do when one output fails - either continue to produce + * other outputs, or, stop the other outputs. The overall Job state will + * not reflect failures of outputs that are specified with 'ContinueJob'. + * The default is 'StopProcessingJob'. Possible values include: + * 'StopProcessingJob', 'ContinueJob'. + */ + @JsonProperty(value = "onError") + private OnErrorType onError; + + /** + * Sets the relative priority of the TransformOutputs within a Transform. + * This sets the priority that the service uses for processing + * TransformOutputs. The default priority is Normal. Possible values + * include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "relativePriority") + private Priority relativePriority; + + /** + * Preset that describes the operations that will be used to modify, + * transcode, or extract insights from the source file to generate the + * output. + */ + @JsonProperty(value = "preset", required = true) + private Preset preset; + + /** + * Get a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @return the onError value + */ + public OnErrorType onError() { + return this.onError; + } + + /** + * Set a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @param onError the onError value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withOnError(OnErrorType onError) { + this.onError = onError; + return this; + } + + /** + * Get sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the relativePriority value + */ + public Priority relativePriority() { + return this.relativePriority; + } + + /** + * Set sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param relativePriority the relativePriority value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withRelativePriority(Priority relativePriority) { + this.relativePriority = relativePriority; + return this; + } + + /** + * Get preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @return the preset value + */ + public Preset preset() { + return this.preset; + } + + /** + * Set preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @param preset the preset value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withPreset(Preset preset) { + this.preset = preset; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java new file mode 100644 index 0000000000000..2ffcea3c0b0a7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.TransformsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Transforms. + */ +public interface Transforms extends SupportsCreating, HasInner { + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName); + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java new file mode 100644 index 0000000000000..60bc5befab058 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC + * 13818-1) output video file(s). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.TransportStreamFormat") +public class TransportStreamFormat extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java new file mode 100644 index 0000000000000..de99921054fd5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for encoding the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Video") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Image", value = Image.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Video", value = H264Video.class) +}) +public class Video extends Codec { + /** + * The distance between two key frames, thereby defining a group of + * pictures (GOP). The value should be a non-zero integer in the range [1, + * 30] seconds, specified in ISO 8601 format. The default is 2 seconds + * (PT2S). + */ + @JsonProperty(value = "keyFrameInterval") + private Period keyFrameInterval; + + /** + * The resizing mode - how the input video will be resized to fit the + * desired output resolution(s). Default is AutoSize. Possible values + * include: 'None', 'AutoSize', 'AutoFit'. + */ + @JsonProperty(value = "stretchMode") + private StretchMode stretchMode; + + /** + * Get the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @return the keyFrameInterval value + */ + public Period keyFrameInterval() { + return this.keyFrameInterval; + } + + /** + * Set the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @param keyFrameInterval the keyFrameInterval value to set + * @return the Video object itself. + */ + public Video withKeyFrameInterval(Period keyFrameInterval) { + this.keyFrameInterval = keyFrameInterval; + return this; + } + + /** + * Get the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @return the stretchMode value + */ + public StretchMode stretchMode() { + return this.stretchMode; + } + + /** + * Set the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @param stretchMode the stretchMode value to set + * @return the Video object itself. + */ + public Video withStretchMode(StretchMode stretchMode) { + this.stretchMode = stretchMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java new file mode 100644 index 0000000000000..92cab5c520caf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A video analyzer preset that extracts insights (rich metadata) from both + * audio and video, and outputs a JSON format file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoAnalyzerPreset") +public class VideoAnalyzerPreset extends AudioAnalyzerPreset { + /** + * The type of insights to be extracted. If not set then based on the + * content the type will selected. If the content is audi only then only + * audio insights are extraced and if it is video only. Possible values + * include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + */ + @JsonProperty(value = "insightsToExtract") + private InsightsType insightsToExtract; + + /** + * Get the type of insights to be extracted. If not set then based on the content the type will selected. If the content is audi only then only audio insights are extraced and if it is video only. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + * + * @return the insightsToExtract value + */ + public InsightsType insightsToExtract() { + return this.insightsToExtract; + } + + /** + * Set the type of insights to be extracted. If not set then based on the content the type will selected. If the content is audi only then only audio insights are extraced and if it is video only. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + * + * @param insightsToExtract the insightsToExtract value to set + * @return the VideoAnalyzerPreset object itself. + */ + public VideoAnalyzerPreset withInsightsToExtract(InsightsType insightsToExtract) { + this.insightsToExtract = insightsToExtract; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java new file mode 100644 index 0000000000000..a9ce42d77b87b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoLayer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Layer", value = H264Layer.class) +}) +public class VideoLayer extends Layer { + /** + * The average bitrate in bits per second at which to encode the input + * video when generating this layer. This is a required field. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * The maximum bitrate (in bits per second), at which the VBV buffer should + * be assumed to refill. If not specified, defaults to the same value as + * bitrate. + */ + @JsonProperty(value = "maxBitrate") + private Integer maxBitrate; + + /** + * The number of B-frames to be used when encoding this layer. If not + * specified, the encoder chooses an appropriate number based on the video + * profile and level. + */ + @JsonProperty(value = "bFrames") + private Integer bFrames; + + /** + * The frame rate (in frames per second) at which to encode this layer. The + * value can be in the form of M/N where M and N are integers (For example, + * 30000/1001), or in the form of a number (For example, 30, or 29.97). The + * encoder enforces constraints on allowed frame rates based on the profile + * and level. If it is not specified, the encoder will use the same frame + * rate as the input video. + */ + @JsonProperty(value = "frameRate") + private String frameRate; + + /** + * The number of slices to be used when encoding this layer. If not + * specified, default is zero, which means that encoder will use a single + * slice for each frame. + */ + @JsonProperty(value = "slices") + private Integer slices; + + /** + * Whether or not adaptive B-frames are to be used when encoding this + * layer. If not specified, the encoder will turn it on whenever the video + * profile permits its use. + */ + @JsonProperty(value = "adaptiveBFrame") + private Boolean adaptiveBFrame; + + /** + * Get the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @param bitrate the bitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @return the maxBitrate value + */ + public Integer maxBitrate() { + return this.maxBitrate; + } + + /** + * Set the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @param maxBitrate the maxBitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withMaxBitrate(Integer maxBitrate) { + this.maxBitrate = maxBitrate; + return this; + } + + /** + * Get the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @return the bFrames value + */ + public Integer bFrames() { + return this.bFrames; + } + + /** + * Set the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @param bFrames the bFrames value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBFrames(Integer bFrames) { + this.bFrames = bFrames; + return this; + } + + /** + * Get the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @return the frameRate value + */ + public String frameRate() { + return this.frameRate; + } + + /** + * Set the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @param frameRate the frameRate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withFrameRate(String frameRate) { + this.frameRate = frameRate; + return this; + } + + /** + * Get the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @return the slices value + */ + public Integer slices() { + return this.slices; + } + + /** + * Set the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @param slices the slices value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withSlices(Integer slices) { + this.slices = slices; + return this; + } + + /** + * Get whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @return the adaptiveBFrame value + */ + public Boolean adaptiveBFrame() { + return this.adaptiveBFrame; + } + + /** + * Set whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @param adaptiveBFrame the adaptiveBFrame value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withAdaptiveBFrame(Boolean adaptiveBFrame) { + this.adaptiveBFrame = adaptiveBFrame; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java new file mode 100644 index 0000000000000..968fb6cc21ca1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of a video overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoOverlay") +public class VideoOverlay extends Overlay { + /** + * The location in the input video where the overlay is applied. + */ + @JsonProperty(value = "position") + private Rectangle position; + + /** + * The opacity of the overlay. This is a value in the range [0 - 1.0]. + * Default is 1.0 which mean the overlay is opaque. + */ + @JsonProperty(value = "opacity") + private Double opacity; + + /** + * An optional rectangular window used to crop the overlay image or video. + */ + @JsonProperty(value = "cropRectangle") + private Rectangle cropRectangle; + + /** + * Get the location in the input video where the overlay is applied. + * + * @return the position value + */ + public Rectangle position() { + return this.position; + } + + /** + * Set the location in the input video where the overlay is applied. + * + * @param position the position value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withPosition(Rectangle position) { + this.position = position; + return this; + } + + /** + * Get the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @return the opacity value + */ + public Double opacity() { + return this.opacity; + } + + /** + * Set the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @param opacity the opacity value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withOpacity(Double opacity) { + this.opacity = opacity; + return this; + } + + /** + * Get an optional rectangular window used to crop the overlay image or video. + * + * @return the cropRectangle value + */ + public Rectangle cropRectangle() { + return this.cropRectangle; + } + + /** + * Set an optional rectangular window used to crop the overlay image or video. + * + * @param cropRectangle the cropRectangle value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withCropRectangle(Rectangle cropRectangle) { + this.cropRectangle = cropRectangle; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java new file mode 100644 index 0000000000000..877b21e06427f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilter; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; + +class AccountFilterImpl extends CreatableUpdatableImpl implements AccountFilter, AccountFilter.Definition, AccountFilter.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String filterName; + + AccountFilterImpl(String name, MediaManager manager) { + super(name, new AccountFilterInner()); + this.manager = manager; + // Set resource name + this.filterName = name; + // + } + + AccountFilterImpl(AccountFilterInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.filterName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.filterName = IdParsingUtils.getValueFromIdByName(inner.id(), "accountFilters"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.getAsync(this.resourceGroupName, this.accountName, this.filterName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FirstQuality firstQuality() { + return this.inner().firstQuality(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PresentationTimeRange presentationTimeRange() { + return this.inner().presentationTimeRange(); + } + + @Override + public List tracks() { + return this.inner().tracks(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AccountFilterImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public AccountFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.inner().withFirstQuality(firstQuality); + return this; + } + + @Override + public AccountFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.inner().withPresentationTimeRange(presentationTimeRange); + return this; + } + + @Override + public AccountFilterImpl withTracks(List tracks) { + this.inner().withTracks(tracks); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java new file mode 100644 index 0000000000000..19ff378792344 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Account Filter. + */ +@JsonFlatten +public class AccountFilterInner extends ProxyResource { + /** + * The presentation time range. + */ + @JsonProperty(value = "properties.presentationTimeRange") + private PresentationTimeRange presentationTimeRange; + + /** + * The first quality. + */ + @JsonProperty(value = "properties.firstQuality") + private FirstQuality firstQuality; + + /** + * The tracks selection conditions. + */ + @JsonProperty(value = "properties.tracks") + private List tracks; + + /** + * Get the presentation time range. + * + * @return the presentationTimeRange value + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentation time range. + * + * @param presentationTimeRange the presentationTimeRange value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.presentationTimeRange = presentationTimeRange; + return this; + } + + /** + * Get the first quality. + * + * @return the firstQuality value + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the first quality. + * + * @param firstQuality the firstQuality value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withFirstQuality(FirstQuality firstQuality) { + this.firstQuality = firstQuality; + return this; + } + + /** + * Get the tracks selection conditions. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks selection conditions. + * + * @param tracks the tracks value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java new file mode 100644 index 0000000000000..f0e6985ef5194 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilter; + +class AccountFiltersImpl extends WrapperImpl implements AccountFilters { + private final MediaManager manager; + + AccountFiltersImpl(MediaManager manager) { + super(manager.inner().accountFilters()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AccountFilterImpl define(String name) { + return wrapModel(name); + } + + private AccountFilterImpl wrapModel(AccountFilterInner inner) { + return new AccountFilterImpl(inner, manager()); + } + + private AccountFilterImpl wrapModel(String name) { + return new AccountFilterImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + AccountFiltersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AccountFilter call(AccountFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String filterName) { + AccountFiltersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, filterName) + .map(new Func1() { + @Override + public AccountFilter call(AccountFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String filterName) { + AccountFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, filterName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java new file mode 100644 index 0000000000000..b3281ececa3b9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java @@ -0,0 +1,741 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AccountFilters. + */ +public class AccountFiltersInner { + /** The Retrofit service to perform REST calls. */ + private AccountFiltersService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AccountFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountFiltersInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AccountFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AccountFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Body AccountFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Body AccountFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AccountFilterInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AccountFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner get(String resourceGroupName, String accountName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, filterName).toBlocking().single().body(); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, filterName), serviceCallback); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, filterName).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner createOrUpdate(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters), serviceCallback); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String filterName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName).toBlocking().single().body(); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName), serviceCallback); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String filterName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner update(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters), serviceCallback); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AccountFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AccountFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java new file mode 100644 index 0000000000000..9be4881180a1e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetContainerSas; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class AssetContainerSasImpl extends WrapperImpl implements AssetContainerSas { + private final MediaManager manager; + AssetContainerSasImpl(AssetContainerSasInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List assetContainerSasUrls() { + return this.inner().assetContainerSasUrls(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java new file mode 100644 index 0000000000000..740b81c6f27d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Asset Storage container SAS URLs. + */ +public class AssetContainerSasInner { + /** + * The list of Asset container SAS URLs. + */ + @JsonProperty(value = "assetContainerSasUrls") + private List assetContainerSasUrls; + + /** + * Get the list of Asset container SAS URLs. + * + * @return the assetContainerSasUrls value + */ + public List assetContainerSasUrls() { + return this.assetContainerSasUrls; + } + + /** + * Set the list of Asset container SAS URLs. + * + * @param assetContainerSasUrls the assetContainerSasUrls value to set + * @return the AssetContainerSasInner object itself. + */ + public AssetContainerSasInner withAssetContainerSasUrls(List assetContainerSasUrls) { + this.assetContainerSasUrls = assetContainerSasUrls; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java new file mode 100644 index 0000000000000..51a7e90541635 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilter; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; + +class AssetFilterImpl extends CreatableUpdatableImpl implements AssetFilter, AssetFilter.Definition, AssetFilter.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String assetName; + private String filterName; + + AssetFilterImpl(String name, MediaManager manager) { + super(name, new AssetFilterInner()); + this.manager = manager; + // Set resource name + this.filterName = name; + // + } + + AssetFilterImpl(AssetFilterInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.filterName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); + this.filterName = IdParsingUtils.getValueFromIdByName(inner.id(), "assetFilters"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.getAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FirstQuality firstQuality() { + return this.inner().firstQuality(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PresentationTimeRange presentationTimeRange() { + return this.inner().presentationTimeRange(); + } + + @Override + public List tracks() { + return this.inner().tracks(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AssetFilterImpl withExistingAsset(String resourceGroupName, String accountName, String assetName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.assetName = assetName; + return this; + } + + @Override + public AssetFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.inner().withFirstQuality(firstQuality); + return this; + } + + @Override + public AssetFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.inner().withPresentationTimeRange(presentationTimeRange); + return this; + } + + @Override + public AssetFilterImpl withTracks(List tracks) { + this.inner().withTracks(tracks); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java new file mode 100644 index 0000000000000..cb971f48b5f3b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Asset Filter. + */ +@JsonFlatten +public class AssetFilterInner extends ProxyResource { + /** + * The presentation time range. + */ + @JsonProperty(value = "properties.presentationTimeRange") + private PresentationTimeRange presentationTimeRange; + + /** + * The first quality. + */ + @JsonProperty(value = "properties.firstQuality") + private FirstQuality firstQuality; + + /** + * The tracks selection conditions. + */ + @JsonProperty(value = "properties.tracks") + private List tracks; + + /** + * Get the presentation time range. + * + * @return the presentationTimeRange value + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentation time range. + * + * @param presentationTimeRange the presentationTimeRange value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.presentationTimeRange = presentationTimeRange; + return this; + } + + /** + * Get the first quality. + * + * @return the firstQuality value + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the first quality. + * + * @param firstQuality the firstQuality value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withFirstQuality(FirstQuality firstQuality) { + this.firstQuality = firstQuality; + return this; + } + + /** + * Get the tracks selection conditions. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks selection conditions. + * + * @param tracks the tracks value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java new file mode 100644 index 0000000000000..28bc3b48c4635 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilter; + +class AssetFiltersImpl extends WrapperImpl implements AssetFilters { + private final MediaManager manager; + + AssetFiltersImpl(MediaManager manager) { + super(manager.inner().assetFilters()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AssetFilterImpl define(String name) { + return wrapModel(name); + } + + private AssetFilterImpl wrapModel(AssetFilterInner inner) { + return new AssetFilterImpl(inner, manager()); + } + + private AssetFilterImpl wrapModel(String name) { + return new AssetFilterImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String assetName) { + AssetFiltersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, assetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AssetFilter call(AssetFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + AssetFiltersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, assetName, filterName) + .map(new Func1() { + @Override + public AssetFilter call(AssetFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + AssetFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, assetName, filterName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java new file mode 100644 index 0000000000000..f87d04a92f6d1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java @@ -0,0 +1,777 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AssetFilters. + */ +public class AssetFiltersInner { + /** The Retrofit service to perform REST calls. */ + private AssetFiltersService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AssetFiltersInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AssetFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AssetFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface AssetFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Body AssetFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Body AssetFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetFilterInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String assetName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, assetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String assetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, assetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String assetName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, assetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String assetName) { + return listSinglePageAsync(resourceGroupName, accountName, assetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner get(String resourceGroupName, String accountName, String assetName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).toBlocking().single().body(); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName), serviceCallback); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner createOrUpdate(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters), serviceCallback); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String assetName, String filterName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).toBlocking().single().body(); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName), serviceCallback); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner update(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters), serviceCallback); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java new file mode 100644 index 0000000000000..41bac9341f50e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Asset; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStorageEncryptionFormat; + +class AssetImpl extends CreatableUpdatableImpl implements Asset, Asset.Definition, Asset.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String assetName; + + AssetImpl(String name, MediaManager manager) { + super(name, new AssetInner()); + this.manager = manager; + // Set resource name + this.assetName = name; + // + } + + AssetImpl(AssetInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.assetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.getAsync(this.resourceGroupName, this.accountName, this.assetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternateId() { + return this.inner().alternateId(); + } + + @Override + public UUID assetId() { + return this.inner().assetId(); + } + + @Override + public String container() { + return this.inner().container(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String storageAccountName() { + return this.inner().storageAccountName(); + } + + @Override + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.inner().storageEncryptionFormat(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AssetImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public AssetImpl withAlternateId(String alternateId) { + this.inner().withAlternateId(alternateId); + return this; + } + + @Override + public AssetImpl withContainer(String container) { + this.inner().withContainer(container); + return this; + } + + @Override + public AssetImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public AssetImpl withStorageAccountName(String storageAccountName) { + this.inner().withStorageAccountName(storageAccountName); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java new file mode 100644 index 0000000000000..6b37faca17ea8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStorageEncryptionFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Asset. + */ +@JsonFlatten +public class AssetInner extends ProxyResource { + /** + * The Asset ID. + */ + @JsonProperty(value = "properties.assetId", access = JsonProperty.Access.WRITE_ONLY) + private UUID assetId; + + /** + * The creation date of the Asset. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Asset. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The alternate ID of the Asset. + */ + @JsonProperty(value = "properties.alternateId") + private String alternateId; + + /** + * The Asset description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The name of the asset blob container. + */ + @JsonProperty(value = "properties.container") + private String container; + + /** + * The name of the storage account. + */ + @JsonProperty(value = "properties.storageAccountName") + private String storageAccountName; + + /** + * The Asset encryption format. One of None or MediaStorageEncryption. + * Possible values include: 'None', 'MediaStorageClientEncryption'. + */ + @JsonProperty(value = "properties.storageEncryptionFormat", access = JsonProperty.Access.WRITE_ONLY) + private AssetStorageEncryptionFormat storageEncryptionFormat; + + /** + * Get the Asset ID. + * + * @return the assetId value + */ + public UUID assetId() { + return this.assetId; + } + + /** + * Get the creation date of the Asset. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Asset. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the alternate ID of the Asset. + * + * @return the alternateId value + */ + public String alternateId() { + return this.alternateId; + } + + /** + * Set the alternate ID of the Asset. + * + * @param alternateId the alternateId value to set + * @return the AssetInner object itself. + */ + public AssetInner withAlternateId(String alternateId) { + this.alternateId = alternateId; + return this; + } + + /** + * Get the Asset description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Asset description. + * + * @param description the description value to set + * @return the AssetInner object itself. + */ + public AssetInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name of the asset blob container. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the name of the asset blob container. + * + * @param container the container value to set + * @return the AssetInner object itself. + */ + public AssetInner withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the name of the storage account. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account. + * + * @param storageAccountName the storageAccountName value to set + * @return the AssetInner object itself. + */ + public AssetInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption'. + * + * @return the storageEncryptionFormat value + */ + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.storageEncryptionFormat; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java new file mode 100644 index 0000000000000..c724c447dabc0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Assets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetContainerSas; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageEncryptedAssetDecryptionData; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListStreamingLocatorsResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContainerSasInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Asset; + +class AssetsImpl extends WrapperImpl implements Assets { + private final MediaManager manager; + + AssetsImpl(MediaManager manager) { + super(manager.inner().assets()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AssetImpl define(String name) { + return wrapModel(name); + } + + private AssetImpl wrapModel(AssetInner inner) { + return new AssetImpl(inner, manager()); + } + + private AssetImpl wrapModel(String name) { + return new AssetImpl(name, this.manager()); + } + + @Override + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + AssetsInner client = this.inner(); + return client.listContainerSasAsync(resourceGroupName, accountName, assetName, parameters) + .map(new Func1() { + @Override + public AssetContainerSas call(AssetContainerSasInner inner) { + return new AssetContainerSasImpl(inner, manager()); + } + }); + } + + @Override + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getEncryptionKeyAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public StorageEncryptedAssetDecryptionData call(StorageEncryptedAssetDecryptionDataInner inner) { + return new StorageEncryptedAssetDecryptionDataImpl(inner, manager()); + } + }); + } + + @Override + public Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.listStreamingLocatorsAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public ListStreamingLocatorsResponse call(ListStreamingLocatorsResponseInner inner) { + return new ListStreamingLocatorsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + AssetsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, assetName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java new file mode 100644 index 0000000000000..b545587414e3c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java @@ -0,0 +1,1193 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContainerSasInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Assets. + */ +public class AssetsInner { + /** The Retrofit service to perform REST calls. */ + private AssetsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AssetsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AssetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Assets to be + * used by Retrofit to perform actually REST calls. + */ + interface AssetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listContainerSas" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listContainerSas") + Observable> listContainerSas(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body ListContainerSasInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets getEncryptionKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/getEncryptionKey") + Observable> getEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listStreamingLocators" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listStreamingLocators") + Observable> listStreamingLocators(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner get(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner createOrUpdate(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String assetName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String assetName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetContainerSasInner object if successful. + */ + public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetContainerSasInner>() { + @Override + public AssetContainerSasInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable> listContainerSasWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listContainerSas(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContainerSasDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContainerSasDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageEncryptedAssetDecryptionDataInner object if successful. + */ + public StorageEncryptedAssetDecryptionDataInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageEncryptedAssetDecryptionDataInner object + */ + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, StorageEncryptedAssetDecryptionDataInner>() { + @Override + public StorageEncryptedAssetDecryptionDataInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageEncryptedAssetDecryptionDataInner object + */ + public Observable> getEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getEncryptionKey(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEncryptionKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEncryptionKeyDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListStreamingLocatorsResponseInner object if successful. + */ + public ListStreamingLocatorsResponseInner listStreamingLocators(String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListStreamingLocatorsResponseInner object + */ + public Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, ListStreamingLocatorsResponseInner>() { + @Override + public ListStreamingLocatorsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListStreamingLocatorsResponseInner object + */ + public Observable> listStreamingLocatorsWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listStreamingLocators(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listStreamingLocatorsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listStreamingLocatorsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java new file mode 100644 index 0000000000000..5a5f41a11fe9a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AzureMediaServicesImpl class. + */ +public class AzureMediaServicesImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The unique identifier for a Microsoft Azure subscription. */ + private String subscriptionId; + + /** + * Gets The unique identifier for a Microsoft Azure subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The unique identifier for a Microsoft Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets The Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AzureMediaServicesImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AzureMediaServicesImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountFiltersInner object to access its operations. + */ + private AccountFiltersInner accountFilters; + + /** + * Gets the AccountFiltersInner object to access its operations. + * @return the AccountFiltersInner object. + */ + public AccountFiltersInner accountFilters() { + return this.accountFilters; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The MediaservicesInner object to access its operations. + */ + private MediaservicesInner mediaservices; + + /** + * Gets the MediaservicesInner object to access its operations. + * @return the MediaservicesInner object. + */ + public MediaservicesInner mediaservices() { + return this.mediaservices; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The AssetsInner object to access its operations. + */ + private AssetsInner assets; + + /** + * Gets the AssetsInner object to access its operations. + * @return the AssetsInner object. + */ + public AssetsInner assets() { + return this.assets; + } + + /** + * The AssetFiltersInner object to access its operations. + */ + private AssetFiltersInner assetFilters; + + /** + * Gets the AssetFiltersInner object to access its operations. + * @return the AssetFiltersInner object. + */ + public AssetFiltersInner assetFilters() { + return this.assetFilters; + } + + /** + * The ContentKeyPoliciesInner object to access its operations. + */ + private ContentKeyPoliciesInner contentKeyPolicies; + + /** + * Gets the ContentKeyPoliciesInner object to access its operations. + * @return the ContentKeyPoliciesInner object. + */ + public ContentKeyPoliciesInner contentKeyPolicies() { + return this.contentKeyPolicies; + } + + /** + * The TransformsInner object to access its operations. + */ + private TransformsInner transforms; + + /** + * Gets the TransformsInner object to access its operations. + * @return the TransformsInner object. + */ + public TransformsInner transforms() { + return this.transforms; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The StreamingPoliciesInner object to access its operations. + */ + private StreamingPoliciesInner streamingPolicies; + + /** + * Gets the StreamingPoliciesInner object to access its operations. + * @return the StreamingPoliciesInner object. + */ + public StreamingPoliciesInner streamingPolicies() { + return this.streamingPolicies; + } + + /** + * The StreamingLocatorsInner object to access its operations. + */ + private StreamingLocatorsInner streamingLocators; + + /** + * Gets the StreamingLocatorsInner object to access its operations. + * @return the StreamingLocatorsInner object. + */ + public StreamingLocatorsInner streamingLocators() { + return this.streamingLocators; + } + + /** + * The LiveEventsInner object to access its operations. + */ + private LiveEventsInner liveEvents; + + /** + * Gets the LiveEventsInner object to access its operations. + * @return the LiveEventsInner object. + */ + public LiveEventsInner liveEvents() { + return this.liveEvents; + } + + /** + * The LiveOutputsInner object to access its operations. + */ + private LiveOutputsInner liveOutputs; + + /** + * Gets the LiveOutputsInner object to access its operations. + * @return the LiveOutputsInner object. + */ + public LiveOutputsInner liveOutputs() { + return this.liveOutputs; + } + + /** + * The StreamingEndpointsInner object to access its operations. + */ + private StreamingEndpointsInner streamingEndpoints; + + /** + * Gets the StreamingEndpointsInner object to access its operations. + * @return the StreamingEndpointsInner object. + */ + public StreamingEndpointsInner streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureMediaServicesImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-07-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accountFilters = new AccountFiltersInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.mediaservices = new MediaservicesInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.assets = new AssetsInner(restClient().retrofit(), this); + this.assetFilters = new AssetFiltersInner(restClient().retrofit(), this); + this.contentKeyPolicies = new ContentKeyPoliciesInner(restClient().retrofit(), this); + this.transforms = new TransformsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.streamingPolicies = new StreamingPoliciesInner(restClient().retrofit(), this); + this.streamingLocators = new StreamingLocatorsInner(restClient().retrofit(), this); + this.liveEvents = new LiveEventsInner(restClient().retrofit(), this); + this.liveOutputs = new LiveOutputsInner(restClient().retrofit(), this); + this.streamingEndpoints = new StreamingEndpointsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AzureMediaServices", "2018-07-01"); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java new file mode 100644 index 0000000000000..dc1e487e7f3a2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyProperties; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicy; + +class ContentKeyPoliciesImpl extends WrapperImpl implements ContentKeyPolicies { + private final MediaManager manager; + + ContentKeyPoliciesImpl(MediaManager manager) { + super(manager.inner().contentKeyPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public ContentKeyPolicyImpl define(String name) { + return wrapModel(name); + } + + private ContentKeyPolicyImpl wrapModel(ContentKeyPolicyInner inner) { + return new ContentKeyPolicyImpl(inner, manager()); + } + + private ContentKeyPolicyImpl wrapModel(String name) { + return new ContentKeyPolicyImpl(name, this.manager()); + } + + @Override + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getPolicyPropertiesWithSecretsAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicyProperties call(ContentKeyPolicyPropertiesInner inner) { + return new ContentKeyPolicyPropertiesImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + ContentKeyPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, contentKeyPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java new file mode 100644 index 0000000000000..7e244a7e60946 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java @@ -0,0 +1,983 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContentKeyPolicies. + */ +public class ContentKeyPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ContentKeyPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of ContentKeyPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContentKeyPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(ContentKeyPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContentKeyPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ContentKeyPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies getPolicyPropertiesWithSecrets" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets") + Observable> getPolicyPropertiesWithSecrets(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner update(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyPropertiesInner object if successful. + */ + public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyPropertiesInner>() { + @Override + public ContentKeyPolicyPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable> getPolicyPropertiesWithSecretsWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPolicyPropertiesWithSecrets(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPolicyPropertiesWithSecretsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPolicyPropertiesWithSecretsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java new file mode 100644 index 0000000000000..591ac5dbc0e63 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; + +class ContentKeyPolicyImpl extends CreatableUpdatableImpl implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String contentKeyPolicyName; + + ContentKeyPolicyImpl(String name, MediaManager manager) { + super(name, new ContentKeyPolicyInner()); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = name; + // + } + + ContentKeyPolicyImpl(ContentKeyPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.contentKeyPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "contentKeyPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ContentKeyPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ContentKeyPolicyImpl withOptions(List options) { + this.inner().withOptions(options); + return this; + } + + @Override + public ContentKeyPolicyImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java new file mode 100644 index 0000000000000..02ac53171b593 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Content Key Policy resource. + */ +@JsonFlatten +public class ContentKeyPolicyInner extends ProxyResource { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "properties.options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java new file mode 100644 index 0000000000000..6e7a21fb08d91 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import java.util.UUID; + +class ContentKeyPolicyPropertiesImpl extends WrapperImpl implements ContentKeyPolicyProperties { + private final MediaManager manager; + ContentKeyPolicyPropertiesImpl(ContentKeyPolicyPropertiesInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java new file mode 100644 index 0000000000000..50940a83334df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Content Key Policy. + */ +public class ContentKeyPolicyPropertiesInner { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java new file mode 100644 index 0000000000000..ce956de3dac31 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EntityNameAvailabilityCheckOutputImpl extends WrapperImpl implements EntityNameAvailabilityCheckOutput { + private final MediaManager manager; + EntityNameAvailabilityCheckOutputImpl(EntityNameAvailabilityCheckOutputInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java new file mode 100644 index 0000000000000..ccb10b352d7d9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the check name availability request. + */ +public class EntityNameAvailabilityCheckOutputInner { + /** + * Specifies if the name is available. + */ + @JsonProperty(value = "nameAvailable", required = true) + private boolean nameAvailable; + + /** + * Specifies the reason if the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Specifies the detailed reason if the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get specifies if the name is available. + * + * @return the nameAvailable value + */ + public boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies if the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withNameAvailable(boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get specifies the reason if the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set specifies the reason if the name is not available. + * + * @param reason the reason value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get specifies the detailed reason if the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set specifies the detailed reason if the name is not available. + * + * @param message the message value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..d5fcbaae3f04f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java new file mode 100644 index 0000000000000..631fdc47292ea --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Job; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Priority; +import java.util.Map; + +class JobImpl extends CreatableUpdatableImpl implements Job, Job.Definition, Job.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + private String jobName; + + JobImpl(String name, MediaManager manager) { + super(name, new JobInner()); + this.manager = manager; + // Set resource name + this.jobName = name; + // + } + + JobImpl(JobInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.jobName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Map correlationData() { + return this.inner().correlationData(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public JobInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public Priority priority() { + return this.inner().priority(); + } + + @Override + public JobState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public JobImpl withExistingTransform(String resourceGroupName, String accountName, String transformName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.transformName = transformName; + return this; + } + + @Override + public JobImpl withInput(JobInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public JobImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public JobImpl withCorrelationData(Map correlationData) { + this.inner().withCorrelationData(correlationData); + return this; + } + + @Override + public JobImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public JobImpl withPriority(Priority priority) { + this.inner().withPriority(priority); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java new file mode 100644 index 0000000000000..12560283a8304 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Priority; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Job resource type. The progress and state can be obtained by polling a Job + * or subscribing to events using EventGrid. + */ +@JsonFlatten +public class JobInner extends ProxyResource { + /** + * The UTC date and time when the Job was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The current state of the job. Possible values include: 'Canceled', + * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * Optional customer supplied description of the Job. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The inputs for the Job. + */ + @JsonProperty(value = "properties.input", required = true) + private JobInput input; + + /** + * The UTC date and time when the Job was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The outputs for the Job. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Priority with which the job should be processed. Higher priority jobs + * are processed before lower priority jobs. If not set, the default is + * normal. Possible values include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "properties.priority") + private Priority priority; + + /** + * Customer provided correlation data that will be returned in Job and + * JobOutput state events. + */ + @JsonProperty(value = "properties.correlationData") + private Map correlationData; + + /** + * Get the UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get optional customer supplied description of the Job. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set optional customer supplied description of the Job. + * + * @param description the description value to set + * @return the JobInner object itself. + */ + public JobInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the inputs for the Job. + * + * @return the input value + */ + public JobInput input() { + return this.input; + } + + /** + * Set the inputs for the Job. + * + * @param input the input value to set + * @return the JobInner object itself. + */ + public JobInner withInput(JobInput input) { + this.input = input; + return this; + } + + /** + * Get the UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the outputs for the Job. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs for the Job. + * + * @param outputs the outputs value to set + * @return the JobInner object itself. + */ + public JobInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the priority value + */ + public Priority priority() { + return this.priority; + } + + /** + * Set priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param priority the priority value to set + * @return the JobInner object itself. + */ + public JobInner withPriority(Priority priority) { + this.priority = priority; + return this; + } + + /** + * Get customer provided correlation data that will be returned in Job and JobOutput state events. + * + * @return the correlationData value + */ + public Map correlationData() { + return this.correlationData; + } + + /** + * Set customer provided correlation data that will be returned in Job and JobOutput state events. + * + * @param correlationData the correlationData value to set + * @return the JobInner object itself. + */ + public JobInner withCorrelationData(Map correlationData) { + this.correlationData = correlationData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java new file mode 100644 index 0000000000000..5304ba38fa3e2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Job; + +class JobsImpl extends WrapperImpl implements Jobs { + private final MediaManager manager; + + JobsImpl(MediaManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public JobImpl define(String name) { + return wrapModel(name); + } + + private JobImpl wrapModel(JobInner inner) { + return new JobImpl(inner, manager()); + } + + private JobImpl wrapModel(String name) { + return new JobImpl(name, this.manager()); + } + + @Override + public Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.cancelJobAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String transformName) { + JobsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, transformName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName, jobName) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java new file mode 100644 index 0000000000000..72299bf41d197 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java @@ -0,0 +1,1031 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs cancelJob" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob") + Observable> cancelJob(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listSinglePageAsync(resourceGroupName, accountName, transformName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param transformName The Transform name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner create(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner update(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { + cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelJobWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancelJob(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelJobDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java new file mode 100644 index 0000000000000..d5a21d5b6df32 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContentKeysResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; + +class ListContentKeysResponseImpl extends WrapperImpl implements ListContentKeysResponse { + private final MediaManager manager; + ListContentKeysResponseImpl(ListContentKeysResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java new file mode 100644 index 0000000000000..b6aedf834354a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listContentKeys action. + */ +public class ListContentKeysResponseInner { + /** + * ContentKeys used by current Streaming Locator. + */ + @JsonProperty(value = "contentKeys") + private List contentKeys; + + /** + * Get contentKeys used by current Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set contentKeys used by current Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the ListContentKeysResponseInner object itself. + */ + public ListContentKeysResponseInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java new file mode 100644 index 0000000000000..133b5c594af55 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListPathsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPath; + +class ListPathsResponseImpl extends WrapperImpl implements ListPathsResponse { + private final MediaManager manager; + ListPathsResponseImpl(ListPathsResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List downloadPaths() { + return this.inner().downloadPaths(); + } + + @Override + public List streamingPaths() { + return this.inner().streamingPaths(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java new file mode 100644 index 0000000000000..daa7825bc0398 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPath; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listPaths action. + */ +public class ListPathsResponseInner { + /** + * Streaming Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "streamingPaths") + private List streamingPaths; + + /** + * Download Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "downloadPaths") + private List downloadPaths; + + /** + * Get streaming Paths supported by current Streaming Locator. + * + * @return the streamingPaths value + */ + public List streamingPaths() { + return this.streamingPaths; + } + + /** + * Set streaming Paths supported by current Streaming Locator. + * + * @param streamingPaths the streamingPaths value to set + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withStreamingPaths(List streamingPaths) { + this.streamingPaths = streamingPaths; + return this; + } + + /** + * Get download Paths supported by current Streaming Locator. + * + * @return the downloadPaths value + */ + public List downloadPaths() { + return this.downloadPaths; + } + + /** + * Set download Paths supported by current Streaming Locator. + * + * @param downloadPaths the downloadPaths value to set + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withDownloadPaths(List downloadPaths) { + this.downloadPaths = downloadPaths; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java new file mode 100644 index 0000000000000..e1a13fceec0e4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListStreamingLocatorsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStreamingLocator; + +class ListStreamingLocatorsResponseImpl extends WrapperImpl implements ListStreamingLocatorsResponse { + private final MediaManager manager; + ListStreamingLocatorsResponseImpl(ListStreamingLocatorsResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List streamingLocators() { + return this.inner().streamingLocators(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java new file mode 100644 index 0000000000000..59e7e01f1ae3a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStreamingLocator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Streaming Locators associated with this Asset. + */ +public class ListStreamingLocatorsResponseInner { + /** + * The list of Streaming Locators. + */ + @JsonProperty(value = "streamingLocators", access = JsonProperty.Access.WRITE_ONLY) + private List streamingLocators; + + /** + * Get the list of Streaming Locators. + * + * @return the streamingLocators value + */ + public List streamingLocators() { + return this.streamingLocators; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java new file mode 100644 index 0000000000000..7e2e1cf00c441 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvent; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamOptionsFlag; +import org.joda.time.DateTime; + +class LiveEventImpl extends CreatableUpdatableImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + private Boolean cautoStart; + + LiveEventImpl(String name, MediaManager manager) { + super(name, new LiveEventInner()); + this.manager = manager; + // Set resource name + this.liveEventName = name; + // + } + + LiveEventImpl(LiveEventInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveEventName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner(), this.cautoStart) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public LiveEventEncoding encoding() { + return this.inner().encoding(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public LiveEventInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public LiveEventPreview preview() { + return this.inner().preview(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveEventResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public List streamOptions() { + return this.inner().streamOptions(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean vanityUrl() { + return this.inner().vanityUrl(); + } + + @Override + public LiveEventImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public LiveEventImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + + @Override + public LiveEventImpl withInput(LiveEventInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public LiveEventImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public LiveEventImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveEventImpl withEncoding(LiveEventEncoding encoding) { + this.inner().withEncoding(encoding); + return this; + } + + @Override + public LiveEventImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public LiveEventImpl withPreview(LiveEventPreview preview) { + this.inner().withPreview(preview); + return this; + } + + @Override + public LiveEventImpl withStreamOptions(List streamOptions) { + this.inner().withStreamOptions(streamOptions); + return this; + } + + @Override + public LiveEventImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public LiveEventImpl withVanityUrl(Boolean vanityUrl) { + this.inner().withVanityUrl(vanityUrl); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java new file mode 100644 index 0000000000000..01c180888df51 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamOptionsFlag; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The Live Event. + */ +@JsonFlatten +@SkipParentValidation +public class LiveEventInner extends Resource { + /** + * The Live Event description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Live Event input. + */ + @JsonProperty(value = "properties.input", required = true) + private LiveEventInput input; + + /** + * The Live Event preview. + */ + @JsonProperty(value = "properties.preview") + private LiveEventPreview preview; + + /** + * The Live Event encoding. + */ + @JsonProperty(value = "properties.encoding") + private LiveEventEncoding encoding; + + /** + * The provisioning state of the Live Event. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Event. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveEventResourceState resourceState; + + /** + * The Live Event access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * Specifies whether to use a vanity url with the Live Event. This value + * is specified at creation time and cannot be updated. + */ + @JsonProperty(value = "properties.vanityUrl") + private Boolean vanityUrl; + + /** + * The options to use for the LiveEvent. This value is specified at + * creation time and cannot be updated. + */ + @JsonProperty(value = "properties.streamOptions") + private List streamOptions; + + /** + * The exact time the Live Event was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Event was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the Live Event description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Live Event description. + * + * @param description the description value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Live Event input. + * + * @return the input value + */ + public LiveEventInput input() { + return this.input; + } + + /** + * Set the Live Event input. + * + * @param input the input value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withInput(LiveEventInput input) { + this.input = input; + return this; + } + + /** + * Get the Live Event preview. + * + * @return the preview value + */ + public LiveEventPreview preview() { + return this.preview; + } + + /** + * Set the Live Event preview. + * + * @param preview the preview value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withPreview(LiveEventPreview preview) { + this.preview = preview; + return this; + } + + /** + * Get the Live Event encoding. + * + * @return the encoding value + */ + public LiveEventEncoding encoding() { + return this.encoding; + } + + /** + * Set the Live Event encoding. + * + * @param encoding the encoding value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withEncoding(LiveEventEncoding encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the provisioning state of the Live Event. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + * + * @return the resourceState value + */ + public LiveEventResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the Live Event access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the Live Event access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated. + * + * @return the vanityUrl value + */ + public Boolean vanityUrl() { + return this.vanityUrl; + } + + /** + * Set specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated. + * + * @param vanityUrl the vanityUrl value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withVanityUrl(Boolean vanityUrl) { + this.vanityUrl = vanityUrl; + return this; + } + + /** + * Get the options to use for the LiveEvent. This value is specified at creation time and cannot be updated. + * + * @return the streamOptions value + */ + public List streamOptions() { + return this.streamOptions; + } + + /** + * Set the options to use for the LiveEvent. This value is specified at creation time and cannot be updated. + * + * @param streamOptions the streamOptions value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withStreamOptions(List streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get the exact time the Live Event was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Event was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java new file mode 100644 index 0000000000000..4fc91cbad990c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvent; + +class LiveEventsImpl extends WrapperImpl implements LiveEvents { + private final MediaManager manager; + + LiveEventsImpl(MediaManager manager) { + super(manager.inner().liveEvents()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveEventImpl define(String name) { + return wrapModel(name); + } + + private LiveEventImpl wrapModel(LiveEventInner inner) { + return new LiveEventImpl(inner, manager()); + } + + private LiveEventImpl wrapModel(String name) { + return new LiveEventImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.resetAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + LiveEventsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java new file mode 100644 index 0000000000000..c2983442e625b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java @@ -0,0 +1,1936 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventActionInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveEvents. + */ +public class LiveEventsInner { + /** The Retrofit service to perform REST calls. */ + private LiveEventsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveEventsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveEventsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveEventsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveEvents to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveEventsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> reset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> beginReset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner get(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner update(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String liveEventName) { + startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String liveEventName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String liveEventName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reset(String resourceGroupName, String accountName, String liveEventName) { + resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.reset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginReset(String resourceGroupName, String accountName, String liveEventName) { + beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginReset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java new file mode 100644 index 0000000000000..2c545cefb105e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutput; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputResourceState; + +class LiveOutputImpl extends CreatableUpdatableImpl implements LiveOutput, LiveOutput.Definition, LiveOutput.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + private String liveOutputName; + + LiveOutputImpl(String name, MediaManager manager) { + super(name, new LiveOutputInner()); + this.manager = manager; + // Set resource name + this.liveOutputName = name; + // + } + + LiveOutputImpl(LiveOutputInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveOutputName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + this.liveOutputName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveOutputs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Period archiveWindowLength() { + return this.inner().archiveWindowLength(); + } + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public Hls hls() { + return this.inner().hls(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String manifestName() { + return this.inner().manifestName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long outputSnapTime() { + return this.inner().outputSnapTime(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveOutputResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public LiveOutputImpl withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.liveEventName = liveEventName; + return this; + } + + @Override + public LiveOutputImpl withArchiveWindowLength(Period archiveWindowLength) { + this.inner().withArchiveWindowLength(archiveWindowLength); + return this; + } + + @Override + public LiveOutputImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public LiveOutputImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveOutputImpl withHls(Hls hls) { + this.inner().withHls(hls); + return this; + } + + @Override + public LiveOutputImpl withManifestName(String manifestName) { + this.inner().withManifestName(manifestName); + return this; + } + + @Override + public LiveOutputImpl withOutputSnapTime(Long outputSnapTime) { + this.inner().withOutputSnapTime(outputSnapTime); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java new file mode 100644 index 0000000000000..a9c6f733a257d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Live Output. + */ +@JsonFlatten +public class LiveOutputInner extends ProxyResource { + /** + * The description of the Live Output. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The asset name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * ISO 8601 timespan duration of the archive window length. This is + * duration that customer want to retain the recorded content. + */ + @JsonProperty(value = "properties.archiveWindowLength", required = true) + private Period archiveWindowLength; + + /** + * The manifest file name. If not provided, the service will generate one + * automatically. + */ + @JsonProperty(value = "properties.manifestName") + private String manifestName; + + /** + * The HLS configuration. + */ + @JsonProperty(value = "properties.hls") + private Hls hls; + + /** + * The output snapshot time. + */ + @JsonProperty(value = "properties.outputSnapTime") + private Long outputSnapTime; + + /** + * The exact time the Live Output was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Output was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The provisioning state of the Live Output. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Output. Possible values include: + * 'Creating', 'Running', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveOutputResourceState resourceState; + + /** + * Get the description of the Live Output. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the Live Output. + * + * @param description the description value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the asset name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the asset name. + * + * @param assetName the assetName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @return the archiveWindowLength value + */ + public Period archiveWindowLength() { + return this.archiveWindowLength; + } + + /** + * Set iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @param archiveWindowLength the archiveWindowLength value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withArchiveWindowLength(Period archiveWindowLength) { + this.archiveWindowLength = archiveWindowLength; + return this; + } + + /** + * Get the manifest file name. If not provided, the service will generate one automatically. + * + * @return the manifestName value + */ + public String manifestName() { + return this.manifestName; + } + + /** + * Set the manifest file name. If not provided, the service will generate one automatically. + * + * @param manifestName the manifestName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withManifestName(String manifestName) { + this.manifestName = manifestName; + return this; + } + + /** + * Get the HLS configuration. + * + * @return the hls value + */ + public Hls hls() { + return this.hls; + } + + /** + * Set the HLS configuration. + * + * @param hls the hls value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withHls(Hls hls) { + this.hls = hls; + return this; + } + + /** + * Get the output snapshot time. + * + * @return the outputSnapTime value + */ + public Long outputSnapTime() { + return this.outputSnapTime; + } + + /** + * Set the output snapshot time. + * + * @param outputSnapTime the outputSnapTime value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withOutputSnapTime(Long outputSnapTime) { + this.outputSnapTime = outputSnapTime; + return this; + } + + /** + * Get the exact time the Live Output was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Output was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the provisioning state of the Live Output. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Output. Possible values include: 'Creating', 'Running', 'Deleting'. + * + * @return the resourceState value + */ + public LiveOutputResourceState resourceState() { + return this.resourceState; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java new file mode 100644 index 0000000000000..0627ddb54d4cd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutput; + +class LiveOutputsImpl extends WrapperImpl implements LiveOutputs { + private final MediaManager manager; + + LiveOutputsImpl(MediaManager manager) { + super(manager.inner().liveOutputs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveOutputImpl define(String name) { + return wrapModel(name); + } + + private LiveOutputImpl wrapModel(LiveOutputInner inner) { + return new LiveOutputImpl(inner, manager()); + } + + private LiveOutputImpl wrapModel(String name) { + return new LiveOutputImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + LiveOutputsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, liveEventName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName, liveOutputName) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java new file mode 100644 index 0000000000000..593f3650fdc38 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java @@ -0,0 +1,850 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveOutputs. + */ +public class LiveOutputsInner { + /** The Retrofit service to perform REST calls. */ + private LiveOutputsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveOutputsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveOutputsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveOutputsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveOutputs to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveOutputsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String liveEventName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, liveEventName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String liveEventName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, liveEventName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listSinglePageAsync(resourceGroupName, accountName, liveEventName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner create(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner beginCreate(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().last().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java new file mode 100644 index 0000000000000..533ad53de4540 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LocationInner model. + */ +public class LocationInner { + /** + * The name property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the LocationInner object itself. + */ + public LocationInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..a68d7fea0cbcf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CheckNameAvailabilityInput; + +class LocationsImpl extends WrapperImpl implements Locations { + private final MediaManager manager; + + LocationsImpl(MediaManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + LocationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(locationName, parameters) + .map(new Func1() { + @Override + public EntityNameAvailabilityCheckOutput call(EntityNameAvailabilityCheckOutputInner inner) { + return new EntityNameAvailabilityCheckOutputImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java new file mode 100644 index 0000000000000..6feebdcd6dc5b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CheckNameAvailabilityInput; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Locations checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Body CheckNameAvailabilityInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EntityNameAvailabilityCheckOutputInner object if successful. + */ + public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, parameters), serviceCallback); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).map(new Func1, EntityNameAvailabilityCheckOutputInner>() { + @Override + public EntityNameAvailabilityCheckOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, CheckNameAvailabilityInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), locationName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java new file mode 100644 index 0000000000000..eca5000d601d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operations; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Locations; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Assets; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Media resource management. + */ +public final class MediaManager extends ManagerCore { + private AccountFilters accountFilters; + private Operations operations; + private Mediaservices mediaservices; + private Locations locations; + private Assets assets; + private AssetFilters assetFilters; + private ContentKeyPolicies contentKeyPolicies; + private Transforms transforms; + private Jobs jobs; + private StreamingPolicies streamingPolicies; + private StreamingLocators streamingLocators; + private LiveEvents liveEvents; + private LiveOutputs liveOutputs; + private StreamingEndpoints streamingEndpoints; + /** + * Get a Configurable instance that can be used to create MediaManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new MediaManager.ConfigurableImpl(); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new MediaManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(RestClient restClient, String subscriptionId) { + return new MediaManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of MediaManager that exposes Media management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Media management API entry points that work across subscriptions + */ + MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AccountFilters. + */ + public AccountFilters accountFilters() { + if (this.accountFilters == null) { + this.accountFilters = new AccountFiltersImpl(this); + } + return this.accountFilters; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Mediaservices. + */ + public Mediaservices mediaservices() { + if (this.mediaservices == null) { + this.mediaservices = new MediaservicesImpl(this); + } + return this.mediaservices; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Assets. + */ + public Assets assets() { + if (this.assets == null) { + this.assets = new AssetsImpl(this); + } + return this.assets; + } + + /** + * @return Entry point to manage AssetFilters. + */ + public AssetFilters assetFilters() { + if (this.assetFilters == null) { + this.assetFilters = new AssetFiltersImpl(this); + } + return this.assetFilters; + } + + /** + * @return Entry point to manage ContentKeyPolicies. + */ + public ContentKeyPolicies contentKeyPolicies() { + if (this.contentKeyPolicies == null) { + this.contentKeyPolicies = new ContentKeyPoliciesImpl(this); + } + return this.contentKeyPolicies; + } + + /** + * @return Entry point to manage Transforms. + */ + public Transforms transforms() { + if (this.transforms == null) { + this.transforms = new TransformsImpl(this); + } + return this.transforms; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * @return Entry point to manage StreamingPolicies. + */ + public StreamingPolicies streamingPolicies() { + if (this.streamingPolicies == null) { + this.streamingPolicies = new StreamingPoliciesImpl(this); + } + return this.streamingPolicies; + } + + /** + * @return Entry point to manage StreamingLocators. + */ + public StreamingLocators streamingLocators() { + if (this.streamingLocators == null) { + this.streamingLocators = new StreamingLocatorsImpl(this); + } + return this.streamingLocators; + } + + /** + * @return Entry point to manage LiveEvents. + */ + public LiveEvents liveEvents() { + if (this.liveEvents == null) { + this.liveEvents = new LiveEventsImpl(this); + } + return this.liveEvents; + } + + /** + * @return Entry point to manage LiveOutputs. + */ + public LiveOutputs liveOutputs() { + if (this.liveOutputs == null) { + this.liveOutputs = new LiveOutputsImpl(this); + } + return this.liveOutputs; + } + + /** + * @return Entry point to manage StreamingEndpoints. + */ + public StreamingEndpoints streamingEndpoints() { + if (this.streamingEndpoints == null) { + this.streamingEndpoints = new StreamingEndpointsImpl(this); + } + return this.streamingEndpoints; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return MediaManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private MediaManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureMediaServicesImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java new file mode 100644 index 0000000000000..c452961521044 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MediaService; +import rx.Observable; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; + +class MediaServiceImpl extends GroupableResourceCoreImpl implements MediaService, MediaService.Definition, MediaService.Update { + MediaServiceImpl(String name, MediaServiceInner inner, MediaManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public MediaServiceImpl withStorageAccounts(List storageAccounts) { + this.inner().withStorageAccounts(storageAccounts); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java new file mode 100644 index 0000000000000..fbd9182349a16 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class MediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java new file mode 100644 index 0000000000000..d29d72ff5b910 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MediaService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.SubscriptionMediaService; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class MediaservicesImpl extends GroupableResourcesCoreImpl implements Mediaservices { + protected MediaservicesImpl(MediaManager manager) { + super(manager.inner().mediaservices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MediaservicesInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(SubscriptionMediaServiceInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + MediaservicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public MediaServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable syncStorageKeysAsync(String resourceGroupName, String accountName) { + MediaservicesInner client = this.inner(); + return client.syncStorageKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable getBySubscriptionAsync(String accountName) { + MediaservicesInner client = this.inner(); + return client.getBySubscriptionAsync(accountName) + .map(new Func1() { + @Override + public SubscriptionMediaService call(SubscriptionMediaServiceInner inner) { + return new SubscriptionMediaServiceImpl(inner, manager()); + } + }); + } + + @Override + protected MediaServiceImpl wrapModel(MediaServiceInner inner) { + return new MediaServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected MediaServiceImpl wrapModel(String name) { + return new MediaServiceImpl(name, new MediaServiceInner(), this.manager()); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java new file mode 100644 index 0000000000000..2e901ff7d331b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java @@ -0,0 +1,1214 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.SyncStorageKeysInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Mediaservices. + */ +public class MediaservicesInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private MediaservicesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of MediaservicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MediaservicesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(MediaservicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Mediaservices to be + * used by Retrofit to perform actually REST calls. + */ + interface MediaservicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices syncStorageKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys") + Observable> syncStorageKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SyncStorageKeysInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices getBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getBySubscription(@Path("subscriptionId") String subscriptionId, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner createOrUpdate(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(null); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName, String id) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName, String id) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String id) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(id); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse syncStorageKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubscriptionMediaServiceInner object if successful. + */ + public SubscriptionMediaServiceInner getBySubscription(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBySubscriptionAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBySubscriptionWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable getBySubscriptionAsync(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).map(new Func1, SubscriptionMediaServiceInner>() { + @Override + public SubscriptionMediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable> getBySubscriptionWithServiceResponseAsync(String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getBySubscription(this.client.subscriptionId(), accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBySubscriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBySubscriptionDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..95c17f1faacea --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MetricProperties; + +class OperationImpl extends WrapperImpl implements Operation { + private final MediaManager manager; + OperationImpl(OperationInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public MetricProperties properties() { + return this.inner().properties(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..7bd5cf2969acc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MetricProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation. + */ +public class OperationInner { + /** + * The operation name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The operation display name. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Operation properties format. + */ + @JsonProperty(value = "properties") + private MetricProperties properties; + + /** + * Get the operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operation display name. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the operation display name. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get operation properties format. + * + * @return the properties value + */ + public MetricProperties properties() { + return this.properties; + } + + /** + * Set operation properties format. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(MetricProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..679cc277fc08c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final MediaManager manager; + + OperationsImpl(MediaManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ee0a52aef6351 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Operations list" }) + @GET("providers/Microsoft.Media/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..d28491d163c1a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("@odata.nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java new file mode 100644 index 0000000000000..70a473e67e193 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageEncryptedAssetDecryptionData; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFileEncryptionMetadata; + +class StorageEncryptedAssetDecryptionDataImpl extends WrapperImpl implements StorageEncryptedAssetDecryptionData { + private final MediaManager manager; + StorageEncryptedAssetDecryptionDataImpl(StorageEncryptedAssetDecryptionDataInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List assetFileEncryptionMetadata() { + return this.inner().assetFileEncryptionMetadata(); + } + + @Override + public byte[] keyVal() { + return this.inner().key(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java new file mode 100644 index 0000000000000..ff30b02014b44 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFileEncryptionMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data needed to decrypt asset files encrypted with legacy storage encryption. + */ +public class StorageEncryptedAssetDecryptionDataInner { + /** + * The Asset File storage encryption key. + */ + @JsonProperty(value = "key") + private byte[] key; + + /** + * Asset File encryption metadata. + */ + @JsonProperty(value = "assetFileEncryptionMetadata") + private List assetFileEncryptionMetadata; + + /** + * Get the Asset File storage encryption key. + * + * @return the key value + */ + public byte[] key() { + return this.key; + } + + /** + * Set the Asset File storage encryption key. + * + * @param key the key value to set + * @return the StorageEncryptedAssetDecryptionDataInner object itself. + */ + public StorageEncryptedAssetDecryptionDataInner withKey(byte[] key) { + this.key = key; + return this; + } + + /** + * Get asset File encryption metadata. + * + * @return the assetFileEncryptionMetadata value + */ + public List assetFileEncryptionMetadata() { + return this.assetFileEncryptionMetadata; + } + + /** + * Set asset File encryption metadata. + * + * @param assetFileEncryptionMetadata the assetFileEncryptionMetadata value to set + * @return the StorageEncryptedAssetDecryptionDataInner object itself. + */ + public StorageEncryptedAssetDecryptionDataInner withAssetFileEncryptionMetadata(List assetFileEncryptionMetadata) { + this.assetFileEncryptionMetadata = assetFileEncryptionMetadata; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java new file mode 100644 index 0000000000000..5d815ddc73db4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoint; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import org.joda.time.DateTime; + +class StreamingEndpointImpl extends CreatableUpdatableImpl implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingEndpointName; + private Boolean cautoStart; + + StreamingEndpointImpl(String name, MediaManager manager) { + super(name, new StreamingEndpointInner()); + this.manager = manager; + // Set resource name + this.streamingEndpointName = name; + // + } + + StreamingEndpointImpl(StreamingEndpointInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingEndpointName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.streamingEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingEndpoints"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner(), this.cautoStart) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public StreamingEndpointAccessControl accessControl() { + return this.inner().accessControl(); + } + + @Override + public String availabilitySetName() { + return this.inner().availabilitySetName(); + } + + @Override + public Boolean cdnEnabled() { + return this.inner().cdnEnabled(); + } + + @Override + public String cdnProfile() { + return this.inner().cdnProfile(); + } + + @Override + public String cdnProvider() { + return this.inner().cdnProvider(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public List customHostNames() { + return this.inner().customHostNames(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime freeTrialEndTime() { + return this.inner().freeTrialEndTime(); + } + + @Override + public String hostName() { + return this.inner().hostName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Long maxCacheAge() { + return this.inner().maxCacheAge(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public StreamingEndpointResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public int scaleUnits() { + return this.inner().scaleUnits(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingEndpointImpl withAutoStart(Boolean autoStart) { + this.cautoStart = autoStart; + return this; + } + + @Override + public StreamingEndpointImpl withScaleUnits(int scaleUnits) { + this.inner().withScaleUnits(scaleUnits); + return this; + } + + @Override + public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { + this.inner().withAccessControl(accessControl); + return this; + } + + @Override + public StreamingEndpointImpl withAvailabilitySetName(String availabilitySetName) { + this.inner().withAvailabilitySetName(availabilitySetName); + return this; + } + + @Override + public StreamingEndpointImpl withCdnEnabled(Boolean cdnEnabled) { + this.inner().withCdnEnabled(cdnEnabled); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProfile(String cdnProfile) { + this.inner().withCdnProfile(cdnProfile); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProvider(String cdnProvider) { + this.inner().withCdnProvider(cdnProvider); + return this; + } + + @Override + public StreamingEndpointImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public StreamingEndpointImpl withCustomHostNames(List customHostNames) { + this.inner().withCustomHostNames(customHostNames); + return this; + } + + @Override + public StreamingEndpointImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public StreamingEndpointImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public StreamingEndpointImpl withMaxCacheAge(Long maxCacheAge) { + this.inner().withMaxCacheAge(maxCacheAge); + return this; + } + + @Override + public StreamingEndpointImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java new file mode 100644 index 0000000000000..cc9ff2326e10e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java @@ -0,0 +1,381 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The StreamingEndpoint. + */ +@JsonFlatten +@SkipParentValidation +public class StreamingEndpointInner extends Resource { + /** + * The StreamingEndpoint description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The number of scale units. Use the Scale operation to adjust this + * value. + */ + @JsonProperty(value = "properties.scaleUnits", required = true) + private int scaleUnits; + + /** + * The name of the AvailabilitySet used with this StreamingEndpoint for + * high availability streaming. This value can only be set at creation + * time. + */ + @JsonProperty(value = "properties.availabilitySetName") + private String availabilitySetName; + + /** + * The access control definition of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.accessControl") + private StreamingEndpointAccessControl accessControl; + + /** + * Max cache age. + */ + @JsonProperty(value = "properties.maxCacheAge") + private Long maxCacheAge; + + /** + * The custom host names of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.customHostNames") + private List customHostNames; + + /** + * The StreamingEndpoint host name. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The CDN enabled flag. + */ + @JsonProperty(value = "properties.cdnEnabled") + private Boolean cdnEnabled; + + /** + * The CDN provider name. + */ + @JsonProperty(value = "properties.cdnProvider") + private String cdnProvider; + + /** + * The CDN profile name. + */ + @JsonProperty(value = "properties.cdnProfile") + private String cdnProfile; + + /** + * The provisioning state of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the StreamingEndpoint. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private StreamingEndpointResourceState resourceState; + + /** + * The StreamingEndpoint access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * The free trial expiration time. + */ + @JsonProperty(value = "properties.freeTrialEndTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime freeTrialEndTime; + + /** + * The exact time the StreamingEndpoint was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the StreamingEndpoint was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the StreamingEndpoint description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the StreamingEndpoint description. + * + * @param description the description value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of scale units. Use the Scale operation to adjust this value. + * + * @return the scaleUnits value + */ + public int scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the number of scale units. Use the Scale operation to adjust this value. + * + * @param scaleUnits the scaleUnits value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withScaleUnits(int scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Get the name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time. + * + * @return the availabilitySetName value + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time. + * + * @param availabilitySetName the availabilitySetName value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the access control definition of the StreamingEndpoint. + * + * @return the accessControl value + */ + public StreamingEndpointAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control definition of the StreamingEndpoint. + * + * @param accessControl the accessControl value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAccessControl(StreamingEndpointAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get max cache age. + * + * @return the maxCacheAge value + */ + public Long maxCacheAge() { + return this.maxCacheAge; + } + + /** + * Set max cache age. + * + * @param maxCacheAge the maxCacheAge value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withMaxCacheAge(Long maxCacheAge) { + this.maxCacheAge = maxCacheAge; + return this; + } + + /** + * Get the custom host names of the StreamingEndpoint. + * + * @return the customHostNames value + */ + public List customHostNames() { + return this.customHostNames; + } + + /** + * Set the custom host names of the StreamingEndpoint. + * + * @param customHostNames the customHostNames value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCustomHostNames(List customHostNames) { + this.customHostNames = customHostNames; + return this; + } + + /** + * Get the StreamingEndpoint host name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the CDN enabled flag. + * + * @return the cdnEnabled value + */ + public Boolean cdnEnabled() { + return this.cdnEnabled; + } + + /** + * Set the CDN enabled flag. + * + * @param cdnEnabled the cdnEnabled value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnEnabled(Boolean cdnEnabled) { + this.cdnEnabled = cdnEnabled; + return this; + } + + /** + * Get the CDN provider name. + * + * @return the cdnProvider value + */ + public String cdnProvider() { + return this.cdnProvider; + } + + /** + * Set the CDN provider name. + * + * @param cdnProvider the cdnProvider value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProvider(String cdnProvider) { + this.cdnProvider = cdnProvider; + return this; + } + + /** + * Get the CDN profile name. + * + * @return the cdnProfile value + */ + public String cdnProfile() { + return this.cdnProfile; + } + + /** + * Set the CDN profile name. + * + * @param cdnProfile the cdnProfile value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProfile(String cdnProfile) { + this.cdnProfile = cdnProfile; + return this; + } + + /** + * Get the provisioning state of the StreamingEndpoint. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the StreamingEndpoint. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + * + * @return the resourceState value + */ + public StreamingEndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the StreamingEndpoint access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the StreamingEndpoint access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get the free trial expiration time. + * + * @return the freeTrialEndTime value + */ + public DateTime freeTrialEndTime() { + return this.freeTrialEndTime; + } + + /** + * Get the exact time the StreamingEndpoint was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the StreamingEndpoint was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java new file mode 100644 index 0000000000000..f70f839dee549 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoint; + +class StreamingEndpointsImpl extends WrapperImpl implements StreamingEndpoints { + private final MediaManager manager; + + StreamingEndpointsImpl(MediaManager manager) { + super(manager.inner().streamingEndpoints()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingEndpointImpl define(String name) { + return wrapModel(name); + } + + private StreamingEndpointImpl wrapModel(StreamingEndpointInner inner) { + return new StreamingEndpointImpl(inner, manager()); + } + + private StreamingEndpointImpl wrapModel(String name) { + return new StreamingEndpointImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.scaleAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingEndpointsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingEndpointName) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java new file mode 100644 index 0000000000000..ff3842a17e420 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java @@ -0,0 +1,1944 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEntityScaleUnit; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingEndpoints. + */ +public class StreamingEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingEndpointsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingEndpointsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints scale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> scale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginScale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> beginScale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner update(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginUpdate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String streamingEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String streamingEndpointName) { + startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScaleDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java new file mode 100644 index 0000000000000..22146a8843a4e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocator; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; + +class StreamingLocatorImpl extends CreatableUpdatableImpl implements StreamingLocator, StreamingLocator.Definition, StreamingLocator.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingLocatorName; + + StreamingLocatorImpl(String name, MediaManager manager) { + super(name, new StreamingLocatorInner()); + this.manager = manager; + // Set resource name + this.streamingLocatorName = name; + // + } + + StreamingLocatorImpl(StreamingLocatorInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingLocatorName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingLocatorName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingLocators"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternativeMediaId() { + return this.inner().alternativeMediaId(); + } + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public UUID streamingLocatorId() { + return this.inner().streamingLocatorId(); + } + + @Override + public String streamingPolicyName() { + return this.inner().streamingPolicyName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingLocatorImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingLocatorImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingPolicyName(String streamingPolicyName) { + this.inner().withStreamingPolicyName(streamingPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withAlternativeMediaId(String alternativeMediaId) { + this.inner().withAlternativeMediaId(alternativeMediaId); + return this; + } + + @Override + public StreamingLocatorImpl withContentKeys(List contentKeys) { + this.inner().withContentKeys(contentKeys); + return this; + } + + @Override + public StreamingLocatorImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withEndTime(DateTime endTime) { + this.inner().withEndTime(endTime); + return this; + } + + @Override + public StreamingLocatorImpl withStartTime(DateTime startTime) { + this.inner().withStartTime(startTime); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingLocatorId(UUID streamingLocatorId) { + this.inner().withStreamingLocatorId(streamingLocatorId); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java new file mode 100644 index 0000000000000..22f9e03b4d6f6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Locator resource. + */ +@JsonFlatten +public class StreamingLocatorInner extends ProxyResource { + /** + * Asset Name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * The creation time of the Streaming Locator. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * The StreamingLocatorId of the Streaming Locator. + */ + @JsonProperty(value = "properties.streamingLocatorId") + private UUID streamingLocatorId; + + /** + * Name of the Streaming Policy used by this Streaming Locator. Either + * specify the name of Streaming Policy you created or use one of the + * predefined Streaming Policies. The predefined Streaming Policies + * available are: 'Predefined_DownloadOnly', + * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming'. + */ + @JsonProperty(value = "properties.streamingPolicyName", required = true) + private String streamingPolicyName; + + /** + * Name of the default ContentKeyPolicy used by this Streaming Locator. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * The ContentKeys used by this Streaming Locator. + */ + @JsonProperty(value = "properties.contentKeys") + private List contentKeys; + + /** + * Alternative Media ID of this Streaming Locator. + */ + @JsonProperty(value = "properties.alternativeMediaId") + private String alternativeMediaId; + + /** + * Get asset Name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set asset Name. + * + * @param assetName the assetName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the creation time of the Streaming Locator. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the start time of the Streaming Locator. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the Streaming Locator. + * + * @param startTime the startTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the Streaming Locator. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the Streaming Locator. + * + * @param endTime the endTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the StreamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Set the StreamingLocatorId of the Streaming Locator. + * + * @param streamingLocatorId the streamingLocatorId value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingLocatorId(UUID streamingLocatorId) { + this.streamingLocatorId = streamingLocatorId; + return this; + } + + /** + * Get name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming'. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming'. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + + /** + * Get name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get the ContentKeys used by this Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set the ContentKeys used by this Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get alternative Media ID of this Streaming Locator. + * + * @return the alternativeMediaId value + */ + public String alternativeMediaId() { + return this.alternativeMediaId; + } + + /** + * Set alternative Media ID of this Streaming Locator. + * + * @param alternativeMediaId the alternativeMediaId value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withAlternativeMediaId(String alternativeMediaId) { + this.alternativeMediaId = alternativeMediaId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java new file mode 100644 index 0000000000000..76911cb5519cf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContentKeysResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListPathsResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocator; + +class StreamingLocatorsImpl extends WrapperImpl implements StreamingLocators { + private final MediaManager manager; + + StreamingLocatorsImpl(MediaManager manager) { + super(manager.inner().streamingLocators()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingLocatorImpl define(String name) { + return wrapModel(name); + } + + private StreamingLocatorImpl wrapModel(StreamingLocatorInner inner) { + return new StreamingLocatorImpl(inner, manager()); + } + + private StreamingLocatorImpl wrapModel(String name) { + return new StreamingLocatorImpl(name, this.manager()); + } + + @Override + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listContentKeysAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListContentKeysResponse call(ListContentKeysResponseInner inner) { + return new ListContentKeysResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listPathsAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListPathsResponse call(ListPathsResponseInner inner) { + return new ListPathsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingLocatorsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingLocatorName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java new file mode 100644 index 0000000000000..ae79dd0df9c59 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java @@ -0,0 +1,972 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingLocators. + */ +public class StreamingLocatorsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingLocatorsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingLocatorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingLocatorsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingLocatorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingLocators to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingLocatorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Body StreamingLocatorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listContentKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys") + Observable> listContentKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listPaths" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths") + Observable> listPaths(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner create(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters), serviceCallback); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListContentKeysResponseInner object if successful. + */ + public ListContentKeysResponseInner listContentKeys(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListContentKeysResponseInner>() { + @Override + public ListContentKeysResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable> listContentKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listContentKeys(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContentKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContentKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListPathsResponseInner object if successful. + */ + public ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListPathsResponseInner>() { + @Override + public ListPathsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable> listPathsWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPaths(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listPathsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listPathsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java new file mode 100644 index 0000000000000..0323902d915ee --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicy; + +class StreamingPoliciesImpl extends WrapperImpl implements StreamingPolicies { + private final MediaManager manager; + + StreamingPoliciesImpl(MediaManager manager) { + super(manager.inner().streamingPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingPolicyImpl define(String name) { + return wrapModel(name); + } + + private StreamingPolicyImpl wrapModel(StreamingPolicyInner inner) { + return new StreamingPolicyImpl(inner, manager()); + } + + private StreamingPolicyImpl wrapModel(String name) { + return new StreamingPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingPolicyName) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java new file mode 100644 index 0000000000000..9da275787f7ed --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java @@ -0,0 +1,769 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingPolicies. + */ +public class StreamingPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private StreamingPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Body StreamingPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner create(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters), serviceCallback); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java new file mode 100644 index 0000000000000..47ed2dca1bad1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.NoEncryption; + +class StreamingPolicyImpl extends CreatableUpdatableImpl implements StreamingPolicy, StreamingPolicy.Definition, StreamingPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingPolicyName; + + StreamingPolicyImpl(String name, MediaManager manager) { + super(name, new StreamingPolicyInner()); + this.manager = manager; + // Set resource name + this.streamingPolicyName = name; + // + } + + StreamingPolicyImpl(StreamingPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.inner().commonEncryptionCbcs(); + } + + @Override + public CommonEncryptionCenc commonEncryptionCenc() { + return this.inner().commonEncryptionCenc(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public EnvelopeEncryption envelopeEncryption() { + return this.inner().envelopeEncryption(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NoEncryption noEncryption() { + return this.inner().noEncryption(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.inner().withCommonEncryptionCbcs(commonEncryptionCbcs); + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.inner().withCommonEncryptionCenc(commonEncryptionCenc); + return this; + } + + @Override + public StreamingPolicyImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingPolicyImpl withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.inner().withEnvelopeEncryption(envelopeEncryption); + return this; + } + + @Override + public StreamingPolicyImpl withNoEncryption(NoEncryption noEncryption) { + this.inner().withNoEncryption(noEncryption); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java new file mode 100644 index 0000000000000..e797922916771 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.NoEncryption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Policy resource. + */ +@JsonFlatten +public class StreamingPolicyInner extends ProxyResource { + /** + * Creation time of Streaming Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Default ContentKey used by current Streaming Policy. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * Configuration of EnvelopeEncryption. + */ + @JsonProperty(value = "properties.envelopeEncryption") + private EnvelopeEncryption envelopeEncryption; + + /** + * Configuration of CommonEncryptionCenc. + */ + @JsonProperty(value = "properties.commonEncryptionCenc") + private CommonEncryptionCenc commonEncryptionCenc; + + /** + * Configuration of CommonEncryptionCbcs. + */ + @JsonProperty(value = "properties.commonEncryptionCbcs") + private CommonEncryptionCbcs commonEncryptionCbcs; + + /** + * Configurations of NoEncryption. + */ + @JsonProperty(value = "properties.noEncryption") + private NoEncryption noEncryption; + + /** + * Get creation time of Streaming Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get default ContentKey used by current Streaming Policy. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set default ContentKey used by current Streaming Policy. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get configuration of EnvelopeEncryption. + * + * @return the envelopeEncryption value + */ + public EnvelopeEncryption envelopeEncryption() { + return this.envelopeEncryption; + } + + /** + * Set configuration of EnvelopeEncryption. + * + * @param envelopeEncryption the envelopeEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.envelopeEncryption = envelopeEncryption; + return this; + } + + /** + * Get configuration of CommonEncryptionCenc. + * + * @return the commonEncryptionCenc value + */ + public CommonEncryptionCenc commonEncryptionCenc() { + return this.commonEncryptionCenc; + } + + /** + * Set configuration of CommonEncryptionCenc. + * + * @param commonEncryptionCenc the commonEncryptionCenc value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.commonEncryptionCenc = commonEncryptionCenc; + return this; + } + + /** + * Get configuration of CommonEncryptionCbcs. + * + * @return the commonEncryptionCbcs value + */ + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.commonEncryptionCbcs; + } + + /** + * Set configuration of CommonEncryptionCbcs. + * + * @param commonEncryptionCbcs the commonEncryptionCbcs value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.commonEncryptionCbcs = commonEncryptionCbcs; + return this; + } + + /** + * Get configurations of NoEncryption. + * + * @return the noEncryption value + */ + public NoEncryption noEncryption() { + return this.noEncryption; + } + + /** + * Set configurations of NoEncryption. + * + * @param noEncryption the noEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withNoEncryption(NoEncryption noEncryption) { + this.noEncryption = noEncryption; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java new file mode 100644 index 0000000000000..56506bb1fb56f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.SubscriptionMediaService; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import java.util.Map; + +class SubscriptionMediaServiceImpl extends WrapperImpl implements SubscriptionMediaService { + private final MediaManager manager; + SubscriptionMediaServiceImpl(SubscriptionMediaServiceInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java new file mode 100644 index 0000000000000..47570dc540df8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class SubscriptionMediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the SubscriptionMediaServiceInner object itself. + */ + public SubscriptionMediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java new file mode 100644 index 0000000000000..804d07b03c7cb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transform; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.TransformOutput; + +class TransformImpl extends CreatableUpdatableImpl implements Transform, Transform.Definition, Transform.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + + TransformImpl(String name, MediaManager manager) { + super(name, new TransformInner()); + this.manager = manager; + // Set resource name + this.transformName = name; + // + } + + TransformImpl(TransformInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.transformName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TransformImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TransformImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public TransformImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java new file mode 100644 index 0000000000000..23bdb61786df0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.TransformOutput; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Transform encapsulates the rules or instructions for generating desired + * outputs from input media, such as by transcoding or by extracting insights. + * After the Transform is created, it can be applied to input media by creating + * Jobs. + */ +@JsonFlatten +public class TransformInner extends ProxyResource { + /** + * The UTC date and time when the Transform was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * An optional verbose description of the Transform. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The UTC date and time when the Transform was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * An array of one or more TransformOutputs that the Transform should + * generate. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Get the UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get an optional verbose description of the Transform. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set an optional verbose description of the Transform. + * + * @param description the description value to set + * @return the TransformInner object itself. + */ + public TransformInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get an array of one or more TransformOutputs that the Transform should generate. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set an array of one or more TransformOutputs that the Transform should generate. + * + * @param outputs the outputs value to set + * @return the TransformInner object itself. + */ + public TransformInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java new file mode 100644 index 0000000000000..f00f0ef5839de --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transform; + +class TransformsImpl extends WrapperImpl implements Transforms { + private final MediaManager manager; + + TransformsImpl(MediaManager manager) { + super(manager.inner().transforms()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public TransformImpl define(String name) { + return wrapModel(name); + } + + private TransformImpl wrapModel(TransformInner inner) { + return new TransformImpl(inner, manager()); + } + + private TransformImpl wrapModel(String name) { + return new TransformImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + TransformsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java new file mode 100644 index 0000000000000..bffea185ab9b6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java @@ -0,0 +1,880 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Transforms. + */ +public class TransformsInner { + /** The Retrofit service to perform REST calls. */ + private TransformsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of TransformsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TransformsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(TransformsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Transforms to be + * used by Retrofit to perform actually REST calls. + */ + interface TransformsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner get(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner createOrUpdate(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner update(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java new file mode 100644 index 0000000000000..29909a260e485 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java new file mode 100644 index 0000000000000..76f78f086c378 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_07_01; diff --git a/mediaservices/resource-manager/v2018_30_30_preview/pom.xml b/mediaservices/resource-manager/v2018_30_30_preview/pom.xml deleted file mode 100644 index 8bb8e21dac7b7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/pom.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - 4.0.0 - com.microsoft.azure.mediaservices.v2018_30_30_preview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-media - 1.0.0-beta - jar - Microsoft Azure SDK for Media Management - This package contains Microsoft Media Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudio.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudio.java deleted file mode 100644 index cc6433290dc07..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudio.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes Advanced Audio Codec (AAC) audio encoding settings. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.AacAudio") -public class AacAudio extends Audio { - /** - * The encoding profile to be used when encoding audio with AAC. Possible - * values include: 'AacLc', 'HeAacV1', 'HeAacV2'. - */ - @JsonProperty(value = "profile") - private AacAudioProfile profile; - - /** - * Get the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. - * - * @return the profile value - */ - public AacAudioProfile profile() { - return this.profile; - } - - /** - * Set the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. - * - * @param profile the profile value to set - * @return the AacAudio object itself. - */ - public AacAudio withProfile(AacAudioProfile profile) { - this.profile = profile; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudioProfile.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudioProfile.java deleted file mode 100644 index 24e4b3d7b1fc9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AacAudioProfile.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for AacAudioProfile. - */ -public enum AacAudioProfile { - /** Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). */ - AAC_LC("AacLc"), - - /** Specifies that the output audio is to be encoded into HE-AAC v1 profile. */ - HE_AAC_V1("HeAacV1"), - - /** Specifies that the output audio is to be encoded into HE-AAC v2 profile. */ - HE_AAC_V2("HeAacV2"); - - /** The actual serialized value for a AacAudioProfile instance. */ - private String value; - - AacAudioProfile(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AacAudioProfile instance. - * - * @param value the serialized value to parse. - * @return the parsed AacAudioProfile object, or null if unable to parse. - */ - @JsonCreator - public static AacAudioProfile fromString(String value) { - AacAudioProfile[] items = AacAudioProfile.values(); - for (AacAudioProfile item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiAccessControl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiAccessControl.java deleted file mode 100644 index 61605b3bcb77e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiAccessControl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Akamai access control. - */ -public class AkamaiAccessControl { - /** - * authentication key list. - */ - @JsonProperty(value = "akamaiSignatureHeaderAuthenticationKeyList") - private List akamaiSignatureHeaderAuthenticationKeyList; - - /** - * Get authentication key list. - * - * @return the akamaiSignatureHeaderAuthenticationKeyList value - */ - public List akamaiSignatureHeaderAuthenticationKeyList() { - return this.akamaiSignatureHeaderAuthenticationKeyList; - } - - /** - * Set authentication key list. - * - * @param akamaiSignatureHeaderAuthenticationKeyList the akamaiSignatureHeaderAuthenticationKeyList value to set - * @return the AkamaiAccessControl object itself. - */ - public AkamaiAccessControl withAkamaiSignatureHeaderAuthenticationKeyList(List akamaiSignatureHeaderAuthenticationKeyList) { - this.akamaiSignatureHeaderAuthenticationKeyList = akamaiSignatureHeaderAuthenticationKeyList; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiSignatureHeaderAuthenticationKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiSignatureHeaderAuthenticationKey.java deleted file mode 100644 index fb0600eb61e42..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AkamaiSignatureHeaderAuthenticationKey.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.DateTime; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Akamai Signature Header authentication key. - */ -public class AkamaiSignatureHeaderAuthenticationKey { - /** - * identifier of the key. - */ - @JsonProperty(value = "identifier") - private String identifier; - - /** - * authentication key. - */ - @JsonProperty(value = "base64Key") - private String base64Key; - - /** - * The exact time the authentication key. - */ - @JsonProperty(value = "expiration") - private DateTime expiration; - - /** - * Get identifier of the key. - * - * @return the identifier value - */ - public String identifier() { - return this.identifier; - } - - /** - * Set identifier of the key. - * - * @param identifier the identifier value to set - * @return the AkamaiSignatureHeaderAuthenticationKey object itself. - */ - public AkamaiSignatureHeaderAuthenticationKey withIdentifier(String identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get authentication key. - * - * @return the base64Key value - */ - public String base64Key() { - return this.base64Key; - } - - /** - * Set authentication key. - * - * @param base64Key the base64Key value to set - * @return the AkamaiSignatureHeaderAuthenticationKey object itself. - */ - public AkamaiSignatureHeaderAuthenticationKey withBase64Key(String base64Key) { - this.base64Key = base64Key; - return this; - } - - /** - * Get the exact time the authentication key. - * - * @return the expiration value - */ - public DateTime expiration() { - return this.expiration; - } - - /** - * Set the exact time the authentication key. - * - * @param expiration the expiration value to set - * @return the AkamaiSignatureHeaderAuthenticationKey object itself. - */ - public AkamaiSignatureHeaderAuthenticationKey withExpiration(DateTime expiration) { - this.expiration = expiration; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiError.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiError.java deleted file mode 100644 index da07daf767928..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiError.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The API error. - */ -public class ApiError { - /** - * ApiError. - * The error properties. - */ - @JsonProperty(value = "error") - private ODataError error; - - /** - * Get the error properties. - * - * @return the error value - */ - public ODataError error() { - return this.error; - } - - /** - * Set the error properties. - * - * @param error the error value to set - * @return the ApiError object itself. - */ - public ApiError withError(ODataError error) { - this.error = error; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiErrorException.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiErrorException.java deleted file mode 100644 index f35abbcc5959f..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ApiErrorException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.rest.RestException; -import okhttp3.ResponseBody; -import retrofit2.Response; - -/** - * Exception thrown for an invalid response with ApiError information. - */ -public class ApiErrorException extends RestException { - /** - * Initializes a new instance of the ApiErrorException class. - * - * @param message the exception message or the response content if a message is not available - * @param response the HTTP response - */ - public ApiErrorException(final String message, final Response response) { - super(message, response); - } - - /** - * Initializes a new instance of the ApiErrorException class. - * - * @param message the exception message or the response content if a message is not available - * @param response the HTTP response - * @param body the deserialized response body - */ - public ApiErrorException(final String message, final Response response, final ApiError body) { - super(message, response, body); - } - - @Override - public ApiError body() { - return (ApiError) super.body(); - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Asset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Asset.java deleted file mode 100644 index 620a334723b7a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Asset.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.AssetInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import java.util.UUID; -import org.joda.time.DateTime; - -/** - * Type representing Asset. - */ -public interface Asset extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the alternateId value. - */ - String alternateId(); - - /** - * @return the assetId value. - */ - UUID assetId(); - - /** - * @return the container value. - */ - String container(); - - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the storageAccountName value. - */ - String storageAccountName(); - - /** - * @return the storageEncryptionFormat value. - */ - AssetStorageEncryptionFormat storageEncryptionFormat(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the Asset definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { - } - - /** - * Grouping of Asset definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a Asset definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the asset definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithCreate withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the asset definition allowing to specify AlternateId. - */ - interface WithAlternateId { - /** - * Specifies alternateId. - */ - WithCreate withAlternateId(String alternateId); - } - - /** - * The stage of the asset definition allowing to specify Container. - */ - interface WithContainer { - /** - * Specifies container. - */ - WithCreate withContainer(String container); - } - - /** - * The stage of the asset definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the asset definition allowing to specify StorageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies storageAccountName. - */ - WithCreate withStorageAccountName(String storageAccountName); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithAlternateId, DefinitionStages.WithContainer, DefinitionStages.WithDescription, DefinitionStages.WithStorageAccountName { - } - } - /** - * The template for a Asset update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithAlternateId, UpdateStages.WithContainer, UpdateStages.WithDescription, UpdateStages.WithStorageAccountName { - } - - /** - * Grouping of Asset update stages. - */ - interface UpdateStages { - /** - * The stage of the asset update allowing to specify AlternateId. - */ - interface WithAlternateId { - /** - * Specifies alternateId. - */ - Update withAlternateId(String alternateId); - } - - /** - * The stage of the asset update allowing to specify Container. - */ - interface WithContainer { - /** - * Specifies container. - */ - Update withContainer(String container); - } - - /** - * The stage of the asset update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - /** - * The stage of the asset update allowing to specify StorageAccountName. - */ - interface WithStorageAccountName { - /** - * Specifies storageAccountName. - */ - Update withStorageAccountName(String storageAccountName); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerPermission.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerPermission.java deleted file mode 100644 index cce4455953d98..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerPermission.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for AssetContainerPermission. - */ -public enum AssetContainerPermission { - /** The SAS URL will allow read access to the container. */ - READ("Read"), - - /** The SAS URL will allow read and write access to the container. */ - READ_WRITE("ReadWrite"), - - /** The SAS URL will allow read, write and delete access to the container. */ - READ_WRITE_DELETE("ReadWriteDelete"); - - /** The actual serialized value for a AssetContainerPermission instance. */ - private String value; - - AssetContainerPermission(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AssetContainerPermission instance. - * - * @param value the serialized value to parse. - * @return the parsed AssetContainerPermission object, or null if unable to parse. - */ - @JsonCreator - public static AssetContainerPermission fromString(String value) { - AssetContainerPermission[] items = AssetContainerPermission.values(); - for (AssetContainerPermission item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerSas.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerSas.java deleted file mode 100644 index 2b2a450ff28c5..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetContainerSas.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.AssetContainerSasInner; -import java.util.List; - -/** - * Type representing AssetContainerSas. - */ -public interface AssetContainerSas extends HasInner, HasManager { - /** - * @return the assetContainerSasUrls value. - */ - List assetContainerSasUrls(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionFormat.java deleted file mode 100644 index 2c2b04d81593b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AssetStorageEncryptionFormat.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for AssetStorageEncryptionFormat. - */ -public enum AssetStorageEncryptionFormat { - /** The Asset does not use client-side storage encryption (this is the only allowed value for new Assets). */ - NONE("None"), - - /** The Asset is encrypted with Media Services client-side encryption. */ - MEDIA_STORAGE_CLIENT_ENCRYPTION("MediaStorageClientEncryption"); - - /** The actual serialized value for a AssetStorageEncryptionFormat instance. */ - private String value; - - AssetStorageEncryptionFormat(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AssetStorageEncryptionFormat instance. - * - * @param value the serialized value to parse. - * @return the parsed AssetStorageEncryptionFormat object, or null if unable to parse. - */ - @JsonCreator - public static AssetStorageEncryptionFormat fromString(String value) { - AssetStorageEncryptionFormat[] items = AssetStorageEncryptionFormat.values(); - for (AssetStorageEncryptionFormat item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Assets.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Assets.java deleted file mode 100644 index 4d67fb09b5475..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Assets.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.AssetsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Assets. - */ -public interface Assets extends SupportsCreating, HasInner { - /** - * List the Asset URLs. - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); - - /** - * Gets the Asset storage key. - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName); - - /** - * Get an Asset. - * Get the details of an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String assetName); - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete an Asset. - * Deletes an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String assetName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Audio.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Audio.java deleted file mode 100644 index 187519b874dcc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Audio.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Defines the common properties for all audio codecs. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.Audio") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.AacAudio", value = AacAudio.class) -}) -public class Audio extends Codec { - /** - * The number of channels in the audio. - */ - @JsonProperty(value = "channels") - private Integer channels; - - /** - * The sampling rate to use for encoding in hertz. - */ - @JsonProperty(value = "samplingRate") - private Integer samplingRate; - - /** - * The bitrate, in bits per second, of the output encoded audio. - */ - @JsonProperty(value = "bitrate") - private Integer bitrate; - - /** - * Get the number of channels in the audio. - * - * @return the channels value - */ - public Integer channels() { - return this.channels; - } - - /** - * Set the number of channels in the audio. - * - * @param channels the channels value to set - * @return the Audio object itself. - */ - public Audio withChannels(Integer channels) { - this.channels = channels; - return this; - } - - /** - * Get the sampling rate to use for encoding in hertz. - * - * @return the samplingRate value - */ - public Integer samplingRate() { - return this.samplingRate; - } - - /** - * Set the sampling rate to use for encoding in hertz. - * - * @param samplingRate the samplingRate value to set - * @return the Audio object itself. - */ - public Audio withSamplingRate(Integer samplingRate) { - this.samplingRate = samplingRate; - return this; - } - - /** - * Get the bitrate, in bits per second, of the output encoded audio. - * - * @return the bitrate value - */ - public Integer bitrate() { - return this.bitrate; - } - - /** - * Set the bitrate, in bits per second, of the output encoded audio. - * - * @param bitrate the bitrate value to set - * @return the Audio object itself. - */ - public Audio withBitrate(Integer bitrate) { - this.bitrate = bitrate; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioAnalyzerPreset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioAnalyzerPreset.java deleted file mode 100644 index 004544b27516a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioAnalyzerPreset.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * The Audio Analyzer preset applies a pre-defined set of AI-based analysis - * operations, including speech transcription. Currently, the preset supports - * processing of content with a single audio track. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.AudioAnalyzerPreset") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.VideoAnalyzerPreset", value = VideoAnalyzerPreset.class) -}) -public class AudioAnalyzerPreset extends Preset { - /** - * The language for the audio payload in the input using the BCP-47 format - * of 'language tag-region' (e.g: 'en-US'). The list of supported languages - * are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', - * 'pt-BR', 'zh-CN'. - */ - @JsonProperty(value = "audioLanguage") - private String audioLanguage; - - /** - * Get the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. - * - * @return the audioLanguage value - */ - public String audioLanguage() { - return this.audioLanguage; - } - - /** - * Set the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. - * - * @param audioLanguage the audioLanguage value to set - * @return the AudioAnalyzerPreset object itself. - */ - public AudioAnalyzerPreset withAudioLanguage(String audioLanguage) { - this.audioLanguage = audioLanguage; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioOverlay.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioOverlay.java deleted file mode 100644 index 659324887db28..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/AudioOverlay.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties of an audio overlay. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.AudioOverlay") -public class AudioOverlay extends Overlay { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/BuiltInStandardEncoderPreset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/BuiltInStandardEncoderPreset.java deleted file mode 100644 index 567cf1efd1d97..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/BuiltInStandardEncoderPreset.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes a built-in preset for encoding the input video with the Standard - * Encoder. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.BuiltInStandardEncoderPreset") -public class BuiltInStandardEncoderPreset extends Preset { - /** - * The built-in preset to be used for encoding videos. Possible values - * include: 'AdaptiveStreaming', 'AACGoodQualityAudio', - * 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', - * 'H264MultipleBitrateSD'. - */ - @JsonProperty(value = "presetName", required = true) - private EncoderNamedPreset presetName; - - /** - * Get the built-in preset to be used for encoding videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. - * - * @return the presetName value - */ - public EncoderNamedPreset presetName() { - return this.presetName; - } - - /** - * Set the built-in preset to be used for encoding videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. - * - * @param presetName the presetName value to set - * @return the BuiltInStandardEncoderPreset object itself. - */ - public BuiltInStandardEncoderPreset withPresetName(EncoderNamedPreset presetName) { - this.presetName = presetName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CbcsDrmConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CbcsDrmConfiguration.java deleted file mode 100644 index 3448aadc58ce2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CbcsDrmConfiguration.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify drm configurations of CommonEncryptionCbcs scheme in - * Streaming Policy. - */ -public class CbcsDrmConfiguration { - /** - * Fairplay configurations. - */ - @JsonProperty(value = "fairPlay") - private StreamingPolicyFairPlayConfiguration fairPlay; - - /** - * PlayReady configurations. - */ - @JsonProperty(value = "playReady") - private StreamingPolicyPlayReadyConfiguration playReady; - - /** - * Widevine configurations. - */ - @JsonProperty(value = "widevine") - private StreamingPolicyWidevineConfiguration widevine; - - /** - * Get fairplay configurations. - * - * @return the fairPlay value - */ - public StreamingPolicyFairPlayConfiguration fairPlay() { - return this.fairPlay; - } - - /** - * Set fairplay configurations. - * - * @param fairPlay the fairPlay value to set - * @return the CbcsDrmConfiguration object itself. - */ - public CbcsDrmConfiguration withFairPlay(StreamingPolicyFairPlayConfiguration fairPlay) { - this.fairPlay = fairPlay; - return this; - } - - /** - * Get playReady configurations. - * - * @return the playReady value - */ - public StreamingPolicyPlayReadyConfiguration playReady() { - return this.playReady; - } - - /** - * Set playReady configurations. - * - * @param playReady the playReady value to set - * @return the CbcsDrmConfiguration object itself. - */ - public CbcsDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { - this.playReady = playReady; - return this; - } - - /** - * Get widevine configurations. - * - * @return the widevine value - */ - public StreamingPolicyWidevineConfiguration widevine() { - return this.widevine; - } - - /** - * Set widevine configurations. - * - * @param widevine the widevine value to set - * @return the CbcsDrmConfiguration object itself. - */ - public CbcsDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { - this.widevine = widevine; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CencDrmConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CencDrmConfiguration.java deleted file mode 100644 index 918b8ca24c9b2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CencDrmConfiguration.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify drm configurations of CommonEncryptionCenc scheme in - * Streaming Policy. - */ -public class CencDrmConfiguration { - /** - * PlayReady configurations. - */ - @JsonProperty(value = "playReady") - private StreamingPolicyPlayReadyConfiguration playReady; - - /** - * Widevine configurations. - */ - @JsonProperty(value = "widevine") - private StreamingPolicyWidevineConfiguration widevine; - - /** - * Get playReady configurations. - * - * @return the playReady value - */ - public StreamingPolicyPlayReadyConfiguration playReady() { - return this.playReady; - } - - /** - * Set playReady configurations. - * - * @param playReady the playReady value to set - * @return the CencDrmConfiguration object itself. - */ - public CencDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { - this.playReady = playReady; - return this; - } - - /** - * Get widevine configurations. - * - * @return the widevine value - */ - public StreamingPolicyWidevineConfiguration widevine() { - return this.widevine; - } - - /** - * Set widevine configurations. - * - * @param widevine the widevine value to set - * @return the CencDrmConfiguration object itself. - */ - public CencDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { - this.widevine = widevine; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CheckNameAvailabilityInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CheckNameAvailabilityInput.java deleted file mode 100644 index 759f368ba1de2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CheckNameAvailabilityInput.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The input to the check name availability request. - */ -public class CheckNameAvailabilityInput { - /** - * The account name. - */ - @JsonProperty(value = "name") - private String name; - - /** - * The account type. For a Media Services account, this should be - * 'MediaServices'. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the account name. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the account name. - * - * @param name the name value to set - * @return the CheckNameAvailabilityInput object itself. - */ - public CheckNameAvailabilityInput withName(String name) { - this.name = name; - return this; - } - - /** - * Get the account type. For a Media Services account, this should be 'MediaServices'. - * - * @return the type value - */ - public String type() { - return this.type; - } - - /** - * Set the account type. For a Media Services account, this should be 'MediaServices'. - * - * @param type the type value to set - * @return the CheckNameAvailabilityInput object itself. - */ - public CheckNameAvailabilityInput withType(String type) { - this.type = type; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Codec.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Codec.java deleted file mode 100644 index 35eb84710519d..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Codec.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the basic properties of all codecs. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("Codec") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.Audio", value = Audio.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.CopyVideo", value = CopyVideo.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.Video", value = Video.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.CopyAudio", value = CopyAudio.class) -}) -public class Codec { - /** - * An optional label for the codec. The label can be used to control muxing - * behavior. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Get an optional label for the codec. The label can be used to control muxing behavior. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set an optional label for the codec. The label can be used to control muxing behavior. - * - * @param label the label value to set - * @return the Codec object itself. - */ - public Codec withLabel(String label) { - this.label = label; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCbcs.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCbcs.java deleted file mode 100644 index c17ea128754fd..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCbcs.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class for CommonEncryptionCbcs encryption scheme. - */ -public class CommonEncryptionCbcs { - /** - * Representing supported protocols. - */ - @JsonProperty(value = "enabledProtocols") - private EnabledProtocols enabledProtocols; - - /** - * Representing which tracks should not be encrypted. - */ - @JsonProperty(value = "clearTracks") - private List clearTracks; - - /** - * Representing default content key for each encryption scheme and separate - * content keys for specific tracks. - */ - @JsonProperty(value = "contentKeys") - private StreamingPolicyContentKeys contentKeys; - - /** - * Configuration of DRMs for current encryption scheme. - */ - @JsonProperty(value = "drm") - private CbcsDrmConfiguration drm; - - /** - * Get representing supported protocols. - * - * @return the enabledProtocols value - */ - public EnabledProtocols enabledProtocols() { - return this.enabledProtocols; - } - - /** - * Set representing supported protocols. - * - * @param enabledProtocols the enabledProtocols value to set - * @return the CommonEncryptionCbcs object itself. - */ - public CommonEncryptionCbcs withEnabledProtocols(EnabledProtocols enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - - /** - * Get representing which tracks should not be encrypted. - * - * @return the clearTracks value - */ - public List clearTracks() { - return this.clearTracks; - } - - /** - * Set representing which tracks should not be encrypted. - * - * @param clearTracks the clearTracks value to set - * @return the CommonEncryptionCbcs object itself. - */ - public CommonEncryptionCbcs withClearTracks(List clearTracks) { - this.clearTracks = clearTracks; - return this; - } - - /** - * Get representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @return the contentKeys value - */ - public StreamingPolicyContentKeys contentKeys() { - return this.contentKeys; - } - - /** - * Set representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @param contentKeys the contentKeys value to set - * @return the CommonEncryptionCbcs object itself. - */ - public CommonEncryptionCbcs withContentKeys(StreamingPolicyContentKeys contentKeys) { - this.contentKeys = contentKeys; - return this; - } - - /** - * Get configuration of DRMs for current encryption scheme. - * - * @return the drm value - */ - public CbcsDrmConfiguration drm() { - return this.drm; - } - - /** - * Set configuration of DRMs for current encryption scheme. - * - * @param drm the drm value to set - * @return the CommonEncryptionCbcs object itself. - */ - public CommonEncryptionCbcs withDrm(CbcsDrmConfiguration drm) { - this.drm = drm; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCenc.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCenc.java deleted file mode 100644 index 3b49a6313ef10..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CommonEncryptionCenc.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class for envelope encryption scheme. - */ -public class CommonEncryptionCenc { - /** - * Representing supported protocols. - */ - @JsonProperty(value = "enabledProtocols") - private EnabledProtocols enabledProtocols; - - /** - * Representing which tracks should not be encrypted. - */ - @JsonProperty(value = "clearTracks") - private List clearTracks; - - /** - * Representing default content key for each encryption scheme and separate - * content keys for specific tracks. - */ - @JsonProperty(value = "contentKeys") - private StreamingPolicyContentKeys contentKeys; - - /** - * Configuration of DRMs for CommonEncryptionCenc encryption scheme. - */ - @JsonProperty(value = "drm") - private CencDrmConfiguration drm; - - /** - * Get representing supported protocols. - * - * @return the enabledProtocols value - */ - public EnabledProtocols enabledProtocols() { - return this.enabledProtocols; - } - - /** - * Set representing supported protocols. - * - * @param enabledProtocols the enabledProtocols value to set - * @return the CommonEncryptionCenc object itself. - */ - public CommonEncryptionCenc withEnabledProtocols(EnabledProtocols enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - - /** - * Get representing which tracks should not be encrypted. - * - * @return the clearTracks value - */ - public List clearTracks() { - return this.clearTracks; - } - - /** - * Set representing which tracks should not be encrypted. - * - * @param clearTracks the clearTracks value to set - * @return the CommonEncryptionCenc object itself. - */ - public CommonEncryptionCenc withClearTracks(List clearTracks) { - this.clearTracks = clearTracks; - return this; - } - - /** - * Get representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @return the contentKeys value - */ - public StreamingPolicyContentKeys contentKeys() { - return this.contentKeys; - } - - /** - * Set representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @param contentKeys the contentKeys value to set - * @return the CommonEncryptionCenc object itself. - */ - public CommonEncryptionCenc withContentKeys(StreamingPolicyContentKeys contentKeys) { - this.contentKeys = contentKeys; - return this; - } - - /** - * Get configuration of DRMs for CommonEncryptionCenc encryption scheme. - * - * @return the drm value - */ - public CencDrmConfiguration drm() { - return this.drm; - } - - /** - * Set configuration of DRMs for CommonEncryptionCenc encryption scheme. - * - * @param drm the drm value to set - * @return the CommonEncryptionCenc object itself. - */ - public CommonEncryptionCenc withDrm(CencDrmConfiguration drm) { - this.drm = drm; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicies.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicies.java deleted file mode 100644 index 1248c41a02375..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicies.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.ContentKeyPoliciesInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing ContentKeyPolicies. - */ -public interface ContentKeyPolicies extends SupportsCreating, HasInner { - /** - * Get a Content Key Policy with secrets. - * Get a Content Key Policy including secret values. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); - - /** - * Get a Content Key Policy. - * Get the details of a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete a Content Key Policy. - * Deletes a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicy.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicy.java deleted file mode 100644 index 4a57d9ed4e7ba..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicy.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.ContentKeyPolicyInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import java.util.UUID; -import org.joda.time.DateTime; -import java.util.List; - -/** - * Type representing ContentKeyPolicy. - */ -public interface ContentKeyPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the options value. - */ - List options(); - - /** - * @return the policyId value. - */ - UUID policyId(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the ContentKeyPolicy definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOptions, DefinitionStages.WithCreate { - } - - /** - * Grouping of ContentKeyPolicy definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a ContentKeyPolicy definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the contentkeypolicy definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithOptions withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the contentkeypolicy definition allowing to specify Options. - */ - interface WithOptions { - /** - * Specifies options. - */ - WithCreate withOptions(List options); - } - - /** - * The stage of the contentkeypolicy definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithDescription { - } - } - /** - * The template for a ContentKeyPolicy update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithDescription { - } - - /** - * Grouping of ContentKeyPolicy update stages. - */ - interface UpdateStages { - /** - * The stage of the contentkeypolicy update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyClearKeyConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyClearKeyConfiguration.java deleted file mode 100644 index e74329c696891..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyClearKeyConfiguration.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a configuration for non-DRM keys. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration") -public class ContentKeyPolicyClearKeyConfiguration extends ContentKeyPolicyConfiguration { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyConfiguration.java deleted file mode 100644 index ddc7efe8fd4a5..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for Content Key Policy configuration. A derived class must be - * used to create a configuration. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("ContentKeyPolicyConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration", value = ContentKeyPolicyClearKeyConfiguration.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration", value = ContentKeyPolicyUnknownConfiguration.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration", value = ContentKeyPolicyWidevineConfiguration.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration", value = ContentKeyPolicyPlayReadyConfiguration.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration", value = ContentKeyPolicyFairPlayConfiguration.class) -}) -public class ContentKeyPolicyConfiguration { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayConfiguration.java deleted file mode 100644 index 4800221efa790..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayConfiguration.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a configuration for FairPlay licenses. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration") -public class ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { - /** - * The key that must be used as FairPlay ASk. - */ - @JsonProperty(value = "ask", required = true) - private byte[] ask; - - /** - * The password encrypting FairPlay certificate in PKCS 12 (pfx) format. - */ - @JsonProperty(value = "fairPlayPfxPassword", required = true) - private String fairPlayPfxPassword; - - /** - * The Base64 representation of FairPlay certificate in PKCS 12 (pfx) - * format (including private key). - */ - @JsonProperty(value = "fairPlayPfx", required = true) - private String fairPlayPfx; - - /** - * The rental and lease key type. Possible values include: 'Unknown', - * 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. - */ - @JsonProperty(value = "rentalAndLeaseKeyType", required = true) - private ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType; - - /** - * The rental duration. Must be greater than or equal to 0. - */ - @JsonProperty(value = "rentalDuration", required = true) - private long rentalDuration; - - /** - * Get the key that must be used as FairPlay ASk. - * - * @return the ask value - */ - public byte[] ask() { - return this.ask; - } - - /** - * Set the key that must be used as FairPlay ASk. - * - * @param ask the ask value to set - * @return the ContentKeyPolicyFairPlayConfiguration object itself. - */ - public ContentKeyPolicyFairPlayConfiguration withAsk(byte[] ask) { - this.ask = ask; - return this; - } - - /** - * Get the password encrypting FairPlay certificate in PKCS 12 (pfx) format. - * - * @return the fairPlayPfxPassword value - */ - public String fairPlayPfxPassword() { - return this.fairPlayPfxPassword; - } - - /** - * Set the password encrypting FairPlay certificate in PKCS 12 (pfx) format. - * - * @param fairPlayPfxPassword the fairPlayPfxPassword value to set - * @return the ContentKeyPolicyFairPlayConfiguration object itself. - */ - public ContentKeyPolicyFairPlayConfiguration withFairPlayPfxPassword(String fairPlayPfxPassword) { - this.fairPlayPfxPassword = fairPlayPfxPassword; - return this; - } - - /** - * Get the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). - * - * @return the fairPlayPfx value - */ - public String fairPlayPfx() { - return this.fairPlayPfx; - } - - /** - * Set the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). - * - * @param fairPlayPfx the fairPlayPfx value to set - * @return the ContentKeyPolicyFairPlayConfiguration object itself. - */ - public ContentKeyPolicyFairPlayConfiguration withFairPlayPfx(String fairPlayPfx) { - this.fairPlayPfx = fairPlayPfx; - return this; - } - - /** - * Get the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. - * - * @return the rentalAndLeaseKeyType value - */ - public ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType() { - return this.rentalAndLeaseKeyType; - } - - /** - * Set the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. - * - * @param rentalAndLeaseKeyType the rentalAndLeaseKeyType value to set - * @return the ContentKeyPolicyFairPlayConfiguration object itself. - */ - public ContentKeyPolicyFairPlayConfiguration withRentalAndLeaseKeyType(ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType) { - this.rentalAndLeaseKeyType = rentalAndLeaseKeyType; - return this; - } - - /** - * Get the rental duration. Must be greater than or equal to 0. - * - * @return the rentalDuration value - */ - public long rentalDuration() { - return this.rentalDuration; - } - - /** - * Set the rental duration. Must be greater than or equal to 0. - * - * @param rentalDuration the rentalDuration value to set - * @return the ContentKeyPolicyFairPlayConfiguration object itself. - */ - public ContentKeyPolicyFairPlayConfiguration withRentalDuration(long rentalDuration) { - this.rentalDuration = rentalDuration; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java deleted file mode 100644 index ddacb2c91e4b2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. - */ -public enum ContentKeyPolicyFairPlayRentalAndLeaseKeyType { - /** Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API version. */ - UNKNOWN("Unknown"), - - /** Key duration is not specified. */ - UNDEFINED("Undefined"), - - /** Content key can be persisted with an unlimited duration. */ - PERSISTENT_UNLIMITED("PersistentUnlimited"), - - /** Content key can be persisted and the valid duration is limited by the Rental Duration value. */ - PERSISTENT_LIMITED("PersistentLimited"); - - /** The actual serialized value for a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. */ - private String value; - - ContentKeyPolicyFairPlayRentalAndLeaseKeyType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. - * - * @param value the serialized value to parse. - * @return the parsed ContentKeyPolicyFairPlayRentalAndLeaseKeyType object, or null if unable to parse. - */ - @JsonCreator - public static ContentKeyPolicyFairPlayRentalAndLeaseKeyType fromString(String value) { - ContentKeyPolicyFairPlayRentalAndLeaseKeyType[] items = ContentKeyPolicyFairPlayRentalAndLeaseKeyType.values(); - for (ContentKeyPolicyFairPlayRentalAndLeaseKeyType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOpenRestriction.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOpenRestriction.java deleted file mode 100644 index 58df607b76dff..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOpenRestriction.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents an open restriction. License or key will be delivered on every - * request. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyOpenRestriction") -public class ContentKeyPolicyOpenRestriction extends ContentKeyPolicyRestriction { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOption.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOption.java deleted file mode 100644 index 0321b1b1885c6..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyOption.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents a policy option. - */ -public class ContentKeyPolicyOption { - /** - * The legacy Policy Option ID. - */ - @JsonProperty(value = "policyOptionId", access = JsonProperty.Access.WRITE_ONLY) - private UUID policyOptionId; - - /** - * The Policy Option description. - */ - @JsonProperty(value = "name") - private String name; - - /** - * The key delivery configuration. - */ - @JsonProperty(value = "configuration", required = true) - private ContentKeyPolicyConfiguration configuration; - - /** - * The requirements that must be met to deliver keys with this - * configuration. - */ - @JsonProperty(value = "restriction", required = true) - private ContentKeyPolicyRestriction restriction; - - /** - * Get the legacy Policy Option ID. - * - * @return the policyOptionId value - */ - public UUID policyOptionId() { - return this.policyOptionId; - } - - /** - * Get the Policy Option description. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the Policy Option description. - * - * @param name the name value to set - * @return the ContentKeyPolicyOption object itself. - */ - public ContentKeyPolicyOption withName(String name) { - this.name = name; - return this; - } - - /** - * Get the key delivery configuration. - * - * @return the configuration value - */ - public ContentKeyPolicyConfiguration configuration() { - return this.configuration; - } - - /** - * Set the key delivery configuration. - * - * @param configuration the configuration value to set - * @return the ContentKeyPolicyOption object itself. - */ - public ContentKeyPolicyOption withConfiguration(ContentKeyPolicyConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Get the requirements that must be met to deliver keys with this configuration. - * - * @return the restriction value - */ - public ContentKeyPolicyRestriction restriction() { - return this.restriction; - } - - /** - * Set the requirements that must be met to deliver keys with this configuration. - * - * @param restriction the restriction value to set - * @return the ContentKeyPolicyOption object itself. - */ - public ContentKeyPolicyOption withRestriction(ContentKeyPolicyRestriction restriction) { - this.restriction = restriction; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyConfiguration.java deleted file mode 100644 index 3e26049498a26..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyConfiguration.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a configuration for PlayReady licenses. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration") -public class ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicyConfiguration { - /** - * The PlayReady licenses. - */ - @JsonProperty(value = "licenses", required = true) - private List licenses; - - /** - * The custom response data. - */ - @JsonProperty(value = "responseCustomData") - private String responseCustomData; - - /** - * Get the PlayReady licenses. - * - * @return the licenses value - */ - public List licenses() { - return this.licenses; - } - - /** - * Set the PlayReady licenses. - * - * @param licenses the licenses value to set - * @return the ContentKeyPolicyPlayReadyConfiguration object itself. - */ - public ContentKeyPolicyPlayReadyConfiguration withLicenses(List licenses) { - this.licenses = licenses; - return this; - } - - /** - * Get the custom response data. - * - * @return the responseCustomData value - */ - public String responseCustomData() { - return this.responseCustomData; - } - - /** - * Set the custom response data. - * - * @param responseCustomData the responseCustomData value to set - * @return the ContentKeyPolicyPlayReadyConfiguration object itself. - */ - public ContentKeyPolicyPlayReadyConfiguration withResponseCustomData(String responseCustomData) { - this.responseCustomData = responseCustomData; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java deleted file mode 100644 index 9aa1dc8dc95f7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies that the content key ID is in the PlayReady header. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader") -public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader extends ContentKeyPolicyPlayReadyContentKeyLocation { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java deleted file mode 100644 index 4a138789585f1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies that the content key ID is specified in the PlayReady - * configuration. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier") -public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier extends ContentKeyPolicyPlayReadyContentKeyLocation { - /** - * The content key ID. - */ - @JsonProperty(value = "keyId", required = true) - private UUID keyId; - - /** - * Get the content key ID. - * - * @return the keyId value - */ - public UUID keyId() { - return this.keyId; - } - - /** - * Set the content key ID. - * - * @param keyId the keyId value to set - * @return the ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier object itself. - */ - public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier withKeyId(UUID keyId) { - this.keyId = keyId; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java deleted file mode 100644 index 763489a4595f8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentKeyLocation.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for content key ID location. A derived class must be used to - * represent the location. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("ContentKeyPolicyPlayReadyContentKeyLocation") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class) -}) -public class ContentKeyPolicyPlayReadyContentKeyLocation { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentType.java deleted file mode 100644 index 63f45f281364e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyContentType.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for ContentKeyPolicyPlayReadyContentType. - */ -public enum ContentKeyPolicyPlayReadyContentType { - /** Represents a ContentKeyPolicyPlayReadyContentType that is unavailable in current API version. */ - UNKNOWN("Unknown"), - - /** Unspecified content type. */ - UNSPECIFIED("Unspecified"), - - /** Ultraviolet download content type. */ - ULTRA_VIOLET_DOWNLOAD("UltraVioletDownload"), - - /** Ultraviolet streaming content type. */ - ULTRA_VIOLET_STREAMING("UltraVioletStreaming"); - - /** The actual serialized value for a ContentKeyPolicyPlayReadyContentType instance. */ - private String value; - - ContentKeyPolicyPlayReadyContentType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContentKeyPolicyPlayReadyContentType instance. - * - * @param value the serialized value to parse. - * @return the parsed ContentKeyPolicyPlayReadyContentType object, or null if unable to parse. - */ - @JsonCreator - public static ContentKeyPolicyPlayReadyContentType fromString(String value) { - ContentKeyPolicyPlayReadyContentType[] items = ContentKeyPolicyPlayReadyContentType.values(); - for (ContentKeyPolicyPlayReadyContentType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java deleted file mode 100644 index 28839f59f2858..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Configures the Explicit Analog Television Output Restriction control bits. - * For further details see the PlayReady Compliance Rules. - */ -public class ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { - /** - * Indicates whether this restriction is enforced on a Best Effort basis. - */ - @JsonProperty(value = "bestEffort", required = true) - private boolean bestEffort; - - /** - * Configures the restriction control bits. Must be between 0 and 3 - * inclusive. - */ - @JsonProperty(value = "configurationData", required = true) - private int configurationData; - - /** - * Get indicates whether this restriction is enforced on a Best Effort basis. - * - * @return the bestEffort value - */ - public boolean bestEffort() { - return this.bestEffort; - } - - /** - * Set indicates whether this restriction is enforced on a Best Effort basis. - * - * @param bestEffort the bestEffort value to set - * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. - */ - public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withBestEffort(boolean bestEffort) { - this.bestEffort = bestEffort; - return this; - } - - /** - * Get configures the restriction control bits. Must be between 0 and 3 inclusive. - * - * @return the configurationData value - */ - public int configurationData() { - return this.configurationData; - } - - /** - * Set configures the restriction control bits. Must be between 0 and 3 inclusive. - * - * @param configurationData the configurationData value to set - * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. - */ - public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withConfigurationData(int configurationData) { - this.configurationData = configurationData; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicense.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicense.java deleted file mode 100644 index ee1ae0fe37599..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicense.java +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.DateTime; -import org.joda.time.Period; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The PlayReady license. - */ -public class ContentKeyPolicyPlayReadyLicense { - /** - * A flag indicating whether test devices can use the license. - */ - @JsonProperty(value = "allowTestDevices", required = true) - private boolean allowTestDevices; - - /** - * The begin date of license. - */ - @JsonProperty(value = "beginDate") - private DateTime beginDate; - - /** - * The expiration date of license. - */ - @JsonProperty(value = "expirationDate") - private DateTime expirationDate; - - /** - * The relative begin date of license. - */ - @JsonProperty(value = "relativeBeginDate") - private Period relativeBeginDate; - - /** - * The relative expiration date of license. - */ - @JsonProperty(value = "relativeExpirationDate") - private Period relativeExpirationDate; - - /** - * The grace period of license. - */ - @JsonProperty(value = "gracePeriod") - private Period gracePeriod; - - /** - * The license PlayRight. - */ - @JsonProperty(value = "playRight") - private ContentKeyPolicyPlayReadyPlayRight playRight; - - /** - * The license type. Possible values include: 'Unknown', 'NonPersistent', - * 'Persistent'. - */ - @JsonProperty(value = "licenseType", required = true) - private ContentKeyPolicyPlayReadyLicenseType licenseType; - - /** - * The content key location. - */ - @JsonProperty(value = "contentKeyLocation", required = true) - private ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation; - - /** - * The PlayReady content type. Possible values include: 'Unknown', - * 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. - */ - @JsonProperty(value = "contentType", required = true) - private ContentKeyPolicyPlayReadyContentType contentType; - - /** - * Get a flag indicating whether test devices can use the license. - * - * @return the allowTestDevices value - */ - public boolean allowTestDevices() { - return this.allowTestDevices; - } - - /** - * Set a flag indicating whether test devices can use the license. - * - * @param allowTestDevices the allowTestDevices value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withAllowTestDevices(boolean allowTestDevices) { - this.allowTestDevices = allowTestDevices; - return this; - } - - /** - * Get the begin date of license. - * - * @return the beginDate value - */ - public DateTime beginDate() { - return this.beginDate; - } - - /** - * Set the begin date of license. - * - * @param beginDate the beginDate value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withBeginDate(DateTime beginDate) { - this.beginDate = beginDate; - return this; - } - - /** - * Get the expiration date of license. - * - * @return the expirationDate value - */ - public DateTime expirationDate() { - return this.expirationDate; - } - - /** - * Set the expiration date of license. - * - * @param expirationDate the expirationDate value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withExpirationDate(DateTime expirationDate) { - this.expirationDate = expirationDate; - return this; - } - - /** - * Get the relative begin date of license. - * - * @return the relativeBeginDate value - */ - public Period relativeBeginDate() { - return this.relativeBeginDate; - } - - /** - * Set the relative begin date of license. - * - * @param relativeBeginDate the relativeBeginDate value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withRelativeBeginDate(Period relativeBeginDate) { - this.relativeBeginDate = relativeBeginDate; - return this; - } - - /** - * Get the relative expiration date of license. - * - * @return the relativeExpirationDate value - */ - public Period relativeExpirationDate() { - return this.relativeExpirationDate; - } - - /** - * Set the relative expiration date of license. - * - * @param relativeExpirationDate the relativeExpirationDate value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withRelativeExpirationDate(Period relativeExpirationDate) { - this.relativeExpirationDate = relativeExpirationDate; - return this; - } - - /** - * Get the grace period of license. - * - * @return the gracePeriod value - */ - public Period gracePeriod() { - return this.gracePeriod; - } - - /** - * Set the grace period of license. - * - * @param gracePeriod the gracePeriod value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withGracePeriod(Period gracePeriod) { - this.gracePeriod = gracePeriod; - return this; - } - - /** - * Get the license PlayRight. - * - * @return the playRight value - */ - public ContentKeyPolicyPlayReadyPlayRight playRight() { - return this.playRight; - } - - /** - * Set the license PlayRight. - * - * @param playRight the playRight value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withPlayRight(ContentKeyPolicyPlayReadyPlayRight playRight) { - this.playRight = playRight; - return this; - } - - /** - * Get the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. - * - * @return the licenseType value - */ - public ContentKeyPolicyPlayReadyLicenseType licenseType() { - return this.licenseType; - } - - /** - * Set the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. - * - * @param licenseType the licenseType value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withLicenseType(ContentKeyPolicyPlayReadyLicenseType licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the content key location. - * - * @return the contentKeyLocation value - */ - public ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation() { - return this.contentKeyLocation; - } - - /** - * Set the content key location. - * - * @param contentKeyLocation the contentKeyLocation value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withContentKeyLocation(ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation) { - this.contentKeyLocation = contentKeyLocation; - return this; - } - - /** - * Get the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. - * - * @return the contentType value - */ - public ContentKeyPolicyPlayReadyContentType contentType() { - return this.contentType; - } - - /** - * Set the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. - * - * @param contentType the contentType value to set - * @return the ContentKeyPolicyPlayReadyLicense object itself. - */ - public ContentKeyPolicyPlayReadyLicense withContentType(ContentKeyPolicyPlayReadyContentType contentType) { - this.contentType = contentType; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicenseType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicenseType.java deleted file mode 100644 index 5145da0a77a71..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyLicenseType.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for ContentKeyPolicyPlayReadyLicenseType. - */ -public enum ContentKeyPolicyPlayReadyLicenseType { - /** Represents a ContentKeyPolicyPlayReadyLicenseType that is unavailable in current API version. */ - UNKNOWN("Unknown"), - - /** Non persistent license. */ - NON_PERSISTENT("NonPersistent"), - - /** Persistent license. Allows offline playback. */ - PERSISTENT("Persistent"); - - /** The actual serialized value for a ContentKeyPolicyPlayReadyLicenseType instance. */ - private String value; - - ContentKeyPolicyPlayReadyLicenseType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContentKeyPolicyPlayReadyLicenseType instance. - * - * @param value the serialized value to parse. - * @return the parsed ContentKeyPolicyPlayReadyLicenseType object, or null if unable to parse. - */ - @JsonCreator - public static ContentKeyPolicyPlayReadyLicenseType fromString(String value) { - ContentKeyPolicyPlayReadyLicenseType[] items = ContentKeyPolicyPlayReadyLicenseType.values(); - for (ContentKeyPolicyPlayReadyLicenseType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyPlayRight.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyPlayRight.java deleted file mode 100644 index 5a91abf8fe21a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyPlayRight.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.Period; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Configures the Play Right in the PlayReady license. - */ -public class ContentKeyPolicyPlayReadyPlayRight { - /** - * The amount of time that the license is valid after the license is first - * used to play content. - */ - @JsonProperty(value = "firstPlayExpiration") - private Period firstPlayExpiration; - - /** - * Configures the Serial Copy Management System (SCMS) in the license. Must - * be between 0 and 3 inclusive. - */ - @JsonProperty(value = "scmsRestriction") - private Integer scmsRestriction; - - /** - * Configures Automatic Gain Control (AGC) and Color Stripe in the license. - * Must be between 0 and 3 inclusive. - */ - @JsonProperty(value = "agcAndColorStripeRestriction") - private Integer agcAndColorStripeRestriction; - - /** - * Configures the Explicit Analog Television Output Restriction in the - * license. Configuration data must be between 0 and 3 inclusive. - */ - @JsonProperty(value = "explicitAnalogTelevisionOutputRestriction") - private ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction; - - /** - * Enables the Image Constraint For Analog Component Video Restriction in - * the license. - */ - @JsonProperty(value = "digitalVideoOnlyContentRestriction", required = true) - private boolean digitalVideoOnlyContentRestriction; - - /** - * Enables the Image Constraint For Analog Component Video Restriction in - * the license. - */ - @JsonProperty(value = "imageConstraintForAnalogComponentVideoRestriction", required = true) - private boolean imageConstraintForAnalogComponentVideoRestriction; - - /** - * Enables the Image Constraint For Analog Component Video Restriction in - * the license. - */ - @JsonProperty(value = "imageConstraintForAnalogComputerMonitorRestriction", required = true) - private boolean imageConstraintForAnalogComputerMonitorRestriction; - - /** - * Configures Unknown output handling settings of the license. Possible - * values include: 'Unknown', 'NotAllowed', 'Allowed', - * 'AllowedWithVideoConstriction'. - */ - @JsonProperty(value = "allowPassingVideoContentToUnknownOutput", required = true) - private ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput; - - /** - * Specifies the output protection level for uncompressed digital video. - */ - @JsonProperty(value = "uncompressedDigitalVideoOpl") - private Integer uncompressedDigitalVideoOpl; - - /** - * Specifies the output protection level for compressed digital video. - */ - @JsonProperty(value = "compressedDigitalVideoOpl") - private Integer compressedDigitalVideoOpl; - - /** - * Specifies the output protection level for compressed digital audio. - */ - @JsonProperty(value = "analogVideoOpl") - private Integer analogVideoOpl; - - /** - * Specifies the output protection level for compressed digital audio. - */ - @JsonProperty(value = "compressedDigitalAudioOpl") - private Integer compressedDigitalAudioOpl; - - /** - * Specifies the output protection level for uncompressed digital audio. - */ - @JsonProperty(value = "uncompressedDigitalAudioOpl") - private Integer uncompressedDigitalAudioOpl; - - /** - * Get the amount of time that the license is valid after the license is first used to play content. - * - * @return the firstPlayExpiration value - */ - public Period firstPlayExpiration() { - return this.firstPlayExpiration; - } - - /** - * Set the amount of time that the license is valid after the license is first used to play content. - * - * @param firstPlayExpiration the firstPlayExpiration value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withFirstPlayExpiration(Period firstPlayExpiration) { - this.firstPlayExpiration = firstPlayExpiration; - return this; - } - - /** - * Get configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. - * - * @return the scmsRestriction value - */ - public Integer scmsRestriction() { - return this.scmsRestriction; - } - - /** - * Set configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. - * - * @param scmsRestriction the scmsRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withScmsRestriction(Integer scmsRestriction) { - this.scmsRestriction = scmsRestriction; - return this; - } - - /** - * Get configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. - * - * @return the agcAndColorStripeRestriction value - */ - public Integer agcAndColorStripeRestriction() { - return this.agcAndColorStripeRestriction; - } - - /** - * Set configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. - * - * @param agcAndColorStripeRestriction the agcAndColorStripeRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withAgcAndColorStripeRestriction(Integer agcAndColorStripeRestriction) { - this.agcAndColorStripeRestriction = agcAndColorStripeRestriction; - return this; - } - - /** - * Get configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. - * - * @return the explicitAnalogTelevisionOutputRestriction value - */ - public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction() { - return this.explicitAnalogTelevisionOutputRestriction; - } - - /** - * Set configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. - * - * @param explicitAnalogTelevisionOutputRestriction the explicitAnalogTelevisionOutputRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withExplicitAnalogTelevisionOutputRestriction(ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction) { - this.explicitAnalogTelevisionOutputRestriction = explicitAnalogTelevisionOutputRestriction; - return this; - } - - /** - * Get enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @return the digitalVideoOnlyContentRestriction value - */ - public boolean digitalVideoOnlyContentRestriction() { - return this.digitalVideoOnlyContentRestriction; - } - - /** - * Set enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @param digitalVideoOnlyContentRestriction the digitalVideoOnlyContentRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withDigitalVideoOnlyContentRestriction(boolean digitalVideoOnlyContentRestriction) { - this.digitalVideoOnlyContentRestriction = digitalVideoOnlyContentRestriction; - return this; - } - - /** - * Get enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @return the imageConstraintForAnalogComponentVideoRestriction value - */ - public boolean imageConstraintForAnalogComponentVideoRestriction() { - return this.imageConstraintForAnalogComponentVideoRestriction; - } - - /** - * Set enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @param imageConstraintForAnalogComponentVideoRestriction the imageConstraintForAnalogComponentVideoRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComponentVideoRestriction(boolean imageConstraintForAnalogComponentVideoRestriction) { - this.imageConstraintForAnalogComponentVideoRestriction = imageConstraintForAnalogComponentVideoRestriction; - return this; - } - - /** - * Get enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @return the imageConstraintForAnalogComputerMonitorRestriction value - */ - public boolean imageConstraintForAnalogComputerMonitorRestriction() { - return this.imageConstraintForAnalogComputerMonitorRestriction; - } - - /** - * Set enables the Image Constraint For Analog Component Video Restriction in the license. - * - * @param imageConstraintForAnalogComputerMonitorRestriction the imageConstraintForAnalogComputerMonitorRestriction value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComputerMonitorRestriction(boolean imageConstraintForAnalogComputerMonitorRestriction) { - this.imageConstraintForAnalogComputerMonitorRestriction = imageConstraintForAnalogComputerMonitorRestriction; - return this; - } - - /** - * Get configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. - * - * @return the allowPassingVideoContentToUnknownOutput value - */ - public ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput() { - return this.allowPassingVideoContentToUnknownOutput; - } - - /** - * Set configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. - * - * @param allowPassingVideoContentToUnknownOutput the allowPassingVideoContentToUnknownOutput value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withAllowPassingVideoContentToUnknownOutput(ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput) { - this.allowPassingVideoContentToUnknownOutput = allowPassingVideoContentToUnknownOutput; - return this; - } - - /** - * Get specifies the output protection level for uncompressed digital video. - * - * @return the uncompressedDigitalVideoOpl value - */ - public Integer uncompressedDigitalVideoOpl() { - return this.uncompressedDigitalVideoOpl; - } - - /** - * Set specifies the output protection level for uncompressed digital video. - * - * @param uncompressedDigitalVideoOpl the uncompressedDigitalVideoOpl value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalVideoOpl(Integer uncompressedDigitalVideoOpl) { - this.uncompressedDigitalVideoOpl = uncompressedDigitalVideoOpl; - return this; - } - - /** - * Get specifies the output protection level for compressed digital video. - * - * @return the compressedDigitalVideoOpl value - */ - public Integer compressedDigitalVideoOpl() { - return this.compressedDigitalVideoOpl; - } - - /** - * Set specifies the output protection level for compressed digital video. - * - * @param compressedDigitalVideoOpl the compressedDigitalVideoOpl value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalVideoOpl(Integer compressedDigitalVideoOpl) { - this.compressedDigitalVideoOpl = compressedDigitalVideoOpl; - return this; - } - - /** - * Get specifies the output protection level for compressed digital audio. - * - * @return the analogVideoOpl value - */ - public Integer analogVideoOpl() { - return this.analogVideoOpl; - } - - /** - * Set specifies the output protection level for compressed digital audio. - * - * @param analogVideoOpl the analogVideoOpl value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withAnalogVideoOpl(Integer analogVideoOpl) { - this.analogVideoOpl = analogVideoOpl; - return this; - } - - /** - * Get specifies the output protection level for compressed digital audio. - * - * @return the compressedDigitalAudioOpl value - */ - public Integer compressedDigitalAudioOpl() { - return this.compressedDigitalAudioOpl; - } - - /** - * Set specifies the output protection level for compressed digital audio. - * - * @param compressedDigitalAudioOpl the compressedDigitalAudioOpl value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalAudioOpl(Integer compressedDigitalAudioOpl) { - this.compressedDigitalAudioOpl = compressedDigitalAudioOpl; - return this; - } - - /** - * Get specifies the output protection level for uncompressed digital audio. - * - * @return the uncompressedDigitalAudioOpl value - */ - public Integer uncompressedDigitalAudioOpl() { - return this.uncompressedDigitalAudioOpl; - } - - /** - * Set specifies the output protection level for uncompressed digital audio. - * - * @param uncompressedDigitalAudioOpl the uncompressedDigitalAudioOpl value to set - * @return the ContentKeyPolicyPlayReadyPlayRight object itself. - */ - public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalAudioOpl(Integer uncompressedDigitalAudioOpl) { - this.uncompressedDigitalAudioOpl = uncompressedDigitalAudioOpl; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java deleted file mode 100644 index 586e4206650b0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. - */ -public enum ContentKeyPolicyPlayReadyUnknownOutputPassingOption { - /** Represents a ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. */ - UNKNOWN("Unknown"), - - /** Passing the video portion of protected content to an Unknown Output is not allowed. */ - NOT_ALLOWED("NotAllowed"), - - /** Passing the video portion of protected content to an Unknown Output is allowed. */ - ALLOWED("Allowed"), - - /** Passing the video portion of protected content to an Unknown Output is allowed but with constrained resolution. */ - ALLOWED_WITH_VIDEO_CONSTRICTION("AllowedWithVideoConstriction"); - - /** The actual serialized value for a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. */ - private String value; - - ContentKeyPolicyPlayReadyUnknownOutputPassingOption(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. - * - * @param value the serialized value to parse. - * @return the parsed ContentKeyPolicyPlayReadyUnknownOutputPassingOption object, or null if unable to parse. - */ - @JsonCreator - public static ContentKeyPolicyPlayReadyUnknownOutputPassingOption fromString(String value) { - ContentKeyPolicyPlayReadyUnknownOutputPassingOption[] items = ContentKeyPolicyPlayReadyUnknownOutputPassingOption.values(); - for (ContentKeyPolicyPlayReadyUnknownOutputPassingOption item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyProperties.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyProperties.java deleted file mode 100644 index c44157c17f1ff..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.ContentKeyPolicyPropertiesInner; -import org.joda.time.DateTime; -import java.util.List; -import java.util.UUID; - -/** - * Type representing ContentKeyPolicyProperties. - */ -public interface ContentKeyPolicyProperties extends HasInner, HasManager { - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the options value. - */ - List options(); - - /** - * @return the policyId value. - */ - UUID policyId(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestriction.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestriction.java deleted file mode 100644 index 13429d25a2426..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestriction.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for Content Key Policy restrictions. A derived class must be used - * to create a restriction. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("ContentKeyPolicyRestriction") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyOpenRestriction", value = ContentKeyPolicyOpenRestriction.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction", value = ContentKeyPolicyUnknownRestriction.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyTokenRestriction", value = ContentKeyPolicyTokenRestriction.class) -}) -public class ContentKeyPolicyRestriction { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenKey.java deleted file mode 100644 index 2fdfdac686247..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenKey.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for Content Key Policy key for token validation. A derived class - * must be used to create a token key. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("ContentKeyPolicyRestrictionTokenKey") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey", value = ContentKeyPolicySymmetricTokenKey.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey", value = ContentKeyPolicyRsaTokenKey.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey", value = ContentKeyPolicyX509CertificateTokenKey.class) -}) -public class ContentKeyPolicyRestrictionTokenKey { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenType.java deleted file mode 100644 index 4bf5ae4cdda22..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRestrictionTokenType.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for ContentKeyPolicyRestrictionTokenType. - */ -public enum ContentKeyPolicyRestrictionTokenType { - /** Represents a ContentKeyPolicyRestrictionTokenType that is unavailable in current API version. */ - UNKNOWN("Unknown"), - - /** Simple Web Token. */ - SWT("Swt"), - - /** JSON Web Token. */ - JWT("Jwt"); - - /** The actual serialized value for a ContentKeyPolicyRestrictionTokenType instance. */ - private String value; - - ContentKeyPolicyRestrictionTokenType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContentKeyPolicyRestrictionTokenType instance. - * - * @param value the serialized value to parse. - * @return the parsed ContentKeyPolicyRestrictionTokenType object, or null if unable to parse. - */ - @JsonCreator - public static ContentKeyPolicyRestrictionTokenType fromString(String value) { - ContentKeyPolicyRestrictionTokenType[] items = ContentKeyPolicyRestrictionTokenType.values(); - for (ContentKeyPolicyRestrictionTokenType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRsaTokenKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRsaTokenKey.java deleted file mode 100644 index 38b78623c5b21..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyRsaTokenKey.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a RSA key for token validation. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyRsaTokenKey") -public class ContentKeyPolicyRsaTokenKey extends ContentKeyPolicyRestrictionTokenKey { - /** - * The RSA Parameter exponent. - */ - @JsonProperty(value = "exponent", required = true) - private byte[] exponent; - - /** - * The RSA Parameter modulus. - */ - @JsonProperty(value = "modulus", required = true) - private byte[] modulus; - - /** - * Get the RSA Parameter exponent. - * - * @return the exponent value - */ - public byte[] exponent() { - return this.exponent; - } - - /** - * Set the RSA Parameter exponent. - * - * @param exponent the exponent value to set - * @return the ContentKeyPolicyRsaTokenKey object itself. - */ - public ContentKeyPolicyRsaTokenKey withExponent(byte[] exponent) { - this.exponent = exponent; - return this; - } - - /** - * Get the RSA Parameter modulus. - * - * @return the modulus value - */ - public byte[] modulus() { - return this.modulus; - } - - /** - * Set the RSA Parameter modulus. - * - * @param modulus the modulus value to set - * @return the ContentKeyPolicyRsaTokenKey object itself. - */ - public ContentKeyPolicyRsaTokenKey withModulus(byte[] modulus) { - this.modulus = modulus; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicySymmetricTokenKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicySymmetricTokenKey.java deleted file mode 100644 index 23f149db981b3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicySymmetricTokenKey.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a symmetric key for token validation. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey") -public class ContentKeyPolicySymmetricTokenKey extends ContentKeyPolicyRestrictionTokenKey { - /** - * The key value of the key. - */ - @JsonProperty(value = "keyValue", required = true) - private byte[] keyValue; - - /** - * Get the key value of the key. - * - * @return the keyValue value - */ - public byte[] keyValue() { - return this.keyValue; - } - - /** - * Set the key value of the key. - * - * @param keyValue the keyValue value to set - * @return the ContentKeyPolicySymmetricTokenKey object itself. - */ - public ContentKeyPolicySymmetricTokenKey withKeyValue(byte[] keyValue) { - this.keyValue = keyValue; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenClaim.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenClaim.java deleted file mode 100644 index 112f12732d90c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenClaim.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents a token claim. - */ -public class ContentKeyPolicyTokenClaim { - /** - * Token claim type. - */ - @JsonProperty(value = "claimType") - private String claimType; - - /** - * Token claim value. - */ - @JsonProperty(value = "claimValue") - private String claimValue; - - /** - * Get token claim type. - * - * @return the claimType value - */ - public String claimType() { - return this.claimType; - } - - /** - * Set token claim type. - * - * @param claimType the claimType value to set - * @return the ContentKeyPolicyTokenClaim object itself. - */ - public ContentKeyPolicyTokenClaim withClaimType(String claimType) { - this.claimType = claimType; - return this; - } - - /** - * Get token claim value. - * - * @return the claimValue value - */ - public String claimValue() { - return this.claimValue; - } - - /** - * Set token claim value. - * - * @param claimValue the claimValue value to set - * @return the ContentKeyPolicyTokenClaim object itself. - */ - public ContentKeyPolicyTokenClaim withClaimValue(String claimValue) { - this.claimValue = claimValue; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenRestriction.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenRestriction.java deleted file mode 100644 index f93c33b1005a0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyTokenRestriction.java +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a token restriction. Provided token must match these requirements - * for successful license or key delivery. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyTokenRestriction") -public class ContentKeyPolicyTokenRestriction extends ContentKeyPolicyRestriction { - /** - * The token issuer. - */ - @JsonProperty(value = "issuer", required = true) - private String issuer; - - /** - * The audience for the token. - */ - @JsonProperty(value = "audience", required = true) - private String audience; - - /** - * The primary verification key. - */ - @JsonProperty(value = "primaryVerificationKey", required = true) - private ContentKeyPolicyRestrictionTokenKey primaryVerificationKey; - - /** - * A list of alternative verification keys. - */ - @JsonProperty(value = "alternateVerificationKeys") - private List alternateVerificationKeys; - - /** - * A list of required token claims. - */ - @JsonProperty(value = "requiredClaims") - private List requiredClaims; - - /** - * The type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. - */ - @JsonProperty(value = "restrictionTokenType", required = true) - private ContentKeyPolicyRestrictionTokenType restrictionTokenType; - - /** - * The OpenID connect discovery document. - */ - @JsonProperty(value = "openIdConnectDiscoveryDocument") - private String openIdConnectDiscoveryDocument; - - /** - * Get the token issuer. - * - * @return the issuer value - */ - public String issuer() { - return this.issuer; - } - - /** - * Set the token issuer. - * - * @param issuer the issuer value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withIssuer(String issuer) { - this.issuer = issuer; - return this; - } - - /** - * Get the audience for the token. - * - * @return the audience value - */ - public String audience() { - return this.audience; - } - - /** - * Set the audience for the token. - * - * @param audience the audience value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withAudience(String audience) { - this.audience = audience; - return this; - } - - /** - * Get the primary verification key. - * - * @return the primaryVerificationKey value - */ - public ContentKeyPolicyRestrictionTokenKey primaryVerificationKey() { - return this.primaryVerificationKey; - } - - /** - * Set the primary verification key. - * - * @param primaryVerificationKey the primaryVerificationKey value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withPrimaryVerificationKey(ContentKeyPolicyRestrictionTokenKey primaryVerificationKey) { - this.primaryVerificationKey = primaryVerificationKey; - return this; - } - - /** - * Get a list of alternative verification keys. - * - * @return the alternateVerificationKeys value - */ - public List alternateVerificationKeys() { - return this.alternateVerificationKeys; - } - - /** - * Set a list of alternative verification keys. - * - * @param alternateVerificationKeys the alternateVerificationKeys value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withAlternateVerificationKeys(List alternateVerificationKeys) { - this.alternateVerificationKeys = alternateVerificationKeys; - return this; - } - - /** - * Get a list of required token claims. - * - * @return the requiredClaims value - */ - public List requiredClaims() { - return this.requiredClaims; - } - - /** - * Set a list of required token claims. - * - * @param requiredClaims the requiredClaims value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withRequiredClaims(List requiredClaims) { - this.requiredClaims = requiredClaims; - return this; - } - - /** - * Get the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. - * - * @return the restrictionTokenType value - */ - public ContentKeyPolicyRestrictionTokenType restrictionTokenType() { - return this.restrictionTokenType; - } - - /** - * Set the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. - * - * @param restrictionTokenType the restrictionTokenType value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType restrictionTokenType) { - this.restrictionTokenType = restrictionTokenType; - return this; - } - - /** - * Get the OpenID connect discovery document. - * - * @return the openIdConnectDiscoveryDocument value - */ - public String openIdConnectDiscoveryDocument() { - return this.openIdConnectDiscoveryDocument; - } - - /** - * Set the OpenID connect discovery document. - * - * @param openIdConnectDiscoveryDocument the openIdConnectDiscoveryDocument value to set - * @return the ContentKeyPolicyTokenRestriction object itself. - */ - public ContentKeyPolicyTokenRestriction withOpenIdConnectDiscoveryDocument(String openIdConnectDiscoveryDocument) { - this.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownConfiguration.java deleted file mode 100644 index b84d6eff2b74b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownConfiguration.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a ContentKeyPolicyConfiguration that is unavailable in the - * current API version. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownConfiguration") -public class ContentKeyPolicyUnknownConfiguration extends ContentKeyPolicyConfiguration { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownRestriction.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownRestriction.java deleted file mode 100644 index 3662c0dd206bc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyUnknownRestriction.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a ContentKeyPolicyRestriction that is unavailable in the current - * API version. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownRestriction") -public class ContentKeyPolicyUnknownRestriction extends ContentKeyPolicyRestriction { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyWidevineConfiguration.java deleted file mode 100644 index a7c505ef90758..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyWidevineConfiguration.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a configuration for Widevine licenses. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration") -public class ContentKeyPolicyWidevineConfiguration extends ContentKeyPolicyConfiguration { - /** - * The Widevine template. - */ - @JsonProperty(value = "widevineTemplate", required = true) - private String widevineTemplate; - - /** - * Get the Widevine template. - * - * @return the widevineTemplate value - */ - public String widevineTemplate() { - return this.widevineTemplate; - } - - /** - * Set the Widevine template. - * - * @param widevineTemplate the widevineTemplate value to set - * @return the ContentKeyPolicyWidevineConfiguration object itself. - */ - public ContentKeyPolicyWidevineConfiguration withWidevineTemplate(String widevineTemplate) { - this.widevineTemplate = widevineTemplate; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyX509CertificateTokenKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyX509CertificateTokenKey.java deleted file mode 100644 index 080c12fff9f11..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ContentKeyPolicyX509CertificateTokenKey.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Specifies a certificate for token validation. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey") -public class ContentKeyPolicyX509CertificateTokenKey extends ContentKeyPolicyRestrictionTokenKey { - /** - * The raw data field of a certificate in PKCS 12 format (X509Certificate2 - * in .NET). - */ - @JsonProperty(value = "rawBody", required = true) - private byte[] rawBody; - - /** - * Get the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). - * - * @return the rawBody value - */ - public byte[] rawBody() { - return this.rawBody; - } - - /** - * Set the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). - * - * @param rawBody the rawBody value to set - * @return the ContentKeyPolicyX509CertificateTokenKey object itself. - */ - public ContentKeyPolicyX509CertificateTokenKey withRawBody(byte[] rawBody) { - this.rawBody = rawBody; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyAudio.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyAudio.java deleted file mode 100644 index cd870ff1bc3df..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyAudio.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * A codec flag, which tells the encoder to copy the input audio bitstream. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.CopyAudio") -public class CopyAudio extends Codec { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyVideo.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyVideo.java deleted file mode 100644 index 693fdec30d547..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CopyVideo.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * A codec flag, which tells the encoder to copy the input video bitstream - * without re-encoding. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.CopyVideo") -public class CopyVideo extends Codec { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CrossSiteAccessPolicies.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CrossSiteAccessPolicies.java deleted file mode 100644 index 542e6963a6d95..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/CrossSiteAccessPolicies.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The client access policy. - */ -public class CrossSiteAccessPolicies { - /** - * The content of clientaccesspolicy.xml used by Silverlight. - */ - @JsonProperty(value = "clientAccessPolicy") - private String clientAccessPolicy; - - /** - * The content of crossdomain.xml used by Silverlight. - */ - @JsonProperty(value = "crossDomainPolicy") - private String crossDomainPolicy; - - /** - * Get the content of clientaccesspolicy.xml used by Silverlight. - * - * @return the clientAccessPolicy value - */ - public String clientAccessPolicy() { - return this.clientAccessPolicy; - } - - /** - * Set the content of clientaccesspolicy.xml used by Silverlight. - * - * @param clientAccessPolicy the clientAccessPolicy value to set - * @return the CrossSiteAccessPolicies object itself. - */ - public CrossSiteAccessPolicies withClientAccessPolicy(String clientAccessPolicy) { - this.clientAccessPolicy = clientAccessPolicy; - return this; - } - - /** - * Get the content of crossdomain.xml used by Silverlight. - * - * @return the crossDomainPolicy value - */ - public String crossDomainPolicy() { - return this.crossDomainPolicy; - } - - /** - * Set the content of crossdomain.xml used by Silverlight. - * - * @param crossDomainPolicy the crossDomainPolicy value to set - * @return the CrossSiteAccessPolicies object itself. - */ - public CrossSiteAccessPolicies withCrossDomainPolicy(String crossDomainPolicy) { - this.crossDomainPolicy = crossDomainPolicy; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DefaultKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DefaultKey.java deleted file mode 100644 index 182165c141b3f..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DefaultKey.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify properties of default content key for each encryption - * scheme. - */ -public class DefaultKey { - /** - * Label can be used to specify Content Key when creating Stremaing - * Locator. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Policy used by Default Key. - */ - @JsonProperty(value = "policyName") - private String policyName; - - /** - * Get label can be used to specify Content Key when creating Stremaing Locator. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set label can be used to specify Content Key when creating Stremaing Locator. - * - * @param label the label value to set - * @return the DefaultKey object itself. - */ - public DefaultKey withLabel(String label) { - this.label = label; - return this; - } - - /** - * Get policy used by Default Key. - * - * @return the policyName value - */ - public String policyName() { - return this.policyName; - } - - /** - * Set policy used by Default Key. - * - * @param policyName the policyName value to set - * @return the DefaultKey object itself. - */ - public DefaultKey withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Deinterlace.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Deinterlace.java deleted file mode 100644 index 932d822734a3d..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Deinterlace.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes the de-interlacing settings. - */ -public class Deinterlace { - /** - * The field parity for de-interlacing, defaults to Auto. Possible values - * include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. - */ - @JsonProperty(value = "parity") - private DeinterlaceParity parity; - - /** - * The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values - * include: 'Off', 'AutoPixelAdaptive'. - */ - @JsonProperty(value = "mode") - private DeinterlaceMode mode; - - /** - * Get the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. - * - * @return the parity value - */ - public DeinterlaceParity parity() { - return this.parity; - } - - /** - * Set the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. - * - * @param parity the parity value to set - * @return the Deinterlace object itself. - */ - public Deinterlace withParity(DeinterlaceParity parity) { - this.parity = parity; - return this; - } - - /** - * Get the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. - * - * @return the mode value - */ - public DeinterlaceMode mode() { - return this.mode; - } - - /** - * Set the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. - * - * @param mode the mode value to set - * @return the Deinterlace object itself. - */ - public Deinterlace withMode(DeinterlaceMode mode) { - this.mode = mode; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceMode.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceMode.java deleted file mode 100644 index caba9f8813da8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceMode.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for DeinterlaceMode. - */ -public enum DeinterlaceMode { - /** Disables de-interlacing of the source video. */ - OFF("Off"), - - /** Apply automatic pixel adaptive de-interlacing on each frame in the input video. */ - AUTO_PIXEL_ADAPTIVE("AutoPixelAdaptive"); - - /** The actual serialized value for a DeinterlaceMode instance. */ - private String value; - - DeinterlaceMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DeinterlaceMode instance. - * - * @param value the serialized value to parse. - * @return the parsed DeinterlaceMode object, or null if unable to parse. - */ - @JsonCreator - public static DeinterlaceMode fromString(String value) { - DeinterlaceMode[] items = DeinterlaceMode.values(); - for (DeinterlaceMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceParity.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceParity.java deleted file mode 100644 index ea39a3320b4d7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/DeinterlaceParity.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for DeinterlaceParity. - */ -public enum DeinterlaceParity { - /** Automatically detect the order of fields. */ - AUTO("Auto"), - - /** Apply top field first processing of input video. */ - TOP_FIELD_FIRST("TopFieldFirst"), - - /** Apply bottom field first processing of input video. */ - BOTTOM_FIELD_FIRST("BottomFieldFirst"); - - /** The actual serialized value for a DeinterlaceParity instance. */ - private String value; - - DeinterlaceParity(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DeinterlaceParity instance. - * - * @param value the serialized value to parse. - * @return the parsed DeinterlaceParity object, or null if unable to parse. - */ - @JsonCreator - public static DeinterlaceParity fromString(String value) { - DeinterlaceParity[] items = DeinterlaceParity.values(); - for (DeinterlaceParity item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnabledProtocols.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnabledProtocols.java deleted file mode 100644 index 293eaa0a92950..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnabledProtocols.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify which protocols are enabled. - */ -public class EnabledProtocols { - /** - * Enable Download protocol or not. - */ - @JsonProperty(value = "download", required = true) - private boolean download; - - /** - * Enable Dash protocol or not. - */ - @JsonProperty(value = "dash", required = true) - private boolean dash; - - /** - * Enable Hls protocol or not. - */ - @JsonProperty(value = "hls", required = true) - private boolean hls; - - /** - * Enable SmoothStreaming protocol or not. - */ - @JsonProperty(value = "smoothStreaming", required = true) - private boolean smoothStreaming; - - /** - * Get enable Download protocol or not. - * - * @return the download value - */ - public boolean download() { - return this.download; - } - - /** - * Set enable Download protocol or not. - * - * @param download the download value to set - * @return the EnabledProtocols object itself. - */ - public EnabledProtocols withDownload(boolean download) { - this.download = download; - return this; - } - - /** - * Get enable Dash protocol or not. - * - * @return the dash value - */ - public boolean dash() { - return this.dash; - } - - /** - * Set enable Dash protocol or not. - * - * @param dash the dash value to set - * @return the EnabledProtocols object itself. - */ - public EnabledProtocols withDash(boolean dash) { - this.dash = dash; - return this; - } - - /** - * Get enable Hls protocol or not. - * - * @return the hls value - */ - public boolean hls() { - return this.hls; - } - - /** - * Set enable Hls protocol or not. - * - * @param hls the hls value to set - * @return the EnabledProtocols object itself. - */ - public EnabledProtocols withHls(boolean hls) { - this.hls = hls; - return this; - } - - /** - * Get enable SmoothStreaming protocol or not. - * - * @return the smoothStreaming value - */ - public boolean smoothStreaming() { - return this.smoothStreaming; - } - - /** - * Set enable SmoothStreaming protocol or not. - * - * @param smoothStreaming the smoothStreaming value to set - * @return the EnabledProtocols object itself. - */ - public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) { - this.smoothStreaming = smoothStreaming; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncoderNamedPreset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncoderNamedPreset.java deleted file mode 100644 index 300118bb186c6..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncoderNamedPreset.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for EncoderNamedPreset. - */ -public enum EncoderNamedPreset { - /** Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output will remain 720p at best, and will start at rates lower than 3 Mbps. The output will will have video and audio in separate MP4 files, which is optimal for adaptive streaming. */ - ADAPTIVE_STREAMING("AdaptiveStreaming"), - - /** Produces a single MP4 file containing only stereo audio encoded at 192 kbps. */ - AACGOOD_QUALITY_AUDIO("AACGoodQualityAudio"), - - /** Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. */ - H264MULTIPLE_BITRATE1080P("H264MultipleBitrate1080p"), - - /** Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 720p and goes down to 360p. */ - H264MULTIPLE_BITRATE720P("H264MultipleBitrate720p"), - - /** Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and stereo AAC audio. Resolution starts at 480p and goes down to 360p. */ - H264MULTIPLE_BITRATE_SD("H264MultipleBitrateSD"); - - /** The actual serialized value for a EncoderNamedPreset instance. */ - private String value; - - EncoderNamedPreset(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EncoderNamedPreset instance. - * - * @param value the serialized value to parse. - * @return the parsed EncoderNamedPreset object, or null if unable to parse. - */ - @JsonCreator - public static EncoderNamedPreset fromString(String value) { - EncoderNamedPreset[] items = EncoderNamedPreset.values(); - for (EncoderNamedPreset item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncryptionScheme.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncryptionScheme.java deleted file mode 100644 index a07464326bd53..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EncryptionScheme.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for EncryptionScheme. - */ -public enum EncryptionScheme { - /** NoEncryption scheme. */ - NO_ENCRYPTION("NoEncryption"), - - /** EnvelopeEncryption scheme. */ - ENVELOPE_ENCRYPTION("EnvelopeEncryption"), - - /** CommonEncryptionCenc scheme. */ - COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), - - /** CommonEncryptionCbcs scheme. */ - COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"); - - /** The actual serialized value for a EncryptionScheme instance. */ - private String value; - - EncryptionScheme(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EncryptionScheme instance. - * - * @param value the serialized value to parse. - * @return the parsed EncryptionScheme object, or null if unable to parse. - */ - @JsonCreator - public static EncryptionScheme fromString(String value) { - EncryptionScheme[] items = EncryptionScheme.values(); - for (EncryptionScheme item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntityNameAvailabilityCheckOutput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntityNameAvailabilityCheckOutput.java deleted file mode 100644 index 9f4a936a4dcdd..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntityNameAvailabilityCheckOutput.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.EntityNameAvailabilityCheckOutputInner; - -/** - * Type representing EntityNameAvailabilityCheckOutput. - */ -public interface EntityNameAvailabilityCheckOutput extends HasInner, HasManager { - /** - * @return the message value. - */ - String message(); - - /** - * @return the nameAvailable value. - */ - boolean nameAvailable(); - - /** - * @return the reason value. - */ - String reason(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntropyMode.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntropyMode.java deleted file mode 100644 index aec59a6cfd090..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EntropyMode.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for EntropyMode. - */ -public enum EntropyMode { - /** Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. */ - CABAC("Cabac"), - - /** Context Adaptive Variable Length Coder (CAVLC) entropy encoding. */ - CAVLC("Cavlc"); - - /** The actual serialized value for a EntropyMode instance. */ - private String value; - - EntropyMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EntropyMode instance. - * - * @param value the serialized value to parse. - * @return the parsed EntropyMode object, or null if unable to parse. - */ - @JsonCreator - public static EntropyMode fromString(String value) { - EntropyMode[] items = EntropyMode.values(); - for (EntropyMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnvelopeEncryption.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnvelopeEncryption.java deleted file mode 100644 index fbe6b1a0b5f06..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/EnvelopeEncryption.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class for EnvelopeEncryption encryption scheme. - */ -public class EnvelopeEncryption { - /** - * Representing supported protocols. - */ - @JsonProperty(value = "enabledProtocols") - private EnabledProtocols enabledProtocols; - - /** - * Representing which tracks should not be encrypted. - */ - @JsonProperty(value = "clearTracks") - private List clearTracks; - - /** - * Representing default content key for each encryption scheme and separate - * content keys for specific tracks. - */ - @JsonProperty(value = "contentKeys") - private StreamingPolicyContentKeys contentKeys; - - /** - * LicenseAcquistionUrlTemplate is used to point to user speicified service - * to delivery content keys. - */ - @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") - private String customLicenseAcquisitionUrlTemplate; - - /** - * Get representing supported protocols. - * - * @return the enabledProtocols value - */ - public EnabledProtocols enabledProtocols() { - return this.enabledProtocols; - } - - /** - * Set representing supported protocols. - * - * @param enabledProtocols the enabledProtocols value to set - * @return the EnvelopeEncryption object itself. - */ - public EnvelopeEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - - /** - * Get representing which tracks should not be encrypted. - * - * @return the clearTracks value - */ - public List clearTracks() { - return this.clearTracks; - } - - /** - * Set representing which tracks should not be encrypted. - * - * @param clearTracks the clearTracks value to set - * @return the EnvelopeEncryption object itself. - */ - public EnvelopeEncryption withClearTracks(List clearTracks) { - this.clearTracks = clearTracks; - return this; - } - - /** - * Get representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @return the contentKeys value - */ - public StreamingPolicyContentKeys contentKeys() { - return this.contentKeys; - } - - /** - * Set representing default content key for each encryption scheme and separate content keys for specific tracks. - * - * @param contentKeys the contentKeys value to set - * @return the EnvelopeEncryption object itself. - */ - public EnvelopeEncryption withContentKeys(StreamingPolicyContentKeys contentKeys) { - this.contentKeys = contentKeys; - return this; - } - - /** - * Get licenseAcquistionUrlTemplate is used to point to user speicified service to delivery content keys. - * - * @return the customLicenseAcquisitionUrlTemplate value - */ - public String customLicenseAcquisitionUrlTemplate() { - return this.customLicenseAcquisitionUrlTemplate; - } - - /** - * Set licenseAcquistionUrlTemplate is used to point to user speicified service to delivery content keys. - * - * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set - * @return the EnvelopeEncryption object itself. - */ - public EnvelopeEncryption withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { - this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Filters.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Filters.java deleted file mode 100644 index d197c34bd59b0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Filters.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes all the filtering operations, such as de-interlacing, rotation - * etc. that are to be applied to the input media before encoding. - */ -public class Filters { - /** - * The de-interlacing settings. - */ - @JsonProperty(value = "deinterlace") - private Deinterlace deinterlace; - - /** - * The rotation, if any, to be applied to the input video, before it is - * encoded. Default is Auto. Possible values include: 'Auto', 'None', - * 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. - */ - @JsonProperty(value = "rotation") - private Rotation rotation; - - /** - * The parameters for the rectangular window with which to crop the input - * video. - */ - @JsonProperty(value = "crop") - private Rectangle crop; - - /** - * The properties of overlays to be applied to the input video. These could - * be audio, image or video overlays. - */ - @JsonProperty(value = "overlays") - private List overlays; - - /** - * Get the de-interlacing settings. - * - * @return the deinterlace value - */ - public Deinterlace deinterlace() { - return this.deinterlace; - } - - /** - * Set the de-interlacing settings. - * - * @param deinterlace the deinterlace value to set - * @return the Filters object itself. - */ - public Filters withDeinterlace(Deinterlace deinterlace) { - this.deinterlace = deinterlace; - return this; - } - - /** - * Get the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. - * - * @return the rotation value - */ - public Rotation rotation() { - return this.rotation; - } - - /** - * Set the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. - * - * @param rotation the rotation value to set - * @return the Filters object itself. - */ - public Filters withRotation(Rotation rotation) { - this.rotation = rotation; - return this; - } - - /** - * Get the parameters for the rectangular window with which to crop the input video. - * - * @return the crop value - */ - public Rectangle crop() { - return this.crop; - } - - /** - * Set the parameters for the rectangular window with which to crop the input video. - * - * @param crop the crop value to set - * @return the Filters object itself. - */ - public Filters withCrop(Rectangle crop) { - this.crop = crop; - return this; - } - - /** - * Get the properties of overlays to be applied to the input video. These could be audio, image or video overlays. - * - * @return the overlays value - */ - public List overlays() { - return this.overlays; - } - - /** - * Set the properties of overlays to be applied to the input video. These could be audio, image or video overlays. - * - * @param overlays the overlays value to set - * @return the Filters object itself. - */ - public Filters withOverlays(List overlays) { - this.overlays = overlays; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Format.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Format.java deleted file mode 100644 index 6b75efbab8138..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Format.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for output. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("Format") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) -}) -public class Format { - /** - * The pattern of the file names for the generated output files. The - * following macros are supported in the file name: {Basename} - The base - * name of the input video {Extension} - The appropriate extension for this - * format. {Label} - The label assigned to the codec/layer. {Index} - A - * unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - - * The audio/video bitrate. Not applicable to thumbnails. {Codec} - The - * type of the audio/video codec. Any unsubstituted macros will be - * collapsed and removed from the filename. - */ - @JsonProperty(value = "filenamePattern") - private String filenamePattern; - - /** - * Get the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. - * - * @return the filenamePattern value - */ - public String filenamePattern() { - return this.filenamePattern; - } - - /** - * Set the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. - * - * @param filenamePattern the filenamePattern value to set - * @return the Format object itself. - */ - public Format withFilenamePattern(String filenamePattern) { - this.filenamePattern = filenamePattern; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Complexity.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Complexity.java deleted file mode 100644 index a9e8a59eac2ed..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Complexity.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for H264Complexity. - */ -public enum H264Complexity { - /** Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to decrease encoding time. */ - SPEED("Speed"), - - /** Tells the encoder to use settings that achieve a balance between speed and quality. */ - BALANCED("Balanced"), - - /** Tells the encoder to use settings that are optimized to produce higher quality output at the expense of slower overall encode time. */ - QUALITY("Quality"); - - /** The actual serialized value for a H264Complexity instance. */ - private String value; - - H264Complexity(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a H264Complexity instance. - * - * @param value the serialized value to parse. - * @return the parsed H264Complexity object, or null if unable to parse. - */ - @JsonCreator - public static H264Complexity fromString(String value) { - H264Complexity[] items = H264Complexity.values(); - for (H264Complexity item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Layer.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Layer.java deleted file mode 100644 index ede9242fe56b1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Layer.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.Period; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the settings to be used when encoding the input video into a - * desired output bitrate layer with the H.264 video codec. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.H264Layer") -public class H264Layer extends VideoLayer { - /** - * Which profile of the H.264 standard should be used when encoding this - * layer. Default is Auto. Possible values include: 'Auto', 'Baseline', - * 'Main', 'High', 'High422', 'High444'. - */ - @JsonProperty(value = "profile") - private H264VideoProfile profile; - - /** - * Which level of the H.264 standard should be used when encoding this - * layer. The value can be Auto, or a number that matches the H.264 - * profile. If not specified, the default is Auto, which lets the encoder - * choose the Level that is appropriate for this layer. - */ - @JsonProperty(value = "level") - private String level; - - /** - * The VBV buffer window length. The value should be in ISO 8601 format. - * The value should be in the range [0.1-100] seconds. The default is 5 - * seconds (for example, PT5S). - */ - @JsonProperty(value = "bufferWindow") - private Period bufferWindow; - - /** - * The number of reference frames to be used when encoding this layer. If - * not specified, the encoder determines an appropriate number based on the - * encoder complexity setting. - */ - @JsonProperty(value = "referenceFrames") - private Integer referenceFrames; - - /** - * The entropy mode to be used for this layer. If not specified, the - * encoder chooses the mode that is appropriate for the profile and level. - * Possible values include: 'Cabac', 'Cavlc'. - */ - @JsonProperty(value = "entropyMode") - private EntropyMode entropyMode; - - /** - * Get which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. - * - * @return the profile value - */ - public H264VideoProfile profile() { - return this.profile; - } - - /** - * Set which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. - * - * @param profile the profile value to set - * @return the H264Layer object itself. - */ - public H264Layer withProfile(H264VideoProfile profile) { - this.profile = profile; - return this; - } - - /** - * Get which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. - * - * @return the level value - */ - public String level() { - return this.level; - } - - /** - * Set which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. - * - * @param level the level value to set - * @return the H264Layer object itself. - */ - public H264Layer withLevel(String level) { - this.level = level; - return this; - } - - /** - * Get the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - * - * @return the bufferWindow value - */ - public Period bufferWindow() { - return this.bufferWindow; - } - - /** - * Set the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - * - * @param bufferWindow the bufferWindow value to set - * @return the H264Layer object itself. - */ - public H264Layer withBufferWindow(Period bufferWindow) { - this.bufferWindow = bufferWindow; - return this; - } - - /** - * Get the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. - * - * @return the referenceFrames value - */ - public Integer referenceFrames() { - return this.referenceFrames; - } - - /** - * Set the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. - * - * @param referenceFrames the referenceFrames value to set - * @return the H264Layer object itself. - */ - public H264Layer withReferenceFrames(Integer referenceFrames) { - this.referenceFrames = referenceFrames; - return this; - } - - /** - * Get the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. - * - * @return the entropyMode value - */ - public EntropyMode entropyMode() { - return this.entropyMode; - } - - /** - * Set the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. - * - * @param entropyMode the entropyMode value to set - * @return the H264Layer object itself. - */ - public H264Layer withEntropyMode(EntropyMode entropyMode) { - this.entropyMode = entropyMode; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Video.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Video.java deleted file mode 100644 index 1092925b9f8f8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264Video.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes all the properties for encoding a video with the H.264 codec. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.H264Video") -public class H264Video extends Video { - /** - * Whether or not the encoder should insert key frames at scene changes. If - * not specified, the default is false. This flag should be set to true - * only when the encoder is being configured to produce a single output - * video. - */ - @JsonProperty(value = "sceneChangeDetection") - private Boolean sceneChangeDetection; - - /** - * Tells the encoder how to choose its encoding settings. The default value - * is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. - */ - @JsonProperty(value = "complexity") - private H264Complexity complexity; - - /** - * The collection of output H.264 layers to be produced by the encoder. - */ - @JsonProperty(value = "layers") - private List layers; - - /** - * Get whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. - * - * @return the sceneChangeDetection value - */ - public Boolean sceneChangeDetection() { - return this.sceneChangeDetection; - } - - /** - * Set whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. - * - * @param sceneChangeDetection the sceneChangeDetection value to set - * @return the H264Video object itself. - */ - public H264Video withSceneChangeDetection(Boolean sceneChangeDetection) { - this.sceneChangeDetection = sceneChangeDetection; - return this; - } - - /** - * Get tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. - * - * @return the complexity value - */ - public H264Complexity complexity() { - return this.complexity; - } - - /** - * Set tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. - * - * @param complexity the complexity value to set - * @return the H264Video object itself. - */ - public H264Video withComplexity(H264Complexity complexity) { - this.complexity = complexity; - return this; - } - - /** - * Get the collection of output H.264 layers to be produced by the encoder. - * - * @return the layers value - */ - public List layers() { - return this.layers; - } - - /** - * Set the collection of output H.264 layers to be produced by the encoder. - * - * @param layers the layers value to set - * @return the H264Video object itself. - */ - public H264Video withLayers(List layers) { - this.layers = layers; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264VideoProfile.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264VideoProfile.java deleted file mode 100644 index fe683f577ecee..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/H264VideoProfile.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for H264VideoProfile. - */ -public enum H264VideoProfile { - /** Tells the encoder to automatically determine the appropriate H.264 profile. */ - AUTO("Auto"), - - /** Baseline profile. */ - BASELINE("Baseline"), - - /** Main profile. */ - MAIN("Main"), - - /** High profile. */ - HIGH("High"), - - /** High 4:2:2 profile. */ - HIGH422("High422"), - - /** High 4:4:4 predictive profile. */ - HIGH444("High444"); - - /** The actual serialized value for a H264VideoProfile instance. */ - private String value; - - H264VideoProfile(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a H264VideoProfile instance. - * - * @param value the serialized value to parse. - * @return the parsed H264VideoProfile object, or null if unable to parse. - */ - @JsonCreator - public static H264VideoProfile fromString(String value) { - H264VideoProfile[] items = H264VideoProfile.values(); - for (H264VideoProfile item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Hls.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Hls.java deleted file mode 100644 index e2e75e7fdb5db..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Hls.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The HLS configuration. - */ -public class Hls { - /** - * The amount of fragments per HTTP Live Streaming (HLS) segment. - */ - @JsonProperty(value = "fragmentsPerTsSegment") - private Integer fragmentsPerTsSegment; - - /** - * Get the amount of fragments per HTTP Live Streaming (HLS) segment. - * - * @return the fragmentsPerTsSegment value - */ - public Integer fragmentsPerTsSegment() { - return this.fragmentsPerTsSegment; - } - - /** - * Set the amount of fragments per HTTP Live Streaming (HLS) segment. - * - * @param fragmentsPerTsSegment the fragmentsPerTsSegment value to set - * @return the Hls object itself. - */ - public Hls withFragmentsPerTsSegment(Integer fragmentsPerTsSegment) { - this.fragmentsPerTsSegment = fragmentsPerTsSegment; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPAccessControl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPAccessControl.java deleted file mode 100644 index e9a19be0c4a3b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPAccessControl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The IP access control. - */ -public class IPAccessControl { - /** - * The IP allow list. - */ - @JsonProperty(value = "allow") - private List allow; - - /** - * Get the IP allow list. - * - * @return the allow value - */ - public List allow() { - return this.allow; - } - - /** - * Set the IP allow list. - * - * @param allow the allow value to set - * @return the IPAccessControl object itself. - */ - public IPAccessControl withAllow(List allow) { - this.allow = allow; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPRange.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPRange.java deleted file mode 100644 index 8cc4dbc7e55ca..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/IPRange.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The IP address range in the CIDR scheme. - */ -public class IPRange { - /** - * The friendly name for the IP address range. - */ - @JsonProperty(value = "name") - private String name; - - /** - * The IP address. - */ - @JsonProperty(value = "address") - private String address; - - /** - * The subnet mask prefix length (see CIDR notation). - */ - @JsonProperty(value = "subnetPrefixLength") - private Integer subnetPrefixLength; - - /** - * Get the friendly name for the IP address range. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the friendly name for the IP address range. - * - * @param name the name value to set - * @return the IPRange object itself. - */ - public IPRange withName(String name) { - this.name = name; - return this; - } - - /** - * Get the IP address. - * - * @return the address value - */ - public String address() { - return this.address; - } - - /** - * Set the IP address. - * - * @param address the address value to set - * @return the IPRange object itself. - */ - public IPRange withAddress(String address) { - this.address = address; - return this; - } - - /** - * Get the subnet mask prefix length (see CIDR notation). - * - * @return the subnetPrefixLength value - */ - public Integer subnetPrefixLength() { - return this.subnetPrefixLength; - } - - /** - * Set the subnet mask prefix length (see CIDR notation). - * - * @param subnetPrefixLength the subnetPrefixLength value to set - * @return the IPRange object itself. - */ - public IPRange withSubnetPrefixLength(Integer subnetPrefixLength) { - this.subnetPrefixLength = subnetPrefixLength; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Image.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Image.java deleted file mode 100644 index d4cfe1a6b1f7a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Image.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the basic properties for generating thumbnails from the input - * video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.Image") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.JpgImage", value = JpgImage.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.PngImage", value = PngImage.class) -}) -public class Image extends Video { - /** - * The position in the input video from where to start generating - * thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: - * PT05S), or a frame count (For example, 10 for the 10th frame), or a - * relative value (For example, 1%). Also supports a macro {Best}, which - * tells the encoder to select the best thumbnail from the first few - * seconds of the video. - */ - @JsonProperty(value = "start") - private String start; - - /** - * The intervals at which thumbnails are generated. The value can be in - * absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), - * or a frame count (For example, 30 for every 30 frames), or a relative - * value (For example, 1%). - */ - @JsonProperty(value = "step") - private String step; - - /** - * The position in the input video at which to stop generating thumbnails. - * The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop - * at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop - * at the 300th frame), or a relative value (For example, 100%). - */ - @JsonProperty(value = "range") - private String range; - - /** - * Get the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. - * - * @return the start value - */ - public String start() { - return this.start; - } - - /** - * Set the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. - * - * @param start the start value to set - * @return the Image object itself. - */ - public Image withStart(String start) { - this.start = start; - return this; - } - - /** - * Get the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). - * - * @return the step value - */ - public String step() { - return this.step; - } - - /** - * Set the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). - * - * @param step the step value to set - * @return the Image object itself. - */ - public Image withStep(String step) { - this.step = step; - return this; - } - - /** - * Get the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). - * - * @return the range value - */ - public String range() { - return this.range; - } - - /** - * Set the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). - * - * @param range the range value to set - * @return the Image object itself. - */ - public Image withRange(String range) { - this.range = range; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ImageFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ImageFormat.java deleted file mode 100644 index 279e845a2962e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ImageFormat.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the properties for an output image file. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.ImageFormat") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class) -}) -public class ImageFormat extends Format { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Job.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Job.java deleted file mode 100644 index fd596e771e56b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Job.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.JobInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import org.joda.time.DateTime; -import java.util.List; - -/** - * Type representing Job. - */ -public interface Job extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the input value. - */ - JobInput input(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the outputs value. - */ - List outputs(); - - /** - * @return the priority value. - */ - Priority priority(); - - /** - * @return the state value. - */ - JobState state(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the Job definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTransform, DefinitionStages.WithInput, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { - } - - /** - * Grouping of Job definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a Job definition. - */ - interface Blank extends WithTransform { - } - - /** - * The stage of the job definition allowing to specify Transform. - */ - interface WithTransform { - /** - * Specifies resourceGroupName, accountName, transformName. - */ - WithInput withExistingTransform(String resourceGroupName, String accountName, String transformName); - } - - /** - * The stage of the job definition allowing to specify Input. - */ - interface WithInput { - /** - * Specifies input. - */ - WithOutputs withInput(JobInput input); - } - - /** - * The stage of the job definition allowing to specify Outputs. - */ - interface WithOutputs { - /** - * Specifies outputs. - */ - WithCreate withOutputs(List outputs); - } - - /** - * The stage of the job definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the job definition allowing to specify Priority. - */ - interface WithPriority { - /** - * Specifies priority. - */ - WithCreate withPriority(Priority priority); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithPriority { - } - } - /** - * The template for a Job update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithPriority { - } - - /** - * Grouping of Job update stages. - */ - interface UpdateStages { - /** - * The stage of the job update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - /** - * The stage of the job update allowing to specify Priority. - */ - interface WithPriority { - /** - * Specifies priority. - */ - Update withPriority(Priority priority); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobError.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobError.java deleted file mode 100644 index 3768f8cd6c6ba..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobError.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Details of JobOutput errors. - */ -public class JobError { - /** - * Error code describing the error. Possible values include: - * 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', - * 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', - * 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private JobErrorCode code; - - /** - * A human-readable language-dependent representation of the error. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * Helps with categorization of errors. Possible values include: 'Service', - * 'Download', 'Upload', 'Configuration', 'Content'. - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private JobErrorCategory category; - - /** - * Indicates that it may be possible to retry the Job. If retry is - * unsuccessful, please contact Azure support via Azure Portal. Possible - * values include: 'DoNotRetry', 'MayRetry'. - */ - @JsonProperty(value = "retry", access = JsonProperty.Access.WRITE_ONLY) - private JobRetry retry; - - /** - * An array of details about specific errors that led to this reported - * error. - */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) - private List details; - - /** - * Get error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. - * - * @return the code value - */ - public JobErrorCode code() { - return this.code; - } - - /** - * Get a human-readable language-dependent representation of the error. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Get helps with categorization of errors. Possible values include: 'Service', 'Download', 'Upload', 'Configuration', 'Content'. - * - * @return the category value - */ - public JobErrorCategory category() { - return this.category; - } - - /** - * Get indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry'. - * - * @return the retry value - */ - public JobRetry retry() { - return this.retry; - } - - /** - * Get an array of details about specific errors that led to this reported error. - * - * @return the details value - */ - public List details() { - return this.details; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCategory.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCategory.java deleted file mode 100644 index 90b499554780c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCategory.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for JobErrorCategory. - */ -public enum JobErrorCategory { - /** The error is service related. */ - SERVICE("Service"), - - /** The error is download related. */ - DOWNLOAD("Download"), - - /** The error is upload related. */ - UPLOAD("Upload"), - - /** The error is configuration related. */ - CONFIGURATION("Configuration"), - - /** The error is related to data in the input files. */ - CONTENT("Content"); - - /** The actual serialized value for a JobErrorCategory instance. */ - private String value; - - JobErrorCategory(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobErrorCategory instance. - * - * @param value the serialized value to parse. - * @return the parsed JobErrorCategory object, or null if unable to parse. - */ - @JsonCreator - public static JobErrorCategory fromString(String value) { - JobErrorCategory[] items = JobErrorCategory.values(); - for (JobErrorCategory item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCode.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCode.java deleted file mode 100644 index 5c109b6622491..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorCode.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for JobErrorCode. - */ -public enum JobErrorCode { - /** Fatal service error, please contact support. */ - SERVICE_ERROR("ServiceError"), - - /** Transient error, please retry, if retry is unsuccessful, please contact support. */ - SERVICE_TRANSIENT_ERROR("ServiceTransientError"), - - /** While trying to download the input files, the files were not accessible, please check the availability of the source. */ - DOWNLOAD_NOT_ACCESSIBLE("DownloadNotAccessible"), - - /** While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. */ - DOWNLOAD_TRANSIENT_ERROR("DownloadTransientError"), - - /** While trying to upload the output files, the destination was not reachable, please check the availability of the destination. */ - UPLOAD_NOT_ACCESSIBLE("UploadNotAccessible"), - - /** While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. */ - UPLOAD_TRANSIENT_ERROR("UploadTransientError"), - - /** There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. */ - CONFIGURATION_UNSUPPORTED("ConfigurationUnsupported"), - - /** There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. */ - CONTENT_MALFORMED("ContentMalformed"), - - /** There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. */ - CONTENT_UNSUPPORTED("ContentUnsupported"); - - /** The actual serialized value for a JobErrorCode instance. */ - private String value; - - JobErrorCode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobErrorCode instance. - * - * @param value the serialized value to parse. - * @return the parsed JobErrorCode object, or null if unable to parse. - */ - @JsonCreator - public static JobErrorCode fromString(String value) { - JobErrorCode[] items = JobErrorCode.values(); - for (JobErrorCode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorDetail.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorDetail.java deleted file mode 100644 index 985a26c0e5dfb..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobErrorDetail.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Details of JobOutput errors. - */ -public class JobErrorDetail { - /** - * Code describing the error detail. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /** - * A human-readable representation of the error. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * Get code describing the error detail. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Get a human-readable representation of the error. - * - * @return the message value - */ - public String message() { - return this.message; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInput.java deleted file mode 100644 index 972947e72e2dc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInput.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base class for inputs to a Job. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("JobInput") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputClip", value = JobInputClip.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputs", value = JobInputs.class) -}) -public class JobInput { - /** - * A label that is assigned to a JobInput, that is used to satisfy a - * reference used in the Transform. For example, a Transform can be - * authored so as to take an image file with the label 'xyz' and apply it - * as an overlay onto the input video before it is encoded. When submitting - * a Job, exactly one of the JobInputs should be the image file, and it - * should have the label 'xyz'. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Get a label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set a label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. - * - * @param label the label value to set - * @return the JobInput object itself. - */ - public JobInput withLabel(String label) { - this.label = label; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputAsset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputAsset.java deleted file mode 100644 index 27c69e7d8c151..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputAsset.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents an Asset for input into a Job. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JobInputAsset") -public class JobInputAsset extends JobInputClip { - /** - * The name of the input Asset. - */ - @JsonProperty(value = "assetName", required = true) - private String assetName; - - /** - * Get the name of the input Asset. - * - * @return the assetName value - */ - public String assetName() { - return this.assetName; - } - - /** - * Set the name of the input Asset. - * - * @param assetName the assetName value to set - * @return the JobInputAsset object itself. - */ - public JobInputAsset withAssetName(String assetName) { - this.assetName = assetName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputClip.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputClip.java deleted file mode 100644 index c01195f49092a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputClip.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Represents input files for a Job. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JobInputClip") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputAsset", value = JobInputAsset.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputHttp", value = JobInputHttp.class) -}) -public class JobInputClip extends JobInput { - /** - * List of files. Required for JobInputHttp. - */ - @JsonProperty(value = "files") - private List files; - - /** - * Get list of files. Required for JobInputHttp. - * - * @return the files value - */ - public List files() { - return this.files; - } - - /** - * Set list of files. Required for JobInputHttp. - * - * @param files the files value to set - * @return the JobInputClip object itself. - */ - public JobInputClip withFiles(List files) { - this.files = files; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputHttp.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputHttp.java deleted file mode 100644 index a974c10d92148..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputHttp.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents HTTPS job input. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JobInputHttp") -public class JobInputHttp extends JobInputClip { - /** - * Base URI for HTTPS job input. It will be concatenated with provided file - * names. If no base uri is given, then the provided file list is assumed - * to be fully qualified uris. - */ - @JsonProperty(value = "baseUri") - private String baseUri; - - /** - * Get base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. - * - * @return the baseUri value - */ - public String baseUri() { - return this.baseUri; - } - - /** - * Set base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. - * - * @param baseUri the baseUri value to set - * @return the JobInputHttp object itself. - */ - public JobInputHttp withBaseUri(String baseUri) { - this.baseUri = baseUri; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputs.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputs.java deleted file mode 100644 index 7f7ed1371d750..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobInputs.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes a list of of inputs to a Job. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JobInputs") -public class JobInputs extends JobInput { - /** - * List of inputs to a Job. - */ - @JsonProperty(value = "inputs") - private List inputs; - - /** - * Get list of inputs to a Job. - * - * @return the inputs value - */ - public List inputs() { - return this.inputs; - } - - /** - * Set list of inputs to a Job. - * - * @param inputs the inputs value to set - * @return the JobInputs object itself. - */ - public JobInputs withInputs(List inputs) { - this.inputs = inputs; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutput.java deleted file mode 100644 index 28602ca65666e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutput.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes all the properties of a JobOutput. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("JobOutput") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.JobOutputAsset", value = JobOutputAsset.class) -}) -public class JobOutput { - /** - * If the JobOutput is in the Error state, it contains the details of the - * error. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private JobError error; - - /** - * Describes the state of the JobOutput. Possible values include: - * 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - * 'Scheduled'. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private JobState state; - - /** - * If the JobOutput is in a Processing state, this contains the job - * completion percentage. The value is an estimate and not intended to be - * used to predict job completion times. To determine if the JobOutput is - * complete, use the State property. - */ - @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) - private int progress; - - /** - * Get if the JobOutput is in the Error state, it contains the details of the error. - * - * @return the error value - */ - public JobError error() { - return this.error; - } - - /** - * Get describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. - * - * @return the state value - */ - public JobState state() { - return this.state; - } - - /** - * Get if the JobOutput is in a Processing state, this contains the job completion percentage. The value is an estimate and not intended to be used to predict job completion times. To determine if the JobOutput is complete, use the State property. - * - * @return the progress value - */ - public int progress() { - return this.progress; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutputAsset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutputAsset.java deleted file mode 100644 index a0fbfb9da8412..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobOutputAsset.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents an Asset used as a JobOutput. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JobOutputAsset") -public class JobOutputAsset extends JobOutput { - /** - * The name of the output Asset. - */ - @JsonProperty(value = "assetName", required = true) - private String assetName; - - /** - * Get the name of the output Asset. - * - * @return the assetName value - */ - public String assetName() { - return this.assetName; - } - - /** - * Set the name of the output Asset. - * - * @param assetName the assetName value to set - * @return the JobOutputAsset object itself. - */ - public JobOutputAsset withAssetName(String assetName) { - this.assetName = assetName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobRetry.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobRetry.java deleted file mode 100644 index d2c0f8881be68..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobRetry.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for JobRetry. - */ -public enum JobRetry { - /** Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. */ - DO_NOT_RETRY("DoNotRetry"), - - /** Issue may be resolved after waiting for a period of time and resubmitting the same Job. */ - MAY_RETRY("MayRetry"); - - /** The actual serialized value for a JobRetry instance. */ - private String value; - - JobRetry(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobRetry instance. - * - * @param value the serialized value to parse. - * @return the parsed JobRetry object, or null if unable to parse. - */ - @JsonCreator - public static JobRetry fromString(String value) { - JobRetry[] items = JobRetry.values(); - for (JobRetry item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobState.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobState.java deleted file mode 100644 index 0d0163ec7387a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JobState.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for JobState. - */ -public enum JobState { - /** The job was canceled. This is a final state for the job. */ - CANCELED("Canceled"), - - /** The job is in the process of being canceled. This is a transient state for the job. */ - CANCELING("Canceling"), - - /** The job has encountered an error. This is a final state for the job. */ - ERROR("Error"), - - /** The job is finished. This is a final state for the job. */ - FINISHED("Finished"), - - /** The job is processing. This is a transient state for the job. */ - PROCESSING("Processing"), - - /** The job is in a queued state, waiting for resources to become available. This is a transient state. */ - QUEUED("Queued"), - - /** The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. */ - SCHEDULED("Scheduled"); - - /** The actual serialized value for a JobState instance. */ - private String value; - - JobState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobState instance. - * - * @param value the serialized value to parse. - * @return the parsed JobState object, or null if unable to parse. - */ - @JsonCreator - public static JobState fromString(String value) { - JobState[] items = JobState.values(); - for (JobState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Jobs.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Jobs.java deleted file mode 100644 index 786b7edcd8f47..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Jobs.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.JobsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Jobs. - */ -public interface Jobs extends SupportsCreating, HasInner { - /** - * Cancel Job. - * Cancel a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName); - - /** - * Get Job. - * Gets a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName); - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName, final String transformName); - - /** - * Delete Job. - * Deletes a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgFormat.java deleted file mode 100644 index d09adb2f4d023..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgFormat.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the settings for producing JPEG thumbnails. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JpgFormat") -public class JpgFormat extends ImageFormat { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgImage.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgImage.java deleted file mode 100644 index 070dc99f9d32a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgImage.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties for producing a series of JPEG images from the - * input video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JpgImage") -public class JpgImage extends Image { - /** - * A collection of output JPEG image layers to be produced by the encoder. - */ - @JsonProperty(value = "layers") - private List layers; - - /** - * Get a collection of output JPEG image layers to be produced by the encoder. - * - * @return the layers value - */ - public List layers() { - return this.layers; - } - - /** - * Set a collection of output JPEG image layers to be produced by the encoder. - * - * @param layers the layers value to set - * @return the JpgImage object itself. - */ - public JpgImage withLayers(List layers) { - this.layers = layers; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgLayer.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgLayer.java deleted file mode 100644 index 2ffd07b767620..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/JpgLayer.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the settings to produce a JPEG image from the input video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.JpgLayer") -public class JpgLayer extends Layer { - /** - * The compression quality of the JPEG output. Range is from 0-100 and the - * default is 70. - */ - @JsonProperty(value = "quality") - private Integer quality; - - /** - * Get the compression quality of the JPEG output. Range is from 0-100 and the default is 70. - * - * @return the quality value - */ - public Integer quality() { - return this.quality; - } - - /** - * Set the compression quality of the JPEG output. Range is from 0-100 and the default is 70. - * - * @param quality the quality value to set - * @return the JpgLayer object itself. - */ - public JpgLayer withQuality(Integer quality) { - this.quality = quality; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Layer.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Layer.java deleted file mode 100644 index bb19e652b3f6e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Layer.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * The encoder can be configured to produce video and/or images (thumbnails) at - * different resolutions, by specifying a layer for each desired resolution. A - * layer represents the properties for the video or image at a resolution. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("Layer") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.VideoLayer", value = VideoLayer.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.JpgLayer", value = JpgLayer.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.PngLayer", value = PngLayer.class) -}) -public class Layer { - /** - * The width of the output video for this layer. The value can be absolute - * (in pixels) or relative (in percentage). For example 50% means the - * output video has half as many pixels in width as the input. - */ - @JsonProperty(value = "width") - private String width; - - /** - * The height of the output video for this layer. The value can be absolute - * (in pixels) or relative (in percentage). For example 50% means the - * output video has half as many pixels in height as the input. - */ - @JsonProperty(value = "height") - private String height; - - /** - * The alphanumeric label for this layer, which can be used in multiplexing - * different video and audio layers, or in naming the output file. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Get the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. - * - * @return the width value - */ - public String width() { - return this.width; - } - - /** - * Set the width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. - * - * @param width the width value to set - * @return the Layer object itself. - */ - public Layer withWidth(String width) { - this.width = width; - return this; - } - - /** - * Get the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. - * - * @return the height value - */ - public String height() { - return this.height; - } - - /** - * Set the height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. - * - * @param height the height value to set - * @return the Layer object itself. - */ - public Layer withHeight(String height) { - this.height = height; - return this; - } - - /** - * Get the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set the alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. - * - * @param label the label value to set - * @return the Layer object itself. - */ - public Layer withLabel(String label) { - this.label = label; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContainerSasInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContainerSasInput.java deleted file mode 100644 index 272c1a35967c3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContainerSasInput.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.DateTime; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The parameters to the list SAS requet. - */ -public class ListContainerSasInput { - /** - * The permissions to set on the SAS URL. Possible values include: 'Read', - * 'ReadWrite', 'ReadWriteDelete'. - */ - @JsonProperty(value = "permissions") - private AssetContainerPermission permissions; - - /** - * The SAS URL expiration time. This must be less than 24 hours from the - * current time. - */ - @JsonProperty(value = "expiryTime") - private DateTime expiryTime; - - /** - * Get the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. - * - * @return the permissions value - */ - public AssetContainerPermission permissions() { - return this.permissions; - } - - /** - * Set the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. - * - * @param permissions the permissions value to set - * @return the ListContainerSasInput object itself. - */ - public ListContainerSasInput withPermissions(AssetContainerPermission permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the SAS URL expiration time. This must be less than 24 hours from the current time. - * - * @return the expiryTime value - */ - public DateTime expiryTime() { - return this.expiryTime; - } - - /** - * Set the SAS URL expiration time. This must be less than 24 hours from the current time. - * - * @param expiryTime the expiryTime value to set - * @return the ListContainerSasInput object itself. - */ - public ListContainerSasInput withExpiryTime(DateTime expiryTime) { - this.expiryTime = expiryTime; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContentKeysResponse.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContentKeysResponse.java deleted file mode 100644 index 1014a404c3b1b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListContentKeysResponse.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.ListContentKeysResponseInner; -import java.util.List; - -/** - * Type representing ListContentKeysResponse. - */ -public interface ListContentKeysResponse extends HasInner, HasManager { - /** - * @return the contentKeys value. - */ - List contentKeys(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListPathsResponse.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListPathsResponse.java deleted file mode 100644 index 0ea2678a28a49..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ListPathsResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.ListPathsResponseInner; -import java.util.List; - -/** - * Type representing ListPathsResponse. - */ -public interface ListPathsResponse extends HasInner, HasManager { - /** - * @return the downloadPaths value. - */ - List downloadPaths(); - - /** - * @return the streamingPaths value. - */ - List streamingPaths(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvent.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvent.java deleted file mode 100644 index e86c3131f2c51..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvent.java +++ /dev/null @@ -1,323 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.LiveEventInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import java.util.Map; -import java.util.List; -import org.joda.time.DateTime; - -/** - * Type representing LiveEvent. - */ -public interface LiveEvent extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the crossSiteAccessPolicies value. - */ - CrossSiteAccessPolicies crossSiteAccessPolicies(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the encoding value. - */ - LiveEventEncoding encoding(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the input value. - */ - LiveEventInput input(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the location value. - */ - String location(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the preview value. - */ - LiveEventPreview preview(); - - /** - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * @return the resourceState value. - */ - LiveEventResourceState resourceState(); - - /** - * @return the streamOptions value. - */ - List streamOptions(); - - /** - * @return the tags value. - */ - Map tags(); - - /** - * @return the type value. - */ - String type(); - - /** - * @return the vanityUrl value. - */ - Boolean vanityUrl(); - - /** - * The entirety of the LiveEvent definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithInput, DefinitionStages.WithCreate { - } - - /** - * Grouping of LiveEvent definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a LiveEvent definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the liveevent definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithInput withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the liveevent definition allowing to specify Input. - */ - interface WithInput { - /** - * Specifies input. - */ - WithCreate withInput(LiveEventInput input); - } - - /** - * The stage of the liveevent definition allowing to specify CrossSiteAccessPolicies. - */ - interface WithCrossSiteAccessPolicies { - /** - * Specifies crossSiteAccessPolicies. - */ - WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); - } - - /** - * The stage of the liveevent definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the liveevent definition allowing to specify Encoding. - */ - interface WithEncoding { - /** - * Specifies encoding. - */ - WithCreate withEncoding(LiveEventEncoding encoding); - } - - /** - * The stage of the liveevent definition allowing to specify Location. - */ - interface WithLocation { - /** - * Specifies location. - */ - WithCreate withLocation(String location); - } - - /** - * The stage of the liveevent definition allowing to specify Preview. - */ - interface WithPreview { - /** - * Specifies preview. - */ - WithCreate withPreview(LiveEventPreview preview); - } - - /** - * The stage of the liveevent definition allowing to specify StreamOptions. - */ - interface WithStreamOptions { - /** - * Specifies streamOptions. - */ - WithCreate withStreamOptions(List streamOptions); - } - - /** - * The stage of the liveevent definition allowing to specify Tags. - */ - interface WithTags { - /** - * Specifies tags. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the liveevent definition allowing to specify VanityUrl. - */ - interface WithVanityUrl { - /** - * Specifies vanityUrl. - */ - WithCreate withVanityUrl(Boolean vanityUrl); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithDescription, DefinitionStages.WithEncoding, DefinitionStages.WithLocation, DefinitionStages.WithPreview, DefinitionStages.WithStreamOptions, DefinitionStages.WithTags, DefinitionStages.WithVanityUrl { - } - } - /** - * The template for a LiveEvent update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithDescription, UpdateStages.WithEncoding, UpdateStages.WithLocation, UpdateStages.WithPreview, UpdateStages.WithStreamOptions, UpdateStages.WithTags, UpdateStages.WithVanityUrl { - } - - /** - * Grouping of LiveEvent update stages. - */ - interface UpdateStages { - /** - * The stage of the liveevent update allowing to specify CrossSiteAccessPolicies. - */ - interface WithCrossSiteAccessPolicies { - /** - * Specifies crossSiteAccessPolicies. - */ - Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); - } - - /** - * The stage of the liveevent update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - /** - * The stage of the liveevent update allowing to specify Encoding. - */ - interface WithEncoding { - /** - * Specifies encoding. - */ - Update withEncoding(LiveEventEncoding encoding); - } - - /** - * The stage of the liveevent update allowing to specify Location. - */ - interface WithLocation { - /** - * Specifies location. - */ - Update withLocation(String location); - } - - /** - * The stage of the liveevent update allowing to specify Preview. - */ - interface WithPreview { - /** - * Specifies preview. - */ - Update withPreview(LiveEventPreview preview); - } - - /** - * The stage of the liveevent update allowing to specify StreamOptions. - */ - interface WithStreamOptions { - /** - * Specifies streamOptions. - */ - Update withStreamOptions(List streamOptions); - } - - /** - * The stage of the liveevent update allowing to specify Tags. - */ - interface WithTags { - /** - * Specifies tags. - */ - Update withTags(Map tags); - } - - /** - * The stage of the liveevent update allowing to specify VanityUrl. - */ - interface WithVanityUrl { - /** - * Specifies vanityUrl. - */ - Update withVanityUrl(Boolean vanityUrl); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventActionInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventActionInput.java deleted file mode 100644 index 098412ced9025..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventActionInput.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The LiveEvent action input parameter definition. - */ -public class LiveEventActionInput { - /** - * The flag indicates if remove LiveOutputs on Stop. - */ - @JsonProperty(value = "removeOutputsOnStop") - private Boolean removeOutputsOnStop; - - /** - * Get the flag indicates if remove LiveOutputs on Stop. - * - * @return the removeOutputsOnStop value - */ - public Boolean removeOutputsOnStop() { - return this.removeOutputsOnStop; - } - - /** - * Set the flag indicates if remove LiveOutputs on Stop. - * - * @param removeOutputsOnStop the removeOutputsOnStop value to set - * @return the LiveEventActionInput object itself. - */ - public LiveEventActionInput withRemoveOutputsOnStop(Boolean removeOutputsOnStop) { - this.removeOutputsOnStop = removeOutputsOnStop; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncoding.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncoding.java deleted file mode 100644 index a3297517749bf..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncoding.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Live Event encoding. - */ -public class LiveEventEncoding { - /** - * The encoding type for Live Event. Possible values include: 'None', - * 'Basic'. - */ - @JsonProperty(value = "encodingType") - private LiveEventEncodingType encodingType; - - /** - * The encoding preset name. - */ - @JsonProperty(value = "presetName") - private String presetName; - - /** - * Get the encoding type for Live Event. Possible values include: 'None', 'Basic'. - * - * @return the encodingType value - */ - public LiveEventEncodingType encodingType() { - return this.encodingType; - } - - /** - * Set the encoding type for Live Event. Possible values include: 'None', 'Basic'. - * - * @param encodingType the encodingType value to set - * @return the LiveEventEncoding object itself. - */ - public LiveEventEncoding withEncodingType(LiveEventEncodingType encodingType) { - this.encodingType = encodingType; - return this; - } - - /** - * Get the encoding preset name. - * - * @return the presetName value - */ - public String presetName() { - return this.presetName; - } - - /** - * Set the encoding preset name. - * - * @param presetName the presetName value to set - * @return the LiveEventEncoding object itself. - */ - public LiveEventEncoding withPresetName(String presetName) { - this.presetName = presetName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncodingType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncodingType.java deleted file mode 100644 index eab7f538e2ce1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEncodingType.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for LiveEventEncodingType. - */ -public enum LiveEventEncodingType { - /** Enum value None. */ - NONE("None"), - - /** Enum value Basic. */ - BASIC("Basic"); - - /** The actual serialized value for a LiveEventEncodingType instance. */ - private String value; - - LiveEventEncodingType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LiveEventEncodingType instance. - * - * @param value the serialized value to parse. - * @return the parsed LiveEventEncodingType object, or null if unable to parse. - */ - @JsonCreator - public static LiveEventEncodingType fromString(String value) { - LiveEventEncodingType[] items = LiveEventEncodingType.values(); - for (LiveEventEncodingType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEndpoint.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEndpoint.java deleted file mode 100644 index 486df1f36f5df..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventEndpoint.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Live Event endpoint. - */ -public class LiveEventEndpoint { - /** - * The endpoint protocol. - */ - @JsonProperty(value = "protocol") - private String protocol; - - /** - * The endpoint URL. - */ - @JsonProperty(value = "url") - private String url; - - /** - * Get the endpoint protocol. - * - * @return the protocol value - */ - public String protocol() { - return this.protocol; - } - - /** - * Set the endpoint protocol. - * - * @param protocol the protocol value to set - * @return the LiveEventEndpoint object itself. - */ - public LiveEventEndpoint withProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the endpoint URL. - * - * @return the url value - */ - public String url() { - return this.url; - } - - /** - * Set the endpoint URL. - * - * @param url the url value to set - * @return the LiveEventEndpoint object itself. - */ - public LiveEventEndpoint withUrl(String url) { - this.url = url; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInput.java deleted file mode 100644 index 2dbd57b9b9840..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInput.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Live Event input. - */ -public class LiveEventInput { - /** - * The streaming protocol for the Live Event. Possible values include: - * 'FragmentedMP4', 'RTMP'. - */ - @JsonProperty(value = "streamingProtocol", required = true) - private LiveEventInputProtocol streamingProtocol; - - /** - * ISO 8601 timespan duration of the key frame interval duration. - */ - @JsonProperty(value = "keyFrameIntervalDuration") - private String keyFrameIntervalDuration; - - /** - * The access token. - */ - @JsonProperty(value = "accessToken") - private String accessToken; - - /** - * The input endpoints for the Live Event. - */ - @JsonProperty(value = "endpoints") - private List endpoints; - - /** - * Get the streaming protocol for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP'. - * - * @return the streamingProtocol value - */ - public LiveEventInputProtocol streamingProtocol() { - return this.streamingProtocol; - } - - /** - * Set the streaming protocol for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP'. - * - * @param streamingProtocol the streamingProtocol value to set - * @return the LiveEventInput object itself. - */ - public LiveEventInput withStreamingProtocol(LiveEventInputProtocol streamingProtocol) { - this.streamingProtocol = streamingProtocol; - return this; - } - - /** - * Get iSO 8601 timespan duration of the key frame interval duration. - * - * @return the keyFrameIntervalDuration value - */ - public String keyFrameIntervalDuration() { - return this.keyFrameIntervalDuration; - } - - /** - * Set iSO 8601 timespan duration of the key frame interval duration. - * - * @param keyFrameIntervalDuration the keyFrameIntervalDuration value to set - * @return the LiveEventInput object itself. - */ - public LiveEventInput withKeyFrameIntervalDuration(String keyFrameIntervalDuration) { - this.keyFrameIntervalDuration = keyFrameIntervalDuration; - return this; - } - - /** - * Get the access token. - * - * @return the accessToken value - */ - public String accessToken() { - return this.accessToken; - } - - /** - * Set the access token. - * - * @param accessToken the accessToken value to set - * @return the LiveEventInput object itself. - */ - public LiveEventInput withAccessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get the input endpoints for the Live Event. - * - * @return the endpoints value - */ - public List endpoints() { - return this.endpoints; - } - - /** - * Set the input endpoints for the Live Event. - * - * @param endpoints the endpoints value to set - * @return the LiveEventInput object itself. - */ - public LiveEventInput withEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInputProtocol.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInputProtocol.java deleted file mode 100644 index b3b21e42106c0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventInputProtocol.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for LiveEventInputProtocol. - */ -public enum LiveEventInputProtocol { - /** Enum value FragmentedMP4. */ - FRAGMENTED_MP4("FragmentedMP4"), - - /** Enum value RTMP. */ - RTMP("RTMP"); - - /** The actual serialized value for a LiveEventInputProtocol instance. */ - private String value; - - LiveEventInputProtocol(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LiveEventInputProtocol instance. - * - * @param value the serialized value to parse. - * @return the parsed LiveEventInputProtocol object, or null if unable to parse. - */ - @JsonCreator - public static LiveEventInputProtocol fromString(String value) { - LiveEventInputProtocol[] items = LiveEventInputProtocol.values(); - for (LiveEventInputProtocol item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreview.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreview.java deleted file mode 100644 index 035a5b8370435..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreview.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Live Event preview. - */ -public class LiveEventPreview { - /** - * The endpoints for preview. - */ - @JsonProperty(value = "endpoints") - private List endpoints; - - /** - * The access control for LiveEvent preview. - */ - @JsonProperty(value = "accessControl") - private LiveEventPreviewAccessControl accessControl; - - /** - * The preview locator Guid. - */ - @JsonProperty(value = "previewLocator") - private String previewLocator; - - /** - * The name of streaming policy used for LiveEvent preview. - */ - @JsonProperty(value = "streamingPolicyName") - private String streamingPolicyName; - - /** - * Get the endpoints for preview. - * - * @return the endpoints value - */ - public List endpoints() { - return this.endpoints; - } - - /** - * Set the endpoints for preview. - * - * @param endpoints the endpoints value to set - * @return the LiveEventPreview object itself. - */ - public LiveEventPreview withEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - - /** - * Get the access control for LiveEvent preview. - * - * @return the accessControl value - */ - public LiveEventPreviewAccessControl accessControl() { - return this.accessControl; - } - - /** - * Set the access control for LiveEvent preview. - * - * @param accessControl the accessControl value to set - * @return the LiveEventPreview object itself. - */ - public LiveEventPreview withAccessControl(LiveEventPreviewAccessControl accessControl) { - this.accessControl = accessControl; - return this; - } - - /** - * Get the preview locator Guid. - * - * @return the previewLocator value - */ - public String previewLocator() { - return this.previewLocator; - } - - /** - * Set the preview locator Guid. - * - * @param previewLocator the previewLocator value to set - * @return the LiveEventPreview object itself. - */ - public LiveEventPreview withPreviewLocator(String previewLocator) { - this.previewLocator = previewLocator; - return this; - } - - /** - * Get the name of streaming policy used for LiveEvent preview. - * - * @return the streamingPolicyName value - */ - public String streamingPolicyName() { - return this.streamingPolicyName; - } - - /** - * Set the name of streaming policy used for LiveEvent preview. - * - * @param streamingPolicyName the streamingPolicyName value to set - * @return the LiveEventPreview object itself. - */ - public LiveEventPreview withStreamingPolicyName(String streamingPolicyName) { - this.streamingPolicyName = streamingPolicyName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreviewAccessControl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreviewAccessControl.java deleted file mode 100644 index 2527e53efb3ac..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventPreviewAccessControl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The IP access control for Live Event preview. - */ -public class LiveEventPreviewAccessControl { - /** - * The IP access control properties. - */ - @JsonProperty(value = "ip") - private IPAccessControl ip; - - /** - * Get the IP access control properties. - * - * @return the ip value - */ - public IPAccessControl ip() { - return this.ip; - } - - /** - * Set the IP access control properties. - * - * @param ip the ip value to set - * @return the LiveEventPreviewAccessControl object itself. - */ - public LiveEventPreviewAccessControl withIp(IPAccessControl ip) { - this.ip = ip; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventResourceState.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventResourceState.java deleted file mode 100644 index 4f0ba5ba36dc9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEventResourceState.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for LiveEventResourceState. - */ -public enum LiveEventResourceState { - /** Enum value Stopped. */ - STOPPED("Stopped"), - - /** Enum value Starting. */ - STARTING("Starting"), - - /** Enum value Running. */ - RUNNING("Running"), - - /** Enum value Stopping. */ - STOPPING("Stopping"), - - /** Enum value Deleting. */ - DELETING("Deleting"); - - /** The actual serialized value for a LiveEventResourceState instance. */ - private String value; - - LiveEventResourceState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LiveEventResourceState instance. - * - * @param value the serialized value to parse. - * @return the parsed LiveEventResourceState object, or null if unable to parse. - */ - @JsonCreator - public static LiveEventResourceState fromString(String value) { - LiveEventResourceState[] items = LiveEventResourceState.values(); - for (LiveEventResourceState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvents.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvents.java deleted file mode 100644 index 3c9aa3acec9cc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveEvents.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.LiveEventsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing LiveEvents. - */ -public interface LiveEvents extends SupportsCreating, HasInner { - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable startAsync(String resourceGroupName, String accountName, String liveEventName); - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable stopAsync(String resourceGroupName, String accountName, String liveEventName); - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable resetAsync(String resourceGroupName, String accountName, String liveEventName); - - /** - * Get Live Event. - * Gets a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String liveEventName); - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutput.java deleted file mode 100644 index c4c519b5e5690..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutput.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.LiveOutputInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import org.joda.time.Period; -import org.joda.time.DateTime; - -/** - * Type representing LiveOutput. - */ -public interface LiveOutput extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the archiveWindowLength value. - */ - Period archiveWindowLength(); - - /** - * @return the assetName value. - */ - String assetName(); - - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the hls value. - */ - Hls hls(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the manifestName value. - */ - String manifestName(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the outputSnapTime value. - */ - Long outputSnapTime(); - - /** - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * @return the resourceState value. - */ - LiveOutputResourceState resourceState(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the LiveOutput definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLiveEvent, DefinitionStages.WithArchiveWindowLength, DefinitionStages.WithAssetName, DefinitionStages.WithCreate { - } - - /** - * Grouping of LiveOutput definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a LiveOutput definition. - */ - interface Blank extends WithLiveEvent { - } - - /** - * The stage of the liveoutput definition allowing to specify LiveEvent. - */ - interface WithLiveEvent { - /** - * Specifies resourceGroupName, accountName, liveEventName. - */ - WithArchiveWindowLength withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); - } - - /** - * The stage of the liveoutput definition allowing to specify ArchiveWindowLength. - */ - interface WithArchiveWindowLength { - /** - * Specifies archiveWindowLength. - */ - WithAssetName withArchiveWindowLength(Period archiveWindowLength); - } - - /** - * The stage of the liveoutput definition allowing to specify AssetName. - */ - interface WithAssetName { - /** - * Specifies assetName. - */ - WithCreate withAssetName(String assetName); - } - - /** - * The stage of the liveoutput definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the liveoutput definition allowing to specify Hls. - */ - interface WithHls { - /** - * Specifies hls. - */ - WithCreate withHls(Hls hls); - } - - /** - * The stage of the liveoutput definition allowing to specify ManifestName. - */ - interface WithManifestName { - /** - * Specifies manifestName. - */ - WithCreate withManifestName(String manifestName); - } - - /** - * The stage of the liveoutput definition allowing to specify OutputSnapTime. - */ - interface WithOutputSnapTime { - /** - * Specifies outputSnapTime. - */ - WithCreate withOutputSnapTime(Long outputSnapTime); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithHls, DefinitionStages.WithManifestName, DefinitionStages.WithOutputSnapTime { - } - } - /** - * The template for a LiveOutput update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithHls, UpdateStages.WithManifestName, UpdateStages.WithOutputSnapTime { - } - - /** - * Grouping of LiveOutput update stages. - */ - interface UpdateStages { - /** - * The stage of the liveoutput update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - /** - * The stage of the liveoutput update allowing to specify Hls. - */ - interface WithHls { - /** - * Specifies hls. - */ - Update withHls(Hls hls); - } - - /** - * The stage of the liveoutput update allowing to specify ManifestName. - */ - interface WithManifestName { - /** - * Specifies manifestName. - */ - Update withManifestName(String manifestName); - } - - /** - * The stage of the liveoutput update allowing to specify OutputSnapTime. - */ - interface WithOutputSnapTime { - /** - * Specifies outputSnapTime. - */ - Update withOutputSnapTime(Long outputSnapTime); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputResourceState.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputResourceState.java deleted file mode 100644 index 1c83c55c4fa2b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputResourceState.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for LiveOutputResourceState. - */ -public enum LiveOutputResourceState { - /** Enum value Creating. */ - CREATING("Creating"), - - /** Enum value Running. */ - RUNNING("Running"), - - /** Enum value Deleting. */ - DELETING("Deleting"); - - /** The actual serialized value for a LiveOutputResourceState instance. */ - private String value; - - LiveOutputResourceState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LiveOutputResourceState instance. - * - * @param value the serialized value to parse. - * @return the parsed LiveOutputResourceState object, or null if unable to parse. - */ - @JsonCreator - public static LiveOutputResourceState fromString(String value) { - LiveOutputResourceState[] items = LiveOutputResourceState.values(); - for (LiveOutputResourceState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputs.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputs.java deleted file mode 100644 index 20928902ee769..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/LiveOutputs.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.LiveOutputsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing LiveOutputs. - */ -public interface LiveOutputs extends SupportsCreating, HasInner { - /** - * Get Live Output. - * Gets a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName); - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Locations.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Locations.java deleted file mode 100644 index b7b9f4bb30bd2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Locations.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.LocationsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Locations. - */ -public interface Locations extends HasInner { - /** - * Check Name Availability. - * Checks whether the Media Service resource name is available. - * - * @param locationName the String value - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaService.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaService.java deleted file mode 100644 index 14d9008e16159..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaService.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.Resource; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; -import com.microsoft.azure.arm.resources.models.HasResourceGroup; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaServiceInner; - -/** - * Type representing MediaService. - */ -public interface MediaService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { - /** - * @return the mediaServiceId value. - */ - UUID mediaServiceId(); - - /** - * @return the storageAccounts value. - */ - List storageAccounts(); - - /** - * The entirety of the MediaService definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** - * Grouping of MediaService definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a MediaService definition. - */ - interface Blank extends GroupableResourceCore.DefinitionWithRegion { - } - - /** - * The stage of the MediaService definition allowing to specify the resource group. - */ - interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { - } - - /** - * The stage of the mediaservice update allowing to specify StorageAccounts. - */ - interface WithStorageAccounts { - /** - * Specifies storageAccounts. - */ - WithCreate withStorageAccounts(List storageAccounts); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithStorageAccounts { - } - } - /** - * The template for a MediaService update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithStorageAccounts { - } - - /** - * Grouping of MediaService update stages. - */ - interface UpdateStages { - /** - * The stage of the mediaservice {0} allowing to specify StorageAccounts. - */ - interface WithStorageAccounts { - /** - * Specifies storageAccounts. - */ - Update withStorageAccounts(List storageAccounts); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mediaservices.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mediaservices.java deleted file mode 100644 index 22090811c0cb9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mediaservices.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; -import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; -import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; -import rx.Observable; -import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; -import com.microsoft.azure.arm.collection.SupportsListing; -import rx.Completable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaservicesInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Mediaservices. - */ -public interface Mediaservices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable syncStorageKeysAsync(String resourceGroupName, String accountName); - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getBySubscriptionAsync(String accountName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mp4Format.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mp4Format.java deleted file mode 100644 index 53da409079a72..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Mp4Format.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties for an output ISO MP4 file. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.Mp4Format") -public class Mp4Format extends MultiBitrateFormat { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MultiBitrateFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MultiBitrateFormat.java deleted file mode 100644 index 1fa5412715d3a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MultiBitrateFormat.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the properties for producing a collection of GOP aligned - * multi-bitrate files. The default behavior is to produce one output file for - * each video layer which is muxed together with all the audios. The exact - * output files produced can be controlled by specifying the outputFiles - * collection. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.MultiBitrateFormat") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.Mp4Format", value = Mp4Format.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.TransportStreamFormat", value = TransportStreamFormat.class) -}) -public class MultiBitrateFormat extends Format { - /** - * The list of output files to produce. Each entry in the list is a set of - * audio and video layer labels to be muxed together . - */ - @JsonProperty(value = "outputFiles") - private List outputFiles; - - /** - * Get the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . - * - * @return the outputFiles value - */ - public List outputFiles() { - return this.outputFiles; - } - - /** - * Set the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . - * - * @param outputFiles the outputFiles value to set - * @return the MultiBitrateFormat object itself. - */ - public MultiBitrateFormat withOutputFiles(List outputFiles) { - this.outputFiles = outputFiles; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/NoEncryption.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/NoEncryption.java deleted file mode 100644 index 497c93be0e71a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/NoEncryption.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class for NoEncryption scheme. - */ -public class NoEncryption { - /** - * Representing supported protocols. - */ - @JsonProperty(value = "enabledProtocols") - private EnabledProtocols enabledProtocols; - - /** - * Get representing supported protocols. - * - * @return the enabledProtocols value - */ - public EnabledProtocols enabledProtocols() { - return this.enabledProtocols; - } - - /** - * Set representing supported protocols. - * - * @param enabledProtocols the enabledProtocols value to set - * @return the NoEncryption object itself. - */ - public NoEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ODataError.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ODataError.java deleted file mode 100644 index c05c93e829c25..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/ODataError.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Information about an error. - */ -public class ODataError { - /** - * A language-independent error name. - */ - @JsonProperty(value = "code") - private String code; - - /** - * The error message. - */ - @JsonProperty(value = "message") - private String message; - - /** - * The target of the error (for example, the name of the property in - * error). - */ - @JsonProperty(value = "target") - private String target; - - /** - * The error details. - */ - @JsonProperty(value = "details") - private List details; - - /** - * Get a language-independent error name. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Set a language-independent error name. - * - * @param code the code value to set - * @return the ODataError object itself. - */ - public ODataError withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the error message. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Set the error message. - * - * @param message the message value to set - * @return the ODataError object itself. - */ - public ODataError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the target of the error (for example, the name of the property in error). - * - * @return the target value - */ - public String target() { - return this.target; - } - - /** - * Set the target of the error (for example, the name of the property in error). - * - * @param target the target value to set - * @return the ODataError object itself. - */ - public ODataError withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the error details. - * - * @return the details value - */ - public List details() { - return this.details; - } - - /** - * Set the error details. - * - * @param details the details value to set - * @return the ODataError object itself. - */ - public ODataError withDetails(List details) { - this.details = details; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OnErrorType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OnErrorType.java deleted file mode 100644 index 268f874207fad..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OnErrorType.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for OnErrorType. - */ -public enum OnErrorType { - /** Tells the service that if this TransformOutput fails, then any other incomplete TransformOutputs can be stopped. */ - STOP_PROCESSING_JOB("StopProcessingJob"), - - /** Tells the service that if this TransformOutput fails, then allow any other TransformOutput to continue. */ - CONTINUE_JOB("ContinueJob"); - - /** The actual serialized value for a OnErrorType instance. */ - private String value; - - OnErrorType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OnErrorType instance. - * - * @param value the serialized value to parse. - * @return the parsed OnErrorType object, or null if unable to parse. - */ - @JsonCreator - public static OnErrorType fromString(String value) { - OnErrorType[] items = OnErrorType.values(); - for (OnErrorType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operation.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operation.java deleted file mode 100644 index f0520d2b10ddf..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operation.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.OperationInner; - -/** - * Type representing Operation. - */ -public interface Operation extends HasInner, HasManager { - /** - * @return the display value. - */ - OperationDisplay display(); - - /** - * @return the name value. - */ - String name(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OperationDisplay.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OperationDisplay.java deleted file mode 100644 index f5fa68cb72216..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OperationDisplay.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Operation details. - */ -public class OperationDisplay { - /** - * The service provider. - */ - @JsonProperty(value = "provider") - private String provider; - - /** - * Resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /** - * The operation type. - */ - @JsonProperty(value = "operation") - private String operation; - - /** - * The operation description. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the service provider. - * - * @return the provider value - */ - public String provider() { - return this.provider; - } - - /** - * Set the service provider. - * - * @param provider the provider value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get resource on which the operation is performed. - * - * @return the resource value - */ - public String resource() { - return this.resource; - } - - /** - * Set resource on which the operation is performed. - * - * @param resource the resource value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation type. - * - * @return the operation value - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation type. - * - * @param operation the operation value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the operation description. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set the operation description. - * - * @param description the description value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operations.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operations.java deleted file mode 100644 index 36b947433eadf..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Operations.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.OperationsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Operations. - */ -public interface Operations extends HasInner { - /** - * List Operations. - * Lists all the Media Services operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OutputFile.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OutputFile.java deleted file mode 100644 index e97bd4a9273ad..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/OutputFile.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an output file produced. - */ -public class OutputFile { - /** - * The list of labels that describe how the encoder should multiplex video - * and audio into an output file. For example, if the encoder is producing - * two video layers with labels v1 and v2, and one audio layer with label - * a1, then an array like '[v1, a1]' tells the encoder to produce an output - * file with the video track represented by v1 and the audio track - * represented by a1. - */ - @JsonProperty(value = "labels") - private List labels; - - /** - * Get the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. - * - * @return the labels value - */ - public List labels() { - return this.labels; - } - - /** - * Set the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. - * - * @param labels the labels value to set - * @return the OutputFile object itself. - */ - public OutputFile withLabels(List labels) { - this.labels = labels; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Overlay.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Overlay.java deleted file mode 100644 index 9a2a768fb9e6d..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Overlay.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.Period; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base type for all overlays - image, audio or video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("Overlay") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.AudioOverlay", value = AudioOverlay.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.VideoOverlay", value = VideoOverlay.class) -}) -public class Overlay { - /** - * The label of the job input which is to be used as an overlay. The Input - * must specify exactly one file. You can specify an image file in JPG or - * PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or - * a video file. See https://aka.ms/mesformats for the complete list of - * supported audio and video file formats. - */ - @JsonProperty(value = "inputLabel") - private String inputLabel; - - /** - * The start position, with reference to the input video, at which the - * overlay starts. The value should be in ISO 8601 format. For example, - * PT05S to start the overlay at 5 seconds in to the input video. If not - * specified the overlay starts from the beginning of the input video. - */ - @JsonProperty(value = "start") - private Period start; - - /** - * The position in the input video at which the overlay ends. The value - * should be in ISO 8601 duration format. For example, PT30S to end the - * overlay at 30 seconds in to the input video. If not specified the - * overlay will be applied until the end of the input video if inputLoop is - * true. Else, if inputLoop is false, then overlay will last as long as the - * duration of the overlay media. - */ - @JsonProperty(value = "end") - private Period end; - - /** - * The duration over which the overlay fades in onto the input video. The - * value should be in ISO 8601 duration format. If not specified the - * default behavior is to have no fade in (same as PT0S). - */ - @JsonProperty(value = "fadeInDuration") - private Period fadeInDuration; - - /** - * The duration over which the overlay fades out of the input video. The - * value should be in ISO 8601 duration format. If not specified the - * default behavior is to have no fade out (same as PT0S). - */ - @JsonProperty(value = "fadeOutDuration") - private Period fadeOutDuration; - - /** - * The gain level of audio in the overlay. The value should be in the range - * [0, 1.0]. The default is 1.0. - */ - @JsonProperty(value = "audioGainLevel") - private Double audioGainLevel; - - /** - * Get the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. - * - * @return the inputLabel value - */ - public String inputLabel() { - return this.inputLabel; - } - - /** - * Set the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. - * - * @param inputLabel the inputLabel value to set - * @return the Overlay object itself. - */ - public Overlay withInputLabel(String inputLabel) { - this.inputLabel = inputLabel; - return this; - } - - /** - * Get the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. - * - * @return the start value - */ - public Period start() { - return this.start; - } - - /** - * Set the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. - * - * @param start the start value to set - * @return the Overlay object itself. - */ - public Overlay withStart(Period start) { - this.start = start; - return this; - } - - /** - * Get the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. - * - * @return the end value - */ - public Period end() { - return this.end; - } - - /** - * Set the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. - * - * @param end the end value to set - * @return the Overlay object itself. - */ - public Overlay withEnd(Period end) { - this.end = end; - return this; - } - - /** - * Get the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). - * - * @return the fadeInDuration value - */ - public Period fadeInDuration() { - return this.fadeInDuration; - } - - /** - * Set the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). - * - * @param fadeInDuration the fadeInDuration value to set - * @return the Overlay object itself. - */ - public Overlay withFadeInDuration(Period fadeInDuration) { - this.fadeInDuration = fadeInDuration; - return this; - } - - /** - * Get the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). - * - * @return the fadeOutDuration value - */ - public Period fadeOutDuration() { - return this.fadeOutDuration; - } - - /** - * Set the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). - * - * @param fadeOutDuration the fadeOutDuration value to set - * @return the Overlay object itself. - */ - public Overlay withFadeOutDuration(Period fadeOutDuration) { - this.fadeOutDuration = fadeOutDuration; - return this; - } - - /** - * Get the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. - * - * @return the audioGainLevel value - */ - public Double audioGainLevel() { - return this.audioGainLevel; - } - - /** - * Set the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. - * - * @param audioGainLevel the audioGainLevel value to set - * @return the Overlay object itself. - */ - public Overlay withAudioGainLevel(Double audioGainLevel) { - this.audioGainLevel = audioGainLevel; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngFormat.java deleted file mode 100644 index d13e3e97e8290..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngFormat.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the settings for producing PNG thumbnails. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.PngFormat") -public class PngFormat extends ImageFormat { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngImage.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngImage.java deleted file mode 100644 index ca3c3544c0368..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngImage.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties for producing a series of PNG images from the input - * video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.PngImage") -public class PngImage extends Image { - /** - * A collection of output PNG image layers to be produced by the encoder. - */ - @JsonProperty(value = "layers") - private List layers; - - /** - * Get a collection of output PNG image layers to be produced by the encoder. - * - * @return the layers value - */ - public List layers() { - return this.layers; - } - - /** - * Set a collection of output PNG image layers to be produced by the encoder. - * - * @param layers the layers value to set - * @return the PngImage object itself. - */ - public PngImage withLayers(List layers) { - this.layers = layers; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngLayer.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngLayer.java deleted file mode 100644 index ff58cb263b81e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/PngLayer.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the settings to produce a PNG image from the input video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.PngLayer") -public class PngLayer extends Layer { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Preset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Preset.java deleted file mode 100644 index d776f9a900a7a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Preset.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Base type for all Presets, which define the recipe or instructions on how - * the input media files should be processed. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("Preset") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.AudioAnalyzerPreset", value = AudioAnalyzerPreset.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.BuiltInStandardEncoderPreset", value = BuiltInStandardEncoderPreset.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.StandardEncoderPreset", value = StandardEncoderPreset.class) -}) -public class Preset { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Priority.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Priority.java deleted file mode 100644 index 9303e918afd6d..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Priority.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for Priority. - */ -public enum Priority { - /** Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. */ - LOW("Low"), - - /** Used for TransformOutputs that can be generated at Normal priority. */ - NORMAL("Normal"), - - /** Used for TransformOutputs that should take precedence over others. */ - HIGH("High"); - - /** The actual serialized value for a Priority instance. */ - private String value; - - Priority(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Priority instance. - * - * @param value the serialized value to parse. - * @return the parsed Priority object, or null if unable to parse. - */ - @JsonCreator - public static Priority fromString(String value) { - Priority[] items = Priority.values(); - for (Priority item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Provider.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Provider.java deleted file mode 100644 index 4171ff26579fa..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Provider.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * A resource provider. - */ -public class Provider { - /** - * The provider name. - */ - @JsonProperty(value = "providerName", required = true) - private String providerName; - - /** - * Get the provider name. - * - * @return the providerName value - */ - public String providerName() { - return this.providerName; - } - - /** - * Set the provider name. - * - * @param providerName the providerName value to set - * @return the Provider object itself. - */ - public Provider withProviderName(String providerName) { - this.providerName = providerName; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rectangle.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rectangle.java deleted file mode 100644 index bc27da4cb7e9e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rectangle.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes the properties of a rectangular window applied to the input media - * before processing it. - */ -public class Rectangle { - /** - * The number of pixels from the left-margin. This can be absolute pixel - * value (e.g 100), or relative to the size of the video (For example, - * 50%). - */ - @JsonProperty(value = "left") - private String left; - - /** - * The number of pixels from the top-margin. This can be absolute pixel - * value (e.g 100), or relative to the size of the video (For example, - * 50%). - */ - @JsonProperty(value = "top") - private String top; - - /** - * The width of the rectangular region in pixels. This can be absolute - * pixel value (e.g 100), or relative to the size of the video (For - * example, 50%). - */ - @JsonProperty(value = "width") - private String width; - - /** - * The height of the rectangular region in pixels. This can be absolute - * pixel value (e.g 100), or relative to the size of the video (For - * example, 50%). - */ - @JsonProperty(value = "height") - private String height; - - /** - * Get the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @return the left value - */ - public String left() { - return this.left; - } - - /** - * Set the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @param left the left value to set - * @return the Rectangle object itself. - */ - public Rectangle withLeft(String left) { - this.left = left; - return this; - } - - /** - * Get the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @return the top value - */ - public String top() { - return this.top; - } - - /** - * Set the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @param top the top value to set - * @return the Rectangle object itself. - */ - public Rectangle withTop(String top) { - this.top = top; - return this; - } - - /** - * Get the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @return the width value - */ - public String width() { - return this.width; - } - - /** - * Set the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @param width the width value to set - * @return the Rectangle object itself. - */ - public Rectangle withWidth(String width) { - this.width = width; - return this; - } - - /** - * Get the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @return the height value - */ - public String height() { - return this.height; - } - - /** - * Set the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). - * - * @param height the height value to set - * @return the Rectangle object itself. - */ - public Rectangle withHeight(String height) { - this.height = height; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rotation.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rotation.java deleted file mode 100644 index 935ea368eecf7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Rotation.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for Rotation. - */ -public enum Rotation { - /** Automatically detect and rotate as needed. */ - AUTO("Auto"), - - /** Do not rotate the video. If the output format supports it, any metadata about rotation is kept intact. */ - NONE("None"), - - /** Do not rotate the video but remove any metadata about the rotation. */ - ROTATE0("Rotate0"), - - /** Rotate 90 degrees clockwise. */ - ROTATE90("Rotate90"), - - /** Rotate 180 degrees clockwise. */ - ROTATE180("Rotate180"), - - /** Rotate 270 degrees clockwise. */ - ROTATE270("Rotate270"); - - /** The actual serialized value for a Rotation instance. */ - private String value; - - Rotation(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Rotation instance. - * - * @param value the serialized value to parse. - * @return the parsed Rotation object, or null if unable to parse. - */ - @JsonCreator - public static Rotation fromString(String value) { - Rotation[] items = Rotation.values(); - for (Rotation item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StandardEncoderPreset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StandardEncoderPreset.java deleted file mode 100644 index 587d2e6f4250d..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StandardEncoderPreset.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes all the settings to be used when encoding the input video with the - * Standard Encoder. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.StandardEncoderPreset") -public class StandardEncoderPreset extends Preset { - /** - * One or more filtering operations that are applied to the input media - * before encoding. - */ - @JsonProperty(value = "filters") - private Filters filters; - - /** - * The list of codecs to be used when encoding the input video. - */ - @JsonProperty(value = "codecs") - private List codecs; - - /** - * The list of outputs to be produced by the encoder. - */ - @JsonProperty(value = "formats") - private List formats; - - /** - * Get one or more filtering operations that are applied to the input media before encoding. - * - * @return the filters value - */ - public Filters filters() { - return this.filters; - } - - /** - * Set one or more filtering operations that are applied to the input media before encoding. - * - * @param filters the filters value to set - * @return the StandardEncoderPreset object itself. - */ - public StandardEncoderPreset withFilters(Filters filters) { - this.filters = filters; - return this; - } - - /** - * Get the list of codecs to be used when encoding the input video. - * - * @return the codecs value - */ - public List codecs() { - return this.codecs; - } - - /** - * Set the list of codecs to be used when encoding the input video. - * - * @param codecs the codecs value to set - * @return the StandardEncoderPreset object itself. - */ - public StandardEncoderPreset withCodecs(List codecs) { - this.codecs = codecs; - return this; - } - - /** - * Get the list of outputs to be produced by the encoder. - * - * @return the formats value - */ - public List formats() { - return this.formats; - } - - /** - * Set the list of outputs to be produced by the encoder. - * - * @param formats the formats value to set - * @return the StandardEncoderPreset object itself. - */ - public StandardEncoderPreset withFormats(List formats) { - this.formats = formats; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccount.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccount.java deleted file mode 100644 index da0b2fc75bcdd..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccount.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The storage account details. - */ -public class StorageAccount { - /** - * The ID of the storage account resource. Media Services relies on tables - * and queues as well as blobs, so the primary storage account must be a - * Standard Storage account (either Microsoft.ClassicStorage or - * Microsoft.Storage). Blob only storage accounts can be added as secondary - * storage accounts. - */ - @JsonProperty(value = "id") - private String id; - - /** - * The type of the storage account. Possible values include: 'Primary', - * 'Secondary'. - */ - @JsonProperty(value = "type", required = true) - private StorageAccountType type; - - /** - * Get the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. - * - * @return the id value - */ - public String id() { - return this.id; - } - - /** - * Set the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. - * - * @param id the id value to set - * @return the StorageAccount object itself. - */ - public StorageAccount withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type of the storage account. Possible values include: 'Primary', 'Secondary'. - * - * @return the type value - */ - public StorageAccountType type() { - return this.type; - } - - /** - * Set the type of the storage account. Possible values include: 'Primary', 'Secondary'. - * - * @param type the type value to set - * @return the StorageAccount object itself. - */ - public StorageAccount withType(StorageAccountType type) { - this.type = type; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccountType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccountType.java deleted file mode 100644 index 6fa58faa3250b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StorageAccountType.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StorageAccountType. - */ -public enum StorageAccountType { - /** The primary storage account for the Media Services account. */ - PRIMARY("Primary"), - - /** A secondary storage account for the Media Services account. */ - SECONDARY("Secondary"); - - /** The actual serialized value for a StorageAccountType instance. */ - private String value; - - StorageAccountType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StorageAccountType instance. - * - * @param value the serialized value to parse. - * @return the parsed StorageAccountType object, or null if unable to parse. - */ - @JsonCreator - public static StorageAccountType fromString(String value) { - StorageAccountType[] items = StorageAccountType.values(); - for (StorageAccountType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamOptionsFlag.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamOptionsFlag.java deleted file mode 100644 index 65fc73df604b0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamOptionsFlag.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StreamOptionsFlag. - */ -public enum StreamOptionsFlag { - /** Enum value Default. */ - DEFAULT("Default"), - - /** Enum value LowLatency. */ - LOW_LATENCY("LowLatency"); - - /** The actual serialized value for a StreamOptionsFlag instance. */ - private String value; - - StreamOptionsFlag(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StreamOptionsFlag instance. - * - * @param value the serialized value to parse. - * @return the parsed StreamOptionsFlag object, or null if unable to parse. - */ - @JsonCreator - public static StreamOptionsFlag fromString(String value) { - StreamOptionsFlag[] items = StreamOptionsFlag.values(); - for (StreamOptionsFlag item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoint.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoint.java deleted file mode 100644 index 5b3bbb320165a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoint.java +++ /dev/null @@ -1,418 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingEndpointInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import java.util.Map; -import java.util.List; -import org.joda.time.DateTime; - -/** - * Type representing StreamingEndpoint. - */ -public interface StreamingEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the accessControl value. - */ - StreamingEndpointAccessControl accessControl(); - - /** - * @return the availabilitySetName value. - */ - String availabilitySetName(); - - /** - * @return the cdnEnabled value. - */ - Boolean cdnEnabled(); - - /** - * @return the cdnProfile value. - */ - String cdnProfile(); - - /** - * @return the cdnProvider value. - */ - String cdnProvider(); - - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the crossSiteAccessPolicies value. - */ - CrossSiteAccessPolicies crossSiteAccessPolicies(); - - /** - * @return the customHostNames value. - */ - List customHostNames(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the freeTrialEndTime value. - */ - DateTime freeTrialEndTime(); - - /** - * @return the hostName value. - */ - String hostName(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the location value. - */ - String location(); - - /** - * @return the maxCacheAge value. - */ - Long maxCacheAge(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * @return the resourceState value. - */ - StreamingEndpointResourceState resourceState(); - - /** - * @return the scaleUnits value. - */ - int scaleUnits(); - - /** - * @return the tags value. - */ - Map tags(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the StreamingEndpoint definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { - } - - /** - * Grouping of StreamingEndpoint definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a StreamingEndpoint definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the streamingendpoint definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithCreate withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the streamingendpoint definition allowing to specify AccessControl. - */ - interface WithAccessControl { - /** - * Specifies accessControl. - */ - WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); - } - - /** - * The stage of the streamingendpoint definition allowing to specify AvailabilitySetName. - */ - interface WithAvailabilitySetName { - /** - * Specifies availabilitySetName. - */ - WithCreate withAvailabilitySetName(String availabilitySetName); - } - - /** - * The stage of the streamingendpoint definition allowing to specify CdnEnabled. - */ - interface WithCdnEnabled { - /** - * Specifies cdnEnabled. - */ - WithCreate withCdnEnabled(Boolean cdnEnabled); - } - - /** - * The stage of the streamingendpoint definition allowing to specify CdnProfile. - */ - interface WithCdnProfile { - /** - * Specifies cdnProfile. - */ - WithCreate withCdnProfile(String cdnProfile); - } - - /** - * The stage of the streamingendpoint definition allowing to specify CdnProvider. - */ - interface WithCdnProvider { - /** - * Specifies cdnProvider. - */ - WithCreate withCdnProvider(String cdnProvider); - } - - /** - * The stage of the streamingendpoint definition allowing to specify CrossSiteAccessPolicies. - */ - interface WithCrossSiteAccessPolicies { - /** - * Specifies crossSiteAccessPolicies. - */ - WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); - } - - /** - * The stage of the streamingendpoint definition allowing to specify CustomHostNames. - */ - interface WithCustomHostNames { - /** - * Specifies customHostNames. - */ - WithCreate withCustomHostNames(List customHostNames); - } - - /** - * The stage of the streamingendpoint definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the streamingendpoint definition allowing to specify Location. - */ - interface WithLocation { - /** - * Specifies location. - */ - WithCreate withLocation(String location); - } - - /** - * The stage of the streamingendpoint definition allowing to specify MaxCacheAge. - */ - interface WithMaxCacheAge { - /** - * Specifies maxCacheAge. - */ - WithCreate withMaxCacheAge(Long maxCacheAge); - } - - /** - * The stage of the streamingendpoint definition allowing to specify ScaleUnits. - */ - interface WithScaleUnits { - /** - * Specifies scaleUnits. - */ - WithCreate withScaleUnits(int scaleUnits); - } - - /** - * The stage of the streamingendpoint definition allowing to specify Tags. - */ - interface WithTags { - /** - * Specifies tags. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithAccessControl, DefinitionStages.WithAvailabilitySetName, DefinitionStages.WithCdnEnabled, DefinitionStages.WithCdnProfile, DefinitionStages.WithCdnProvider, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithCustomHostNames, DefinitionStages.WithDescription, DefinitionStages.WithLocation, DefinitionStages.WithMaxCacheAge, DefinitionStages.WithScaleUnits, DefinitionStages.WithTags { - } - } - /** - * The template for a StreamingEndpoint update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithAccessControl, UpdateStages.WithAvailabilitySetName, UpdateStages.WithCdnEnabled, UpdateStages.WithCdnProfile, UpdateStages.WithCdnProvider, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithCustomHostNames, UpdateStages.WithDescription, UpdateStages.WithLocation, UpdateStages.WithMaxCacheAge, UpdateStages.WithScaleUnits, UpdateStages.WithTags { - } - - /** - * Grouping of StreamingEndpoint update stages. - */ - interface UpdateStages { - /** - * The stage of the streamingendpoint update allowing to specify AccessControl. - */ - interface WithAccessControl { - /** - * Specifies accessControl. - */ - Update withAccessControl(StreamingEndpointAccessControl accessControl); - } - - /** - * The stage of the streamingendpoint update allowing to specify AvailabilitySetName. - */ - interface WithAvailabilitySetName { - /** - * Specifies availabilitySetName. - */ - Update withAvailabilitySetName(String availabilitySetName); - } - - /** - * The stage of the streamingendpoint update allowing to specify CdnEnabled. - */ - interface WithCdnEnabled { - /** - * Specifies cdnEnabled. - */ - Update withCdnEnabled(Boolean cdnEnabled); - } - - /** - * The stage of the streamingendpoint update allowing to specify CdnProfile. - */ - interface WithCdnProfile { - /** - * Specifies cdnProfile. - */ - Update withCdnProfile(String cdnProfile); - } - - /** - * The stage of the streamingendpoint update allowing to specify CdnProvider. - */ - interface WithCdnProvider { - /** - * Specifies cdnProvider. - */ - Update withCdnProvider(String cdnProvider); - } - - /** - * The stage of the streamingendpoint update allowing to specify CrossSiteAccessPolicies. - */ - interface WithCrossSiteAccessPolicies { - /** - * Specifies crossSiteAccessPolicies. - */ - Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); - } - - /** - * The stage of the streamingendpoint update allowing to specify CustomHostNames. - */ - interface WithCustomHostNames { - /** - * Specifies customHostNames. - */ - Update withCustomHostNames(List customHostNames); - } - - /** - * The stage of the streamingendpoint update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - /** - * The stage of the streamingendpoint update allowing to specify Location. - */ - interface WithLocation { - /** - * Specifies location. - */ - Update withLocation(String location); - } - - /** - * The stage of the streamingendpoint update allowing to specify MaxCacheAge. - */ - interface WithMaxCacheAge { - /** - * Specifies maxCacheAge. - */ - Update withMaxCacheAge(Long maxCacheAge); - } - - /** - * The stage of the streamingendpoint update allowing to specify ScaleUnits. - */ - interface WithScaleUnits { - /** - * Specifies scaleUnits. - */ - Update withScaleUnits(int scaleUnits); - } - - /** - * The stage of the streamingendpoint update allowing to specify Tags. - */ - interface WithTags { - /** - * Specifies tags. - */ - Update withTags(Map tags); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointAccessControl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointAccessControl.java deleted file mode 100644 index deb71e000fb6f..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointAccessControl.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * StreamingEndpoint access control definition. - */ -public class StreamingEndpointAccessControl { - /** - * The access control of Akamai. - */ - @JsonProperty(value = "akamai") - private AkamaiAccessControl akamai; - - /** - * The IP access control of the StreamingEndpoint. - */ - @JsonProperty(value = "ip") - private IPAccessControl ip; - - /** - * Get the access control of Akamai. - * - * @return the akamai value - */ - public AkamaiAccessControl akamai() { - return this.akamai; - } - - /** - * Set the access control of Akamai. - * - * @param akamai the akamai value to set - * @return the StreamingEndpointAccessControl object itself. - */ - public StreamingEndpointAccessControl withAkamai(AkamaiAccessControl akamai) { - this.akamai = akamai; - return this; - } - - /** - * Get the IP access control of the StreamingEndpoint. - * - * @return the ip value - */ - public IPAccessControl ip() { - return this.ip; - } - - /** - * Set the IP access control of the StreamingEndpoint. - * - * @param ip the ip value to set - * @return the StreamingEndpointAccessControl object itself. - */ - public StreamingEndpointAccessControl withIp(IPAccessControl ip) { - this.ip = ip; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointResourceState.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointResourceState.java deleted file mode 100644 index 5b947ec2219f6..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpointResourceState.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StreamingEndpointResourceState. - */ -public enum StreamingEndpointResourceState { - /** Enum value Stopped. */ - STOPPED("Stopped"), - - /** Enum value Starting. */ - STARTING("Starting"), - - /** Enum value Running. */ - RUNNING("Running"), - - /** Enum value Stopping. */ - STOPPING("Stopping"), - - /** Enum value Deleting. */ - DELETING("Deleting"), - - /** Enum value Scaling. */ - SCALING("Scaling"); - - /** The actual serialized value for a StreamingEndpointResourceState instance. */ - private String value; - - StreamingEndpointResourceState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StreamingEndpointResourceState instance. - * - * @param value the serialized value to parse. - * @return the parsed StreamingEndpointResourceState object, or null if unable to parse. - */ - @JsonCreator - public static StreamingEndpointResourceState fromString(String value) { - StreamingEndpointResourceState[] items = StreamingEndpointResourceState.values(); - for (StreamingEndpointResourceState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoints.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoints.java deleted file mode 100644 index f627778081fab..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEndpoints.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingEndpointsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing StreamingEndpoints. - */ -public interface StreamingEndpoints extends SupportsCreating, HasInner { - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName); - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName); - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName); - - /** - * Get StreamingEndpoint. - * Gets a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName); - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEntityScaleUnit.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEntityScaleUnit.java deleted file mode 100644 index 7962588c5dafc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingEntityScaleUnit.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * scale units definition. - */ -public class StreamingEntityScaleUnit { - /** - * ScaleUnit. - * The scale unit number of the StreamingEndpoint. - */ - @JsonProperty(value = "scaleUnit") - private Integer scaleUnit; - - /** - * Get the scale unit number of the StreamingEndpoint. - * - * @return the scaleUnit value - */ - public Integer scaleUnit() { - return this.scaleUnit; - } - - /** - * Set the scale unit number of the StreamingEndpoint. - * - * @param scaleUnit the scaleUnit value to set - * @return the StreamingEntityScaleUnit object itself. - */ - public StreamingEntityScaleUnit withScaleUnit(Integer scaleUnit) { - this.scaleUnit = scaleUnit; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocator.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocator.java deleted file mode 100644 index 528a553267d8a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocator.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingLocatorInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import org.joda.time.DateTime; -import java.util.UUID; -import java.util.List; - -/** - * Type representing StreamingLocator. - */ -public interface StreamingLocator extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the assetName value. - */ - String assetName(); - - /** - * @return the contentKeys value. - */ - List contentKeys(); - - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the defaultContentKeyPolicyName value. - */ - String defaultContentKeyPolicyName(); - - /** - * @return the endTime value. - */ - DateTime endTime(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the startTime value. - */ - DateTime startTime(); - - /** - * @return the streamingLocatorId value. - */ - UUID streamingLocatorId(); - - /** - * @return the streamingPolicyName value. - */ - String streamingPolicyName(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the StreamingLocator definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAssetName, DefinitionStages.WithStreamingPolicyName, DefinitionStages.WithCreate { - } - - /** - * Grouping of StreamingLocator definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a StreamingLocator definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the streaminglocator definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithAssetName withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the streaminglocator definition allowing to specify AssetName. - */ - interface WithAssetName { - /** - * Specifies assetName. - */ - WithStreamingPolicyName withAssetName(String assetName); - } - - /** - * The stage of the streaminglocator definition allowing to specify StreamingPolicyName. - */ - interface WithStreamingPolicyName { - /** - * Specifies streamingPolicyName. - */ - WithCreate withStreamingPolicyName(String streamingPolicyName); - } - - /** - * The stage of the streaminglocator definition allowing to specify ContentKeys. - */ - interface WithContentKeys { - /** - * Specifies contentKeys. - */ - WithCreate withContentKeys(List contentKeys); - } - - /** - * The stage of the streaminglocator definition allowing to specify DefaultContentKeyPolicyName. - */ - interface WithDefaultContentKeyPolicyName { - /** - * Specifies defaultContentKeyPolicyName. - */ - WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); - } - - /** - * The stage of the streaminglocator definition allowing to specify EndTime. - */ - interface WithEndTime { - /** - * Specifies endTime. - */ - WithCreate withEndTime(DateTime endTime); - } - - /** - * The stage of the streaminglocator definition allowing to specify StartTime. - */ - interface WithStartTime { - /** - * Specifies startTime. - */ - WithCreate withStartTime(DateTime startTime); - } - - /** - * The stage of the streaminglocator definition allowing to specify StreamingLocatorId. - */ - interface WithStreamingLocatorId { - /** - * Specifies streamingLocatorId. - */ - WithCreate withStreamingLocatorId(UUID streamingLocatorId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithContentKeys, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEndTime, DefinitionStages.WithStartTime, DefinitionStages.WithStreamingLocatorId { - } - } - /** - * The template for a StreamingLocator update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithContentKeys, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEndTime, UpdateStages.WithStartTime, UpdateStages.WithStreamingLocatorId { - } - - /** - * Grouping of StreamingLocator update stages. - */ - interface UpdateStages { - /** - * The stage of the streaminglocator update allowing to specify ContentKeys. - */ - interface WithContentKeys { - /** - * Specifies contentKeys. - */ - Update withContentKeys(List contentKeys); - } - - /** - * The stage of the streaminglocator update allowing to specify DefaultContentKeyPolicyName. - */ - interface WithDefaultContentKeyPolicyName { - /** - * Specifies defaultContentKeyPolicyName. - */ - Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); - } - - /** - * The stage of the streaminglocator update allowing to specify EndTime. - */ - interface WithEndTime { - /** - * Specifies endTime. - */ - Update withEndTime(DateTime endTime); - } - - /** - * The stage of the streaminglocator update allowing to specify StartTime. - */ - interface WithStartTime { - /** - * Specifies startTime. - */ - Update withStartTime(DateTime startTime); - } - - /** - * The stage of the streaminglocator update allowing to specify StreamingLocatorId. - */ - interface WithStreamingLocatorId { - /** - * Specifies streamingLocatorId. - */ - Update withStreamingLocatorId(UUID streamingLocatorId); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKey.java deleted file mode 100644 index 62a1fde110393..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKey.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.UUID; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class for content key in Streaming Locator. - */ -public class StreamingLocatorContentKey { - /** - * Label of Content Key. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Encryption type of Content Key. Possible values include: - * 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. - */ - @JsonProperty(value = "type", required = true) - private StreamingLocatorContentKeyType type; - - /** - * ID of Content Key. - */ - @JsonProperty(value = "id", required = true) - private UUID id; - - /** - * Value of of Content Key. - */ - @JsonProperty(value = "value") - private String value; - - /** - * ContentKeyPolicy used by Content Key. - */ - @JsonProperty(value = "policyName") - private String policyName; - - /** - * Tracks which use this Content Key. - */ - @JsonProperty(value = "tracks") - private List tracks; - - /** - * Get label of Content Key. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set label of Content Key. - * - * @param label the label value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withLabel(String label) { - this.label = label; - return this; - } - - /** - * Get encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. - * - * @return the type value - */ - public StreamingLocatorContentKeyType type() { - return this.type; - } - - /** - * Set encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. - * - * @param type the type value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withType(StreamingLocatorContentKeyType type) { - this.type = type; - return this; - } - - /** - * Get iD of Content Key. - * - * @return the id value - */ - public UUID id() { - return this.id; - } - - /** - * Set iD of Content Key. - * - * @param id the id value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withId(UUID id) { - this.id = id; - return this; - } - - /** - * Get value of of Content Key. - * - * @return the value value - */ - public String value() { - return this.value; - } - - /** - * Set value of of Content Key. - * - * @param value the value value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withValue(String value) { - this.value = value; - return this; - } - - /** - * Get contentKeyPolicy used by Content Key. - * - * @return the policyName value - */ - public String policyName() { - return this.policyName; - } - - /** - * Set contentKeyPolicy used by Content Key. - * - * @param policyName the policyName value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get tracks which use this Content Key. - * - * @return the tracks value - */ - public List tracks() { - return this.tracks; - } - - /** - * Set tracks which use this Content Key. - * - * @param tracks the tracks value to set - * @return the StreamingLocatorContentKey object itself. - */ - public StreamingLocatorContentKey withTracks(List tracks) { - this.tracks = tracks; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKeyType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKeyType.java deleted file mode 100644 index 6f7b4e87612ec..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocatorContentKeyType.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StreamingLocatorContentKeyType. - */ -public enum StreamingLocatorContentKeyType { - /** Common Encryption using CENC. */ - COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), - - /** Common Encryption using CBCS. */ - COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"), - - /** Envelope Encryption. */ - ENVELOPE_ENCRYPTION("EnvelopeEncryption"); - - /** The actual serialized value for a StreamingLocatorContentKeyType instance. */ - private String value; - - StreamingLocatorContentKeyType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StreamingLocatorContentKeyType instance. - * - * @param value the serialized value to parse. - * @return the parsed StreamingLocatorContentKeyType object, or null if unable to parse. - */ - @JsonCreator - public static StreamingLocatorContentKeyType fromString(String value) { - StreamingLocatorContentKeyType[] items = StreamingLocatorContentKeyType.values(); - for (StreamingLocatorContentKeyType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocators.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocators.java deleted file mode 100644 index 22385d2642c0e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingLocators.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingLocatorsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing StreamingLocators. - */ -public interface StreamingLocators extends SupportsCreating, HasInner { - /** - * List Content Keys. - * List Content Keys used by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName); - - /** - * List Paths. - * List Paths supported by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName); - - /** - * Get a Streaming Locator. - * Get the details of a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName); - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete a Streaming Locator. - * Deletes a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPath.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPath.java deleted file mode 100644 index ac39b4b177d03..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPath.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class of paths for streaming. - */ -public class StreamingPath { - /** - * Streaming protocol. Possible values include: 'Hls', 'Dash', - * 'SmoothStreaming', 'Download'. - */ - @JsonProperty(value = "streamingProtocol", required = true) - private StreamingPolicyStreamingProtocol streamingProtocol; - - /** - * Encryption scheme. Possible values include: 'NoEncryption', - * 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. - */ - @JsonProperty(value = "encryptionScheme", required = true) - private EncryptionScheme encryptionScheme; - - /** - * Streaming paths for each protocol and encryptionScheme pair. - */ - @JsonProperty(value = "paths") - private List paths; - - /** - * Get streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. - * - * @return the streamingProtocol value - */ - public StreamingPolicyStreamingProtocol streamingProtocol() { - return this.streamingProtocol; - } - - /** - * Set streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. - * - * @param streamingProtocol the streamingProtocol value to set - * @return the StreamingPath object itself. - */ - public StreamingPath withStreamingProtocol(StreamingPolicyStreamingProtocol streamingProtocol) { - this.streamingProtocol = streamingProtocol; - return this; - } - - /** - * Get encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. - * - * @return the encryptionScheme value - */ - public EncryptionScheme encryptionScheme() { - return this.encryptionScheme; - } - - /** - * Set encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. - * - * @param encryptionScheme the encryptionScheme value to set - * @return the StreamingPath object itself. - */ - public StreamingPath withEncryptionScheme(EncryptionScheme encryptionScheme) { - this.encryptionScheme = encryptionScheme; - return this; - } - - /** - * Get streaming paths for each protocol and encryptionScheme pair. - * - * @return the paths value - */ - public List paths() { - return this.paths; - } - - /** - * Set streaming paths for each protocol and encryptionScheme pair. - * - * @param paths the paths value to set - * @return the StreamingPath object itself. - */ - public StreamingPath withPaths(List paths) { - this.paths = paths; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicies.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicies.java deleted file mode 100644 index b21b9f2a99403..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicies.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingPoliciesInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing StreamingPolicies. - */ -public interface StreamingPolicies extends SupportsCreating, HasInner { - /** - * Get a Streaming Policy. - * Get the details of a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName); - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete a Streaming Policy. - * Deletes a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicy.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicy.java deleted file mode 100644 index 014f967bb5693..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicy.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.StreamingPolicyInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import org.joda.time.DateTime; - -/** - * Type representing StreamingPolicy. - */ -public interface StreamingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the commonEncryptionCbcs value. - */ - CommonEncryptionCbcs commonEncryptionCbcs(); - - /** - * @return the commonEncryptionCenc value. - */ - CommonEncryptionCenc commonEncryptionCenc(); - - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the defaultContentKeyPolicyName value. - */ - String defaultContentKeyPolicyName(); - - /** - * @return the envelopeEncryption value. - */ - EnvelopeEncryption envelopeEncryption(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the noEncryption value. - */ - NoEncryption noEncryption(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the StreamingPolicy definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { - } - - /** - * Grouping of StreamingPolicy definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a StreamingPolicy definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the streamingpolicy definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithCreate withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCbcs. - */ - interface WithCommonEncryptionCbcs { - /** - * Specifies commonEncryptionCbcs. - */ - WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); - } - - /** - * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCenc. - */ - interface WithCommonEncryptionCenc { - /** - * Specifies commonEncryptionCenc. - */ - WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); - } - - /** - * The stage of the streamingpolicy definition allowing to specify DefaultContentKeyPolicyName. - */ - interface WithDefaultContentKeyPolicyName { - /** - * Specifies defaultContentKeyPolicyName. - */ - WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); - } - - /** - * The stage of the streamingpolicy definition allowing to specify EnvelopeEncryption. - */ - interface WithEnvelopeEncryption { - /** - * Specifies envelopeEncryption. - */ - WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); - } - - /** - * The stage of the streamingpolicy definition allowing to specify NoEncryption. - */ - interface WithNoEncryption { - /** - * Specifies noEncryption. - */ - WithCreate withNoEncryption(NoEncryption noEncryption); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithCommonEncryptionCbcs, DefinitionStages.WithCommonEncryptionCenc, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEnvelopeEncryption, DefinitionStages.WithNoEncryption { - } - } - /** - * The template for a StreamingPolicy update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithCommonEncryptionCbcs, UpdateStages.WithCommonEncryptionCenc, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEnvelopeEncryption, UpdateStages.WithNoEncryption { - } - - /** - * Grouping of StreamingPolicy update stages. - */ - interface UpdateStages { - /** - * The stage of the streamingpolicy update allowing to specify CommonEncryptionCbcs. - */ - interface WithCommonEncryptionCbcs { - /** - * Specifies commonEncryptionCbcs. - */ - Update withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); - } - - /** - * The stage of the streamingpolicy update allowing to specify CommonEncryptionCenc. - */ - interface WithCommonEncryptionCenc { - /** - * Specifies commonEncryptionCenc. - */ - Update withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); - } - - /** - * The stage of the streamingpolicy update allowing to specify DefaultContentKeyPolicyName. - */ - interface WithDefaultContentKeyPolicyName { - /** - * Specifies defaultContentKeyPolicyName. - */ - Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); - } - - /** - * The stage of the streamingpolicy update allowing to specify EnvelopeEncryption. - */ - interface WithEnvelopeEncryption { - /** - * Specifies envelopeEncryption. - */ - Update withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); - } - - /** - * The stage of the streamingpolicy update allowing to specify NoEncryption. - */ - interface WithNoEncryption { - /** - * Specifies noEncryption. - */ - Update withNoEncryption(NoEncryption noEncryption); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKey.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKey.java deleted file mode 100644 index ba8f8adb2f435..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKey.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify properties of content key. - */ -public class StreamingPolicyContentKey { - /** - * Label can be used to specify Content Key when creating Stremaing - * Locator. - */ - @JsonProperty(value = "label") - private String label; - - /** - * Policy used by Content Key. - */ - @JsonProperty(value = "policyName") - private String policyName; - - /** - * Tracks which use this content key. - */ - @JsonProperty(value = "tracks") - private List tracks; - - /** - * Get label can be used to specify Content Key when creating Stremaing Locator. - * - * @return the label value - */ - public String label() { - return this.label; - } - - /** - * Set label can be used to specify Content Key when creating Stremaing Locator. - * - * @param label the label value to set - * @return the StreamingPolicyContentKey object itself. - */ - public StreamingPolicyContentKey withLabel(String label) { - this.label = label; - return this; - } - - /** - * Get policy used by Content Key. - * - * @return the policyName value - */ - public String policyName() { - return this.policyName; - } - - /** - * Set policy used by Content Key. - * - * @param policyName the policyName value to set - * @return the StreamingPolicyContentKey object itself. - */ - public StreamingPolicyContentKey withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get tracks which use this content key. - * - * @return the tracks value - */ - public List tracks() { - return this.tracks; - } - - /** - * Set tracks which use this content key. - * - * @param tracks the tracks value to set - * @return the StreamingPolicyContentKey object itself. - */ - public StreamingPolicyContentKey withTracks(List tracks) { - this.tracks = tracks; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKeys.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKeys.java deleted file mode 100644 index 7ccffcb493927..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyContentKeys.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify properties of all content keys in Streaming Policy. - */ -public class StreamingPolicyContentKeys { - /** - * Default content key for an encryption scheme. - */ - @JsonProperty(value = "defaultKey") - private DefaultKey defaultKey; - - /** - * Representing tracks needs sepearete content key. - */ - @JsonProperty(value = "keyToTrackMappings") - private List keyToTrackMappings; - - /** - * Get default content key for an encryption scheme. - * - * @return the defaultKey value - */ - public DefaultKey defaultKey() { - return this.defaultKey; - } - - /** - * Set default content key for an encryption scheme. - * - * @param defaultKey the defaultKey value to set - * @return the StreamingPolicyContentKeys object itself. - */ - public StreamingPolicyContentKeys withDefaultKey(DefaultKey defaultKey) { - this.defaultKey = defaultKey; - return this; - } - - /** - * Get representing tracks needs sepearete content key. - * - * @return the keyToTrackMappings value - */ - public List keyToTrackMappings() { - return this.keyToTrackMappings; - } - - /** - * Set representing tracks needs sepearete content key. - * - * @param keyToTrackMappings the keyToTrackMappings value to set - * @return the StreamingPolicyContentKeys object itself. - */ - public StreamingPolicyContentKeys withKeyToTrackMappings(List keyToTrackMappings) { - this.keyToTrackMappings = keyToTrackMappings; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyFairPlayConfiguration.java deleted file mode 100644 index 1a9778f6e1e15..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyFairPlayConfiguration.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify configurations of FairPlay in Streaming Policy. - */ -public class StreamingPolicyFairPlayConfiguration { - /** - * The template for a customer service to deliver keys to end users. Not - * needed when using Azure Media Services for issuing keys. - */ - @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") - private String customLicenseAcquisitionUrlTemplate; - - /** - * All license to be persistent or not. - */ - @JsonProperty(value = "allowPersistentLicense", required = true) - private boolean allowPersistentLicense; - - /** - * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @return the customLicenseAcquisitionUrlTemplate value - */ - public String customLicenseAcquisitionUrlTemplate() { - return this.customLicenseAcquisitionUrlTemplate; - } - - /** - * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set - * @return the StreamingPolicyFairPlayConfiguration object itself. - */ - public StreamingPolicyFairPlayConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { - this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; - return this; - } - - /** - * Get all license to be persistent or not. - * - * @return the allowPersistentLicense value - */ - public boolean allowPersistentLicense() { - return this.allowPersistentLicense; - } - - /** - * Set all license to be persistent or not. - * - * @param allowPersistentLicense the allowPersistentLicense value to set - * @return the StreamingPolicyFairPlayConfiguration object itself. - */ - public StreamingPolicyFairPlayConfiguration withAllowPersistentLicense(boolean allowPersistentLicense) { - this.allowPersistentLicense = allowPersistentLicense; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyPlayReadyConfiguration.java deleted file mode 100644 index f827e8a718104..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyPlayReadyConfiguration.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify configurations of PlayReady in Streaming Policy. - */ -public class StreamingPolicyPlayReadyConfiguration { - /** - * The template for a customer service to deliver keys to end users. Not - * needed when using Azure Media Services for issuing keys. - */ - @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") - private String customLicenseAcquisitionUrlTemplate; - - /** - * Custom attributes for PlayReady. - */ - @JsonProperty(value = "playReadyCustomAttributes") - private String playReadyCustomAttributes; - - /** - * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @return the customLicenseAcquisitionUrlTemplate value - */ - public String customLicenseAcquisitionUrlTemplate() { - return this.customLicenseAcquisitionUrlTemplate; - } - - /** - * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set - * @return the StreamingPolicyPlayReadyConfiguration object itself. - */ - public StreamingPolicyPlayReadyConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { - this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; - return this; - } - - /** - * Get custom attributes for PlayReady. - * - * @return the playReadyCustomAttributes value - */ - public String playReadyCustomAttributes() { - return this.playReadyCustomAttributes; - } - - /** - * Set custom attributes for PlayReady. - * - * @param playReadyCustomAttributes the playReadyCustomAttributes value to set - * @return the StreamingPolicyPlayReadyConfiguration object itself. - */ - public StreamingPolicyPlayReadyConfiguration withPlayReadyCustomAttributes(String playReadyCustomAttributes) { - this.playReadyCustomAttributes = playReadyCustomAttributes; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyStreamingProtocol.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyStreamingProtocol.java deleted file mode 100644 index fa01fe7ddd830..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyStreamingProtocol.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StreamingPolicyStreamingProtocol. - */ -public enum StreamingPolicyStreamingProtocol { - /** HLS protocol. */ - HLS("Hls"), - - /** DASH protocol. */ - DASH("Dash"), - - /** SmoothStreaming protocol. */ - SMOOTH_STREAMING("SmoothStreaming"), - - /** Download protocol. */ - DOWNLOAD("Download"); - - /** The actual serialized value for a StreamingPolicyStreamingProtocol instance. */ - private String value; - - StreamingPolicyStreamingProtocol(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StreamingPolicyStreamingProtocol instance. - * - * @param value the serialized value to parse. - * @return the parsed StreamingPolicyStreamingProtocol object, or null if unable to parse. - */ - @JsonCreator - public static StreamingPolicyStreamingProtocol fromString(String value) { - StreamingPolicyStreamingProtocol[] items = StreamingPolicyStreamingProtocol.values(); - for (StreamingPolicyStreamingProtocol item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyWidevineConfiguration.java deleted file mode 100644 index eff579ae5a808..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StreamingPolicyWidevineConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify configurations of Widevine in Streaming Policy. - */ -public class StreamingPolicyWidevineConfiguration { - /** - * The template for a customer service to deliver keys to end users. Not - * needed when using Azure Media Services for issuing keys. - */ - @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") - private String customLicenseAcquisitionUrlTemplate; - - /** - * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @return the customLicenseAcquisitionUrlTemplate value - */ - public String customLicenseAcquisitionUrlTemplate() { - return this.customLicenseAcquisitionUrlTemplate; - } - - /** - * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. - * - * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set - * @return the StreamingPolicyWidevineConfiguration object itself. - */ - public StreamingPolicyWidevineConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { - this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StretchMode.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StretchMode.java deleted file mode 100644 index f548d5267c2e6..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/StretchMode.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for StretchMode. - */ -public enum StretchMode { - /** Strictly respect the output resolution without considering the pixel aspect ratio or display aspect ratio of the input video. */ - NONE("None"), - - /** Override the output resolution, and change it to match the display aspect ratio of the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which maintains the input aspect ratio of 16:9. */ - AUTO_SIZE("AutoSize"), - - /** Pad the output (with either letterbox or pillar box) to honor the output resolution, while ensuring that the active video region in the output has the same aspect ratio as the input. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box regions 280 pixels wide at the left and right. */ - AUTO_FIT("AutoFit"); - - /** The actual serialized value for a StretchMode instance. */ - private String value; - - StretchMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StretchMode instance. - * - * @param value the serialized value to parse. - * @return the parsed StretchMode object, or null if unable to parse. - */ - @JsonCreator - public static StretchMode fromString(String value) { - StretchMode[] items = StretchMode.values(); - for (StretchMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SubscriptionMediaService.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SubscriptionMediaService.java deleted file mode 100644 index 255bd516fe21b..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SubscriptionMediaService.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.SubscriptionMediaServiceInner; -import java.util.UUID; -import java.util.List; -import java.util.Map; - -/** - * Type representing SubscriptionMediaService. - */ -public interface SubscriptionMediaService extends HasInner, HasManager { - /** - * @return the id value. - */ - String id(); - - /** - * @return the location value. - */ - String location(); - - /** - * @return the mediaServiceId value. - */ - UUID mediaServiceId(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the storageAccounts value. - */ - List storageAccounts(); - - /** - * @return the tags value. - */ - Map tags(); - - /** - * @return the type value. - */ - String type(); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SyncStorageKeysInput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SyncStorageKeysInput.java deleted file mode 100644 index 4dafa0e3a5ca9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/SyncStorageKeysInput.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The input to the sync storage keys request. - */ -public class SyncStorageKeysInput { - /** - * The ID of the storage account resource. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the ID of the storage account resource. - * - * @return the id value - */ - public String id() { - return this.id; - } - - /** - * Set the ID of the storage account resource. - * - * @param id the id value to set - * @return the SyncStorageKeysInput object itself. - */ - public SyncStorageKeysInput withId(String id) { - this.id = id; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCompareOperation.java deleted file mode 100644 index babb72b441d0e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCompareOperation.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for TrackPropertyCompareOperation. - */ -public enum TrackPropertyCompareOperation { - /** Unknown track property compare operation. */ - UNKNOWN("Unknown"), - - /** Equal operation. */ - EQUAL("Equal"); - - /** The actual serialized value for a TrackPropertyCompareOperation instance. */ - private String value; - - TrackPropertyCompareOperation(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TrackPropertyCompareOperation instance. - * - * @param value the serialized value to parse. - * @return the parsed TrackPropertyCompareOperation object, or null if unable to parse. - */ - @JsonCreator - public static TrackPropertyCompareOperation fromString(String value) { - TrackPropertyCompareOperation[] items = TrackPropertyCompareOperation.values(); - for (TrackPropertyCompareOperation item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCondition.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCondition.java deleted file mode 100644 index 0e7e2c01bea53..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyCondition.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to specify one track property condition. - */ -public class TrackPropertyCondition { - /** - * Track property type. Possible values include: 'Unknown', 'FourCC'. - */ - @JsonProperty(value = "property", required = true) - private TrackPropertyType property; - - /** - * Track property condition operation. Possible values include: 'Unknown', - * 'Equal'. - */ - @JsonProperty(value = "operation", required = true) - private TrackPropertyCompareOperation operation; - - /** - * Track proprty value. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get track property type. Possible values include: 'Unknown', 'FourCC'. - * - * @return the property value - */ - public TrackPropertyType property() { - return this.property; - } - - /** - * Set track property type. Possible values include: 'Unknown', 'FourCC'. - * - * @param property the property value to set - * @return the TrackPropertyCondition object itself. - */ - public TrackPropertyCondition withProperty(TrackPropertyType property) { - this.property = property; - return this; - } - - /** - * Get track property condition operation. Possible values include: 'Unknown', 'Equal'. - * - * @return the operation value - */ - public TrackPropertyCompareOperation operation() { - return this.operation; - } - - /** - * Set track property condition operation. Possible values include: 'Unknown', 'Equal'. - * - * @param operation the operation value to set - * @return the TrackPropertyCondition object itself. - */ - public TrackPropertyCondition withOperation(TrackPropertyCompareOperation operation) { - this.operation = operation; - return this; - } - - /** - * Get track proprty value. - * - * @return the value value - */ - public String value() { - return this.value; - } - - /** - * Set track proprty value. - * - * @param value the value value to set - * @return the TrackPropertyCondition object itself. - */ - public TrackPropertyCondition withValue(String value) { - this.value = value; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyType.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyType.java deleted file mode 100644 index e51805a59c131..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackPropertyType.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for TrackPropertyType. - */ -public enum TrackPropertyType { - /** Unknown track property. */ - UNKNOWN("Unknown"), - - /** Track FourCC. */ - FOUR_CC("FourCC"); - - /** The actual serialized value for a TrackPropertyType instance. */ - private String value; - - TrackPropertyType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TrackPropertyType instance. - * - * @param value the serialized value to parse. - * @return the parsed TrackPropertyType object, or null if unable to parse. - */ - @JsonCreator - public static TrackPropertyType fromString(String value) { - TrackPropertyType[] items = TrackPropertyType.values(); - for (TrackPropertyType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackSelection.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackSelection.java deleted file mode 100644 index 9dc0d427adee5..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TrackSelection.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class to select a track. - */ -public class TrackSelection { - /** - * TrackSelections is a track property condition list which can specify - * track(s). - */ - @JsonProperty(value = "trackSelections") - private List trackSelections; - - /** - * Get trackSelections is a track property condition list which can specify track(s). - * - * @return the trackSelections value - */ - public List trackSelections() { - return this.trackSelections; - } - - /** - * Set trackSelections is a track property condition list which can specify track(s). - * - * @param trackSelections the trackSelections value to set - * @return the TrackSelection object itself. - */ - public TrackSelection withTrackSelections(List trackSelections) { - this.trackSelections = trackSelections; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transform.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transform.java deleted file mode 100644 index 12eb243919bdc..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transform.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.TransformInner; -import com.microsoft.azure.arm.model.Indexable; -import com.microsoft.azure.arm.model.Refreshable; -import com.microsoft.azure.arm.model.Updatable; -import com.microsoft.azure.arm.model.Appliable; -import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import org.joda.time.DateTime; -import java.util.List; - -/** - * Type representing Transform. - */ -public interface Transform extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the created value. - */ - DateTime created(); - - /** - * @return the description value. - */ - String description(); - - /** - * @return the id value. - */ - String id(); - - /** - * @return the lastModified value. - */ - DateTime lastModified(); - - /** - * @return the name value. - */ - String name(); - - /** - * @return the outputs value. - */ - List outputs(); - - /** - * @return the type value. - */ - String type(); - - /** - * The entirety of the Transform definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { - } - - /** - * Grouping of Transform definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a Transform definition. - */ - interface Blank extends WithMediaservice { - } - - /** - * The stage of the transform definition allowing to specify Mediaservice. - */ - interface WithMediaservice { - /** - * Specifies resourceGroupName, accountName. - */ - WithOutputs withExistingMediaservice(String resourceGroupName, String accountName); - } - - /** - * The stage of the transform definition allowing to specify Outputs. - */ - interface WithOutputs { - /** - * Specifies outputs. - */ - WithCreate withOutputs(List outputs); - } - - /** - * The stage of the transform definition allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionStages.WithDescription { - } - } - /** - * The template for a Transform update operation, containing all the settings that can be modified. - */ - interface Update extends Appliable, UpdateStages.WithDescription { - } - - /** - * Grouping of Transform update stages. - */ - interface UpdateStages { - /** - * The stage of the transform update allowing to specify Description. - */ - interface WithDescription { - /** - * Specifies description. - */ - Update withDescription(String description); - } - - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransformOutput.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransformOutput.java deleted file mode 100644 index 552ddb5c4fc4c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransformOutput.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes the properties of a TransformOutput, which are the rules to be - * applied while generating the desired output. - */ -public class TransformOutput { - /** - * A Transform can define more than one outputs. This property defines what - * the service should do when one output fails - either continue to produce - * other outputs, or, stop the other outputs. The default is stop. Possible - * values include: 'StopProcessingJob', 'ContinueJob'. - */ - @JsonProperty(value = "onError") - private OnErrorType onError; - - /** - * Sets the relative priority of the TransformOutputs within a Transform. - * This sets the priority that the service uses for processing - * TransformOutputs. The default priority is Normal. Possible values - * include: 'Low', 'Normal', 'High'. - */ - @JsonProperty(value = "relativePriority") - private Priority relativePriority; - - /** - * Preset that describes the operations that will be used to modify, - * transcode, or extract insights from the source file to generate the - * output. - */ - @JsonProperty(value = "preset", required = true) - private Preset preset; - - /** - * Get a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob'. - * - * @return the onError value - */ - public OnErrorType onError() { - return this.onError; - } - - /** - * Set a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob'. - * - * @param onError the onError value to set - * @return the TransformOutput object itself. - */ - public TransformOutput withOnError(OnErrorType onError) { - this.onError = onError; - return this; - } - - /** - * Get sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. - * - * @return the relativePriority value - */ - public Priority relativePriority() { - return this.relativePriority; - } - - /** - * Set sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. - * - * @param relativePriority the relativePriority value to set - * @return the TransformOutput object itself. - */ - public TransformOutput withRelativePriority(Priority relativePriority) { - this.relativePriority = relativePriority; - return this; - } - - /** - * Get preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. - * - * @return the preset value - */ - public Preset preset() { - return this.preset; - } - - /** - * Set preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. - * - * @param preset the preset value to set - * @return the TransformOutput object itself. - */ - public TransformOutput withPreset(Preset preset) { - this.preset = preset; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transforms.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transforms.java deleted file mode 100644 index af2a4e0f882c8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Transforms.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.microsoft.azure.arm.collection.SupportsCreating; -import rx.Completable; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.TransformsInner; -import com.microsoft.azure.arm.model.HasInner; - -/** - * Type representing Transforms. - */ -public interface Transforms extends SupportsCreating, HasInner { - /** - * Get Transform. - * Gets a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getAsync(String resourceGroupName, String accountName, String transformName); - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listAsync(final String resourceGroupName, final String accountName); - - /** - * Delete Transform. - * Deletes a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable deleteAsync(String resourceGroupName, String accountName, String transformName); - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransportStreamFormat.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransportStreamFormat.java deleted file mode 100644 index a2b64ac2a9b28..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/TransportStreamFormat.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC - * 13818-1) output video file(s). - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.TransportStreamFormat") -public class TransportStreamFormat extends MultiBitrateFormat { -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Video.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Video.java deleted file mode 100644 index 31f054b12a1e1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/Video.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import org.joda.time.Period; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the basic properties for encoding the input video. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.Video") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.Image", value = Image.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.H264Video", value = H264Video.class) -}) -public class Video extends Codec { - /** - * The distance between two key frames, thereby defining a group of - * pictures (GOP). The value should be a non-zero integer in the range [1, - * 30] seconds, specified in ISO 8601 format. The default is 2 seconds - * (PT2S). - */ - @JsonProperty(value = "keyFrameInterval") - private Period keyFrameInterval; - - /** - * The resizing mode - how the input video will be resized to fit the - * desired output resolution(s). Default is AutoSize. Possible values - * include: 'None', 'AutoSize', 'AutoFit'. - */ - @JsonProperty(value = "stretchMode") - private StretchMode stretchMode; - - /** - * Get the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). - * - * @return the keyFrameInterval value - */ - public Period keyFrameInterval() { - return this.keyFrameInterval; - } - - /** - * Set the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). - * - * @param keyFrameInterval the keyFrameInterval value to set - * @return the Video object itself. - */ - public Video withKeyFrameInterval(Period keyFrameInterval) { - this.keyFrameInterval = keyFrameInterval; - return this; - } - - /** - * Get the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. - * - * @return the stretchMode value - */ - public StretchMode stretchMode() { - return this.stretchMode; - } - - /** - * Set the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. - * - * @param stretchMode the stretchMode value to set - * @return the Video object itself. - */ - public Video withStretchMode(StretchMode stretchMode) { - this.stretchMode = stretchMode; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoAnalyzerPreset.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoAnalyzerPreset.java deleted file mode 100644 index a1d3dcaaa54d2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoAnalyzerPreset.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * A video analyzer preset that extracts insights (rich metadata) from both - * audio and video, and outputs a JSON format file. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.VideoAnalyzerPreset") -public class VideoAnalyzerPreset extends AudioAnalyzerPreset { - /** - * Whether to only extract audio insights when processing a video file. - */ - @JsonProperty(value = "audioInsightsOnly") - private Boolean audioInsightsOnly; - - /** - * Get whether to only extract audio insights when processing a video file. - * - * @return the audioInsightsOnly value - */ - public Boolean audioInsightsOnly() { - return this.audioInsightsOnly; - } - - /** - * Set whether to only extract audio insights when processing a video file. - * - * @param audioInsightsOnly the audioInsightsOnly value to set - * @return the VideoAnalyzerPreset object itself. - */ - public VideoAnalyzerPreset withAudioInsightsOnly(Boolean audioInsightsOnly) { - this.audioInsightsOnly = audioInsightsOnly; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoLayer.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoLayer.java deleted file mode 100644 index 9ea60acd992a3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoLayer.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; - -/** - * Describes the settings to be used when encoding the input video into a - * desired output bitrate layer. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.VideoLayer") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "#Microsoft.Media.H264Layer", value = H264Layer.class) -}) -public class VideoLayer extends Layer { - /** - * The average bitrate in bits per second at which to encode the input - * video when generating this layer. This is a required field. - */ - @JsonProperty(value = "bitrate") - private Integer bitrate; - - /** - * The maximum bitrate (in bits per second), at which the VBV buffer should - * be assumed to refill. If not specified, defaults to the same value as - * bitrate. - */ - @JsonProperty(value = "maxBitrate") - private Integer maxBitrate; - - /** - * The number of B-frames to be used when encoding this layer. If not - * specified, the encoder chooses an appropriate number based on the video - * profile and level. - */ - @JsonProperty(value = "bFrames") - private Integer bFrames; - - /** - * The frame rate (in frames per second) at which to encode this layer. The - * value can be in the form of M/N where M and N are integers (For example, - * 30000/1001), or in the form of a number (For example, 30, or 29.97). The - * encoder enforces constraints on allowed frame rates based on the profile - * and level. If it is not specified, the encoder will use the same frame - * rate as the input video. - */ - @JsonProperty(value = "frameRate") - private String frameRate; - - /** - * The number of slices to be used when encoding this layer. If not - * specified, default is zero, which means that encoder will use a single - * slice for each frame. - */ - @JsonProperty(value = "slices") - private Integer slices; - - /** - * Whether or not adaptive B-frames are to be used when encoding this - * layer. If not specified, the encoder will turn it on whenever the video - * profile permits its use. - */ - @JsonProperty(value = "adaptiveBFrame") - private Boolean adaptiveBFrame; - - /** - * Get the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. - * - * @return the bitrate value - */ - public Integer bitrate() { - return this.bitrate; - } - - /** - * Set the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. - * - * @param bitrate the bitrate value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withBitrate(Integer bitrate) { - this.bitrate = bitrate; - return this; - } - - /** - * Get the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. - * - * @return the maxBitrate value - */ - public Integer maxBitrate() { - return this.maxBitrate; - } - - /** - * Set the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. - * - * @param maxBitrate the maxBitrate value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withMaxBitrate(Integer maxBitrate) { - this.maxBitrate = maxBitrate; - return this; - } - - /** - * Get the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. - * - * @return the bFrames value - */ - public Integer bFrames() { - return this.bFrames; - } - - /** - * Set the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. - * - * @param bFrames the bFrames value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withBFrames(Integer bFrames) { - this.bFrames = bFrames; - return this; - } - - /** - * Get the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. - * - * @return the frameRate value - */ - public String frameRate() { - return this.frameRate; - } - - /** - * Set the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. - * - * @param frameRate the frameRate value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withFrameRate(String frameRate) { - this.frameRate = frameRate; - return this; - } - - /** - * Get the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. - * - * @return the slices value - */ - public Integer slices() { - return this.slices; - } - - /** - * Set the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. - * - * @param slices the slices value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withSlices(Integer slices) { - this.slices = slices; - return this; - } - - /** - * Get whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. - * - * @return the adaptiveBFrame value - */ - public Boolean adaptiveBFrame() { - return this.adaptiveBFrame; - } - - /** - * Set whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. - * - * @param adaptiveBFrame the adaptiveBFrame value to set - * @return the VideoLayer object itself. - */ - public VideoLayer withAdaptiveBFrame(Boolean adaptiveBFrame) { - this.adaptiveBFrame = adaptiveBFrame; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoOverlay.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoOverlay.java deleted file mode 100644 index ce5e99fbaa6bb..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/VideoOverlay.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Describes the properties of a video overlay. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") -@JsonTypeName("#Microsoft.Media.VideoOverlay") -public class VideoOverlay extends Overlay { - /** - * The location in the input video where the overlay is applied. - */ - @JsonProperty(value = "position") - private Rectangle position; - - /** - * The opacity of the overlay. This is a value in the range [0 - 1.0]. - * Default is 1.0 which mean the overlay is opaque. - */ - @JsonProperty(value = "opacity") - private Double opacity; - - /** - * An optional rectangular window used to crop the overlay image or video. - */ - @JsonProperty(value = "cropRectangle") - private Rectangle cropRectangle; - - /** - * Get the location in the input video where the overlay is applied. - * - * @return the position value - */ - public Rectangle position() { - return this.position; - } - - /** - * Set the location in the input video where the overlay is applied. - * - * @param position the position value to set - * @return the VideoOverlay object itself. - */ - public VideoOverlay withPosition(Rectangle position) { - this.position = position; - return this; - } - - /** - * Get the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. - * - * @return the opacity value - */ - public Double opacity() { - return this.opacity; - } - - /** - * Set the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. - * - * @param opacity the opacity value to set - * @return the VideoOverlay object itself. - */ - public VideoOverlay withOpacity(Double opacity) { - this.opacity = opacity; - return this; - } - - /** - * Get an optional rectangular window used to crop the overlay image or video. - * - * @return the cropRectangle value - */ - public Rectangle cropRectangle() { - return this.cropRectangle; - } - - /** - * Set an optional rectangular window used to crop the overlay image or video. - * - * @param cropRectangle the cropRectangle value to set - * @return the VideoOverlay object itself. - */ - public VideoOverlay withCropRectangle(Rectangle cropRectangle) { - this.cropRectangle = cropRectangle; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasImpl.java deleted file mode 100644 index e4fcbefc5f9b8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetContainerSas; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import java.util.List; - -class AssetContainerSasImpl extends WrapperImpl implements AssetContainerSas { - private final MediaManager manager; - AssetContainerSasImpl(AssetContainerSasInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public List assetContainerSasUrls() { - return this.inner().assetContainerSasUrls(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasInner.java deleted file mode 100644 index 00135d2d838d3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetContainerSasInner.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Asset Storage container SAS URLs. - */ -public class AssetContainerSasInner { - /** - * The list of Asset container SAS URLs. - */ - @JsonProperty(value = "assetContainerSasUrls") - private List assetContainerSasUrls; - - /** - * Get the list of Asset container SAS URLs. - * - * @return the assetContainerSasUrls value - */ - public List assetContainerSasUrls() { - return this.assetContainerSasUrls; - } - - /** - * Set the list of Asset container SAS URLs. - * - * @param assetContainerSasUrls the assetContainerSasUrls value to set - * @return the AssetContainerSasInner object itself. - */ - public AssetContainerSasInner withAssetContainerSasUrls(List assetContainerSasUrls) { - this.assetContainerSasUrls = assetContainerSasUrls; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetImpl.java deleted file mode 100644 index d99742cc248d3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Asset; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import java.util.UUID; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetStorageEncryptionFormat; - -class AssetImpl extends CreatableUpdatableImpl implements Asset, Asset.Definition, Asset.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String assetName; - - AssetImpl(String name, MediaManager manager) { - super(name, new AssetInner()); - this.manager = manager; - // Set resource name - this.assetName = name; - // - } - - AssetImpl(AssetInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.assetName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - AssetsInner client = this.manager().inner().assets(); - return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - AssetsInner client = this.manager().inner().assets(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - AssetsInner client = this.manager().inner().assets(); - return client.getAsync(this.resourceGroupName, this.accountName, this.assetName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public String alternateId() { - return this.inner().alternateId(); - } - - @Override - public UUID assetId() { - return this.inner().assetId(); - } - - @Override - public String container() { - return this.inner().container(); - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public String storageAccountName() { - return this.inner().storageAccountName(); - } - - @Override - public AssetStorageEncryptionFormat storageEncryptionFormat() { - return this.inner().storageEncryptionFormat(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public AssetImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public AssetImpl withAlternateId(String alternateId) { - this.inner().withAlternateId(alternateId); - return this; - } - - @Override - public AssetImpl withContainer(String container) { - this.inner().withContainer(container); - return this; - } - - @Override - public AssetImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - - @Override - public AssetImpl withStorageAccountName(String storageAccountName) { - this.inner().withStorageAccountName(storageAccountName); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetInner.java deleted file mode 100644 index d75736fbaa8a1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetInner.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.UUID; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetStorageEncryptionFormat; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * An Asset. - */ -@JsonFlatten -public class AssetInner extends ProxyResource { - /** - * The Asset ID. - */ - @JsonProperty(value = "properties.assetId", access = JsonProperty.Access.WRITE_ONLY) - private UUID assetId; - - /** - * The creation date of the Asset. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The last modified date of the Asset. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * The alternate ID of the Asset. - */ - @JsonProperty(value = "properties.alternateId") - private String alternateId; - - /** - * The Asset description. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The name of the asset blob container. - */ - @JsonProperty(value = "properties.container") - private String container; - - /** - * The name of the storage account. - */ - @JsonProperty(value = "properties.storageAccountName") - private String storageAccountName; - - /** - * The Asset encryption format. One of None or MediaStorageEncryption. - * Possible values include: 'None', 'MediaStorageClientEncryption'. - */ - @JsonProperty(value = "properties.storageEncryptionFormat", access = JsonProperty.Access.WRITE_ONLY) - private AssetStorageEncryptionFormat storageEncryptionFormat; - - /** - * Get the Asset ID. - * - * @return the assetId value - */ - public UUID assetId() { - return this.assetId; - } - - /** - * Get the creation date of the Asset. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the last modified date of the Asset. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get the alternate ID of the Asset. - * - * @return the alternateId value - */ - public String alternateId() { - return this.alternateId; - } - - /** - * Set the alternate ID of the Asset. - * - * @param alternateId the alternateId value to set - * @return the AssetInner object itself. - */ - public AssetInner withAlternateId(String alternateId) { - this.alternateId = alternateId; - return this; - } - - /** - * Get the Asset description. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set the Asset description. - * - * @param description the description value to set - * @return the AssetInner object itself. - */ - public AssetInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the name of the asset blob container. - * - * @return the container value - */ - public String container() { - return this.container; - } - - /** - * Set the name of the asset blob container. - * - * @param container the container value to set - * @return the AssetInner object itself. - */ - public AssetInner withContainer(String container) { - this.container = container; - return this; - } - - /** - * Get the name of the storage account. - * - * @return the storageAccountName value - */ - public String storageAccountName() { - return this.storageAccountName; - } - - /** - * Set the name of the storage account. - * - * @param storageAccountName the storageAccountName value to set - * @return the AssetInner object itself. - */ - public AssetInner withStorageAccountName(String storageAccountName) { - this.storageAccountName = storageAccountName; - return this; - } - - /** - * Get the Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption'. - * - * @return the storageEncryptionFormat value - */ - public AssetStorageEncryptionFormat storageEncryptionFormat() { - return this.storageEncryptionFormat; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsImpl.java deleted file mode 100644 index b0726131e2402..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetContainerSas; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.AssetStorageEncryptionKey; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListContainerSasInput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Asset; - -class AssetsImpl extends WrapperImpl implements Assets { - private final MediaManager manager; - - AssetsImpl(MediaManager manager) { - super(manager.inner().assets()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public AssetImpl define(String name) { - return wrapModel(name); - } - - private AssetImpl wrapModel(AssetInner inner) { - return new AssetImpl(inner, manager()); - } - - private AssetImpl wrapModel(String name) { - return new AssetImpl(name, this.manager()); - } - - @Override - public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { - AssetsInner client = this.inner(); - return client.listContainerSasAsync(resourceGroupName, accountName, assetName, parameters) - .map(new Func1() { - @Override - public AssetContainerSas call(AssetContainerSasInner inner) { - return new AssetContainerSasImpl(inner, manager()); - } - }); - } - - @Override - public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { - AssetsInner client = this.inner(); - return client.getEncryptionKeyAsync(resourceGroupName, accountName, assetName) - .map(new Func1() { - @Override - public AssetStorageEncryptionKey call(AssetStorageEncryptionKeyInner inner) { - return new AssetStorageEncryptionKeyImpl(inner, manager()); - } - }); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - AssetsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public Asset call(AssetInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String assetName) { - AssetsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, assetName) - .map(new Func1() { - @Override - public Asset call(AssetInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String assetName) { - AssetsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, assetName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsInner.java deleted file mode 100644 index bff91539ae206..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AssetsInner.java +++ /dev/null @@ -1,1092 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListContainerSasInput; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Assets. - */ -public class AssetsInner { - /** The Retrofit service to perform REST calls. */ - private AssetsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of AssetsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public AssetsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(AssetsService.class); - this.client = client; - } - - /** - * The interface defining all the services for Assets to be - * used by Retrofit to perform actually REST calls. - */ - interface AssetsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets listContainerSas" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listContainerSas") - Observable> listContainerSas(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body ListContainerSasInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets getEncryptionKey" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/getEncryptionKey") - Observable> getEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<AssetInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final String orderby = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<AssetInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get an Asset. - * Get the details of an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AssetInner object if successful. - */ - public AssetInner get(String resourceGroupName, String accountName, String assetName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); - } - - /** - * Get an Asset. - * Get the details of an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); - } - - /** - * Get an Asset. - * Get the details of an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String assetName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetInner>() { - @Override - public AssetInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get an Asset. - * Get the details of an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create or update an Asset. - * Creates or updates an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AssetInner object if successful. - */ - public AssetInner createOrUpdate(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); - } - - /** - * Create or update an Asset. - * Creates or updates an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); - } - - /** - * Create or update an Asset. - * Creates or updates an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { - @Override - public AssetInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or update an Asset. - * Creates or updates an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete an Asset. - * Deletes an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String assetName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); - } - - /** - * Delete an Asset. - * Deletes an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); - } - - /** - * Delete an Asset. - * Deletes an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String assetName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete an Asset. - * Deletes an Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Update an Asset. - * Updates an existing Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AssetInner object if successful. - */ - public AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); - } - - /** - * Update an Asset. - * Updates an existing Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); - } - - /** - * Update an Asset. - * Updates an existing Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { - @Override - public AssetInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update an Asset. - * Updates an existing Asset in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List the Asset URLs. - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AssetContainerSasInner object if successful. - */ - public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { - return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); - } - - /** - * List the Asset URLs. - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); - } - - /** - * List the Asset URLs. - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetContainerSasInner object - */ - public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { - return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetContainerSasInner>() { - @Override - public AssetContainerSasInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * List the Asset URLs. - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetContainerSasInner object - */ - public Observable> listContainerSasWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.listContainerSas(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = listContainerSasDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse listContainerSasDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Gets the Asset storage key. - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AssetStorageEncryptionKeyInner object if successful. - */ - public AssetStorageEncryptionKeyInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) { - return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); - } - - /** - * Gets the Asset storage key. - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); - } - - /** - * Gets the Asset storage key. - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetStorageEncryptionKeyInner object - */ - public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { - return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetStorageEncryptionKeyInner>() { - @Override - public AssetStorageEncryptionKeyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets the Asset storage key. - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param assetName The Asset name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AssetStorageEncryptionKeyInner object - */ - public Observable> getEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (assetName == null) { - throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getEncryptionKey(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getEncryptionKeyDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getEncryptionKeyDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<AssetInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AssetInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Assets. - * List Assets in the Media Services account with optional filtering and ordering. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AzureMediaServicesImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AzureMediaServicesImpl.java deleted file mode 100644 index 96ce43204feaf..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/AzureMediaServicesImpl.java +++ /dev/null @@ -1,350 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.AzureClient; -import com.microsoft.azure.AzureServiceClient; -import com.microsoft.rest.credentials.ServiceClientCredentials; -import com.microsoft.rest.RestClient; - -/** - * Initializes a new instance of the AzureMediaServicesImpl class. - */ -public class AzureMediaServicesImpl extends AzureServiceClient { - /** the {@link AzureClient} used for long running operations. */ - private AzureClient azureClient; - - /** - * Gets the {@link AzureClient} used for long running operations. - * @return the azure client; - */ - public AzureClient getAzureClient() { - return this.azureClient; - } - - /** The unique identifier for a Microsoft Azure subscription. */ - private String subscriptionId; - - /** - * Gets The unique identifier for a Microsoft Azure subscription. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Sets The unique identifier for a Microsoft Azure subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the service client itself - */ - public AzureMediaServicesImpl withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** The Version of the API to be used with the client request. */ - private String apiVersion; - - /** - * Gets The Version of the API to be used with the client request. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - - /** Gets or sets the preferred language for the response. */ - private String acceptLanguage; - - /** - * Gets Gets or sets the preferred language for the response. - * - * @return the acceptLanguage value. - */ - public String acceptLanguage() { - return this.acceptLanguage; - } - - /** - * Sets Gets or sets the preferred language for the response. - * - * @param acceptLanguage the acceptLanguage value. - * @return the service client itself - */ - public AzureMediaServicesImpl withAcceptLanguage(String acceptLanguage) { - this.acceptLanguage = acceptLanguage; - return this; - } - - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ - private int longRunningOperationRetryTimeout; - - /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * - * @return the longRunningOperationRetryTimeout value. - */ - public int longRunningOperationRetryTimeout() { - return this.longRunningOperationRetryTimeout; - } - - /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * - * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. - * @return the service client itself - */ - public AzureMediaServicesImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { - this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; - return this; - } - - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ - private boolean generateClientRequestId; - - /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - * - * @return the generateClientRequestId value. - */ - public boolean generateClientRequestId() { - return this.generateClientRequestId; - } - - /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - * - * @param generateClientRequestId the generateClientRequestId value. - * @return the service client itself - */ - public AzureMediaServicesImpl withGenerateClientRequestId(boolean generateClientRequestId) { - this.generateClientRequestId = generateClientRequestId; - return this; - } - - /** - * The OperationsInner object to access its operations. - */ - private OperationsInner operations; - - /** - * Gets the OperationsInner object to access its operations. - * @return the OperationsInner object. - */ - public OperationsInner operations() { - return this.operations; - } - - /** - * The MediaservicesInner object to access its operations. - */ - private MediaservicesInner mediaservices; - - /** - * Gets the MediaservicesInner object to access its operations. - * @return the MediaservicesInner object. - */ - public MediaservicesInner mediaservices() { - return this.mediaservices; - } - - /** - * The LocationsInner object to access its operations. - */ - private LocationsInner locations; - - /** - * Gets the LocationsInner object to access its operations. - * @return the LocationsInner object. - */ - public LocationsInner locations() { - return this.locations; - } - - /** - * The AssetsInner object to access its operations. - */ - private AssetsInner assets; - - /** - * Gets the AssetsInner object to access its operations. - * @return the AssetsInner object. - */ - public AssetsInner assets() { - return this.assets; - } - - /** - * The ContentKeyPoliciesInner object to access its operations. - */ - private ContentKeyPoliciesInner contentKeyPolicies; - - /** - * Gets the ContentKeyPoliciesInner object to access its operations. - * @return the ContentKeyPoliciesInner object. - */ - public ContentKeyPoliciesInner contentKeyPolicies() { - return this.contentKeyPolicies; - } - - /** - * The TransformsInner object to access its operations. - */ - private TransformsInner transforms; - - /** - * Gets the TransformsInner object to access its operations. - * @return the TransformsInner object. - */ - public TransformsInner transforms() { - return this.transforms; - } - - /** - * The JobsInner object to access its operations. - */ - private JobsInner jobs; - - /** - * Gets the JobsInner object to access its operations. - * @return the JobsInner object. - */ - public JobsInner jobs() { - return this.jobs; - } - - /** - * The StreamingPoliciesInner object to access its operations. - */ - private StreamingPoliciesInner streamingPolicies; - - /** - * Gets the StreamingPoliciesInner object to access its operations. - * @return the StreamingPoliciesInner object. - */ - public StreamingPoliciesInner streamingPolicies() { - return this.streamingPolicies; - } - - /** - * The StreamingLocatorsInner object to access its operations. - */ - private StreamingLocatorsInner streamingLocators; - - /** - * Gets the StreamingLocatorsInner object to access its operations. - * @return the StreamingLocatorsInner object. - */ - public StreamingLocatorsInner streamingLocators() { - return this.streamingLocators; - } - - /** - * The LiveEventsInner object to access its operations. - */ - private LiveEventsInner liveEvents; - - /** - * Gets the LiveEventsInner object to access its operations. - * @return the LiveEventsInner object. - */ - public LiveEventsInner liveEvents() { - return this.liveEvents; - } - - /** - * The LiveOutputsInner object to access its operations. - */ - private LiveOutputsInner liveOutputs; - - /** - * Gets the LiveOutputsInner object to access its operations. - * @return the LiveOutputsInner object. - */ - public LiveOutputsInner liveOutputs() { - return this.liveOutputs; - } - - /** - * The StreamingEndpointsInner object to access its operations. - */ - private StreamingEndpointsInner streamingEndpoints; - - /** - * Gets the StreamingEndpointsInner object to access its operations. - * @return the StreamingEndpointsInner object. - */ - public StreamingEndpointsInner streamingEndpoints() { - return this.streamingEndpoints; - } - - /** - * Initializes an instance of AzureMediaServices client. - * - * @param credentials the management credentials for Azure - */ - public AzureMediaServicesImpl(ServiceClientCredentials credentials) { - this("https://management.azure.com", credentials); - } - - /** - * Initializes an instance of AzureMediaServices client. - * - * @param baseUrl the base URL of the host - * @param credentials the management credentials for Azure - */ - public AzureMediaServicesImpl(String baseUrl, ServiceClientCredentials credentials) { - super(baseUrl, credentials); - initialize(); - } - - /** - * Initializes an instance of AzureMediaServices client. - * - * @param restClient the REST client to connect to Azure. - */ - public AzureMediaServicesImpl(RestClient restClient) { - super(restClient); - initialize(); - } - - protected void initialize() { - this.apiVersion = "2018-03-30-preview"; - this.acceptLanguage = "en-US"; - this.longRunningOperationRetryTimeout = 30; - this.generateClientRequestId = true; - this.operations = new OperationsInner(restClient().retrofit(), this); - this.mediaservices = new MediaservicesInner(restClient().retrofit(), this); - this.locations = new LocationsInner(restClient().retrofit(), this); - this.assets = new AssetsInner(restClient().retrofit(), this); - this.contentKeyPolicies = new ContentKeyPoliciesInner(restClient().retrofit(), this); - this.transforms = new TransformsInner(restClient().retrofit(), this); - this.jobs = new JobsInner(restClient().retrofit(), this); - this.streamingPolicies = new StreamingPoliciesInner(restClient().retrofit(), this); - this.streamingLocators = new StreamingLocatorsInner(restClient().retrofit(), this); - this.liveEvents = new LiveEventsInner(restClient().retrofit(), this); - this.liveOutputs = new LiveOutputsInner(restClient().retrofit(), this); - this.streamingEndpoints = new StreamingEndpointsInner(restClient().retrofit(), this); - this.azureClient = new AzureClient(this); - } - - /** - * Gets the User-Agent header for the client. - * - * @return the user agent string. - */ - @Override - public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "AzureMediaServices", "2018-03-30-preview"); - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesImpl.java deleted file mode 100644 index eb31a248e879c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyProperties; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicy; - -class ContentKeyPoliciesImpl extends WrapperImpl implements ContentKeyPolicies { - private final MediaManager manager; - - ContentKeyPoliciesImpl(MediaManager manager) { - super(manager.inner().contentKeyPolicies()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public ContentKeyPolicyImpl define(String name) { - return wrapModel(name); - } - - private ContentKeyPolicyImpl wrapModel(ContentKeyPolicyInner inner) { - return new ContentKeyPolicyImpl(inner, manager()); - } - - private ContentKeyPolicyImpl wrapModel(String name) { - return new ContentKeyPolicyImpl(name, this.manager()); - } - - @Override - public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - ContentKeyPoliciesInner client = this.inner(); - return client.getPolicyPropertiesWithSecretsAsync(resourceGroupName, accountName, contentKeyPolicyName) - .map(new Func1() { - @Override - public ContentKeyPolicyProperties call(ContentKeyPolicyPropertiesInner inner) { - return new ContentKeyPolicyPropertiesImpl(inner, manager()); - } - }); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - ContentKeyPoliciesInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public ContentKeyPolicy call(ContentKeyPolicyInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - ContentKeyPoliciesInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, contentKeyPolicyName) - .map(new Func1() { - @Override - public ContentKeyPolicy call(ContentKeyPolicyInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - ContentKeyPoliciesInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, contentKeyPolicyName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesInner.java deleted file mode 100644 index 27f1c19aeeb53..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPoliciesInner.java +++ /dev/null @@ -1,983 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in ContentKeyPolicies. - */ -public class ContentKeyPoliciesInner { - /** The Retrofit service to perform REST calls. */ - private ContentKeyPoliciesService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of ContentKeyPoliciesInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public ContentKeyPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(ContentKeyPoliciesService.class); - this.client = client; - } - - /** - * The interface defining all the services for ContentKeyPolicies to be - * used by Retrofit to perform actually REST calls. - */ - interface ContentKeyPoliciesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies getPolicyPropertiesWithSecrets" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets") - Observable> getPolicyPropertiesWithSecrets(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<ContentKeyPolicyInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final String orderby = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<ContentKeyPolicyInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Content Key Policy. - * Get the details of a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ContentKeyPolicyInner object if successful. - */ - public ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); - } - - /** - * Get a Content Key Policy. - * Get the details of a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); - } - - /** - * Get a Content Key Policy. - * Get the details of a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyInner>() { - @Override - public ContentKeyPolicyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Content Key Policy. - * Get the details of a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (contentKeyPolicyName == null) { - throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create or update an Content Key Policy. - * Create or update a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ContentKeyPolicyInner object if successful. - */ - public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); - } - - /** - * Create or update an Content Key Policy. - * Create or update a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); - } - - /** - * Create or update an Content Key Policy. - * Create or update a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { - @Override - public ContentKeyPolicyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or update an Content Key Policy. - * Create or update a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (contentKeyPolicyName == null) { - throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete a Content Key Policy. - * Deletes a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); - } - - /** - * Delete a Content Key Policy. - * Deletes a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); - } - - /** - * Delete a Content Key Policy. - * Deletes a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete a Content Key Policy. - * Deletes a Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (contentKeyPolicyName == null) { - throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Update a Content Key Policy. - * Updates an existing Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ContentKeyPolicyInner object if successful. - */ - public ContentKeyPolicyInner update(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); - } - - /** - * Update a Content Key Policy. - * Updates an existing Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); - } - - /** - * Update a Content Key Policy. - * Updates an existing Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { - @Override - public ContentKeyPolicyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a Content Key Policy. - * Updates an existing Content Key Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (contentKeyPolicyName == null) { - throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Content Key Policy with secrets. - * Get a Content Key Policy including secret values. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ContentKeyPolicyPropertiesInner object if successful. - */ - public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) { - return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); - } - - /** - * Get a Content Key Policy with secrets. - * Get a Content Key Policy including secret values. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); - } - - /** - * Get a Content Key Policy with secrets. - * Get a Content Key Policy including secret values. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyPropertiesInner object - */ - public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyPropertiesInner>() { - @Override - public ContentKeyPolicyPropertiesInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Content Key Policy with secrets. - * Get a Content Key Policy including secret values. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param contentKeyPolicyName The Content Key Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ContentKeyPolicyPropertiesInner object - */ - public Observable> getPolicyPropertiesWithSecretsWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (contentKeyPolicyName == null) { - throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getPolicyPropertiesWithSecrets(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getPolicyPropertiesWithSecretsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getPolicyPropertiesWithSecretsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<ContentKeyPolicyInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ContentKeyPolicyInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Content Key Policies. - * Lists the Content Key Policies in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyImpl.java deleted file mode 100644 index 495c7cc3f6823..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicy; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import java.util.UUID; -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyOption; - -class ContentKeyPolicyImpl extends CreatableUpdatableImpl implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String contentKeyPolicyName; - - ContentKeyPolicyImpl(String name, MediaManager manager) { - super(name, new ContentKeyPolicyInner()); - this.manager = manager; - // Set resource name - this.contentKeyPolicyName = name; - // - } - - ContentKeyPolicyImpl(ContentKeyPolicyInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.contentKeyPolicyName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.contentKeyPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "contentKeyPolicies"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); - return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); - return client.getAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public List options() { - return this.inner().options(); - } - - @Override - public UUID policyId() { - return this.inner().policyId(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public ContentKeyPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public ContentKeyPolicyImpl withOptions(List options) { - this.inner().withOptions(options); - return this; - } - - @Override - public ContentKeyPolicyImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyInner.java deleted file mode 100644 index 44bb331e7d40a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyInner.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.UUID; -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyOption; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * A Content Key Policy resource. - */ -@JsonFlatten -public class ContentKeyPolicyInner extends ProxyResource { - /** - * The legacy Policy ID. - */ - @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) - private UUID policyId; - - /** - * The creation date of the Policy. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The last modified date of the Policy. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * A description for the Policy. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The Key Policy options. - */ - @JsonProperty(value = "properties.options", required = true) - private List options; - - /** - * Get the legacy Policy ID. - * - * @return the policyId value - */ - public UUID policyId() { - return this.policyId; - } - - /** - * Get the creation date of the Policy. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the last modified date of the Policy. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get a description for the Policy. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set a description for the Policy. - * - * @param description the description value to set - * @return the ContentKeyPolicyInner object itself. - */ - public ContentKeyPolicyInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the Key Policy options. - * - * @return the options value - */ - public List options() { - return this.options; - } - - /** - * Set the Key Policy options. - * - * @param options the options value to set - * @return the ContentKeyPolicyInner object itself. - */ - public ContentKeyPolicyInner withOptions(List options) { - this.options = options; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java deleted file mode 100644 index 3fff46969e7f3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyProperties; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyOption; -import java.util.UUID; - -class ContentKeyPolicyPropertiesImpl extends WrapperImpl implements ContentKeyPolicyProperties { - private final MediaManager manager; - ContentKeyPolicyPropertiesImpl(ContentKeyPolicyPropertiesInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public List options() { - return this.inner().options(); - } - - @Override - public UUID policyId() { - return this.inner().policyId(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesInner.java deleted file mode 100644 index 3ab663f7e6b45..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ContentKeyPolicyPropertiesInner.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.UUID; -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicyOption; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The properties of the Content Key Policy. - */ -public class ContentKeyPolicyPropertiesInner { - /** - * The legacy Policy ID. - */ - @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) - private UUID policyId; - - /** - * The creation date of the Policy. - */ - @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The last modified date of the Policy. - */ - @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * A description for the Policy. - */ - @JsonProperty(value = "description") - private String description; - - /** - * The Key Policy options. - */ - @JsonProperty(value = "options", required = true) - private List options; - - /** - * Get the legacy Policy ID. - * - * @return the policyId value - */ - public UUID policyId() { - return this.policyId; - } - - /** - * Get the creation date of the Policy. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the last modified date of the Policy. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get a description for the Policy. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set a description for the Policy. - * - * @param description the description value to set - * @return the ContentKeyPolicyPropertiesInner object itself. - */ - public ContentKeyPolicyPropertiesInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the Key Policy options. - * - * @return the options value - */ - public List options() { - return this.options; - } - - /** - * Set the Key Policy options. - * - * @param options the options value to set - * @return the ContentKeyPolicyPropertiesInner object itself. - */ - public ContentKeyPolicyPropertiesInner withOptions(List options) { - this.options = options; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java deleted file mode 100644 index baa0e1cac430c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.EntityNameAvailabilityCheckOutput; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; - -class EntityNameAvailabilityCheckOutputImpl extends WrapperImpl implements EntityNameAvailabilityCheckOutput { - private final MediaManager manager; - EntityNameAvailabilityCheckOutputImpl(EntityNameAvailabilityCheckOutputInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public String message() { - return this.inner().message(); - } - - @Override - public boolean nameAvailable() { - return this.inner().nameAvailable(); - } - - @Override - public String reason() { - return this.inner().reason(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java deleted file mode 100644 index e101798660978..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/EntityNameAvailabilityCheckOutputInner.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The response from the check name availability request. - */ -public class EntityNameAvailabilityCheckOutputInner { - /** - * Specifies if the name is available. - */ - @JsonProperty(value = "nameAvailable", required = true) - private boolean nameAvailable; - - /** - * Specifies the reason if the name is not available. - */ - @JsonProperty(value = "reason") - private String reason; - - /** - * Specifies the detailed reason if the name is not available. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get specifies if the name is available. - * - * @return the nameAvailable value - */ - public boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set specifies if the name is available. - * - * @param nameAvailable the nameAvailable value to set - * @return the EntityNameAvailabilityCheckOutputInner object itself. - */ - public EntityNameAvailabilityCheckOutputInner withNameAvailable(boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get specifies the reason if the name is not available. - * - * @return the reason value - */ - public String reason() { - return this.reason; - } - - /** - * Set specifies the reason if the name is not available. - * - * @param reason the reason value to set - * @return the EntityNameAvailabilityCheckOutputInner object itself. - */ - public EntityNameAvailabilityCheckOutputInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get specifies the detailed reason if the name is not available. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Set specifies the detailed reason if the name is not available. - * - * @param message the message value to set - * @return the EntityNameAvailabilityCheckOutputInner object itself. - */ - public EntityNameAvailabilityCheckOutputInner withMessage(String message) { - this.message = message; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/IdParsingUtils.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/IdParsingUtils.java deleted file mode 100644 index 820c7728b5320..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/IdParsingUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; -import java.util.Arrays; -import java.util.Iterator; - -class IdParsingUtils { - public static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && part.trim() != "") { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - public static String getValueFromIdByPosition(String id, int pos) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - int index = 0; - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && part.trim() != "") { - if (index == pos) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - index++; - } - return null; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobImpl.java deleted file mode 100644 index 9ef6c72a9e616..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Job; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobInput; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobOutput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Priority; - -class JobImpl extends CreatableUpdatableImpl implements Job, Job.Definition, Job.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String transformName; - private String jobName; - - JobImpl(String name, MediaManager manager) { - super(name, new JobInner()); - this.manager = manager; - // Set resource name - this.jobName = name; - // - } - - JobImpl(JobInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.jobName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); - this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - JobsInner client = this.manager().inner().jobs(); - return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - JobsInner client = this.manager().inner().jobs(); - return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - JobsInner client = this.manager().inner().jobs(); - return client.getAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public JobInput input() { - return this.inner().input(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public List outputs() { - return this.inner().outputs(); - } - - @Override - public Priority priority() { - return this.inner().priority(); - } - - @Override - public JobState state() { - return this.inner().state(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public JobImpl withExistingTransform(String resourceGroupName, String accountName, String transformName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.transformName = transformName; - return this; - } - - @Override - public JobImpl withInput(JobInput input) { - this.inner().withInput(input); - return this; - } - - @Override - public JobImpl withOutputs(List outputs) { - this.inner().withOutputs(outputs); - return this; - } - - @Override - public JobImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - - @Override - public JobImpl withPriority(Priority priority) { - this.inner().withPriority(priority); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobInner.java deleted file mode 100644 index de35b5f7e9c82..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobInner.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobInput; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.JobOutput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Priority; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * A Job resource type. The progress and state can be obtained by polling a Job - * or subscribing to events using EventGrid. - */ -@JsonFlatten -public class JobInner extends ProxyResource { - /** - * The UTC date and time when the Job was created, in - * 'YYYY-MM-DDThh:mm:ssZ' format. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The current state of the job. Possible values include: 'Canceled', - * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. - */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private JobState state; - - /** - * Optional customer supplied description of the Job. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The inputs for the Job. - */ - @JsonProperty(value = "properties.input", required = true) - private JobInput input; - - /** - * The UTC date and time when the Job was last updated, in - * 'YYYY-MM-DDThh:mm:ssZ' format. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * The outputs for the Job. - */ - @JsonProperty(value = "properties.outputs", required = true) - private List outputs; - - /** - * Priority with which the job should be processed. Higher priority jobs - * are processed before lower priority jobs. If not set, the default is - * normal. Possible values include: 'Low', 'Normal', 'High'. - */ - @JsonProperty(value = "properties.priority") - private Priority priority; - - /** - * Get the UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. - * - * @return the state value - */ - public JobState state() { - return this.state; - } - - /** - * Get optional customer supplied description of the Job. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set optional customer supplied description of the Job. - * - * @param description the description value to set - * @return the JobInner object itself. - */ - public JobInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the inputs for the Job. - * - * @return the input value - */ - public JobInput input() { - return this.input; - } - - /** - * Set the inputs for the Job. - * - * @param input the input value to set - * @return the JobInner object itself. - */ - public JobInner withInput(JobInput input) { - this.input = input; - return this; - } - - /** - * Get the UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get the outputs for the Job. - * - * @return the outputs value - */ - public List outputs() { - return this.outputs; - } - - /** - * Set the outputs for the Job. - * - * @param outputs the outputs value to set - * @return the JobInner object itself. - */ - public JobInner withOutputs(List outputs) { - this.outputs = outputs; - return this; - } - - /** - * Get priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. - * - * @return the priority value - */ - public Priority priority() { - return this.priority; - } - - /** - * Set priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. - * - * @param priority the priority value to set - * @return the JobInner object itself. - */ - public JobInner withPriority(Priority priority) { - this.priority = priority; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsImpl.java deleted file mode 100644 index b8cb91cb351a9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Job; - -class JobsImpl extends WrapperImpl implements Jobs { - private final MediaManager manager; - - JobsImpl(MediaManager manager) { - super(manager.inner().jobs()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public JobImpl define(String name) { - return wrapModel(name); - } - - private JobImpl wrapModel(JobInner inner) { - return new JobImpl(inner, manager()); - } - - private JobImpl wrapModel(String name) { - return new JobImpl(name, this.manager()); - } - - @Override - public Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - JobsInner client = this.inner(); - return client.cancelJobAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName, final String transformName) { - JobsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName, transformName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public Job call(JobInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - JobsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, transformName, jobName) - .map(new Func1() { - @Override - public Job call(JobInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - JobsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsInner.java deleted file mode 100644 index 82d7e9953bc04..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/JobsInner.java +++ /dev/null @@ -1,914 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Jobs. - */ -public class JobsInner { - /** The Retrofit service to perform REST calls. */ - private JobsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of JobsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public JobsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(JobsService.class); - this.client = client; - } - - /** - * The interface defining all the services for Jobs to be - * used by Retrofit to perform actually REST calls. - */ - interface JobsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs cancelJob" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob") - Observable> cancelJob(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<JobInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String transformName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, transformName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName) { - return listWithServiceResponseAsync(resourceGroupName, accountName, transformName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName) { - return listSinglePageAsync(resourceGroupName, accountName, transformName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final Integer skip = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<JobInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { - return listWithServiceResponseAsync(resourceGroupName, accountName, transformName, filter, top, skip) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { - return listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param transformName The Transform name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get Job. - * Gets a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the JobInner object if successful. - */ - public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); - } - - /** - * Get Job. - * Gets a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); - } - - /** - * Get Job. - * Gets a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the JobInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, JobInner>() { - @Override - public JobInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get Job. - * Gets a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the JobInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (jobName == null) { - throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create Job. - * Creates a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the JobInner object if successful. - */ - public JobInner create(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); - } - - /** - * Create Job. - * Creates a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); - } - - /** - * Create Job. - * Creates a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the JobInner object - */ - public Observable createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { - @Override - public JobInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Job. - * Creates a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the JobInner object - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (jobName == null) { - throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.create(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete Job. - * Deletes a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); - } - - /** - * Delete Job. - * Deletes a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); - } - - /** - * Delete Job. - * Deletes a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Job. - * Deletes a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (jobName == null) { - throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Cancel Job. - * Cancel a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { - cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); - } - - /** - * Cancel Job. - * Cancel a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); - } - - /** - * Cancel Job. - * Cancel a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - return cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Cancel Job. - * Cancel a Job. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param jobName The Job name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> cancelJobWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (jobName == null) { - throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.cancelJob(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = cancelJobDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse cancelJobDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<JobInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<JobInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Jobs. - * Lists all of the Jobs for the Transform. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseImpl.java deleted file mode 100644 index 41a92cae54d33..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListContentKeysResponse; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocatorContentKey; - -class ListContentKeysResponseImpl extends WrapperImpl implements ListContentKeysResponse { - private final MediaManager manager; - ListContentKeysResponseImpl(ListContentKeysResponseInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public List contentKeys() { - return this.inner().contentKeys(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseInner.java deleted file mode 100644 index 1089673195cff..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListContentKeysResponseInner.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocatorContentKey; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class of response for listContentKeys action. - */ -public class ListContentKeysResponseInner { - /** - * ContentKeys used by current Streaming Locator. - */ - @JsonProperty(value = "contentKeys") - private List contentKeys; - - /** - * Get contentKeys used by current Streaming Locator. - * - * @return the contentKeys value - */ - public List contentKeys() { - return this.contentKeys; - } - - /** - * Set contentKeys used by current Streaming Locator. - * - * @param contentKeys the contentKeys value to set - * @return the ListContentKeysResponseInner object itself. - */ - public ListContentKeysResponseInner withContentKeys(List contentKeys) { - this.contentKeys = contentKeys; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseImpl.java deleted file mode 100644 index 08b9d84824ba7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListPathsResponse; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPath; - -class ListPathsResponseImpl extends WrapperImpl implements ListPathsResponse { - private final MediaManager manager; - ListPathsResponseImpl(ListPathsResponseInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public List downloadPaths() { - return this.inner().downloadPaths(); - } - - @Override - public List streamingPaths() { - return this.inner().streamingPaths(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseInner.java deleted file mode 100644 index c17b4627c2134..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/ListPathsResponseInner.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPath; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class of response for listPaths action. - */ -public class ListPathsResponseInner { - /** - * Streaming Paths supported by current Streaming Locator. - */ - @JsonProperty(value = "streamingPaths") - private List streamingPaths; - - /** - * Download Paths supported by current Streaming Locator. - */ - @JsonProperty(value = "downloadPaths") - private List downloadPaths; - - /** - * Get streaming Paths supported by current Streaming Locator. - * - * @return the streamingPaths value - */ - public List streamingPaths() { - return this.streamingPaths; - } - - /** - * Set streaming Paths supported by current Streaming Locator. - * - * @param streamingPaths the streamingPaths value to set - * @return the ListPathsResponseInner object itself. - */ - public ListPathsResponseInner withStreamingPaths(List streamingPaths) { - this.streamingPaths = streamingPaths; - return this; - } - - /** - * Get download Paths supported by current Streaming Locator. - * - * @return the downloadPaths value - */ - public List downloadPaths() { - return this.downloadPaths; - } - - /** - * Set download Paths supported by current Streaming Locator. - * - * @param downloadPaths the downloadPaths value to set - * @return the ListPathsResponseInner object itself. - */ - public ListPathsResponseInner withDownloadPaths(List downloadPaths) { - this.downloadPaths = downloadPaths; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventImpl.java deleted file mode 100644 index e507cba4f26b2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvent; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import java.util.Map; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventInput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventPreview; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventEncoding; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventResourceState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CrossSiteAccessPolicies; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamOptionsFlag; -import org.joda.time.DateTime; - -class LiveEventImpl extends CreatableUpdatableImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String liveEventName; - - LiveEventImpl(String name, MediaManager manager) { - super(name, new LiveEventInner()); - this.manager = manager; - // Set resource name - this.liveEventName = name; - // - } - - LiveEventImpl(LiveEventInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.liveEventName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); - this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - LiveEventsInner client = this.manager().inner().liveEvents(); - return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - LiveEventsInner client = this.manager().inner().liveEvents(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - LiveEventsInner client = this.manager().inner().liveEvents(); - return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public CrossSiteAccessPolicies crossSiteAccessPolicies() { - return this.inner().crossSiteAccessPolicies(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public LiveEventEncoding encoding() { - return this.inner().encoding(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public LiveEventInput input() { - return this.inner().input(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String location() { - return this.inner().location(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public LiveEventPreview preview() { - return this.inner().preview(); - } - - @Override - public String provisioningState() { - return this.inner().provisioningState(); - } - - @Override - public LiveEventResourceState resourceState() { - return this.inner().resourceState(); - } - - @Override - public List streamOptions() { - return this.inner().streamOptions(); - } - - @Override - public Map tags() { - return this.inner().getTags(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public Boolean vanityUrl() { - return this.inner().vanityUrl(); - } - - @Override - public LiveEventImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public LiveEventImpl withInput(LiveEventInput input) { - this.inner().withInput(input); - return this; - } - - @Override - public LiveEventImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { - this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); - return this; - } - - @Override - public LiveEventImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - - @Override - public LiveEventImpl withEncoding(LiveEventEncoding encoding) { - this.inner().withEncoding(encoding); - return this; - } - - @Override - public LiveEventImpl withLocation(String location) { - this.inner().withLocation(location); - return this; - } - - @Override - public LiveEventImpl withPreview(LiveEventPreview preview) { - this.inner().withPreview(preview); - return this; - } - - @Override - public LiveEventImpl withStreamOptions(List streamOptions) { - this.inner().withStreamOptions(streamOptions); - return this; - } - - @Override - public LiveEventImpl withTags(Map tags) { - this.inner().withTags(tags); - return this; - } - - @Override - public LiveEventImpl withVanityUrl(Boolean vanityUrl) { - this.inner().withVanityUrl(vanityUrl); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventInner.java deleted file mode 100644 index 88c59a95d6e39..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventInner.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventInput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventPreview; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventEncoding; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventResourceState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CrossSiteAccessPolicies; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamOptionsFlag; -import org.joda.time.DateTime; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.rest.SkipParentValidation; -import com.microsoft.azure.Resource; - -/** - * The Live Event. - */ -@JsonFlatten -@SkipParentValidation -public class LiveEventInner extends Resource { - /** - * The Live Event description. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The Live Event input. - */ - @JsonProperty(value = "properties.input", required = true) - private LiveEventInput input; - - /** - * The Live Event preview. - */ - @JsonProperty(value = "properties.preview") - private LiveEventPreview preview; - - /** - * The Live Event encoding. - */ - @JsonProperty(value = "properties.encoding") - private LiveEventEncoding encoding; - - /** - * The provisioning state of the Live Event. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * The resource state of the Live Event. Possible values include: - * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private LiveEventResourceState resourceState; - - /** - * The Live Event access policies. - */ - @JsonProperty(value = "properties.crossSiteAccessPolicies") - private CrossSiteAccessPolicies crossSiteAccessPolicies; - - /** - * The Live Event vanity URL flag. - */ - @JsonProperty(value = "properties.vanityUrl") - private Boolean vanityUrl; - - /** - * The stream options. - */ - @JsonProperty(value = "properties.streamOptions") - private List streamOptions; - - /** - * The exact time the Live Event was created. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The exact time the Live Event was last modified. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * Get the Live Event description. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set the Live Event description. - * - * @param description the description value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the Live Event input. - * - * @return the input value - */ - public LiveEventInput input() { - return this.input; - } - - /** - * Set the Live Event input. - * - * @param input the input value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withInput(LiveEventInput input) { - this.input = input; - return this; - } - - /** - * Get the Live Event preview. - * - * @return the preview value - */ - public LiveEventPreview preview() { - return this.preview; - } - - /** - * Set the Live Event preview. - * - * @param preview the preview value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withPreview(LiveEventPreview preview) { - this.preview = preview; - return this; - } - - /** - * Get the Live Event encoding. - * - * @return the encoding value - */ - public LiveEventEncoding encoding() { - return this.encoding; - } - - /** - * Set the Live Event encoding. - * - * @param encoding the encoding value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withEncoding(LiveEventEncoding encoding) { - this.encoding = encoding; - return this; - } - - /** - * Get the provisioning state of the Live Event. - * - * @return the provisioningState value - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. - * - * @return the resourceState value - */ - public LiveEventResourceState resourceState() { - return this.resourceState; - } - - /** - * Get the Live Event access policies. - * - * @return the crossSiteAccessPolicies value - */ - public CrossSiteAccessPolicies crossSiteAccessPolicies() { - return this.crossSiteAccessPolicies; - } - - /** - * Set the Live Event access policies. - * - * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { - this.crossSiteAccessPolicies = crossSiteAccessPolicies; - return this; - } - - /** - * Get the Live Event vanity URL flag. - * - * @return the vanityUrl value - */ - public Boolean vanityUrl() { - return this.vanityUrl; - } - - /** - * Set the Live Event vanity URL flag. - * - * @param vanityUrl the vanityUrl value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withVanityUrl(Boolean vanityUrl) { - this.vanityUrl = vanityUrl; - return this; - } - - /** - * Get the stream options. - * - * @return the streamOptions value - */ - public List streamOptions() { - return this.streamOptions; - } - - /** - * Set the stream options. - * - * @param streamOptions the streamOptions value to set - * @return the LiveEventInner object itself. - */ - public LiveEventInner withStreamOptions(List streamOptions) { - this.streamOptions = streamOptions; - return this; - } - - /** - * Get the exact time the Live Event was created. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the exact time the Live Event was last modified. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsImpl.java deleted file mode 100644 index 110d79673e506..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvent; - -class LiveEventsImpl extends WrapperImpl implements LiveEvents { - private final MediaManager manager; - - LiveEventsImpl(MediaManager manager) { - super(manager.inner().liveEvents()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public LiveEventImpl define(String name) { - return wrapModel(name); - } - - private LiveEventImpl wrapModel(LiveEventInner inner) { - return new LiveEventImpl(inner, manager()); - } - - private LiveEventImpl wrapModel(String name) { - return new LiveEventImpl(name, this.manager()); - } - - @Override - public Completable startAsync(String resourceGroupName, String accountName, String liveEventName) { - LiveEventsInner client = this.inner(); - return client.startAsync(resourceGroupName, accountName, liveEventName).toCompletable(); - } - - @Override - public Completable stopAsync(String resourceGroupName, String accountName, String liveEventName) { - LiveEventsInner client = this.inner(); - return client.stopAsync(resourceGroupName, accountName, liveEventName).toCompletable(); - } - - @Override - public Completable resetAsync(String resourceGroupName, String accountName, String liveEventName) { - LiveEventsInner client = this.inner(); - return client.resetAsync(resourceGroupName, accountName, liveEventName).toCompletable(); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - LiveEventsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public LiveEvent call(LiveEventInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { - LiveEventsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, liveEventName) - .map(new Func1() { - @Override - public LiveEvent call(LiveEventInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { - LiveEventsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, liveEventName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsInner.java deleted file mode 100644 index 5939365b901be..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventsInner.java +++ /dev/null @@ -1,1936 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventActionInput; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in LiveEvents. - */ -public class LiveEventsInner { - /** The Retrofit service to perform REST calls. */ - private LiveEventsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of LiveEventsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public LiveEventsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(LiveEventsService.class); - this.client = client; - } - - /** - * The interface defining all the services for LiveEvents to be - * used by Retrofit to perform actually REST calls. - */ - interface LiveEventsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginCreate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") - Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginUpdate" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) - Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents start" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") - Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginStart" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") - Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents stop" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") - Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginStop" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") - Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents reset" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") - Observable> reset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents beginReset" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") - Observable> beginReset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<LiveEventInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveEventInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveEventInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get Live Event. - * Gets a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner get(String resourceGroupName, String accountName, String liveEventName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); - } - - /** - * Get Live Event. - * Gets a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Get Live Event. - * Gets a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get Live Event. - * Gets a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final Boolean autoStart = null; - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().last().body(); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final Boolean autoStart = null; - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().single().body(); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Event. - * Creates a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner update(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveEventInner object if successful. - */ - public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { - @Override - public LiveEventInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Updates a existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param parameters Live Event properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveEventInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String liveEventName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginDelete(String resourceGroupName, String accountName, String liveEventName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Live Event. - * Deletes a Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginDeleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void start(String resourceGroupName, String accountName, String liveEventName) { - startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture startAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable startAsync(String resourceGroupName, String accountName, String liveEventName) { - return startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginStart(String resourceGroupName, String accountName, String liveEventName) { - beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginStartAsync(String resourceGroupName, String accountName, String liveEventName) { - return beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Start Live Event. - * Starts an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginStartDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void stop(String resourceGroupName, String accountName, String liveEventName) { - stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName) { - return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Boolean removeOutputsOnStop = null; - LiveEventActionInput parameters = new LiveEventActionInput(); - parameters.withRemoveOutputsOnStop(null); - Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void stop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().last().body(); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - LiveEventActionInput parameters = new LiveEventActionInput(); - parameters.withRemoveOutputsOnStop(removeOutputsOnStop); - Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginStop(String resourceGroupName, String accountName, String liveEventName) { - beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName) { - return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Boolean removeOutputsOnStop = null; - LiveEventActionInput parameters = new LiveEventActionInput(); - parameters.withRemoveOutputsOnStop(null); - return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginStopDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().single().body(); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop Live Event. - * Stops an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - LiveEventActionInput parameters = new LiveEventActionInput(); - parameters.withRemoveOutputsOnStop(removeOutputsOnStop); - return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginStopDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void reset(String resourceGroupName, String accountName, String liveEventName) { - resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture resetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable resetAsync(String resourceGroupName, String accountName, String liveEventName) { - return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> resetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.reset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginReset(String resourceGroupName, String accountName, String liveEventName) { - beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginResetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginResetAsync(String resourceGroupName, String accountName, String liveEventName) { - return beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Reset Live Event. - * Resets an existing Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginReset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginResetDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginResetDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<LiveEventInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveEventInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveEventInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Live Events. - * Lists the Live Events in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputImpl.java deleted file mode 100644 index ee5cf51158145..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutput; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import org.joda.time.Period; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Hls; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputResourceState; - -class LiveOutputImpl extends CreatableUpdatableImpl implements LiveOutput, LiveOutput.Definition, LiveOutput.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String liveEventName; - private String liveOutputName; - - LiveOutputImpl(String name, MediaManager manager) { - super(name, new LiveOutputInner()); - this.manager = manager; - // Set resource name - this.liveOutputName = name; - // - } - - LiveOutputImpl(LiveOutputInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.liveOutputName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); - this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); - this.liveOutputName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveOutputs"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - LiveOutputsInner client = this.manager().inner().liveOutputs(); - return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - LiveOutputsInner client = this.manager().inner().liveOutputs(); - return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - LiveOutputsInner client = this.manager().inner().liveOutputs(); - return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public Period archiveWindowLength() { - return this.inner().archiveWindowLength(); - } - - @Override - public String assetName() { - return this.inner().assetName(); - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public Hls hls() { - return this.inner().hls(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String manifestName() { - return this.inner().manifestName(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public Long outputSnapTime() { - return this.inner().outputSnapTime(); - } - - @Override - public String provisioningState() { - return this.inner().provisioningState(); - } - - @Override - public LiveOutputResourceState resourceState() { - return this.inner().resourceState(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public LiveOutputImpl withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.liveEventName = liveEventName; - return this; - } - - @Override - public LiveOutputImpl withArchiveWindowLength(Period archiveWindowLength) { - this.inner().withArchiveWindowLength(archiveWindowLength); - return this; - } - - @Override - public LiveOutputImpl withAssetName(String assetName) { - this.inner().withAssetName(assetName); - return this; - } - - @Override - public LiveOutputImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - - @Override - public LiveOutputImpl withHls(Hls hls) { - this.inner().withHls(hls); - return this; - } - - @Override - public LiveOutputImpl withManifestName(String manifestName) { - this.inner().withManifestName(manifestName); - return this; - } - - @Override - public LiveOutputImpl withOutputSnapTime(Long outputSnapTime) { - this.inner().withOutputSnapTime(outputSnapTime); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputInner.java deleted file mode 100644 index 7fc2547999ff5..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputInner.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import org.joda.time.Period; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Hls; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputResourceState; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * The Live Output. - */ -@JsonFlatten -public class LiveOutputInner extends ProxyResource { - /** - * The description of the Live Output. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The asset name. - */ - @JsonProperty(value = "properties.assetName", required = true) - private String assetName; - - /** - * ISO 8601 timespan duration of the archive window length. This is - * duration that customer want to retain the recorded content. - */ - @JsonProperty(value = "properties.archiveWindowLength", required = true) - private Period archiveWindowLength; - - /** - * The manifest file name. - */ - @JsonProperty(value = "properties.manifestName") - private String manifestName; - - /** - * The HLS configuration. - */ - @JsonProperty(value = "properties.hls") - private Hls hls; - - /** - * The output snapshot time. - */ - @JsonProperty(value = "properties.outputSnapTime") - private Long outputSnapTime; - - /** - * The exact time the Live Output was created. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The exact time the Live Output was last modified. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * The provisioning state of the Live Output. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * The resource state of the Live Output. Possible values include: - * 'Creating', 'Running', 'Deleting'. - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private LiveOutputResourceState resourceState; - - /** - * Get the description of the Live Output. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set the description of the Live Output. - * - * @param description the description value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the asset name. - * - * @return the assetName value - */ - public String assetName() { - return this.assetName; - } - - /** - * Set the asset name. - * - * @param assetName the assetName value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withAssetName(String assetName) { - this.assetName = assetName; - return this; - } - - /** - * Get iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. - * - * @return the archiveWindowLength value - */ - public Period archiveWindowLength() { - return this.archiveWindowLength; - } - - /** - * Set iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. - * - * @param archiveWindowLength the archiveWindowLength value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withArchiveWindowLength(Period archiveWindowLength) { - this.archiveWindowLength = archiveWindowLength; - return this; - } - - /** - * Get the manifest file name. - * - * @return the manifestName value - */ - public String manifestName() { - return this.manifestName; - } - - /** - * Set the manifest file name. - * - * @param manifestName the manifestName value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withManifestName(String manifestName) { - this.manifestName = manifestName; - return this; - } - - /** - * Get the HLS configuration. - * - * @return the hls value - */ - public Hls hls() { - return this.hls; - } - - /** - * Set the HLS configuration. - * - * @param hls the hls value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withHls(Hls hls) { - this.hls = hls; - return this; - } - - /** - * Get the output snapshot time. - * - * @return the outputSnapTime value - */ - public Long outputSnapTime() { - return this.outputSnapTime; - } - - /** - * Set the output snapshot time. - * - * @param outputSnapTime the outputSnapTime value to set - * @return the LiveOutputInner object itself. - */ - public LiveOutputInner withOutputSnapTime(Long outputSnapTime) { - this.outputSnapTime = outputSnapTime; - return this; - } - - /** - * Get the exact time the Live Output was created. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the exact time the Live Output was last modified. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get the provisioning state of the Live Output. - * - * @return the provisioningState value - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the resource state of the Live Output. Possible values include: 'Creating', 'Running', 'Deleting'. - * - * @return the resourceState value - */ - public LiveOutputResourceState resourceState() { - return this.resourceState; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsImpl.java deleted file mode 100644 index a179f77cf88d6..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutput; - -class LiveOutputsImpl extends WrapperImpl implements LiveOutputs { - private final MediaManager manager; - - LiveOutputsImpl(MediaManager manager) { - super(manager.inner().liveOutputs()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public LiveOutputImpl define(String name) { - return wrapModel(name); - } - - private LiveOutputImpl wrapModel(LiveOutputInner inner) { - return new LiveOutputImpl(inner, manager()); - } - - private LiveOutputImpl wrapModel(String name) { - return new LiveOutputImpl(name, this.manager()); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { - LiveOutputsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName, liveEventName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public LiveOutput call(LiveOutputInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - LiveOutputsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, liveEventName, liveOutputName) - .map(new Func1() { - @Override - public LiveOutput call(LiveOutputInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - LiveOutputsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsInner.java deleted file mode 100644 index b054f62ab2852..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveOutputsInner.java +++ /dev/null @@ -1,850 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.Path; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in LiveOutputs. - */ -public class LiveOutputsInner { - /** The Retrofit service to perform REST calls. */ - private LiveOutputsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of LiveOutputsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public LiveOutputsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(LiveOutputsService.class); - this.client = client; - } - - /** - * The interface defining all the services for LiveOutputs to be - * used by Retrofit to perform actually REST calls. - */ - interface LiveOutputsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs beginCreate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") - Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) - Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<LiveOutputInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String liveEventName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, liveEventName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String liveEventName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, liveEventName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveOutputInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { - return listWithServiceResponseAsync(resourceGroupName, accountName, liveEventName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveOutputInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String liveEventName) { - return listSinglePageAsync(resourceGroupName, accountName, liveEventName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param liveEventName The name of the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String liveEventName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get Live Output. - * Gets a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveOutputInner object if successful. - */ - public LiveOutputInner get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); - } - - /** - * Get Live Output. - * Gets a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); - } - - /** - * Get Live Output. - * Gets a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveOutputInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, LiveOutputInner>() { - @Override - public LiveOutputInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get Live Output. - * Gets a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveOutputInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (liveOutputName == null) { - throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveOutputInner object if successful. - */ - public LiveOutputInner create(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().last().body(); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { - @Override - public LiveOutputInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (liveOutputName == null) { - throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the LiveOutputInner object if successful. - */ - public LiveOutputInner beginCreate(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().single().body(); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveOutputInner object - */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { - @Override - public LiveOutputInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create Live Output. - * Creates a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param parameters Live Output properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the LiveOutputInner object - */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (liveOutputName == null) { - throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().last().body(); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (liveOutputName == null) { - throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Live Output. - * Deletes a Live Output. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param liveEventName The name of the Live Event. - * @param liveOutputName The name of the Live Output. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (liveEventName == null) { - throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); - } - if (liveOutputName == null) { - throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginDeleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<LiveOutputInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveOutputInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<LiveOutputInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Live Outputs. - * Lists the Live Outputs in the Live Event. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationInner.java deleted file mode 100644 index c020151652e40..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationInner.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The LocationInner model. - */ -public class LocationInner { - /** - * The name property. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the name value. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the name value. - * - * @param name the name value to set - * @return the LocationInner object itself. - */ - public LocationInner withName(String name) { - this.name = name; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsImpl.java deleted file mode 100644 index a9497d17867e4..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * abc - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Locations; -import rx.functions.Func1; -import rx.Observable; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.EntityNameAvailabilityCheckOutput; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CheckNameAvailabilityInput; - -class LocationsImpl extends WrapperImpl implements Locations { - private final MediaManager manager; - - LocationsImpl(MediaManager manager) { - super(manager.inner().locations()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { - LocationsInner client = this.inner(); - return client.checkNameAvailabilityAsync(locationName, parameters) - .map(new Func1() { - @Override - public EntityNameAvailabilityCheckOutput call(EntityNameAvailabilityCheckOutputInner inner) { - return new EntityNameAvailabilityCheckOutputImpl(inner, manager()); - } - }); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsInner.java deleted file mode 100644 index 55c71695c66cf..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LocationsInner.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CheckNameAvailabilityInput; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.Query; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Locations. - */ -public class LocationsInner { - /** The Retrofit service to perform REST calls. */ - private LocationsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of LocationsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public LocationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(LocationsService.class); - this.client = client; - } - - /** - * The interface defining all the services for Locations to be - * used by Retrofit to perform actually REST calls. - */ - interface LocationsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Locations checkNameAvailability" }) - @POST("subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability") - Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Body CheckNameAvailabilityInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * Check Name Availability. - * Checks whether the Media Service resource name is available. - * - * @param locationName the String value - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the EntityNameAvailabilityCheckOutputInner object if successful. - */ - public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { - return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); - } - - /** - * Check Name Availability. - * Checks whether the Media Service resource name is available. - * - * @param locationName the String value - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, parameters), serviceCallback); - } - - /** - * Check Name Availability. - * Checks whether the Media Service resource name is available. - * - * @param locationName the String value - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntityNameAvailabilityCheckOutputInner object - */ - public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { - return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).map(new Func1, EntityNameAvailabilityCheckOutputInner>() { - @Override - public EntityNameAvailabilityCheckOutputInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Check Name Availability. - * Checks whether the Media Service resource name is available. - * - * @param locationName the String value - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntityNameAvailabilityCheckOutputInner object - */ - public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, CheckNameAvailabilityInput parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (locationName == null) { - throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.checkNameAvailability(this.client.subscriptionId(), locationName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaManager.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaManager.java deleted file mode 100644 index 91c21be06d8f1..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaManager.java +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.AzureEnvironment; -import com.microsoft.azure.AzureResponseBuilder; -import com.microsoft.azure.credentials.AzureTokenCredentials; -import com.microsoft.azure.management.apigeneration.Beta; -import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; -import com.microsoft.azure.arm.resources.AzureConfigurable; -import com.microsoft.azure.serializer.AzureJacksonAdapter; -import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operations; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Locations; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Assets; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ContentKeyPolicies; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Jobs; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEvents; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveOutputs; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints; -import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; -import com.microsoft.azure.arm.resources.implementation.ManagerCore; - -/** - * Entry point to Azure Media resource management. - */ -public final class MediaManager extends ManagerCore { - private Operations operations; - private Mediaservices mediaservices; - private Locations locations; - private Assets assets; - private ContentKeyPolicies contentKeyPolicies; - private Transforms transforms; - private Jobs jobs; - private StreamingPolicies streamingPolicies; - private StreamingLocators streamingLocators; - private LiveEvents liveEvents; - private LiveOutputs liveOutputs; - private StreamingEndpoints streamingEndpoints; - /** - * Get a Configurable instance that can be used to create MediaManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new MediaManager.ConfigurableImpl(); - } - /** - * Creates an instance of MediaManager that exposes Media resource management API entry points. - * - * @param credentials the credentials to use - * @param subscriptionId the subscription UUID - * @return the MediaManager - */ - public static MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { - return new MediaManager(new RestClient.Builder() - .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) - .withCredentials(credentials) - .withSerializerAdapter(new AzureJacksonAdapter()) - .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) - .build(), subscriptionId); - } - /** - * Creates an instance of MediaManager that exposes Media resource management API entry points. - * - * @param restClient the RestClient to be used for API calls. - * @param subscriptionId the subscription UUID - * @return the MediaManager - */ - public static MediaManager authenticate(RestClient restClient, String subscriptionId) { - return new MediaManager(restClient, subscriptionId); - } - /** - * The interface allowing configurations to be set. - */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of MediaManager that exposes Media management API entry points. - * - * @param credentials the credentials to use - * @param subscriptionId the subscription UUID - * @return the interface exposing Media management API entry points that work across subscriptions - */ - MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId); - } - - /** - * @return Entry point to manage Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(this); - } - return this.operations; - } - - /** - * @return Entry point to manage Mediaservices. - */ - public Mediaservices mediaservices() { - if (this.mediaservices == null) { - this.mediaservices = new MediaservicesImpl(this); - } - return this.mediaservices; - } - - /** - * @return Entry point to manage Locations. - */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(this); - } - return this.locations; - } - - /** - * @return Entry point to manage Assets. - */ - public Assets assets() { - if (this.assets == null) { - this.assets = new AssetsImpl(this); - } - return this.assets; - } - - /** - * @return Entry point to manage ContentKeyPolicies. - */ - public ContentKeyPolicies contentKeyPolicies() { - if (this.contentKeyPolicies == null) { - this.contentKeyPolicies = new ContentKeyPoliciesImpl(this); - } - return this.contentKeyPolicies; - } - - /** - * @return Entry point to manage Transforms. - */ - public Transforms transforms() { - if (this.transforms == null) { - this.transforms = new TransformsImpl(this); - } - return this.transforms; - } - - /** - * @return Entry point to manage Jobs. - */ - public Jobs jobs() { - if (this.jobs == null) { - this.jobs = new JobsImpl(this); - } - return this.jobs; - } - - /** - * @return Entry point to manage StreamingPolicies. - */ - public StreamingPolicies streamingPolicies() { - if (this.streamingPolicies == null) { - this.streamingPolicies = new StreamingPoliciesImpl(this); - } - return this.streamingPolicies; - } - - /** - * @return Entry point to manage StreamingLocators. - */ - public StreamingLocators streamingLocators() { - if (this.streamingLocators == null) { - this.streamingLocators = new StreamingLocatorsImpl(this); - } - return this.streamingLocators; - } - - /** - * @return Entry point to manage LiveEvents. - */ - public LiveEvents liveEvents() { - if (this.liveEvents == null) { - this.liveEvents = new LiveEventsImpl(this); - } - return this.liveEvents; - } - - /** - * @return Entry point to manage LiveOutputs. - */ - public LiveOutputs liveOutputs() { - if (this.liveOutputs == null) { - this.liveOutputs = new LiveOutputsImpl(this); - } - return this.liveOutputs; - } - - /** - * @return Entry point to manage StreamingEndpoints. - */ - public StreamingEndpoints streamingEndpoints() { - if (this.streamingEndpoints == null) { - this.streamingEndpoints = new StreamingEndpointsImpl(this); - } - return this.streamingEndpoints; - } - - /** - * The implementation for Configurable interface. - */ - private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { - public MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { - return MediaManager.authenticate(buildRestClient(credentials), subscriptionId); - } - } - private MediaManager(RestClient restClient, String subscriptionId) { - super( - restClient, - subscriptionId, - new AzureMediaServicesImpl(restClient).withSubscriptionId(subscriptionId)); - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceImpl.java deleted file mode 100644 index c5acd09e46d86..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.MediaService; -import rx.Observable; -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StorageAccount; - -class MediaServiceImpl extends GroupableResourceCoreImpl implements MediaService, MediaService.Definition, MediaService.Update { - MediaServiceImpl(String name, MediaServiceInner inner, MediaManager manager) { - super(name, inner, manager); - } - - @Override - public Observable createResourceAsync() { - MediaservicesInner client = this.manager().inner().mediaservices(); - return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - MediaservicesInner client = this.manager().inner().mediaservices(); - return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - MediaservicesInner client = this.manager().inner().mediaservices(); - return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public UUID mediaServiceId() { - return this.inner().mediaServiceId(); - } - - @Override - public List storageAccounts() { - return this.inner().storageAccounts(); - } - - @Override - public MediaServiceImpl withStorageAccounts(List storageAccounts) { - this.inner().withStorageAccounts(storageAccounts); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceInner.java deleted file mode 100644 index b9c30490af1e2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaServiceInner.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StorageAccount; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.rest.SkipParentValidation; -import com.microsoft.azure.Resource; - -/** - * A Media Services account. - */ -@JsonFlatten -@SkipParentValidation -public class MediaServiceInner extends Resource { - /** - * The Media Services account ID. - */ - @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) - private UUID mediaServiceId; - - /** - * The storage accounts for this resource. - */ - @JsonProperty(value = "properties.storageAccounts") - private List storageAccounts; - - /** - * Get the Media Services account ID. - * - * @return the mediaServiceId value - */ - public UUID mediaServiceId() { - return this.mediaServiceId; - } - - /** - * Get the storage accounts for this resource. - * - * @return the storageAccounts value - */ - public List storageAccounts() { - return this.storageAccounts; - } - - /** - * Set the storage accounts for this resource. - * - * @param storageAccounts the storageAccounts value to set - * @return the MediaServiceInner object itself. - */ - public MediaServiceInner withStorageAccounts(List storageAccounts) { - this.storageAccounts = storageAccounts; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesImpl.java deleted file mode 100644 index 899ed34b0580c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * def - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.MediaService; -import rx.Observable; -import rx.Completable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import com.microsoft.azure.arm.resources.ResourceUtilsCore; -import com.microsoft.azure.arm.utils.RXMapper; -import rx.functions.Func1; -import com.microsoft.azure.PagedList; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.SubscriptionMediaService; -import com.microsoft.azure.arm.utils.PagedListConverter; - -class MediaservicesImpl extends GroupableResourcesCoreImpl implements Mediaservices { - protected MediaservicesImpl(MediaManager manager) { - super(manager.inner().mediaservices(), manager); - } - - @Override - protected Observable getInnerAsync(String resourceGroupName, String name) { - MediaservicesInner client = this.inner(); - return client.getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Completable deleteInnerAsync(String resourceGroupName, String name) { - MediaservicesInner client = this.inner(); - return client.deleteAsync(resourceGroupName, name).toCompletable(); - } - - @Override - public Observable deleteByIdsAsync(Collection ids) { - if (ids == null || ids.isEmpty()) { - return Observable.empty(); - } - Collection> observables = new ArrayList<>(); - for (String id : ids) { - final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); - final String name = ResourceUtilsCore.nameFromResourceId(id); - Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); - observables.add(o); - } - return Observable.mergeDelayError(observables); - } - - @Override - public Observable deleteByIdsAsync(String...ids) { - return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).toBlocking().last(); - } - } - - @Override - public void deleteByIds(String...ids) { - this.deleteByIds(new ArrayList(Arrays.asList(ids))); - } - - @Override - public PagedList listByResourceGroup(String resourceGroupName) { - MediaservicesInner client = this.inner(); - return this.wrapList(client.listByResourceGroup(resourceGroupName)); - } - - @Override - public Observable listByResourceGroupAsync(String resourceGroupName) { - MediaservicesInner client = this.inner(); - return client.listByResourceGroupAsync(resourceGroupName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public MediaService call(MediaServiceInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public PagedList list() { - MediaservicesInner client = this.inner(); - PagedListConverter converter = - new PagedListConverter() { - @Override - public Observable typeConvertAsync(SubscriptionMediaServiceInner inner) { - return Observable.just(inner) - .flatMap(new Func1>() { - @Override - public Observable call(SubscriptionMediaServiceInner inner) { - return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); - } - }) - .map(new Func1() { - @Override - public MediaService call(MediaServiceInner inner) { - return wrapModel(inner); - } - }); - } - }; - return converter.convert(client.list()); - } - - @Override - public Observable listAsync() { - MediaservicesInner client = this.inner(); - return client.listAsync() - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .flatMap(new Func1>() { - @Override - public Observable call(SubscriptionMediaServiceInner inner) { - return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); - } - }) - .map(new Func1() { - @Override - public MediaService call(MediaServiceInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public MediaServiceImpl define(String name) { - return wrapModel(name); - } - - @Override - public Completable syncStorageKeysAsync(String resourceGroupName, String accountName) { - MediaservicesInner client = this.inner(); - return client.syncStorageKeysAsync(resourceGroupName, accountName).toCompletable(); - } - - @Override - public Observable getBySubscriptionAsync(String accountName) { - MediaservicesInner client = this.inner(); - return client.getBySubscriptionAsync(accountName) - .map(new Func1() { - @Override - public SubscriptionMediaService call(SubscriptionMediaServiceInner inner) { - return new SubscriptionMediaServiceImpl(inner, manager()); - } - }); - } - - @Override - protected MediaServiceImpl wrapModel(MediaServiceInner inner) { - return new MediaServiceImpl(inner.name(), inner, manager()); - } - - @Override - protected MediaServiceImpl wrapModel(String name) { - return new MediaServiceImpl(name, new MediaServiceInner(), this.manager()); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesInner.java deleted file mode 100644 index ece448806c0a0..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/MediaservicesInner.java +++ /dev/null @@ -1,1214 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.collection.InnerSupportsGet; -import com.microsoft.azure.arm.collection.InnerSupportsDelete; -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.SyncStorageKeysInput; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Mediaservices. - */ -public class MediaservicesInner implements InnerSupportsGet, InnerSupportsDelete { - /** The Retrofit service to perform REST calls. */ - private MediaservicesService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of MediaservicesInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public MediaservicesInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(MediaservicesService.class); - this.client = client; - } - - /** - * The interface defining all the services for Mediaservices to be - * used by Retrofit to perform actually REST calls. - */ - interface MediaservicesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices listByResourceGroup" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices") - Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices getByResourceGroup" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") - Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices syncStorageKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys") - Observable> syncStorageKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SyncStorageKeysInput parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices") - Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices getBySubscription" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") - Observable> getBySubscription(@Path("subscriptionId") String subscriptionId, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices listByResourceGroupNext" }) - @GET - Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Mediaservices listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<MediaServiceInner> object if successful. - */ - public PagedList listByResourceGroup(final String resourceGroupName) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByResourceGroupSinglePageAsync(resourceGroupName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<MediaServiceInner> object - */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { - return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<MediaServiceInner> object - */ - public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { - return listByResourceGroupSinglePageAsync(resourceGroupName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the MediaServiceInner object if successful. - */ - public MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, MediaServiceInner>() { - @Override - public MediaServiceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getByResourceGroupDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create or update a Media Services account. - * Creates or updates a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the MediaServiceInner object if successful. - */ - public MediaServiceInner createOrUpdate(String resourceGroupName, String accountName, MediaServiceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); - } - - /** - * Create or update a Media Services account. - * Creates or updates a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); - } - - /** - * Create or update a Media Services account. - * Creates or updates a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { - @Override - public MediaServiceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or update a Media Services account. - * Creates or updates a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete a Media Services account. - * Deletes a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); - } - - /** - * Delete a Media Services account. - * Deletes a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); - } - - /** - * Delete a Media Services account. - * Deletes a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete a Media Services account. - * Deletes a Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Update a Media Services account. - * Updates an existing Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the MediaServiceInner object if successful. - */ - public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); - } - - /** - * Update a Media Services account. - * Updates an existing Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); - } - - /** - * Update a Media Services account. - * Updates an existing Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { - @Override - public MediaServiceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a Media Services account. - * Updates an existing Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MediaServiceInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void syncStorageKeys(String resourceGroupName, String accountName) { - syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable syncStorageKeysAsync(String resourceGroupName, String accountName) { - return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String id = null; - SyncStorageKeysInput parameters = new SyncStorageKeysInput(); - parameters.withId(null); - return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = syncStorageKeysDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param id The ID of the storage account resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void syncStorageKeys(String resourceGroupName, String accountName, String id) { - syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).toBlocking().single().body(); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param id The ID of the storage account resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, String id, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id), serviceCallback); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param id The ID of the storage account resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable syncStorageKeysAsync(String resourceGroupName, String accountName, String id) { - return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Synchronizes Storage Account Keys. - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param id The ID of the storage account resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String id) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - SyncStorageKeysInput parameters = new SyncStorageKeysInput(); - parameters.withId(id); - return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = syncStorageKeysDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse syncStorageKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<SubscriptionMediaServiceInner> object if successful. - */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SubscriptionMediaServiceInner> object - */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SubscriptionMediaServiceInner> object - */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync() { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SubscriptionMediaServiceInner object if successful. - */ - public SubscriptionMediaServiceInner getBySubscription(String accountName) { - return getBySubscriptionWithServiceResponseAsync(accountName).toBlocking().single().body(); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getBySubscriptionAsync(String accountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getBySubscriptionWithServiceResponseAsync(accountName), serviceCallback); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SubscriptionMediaServiceInner object - */ - public Observable getBySubscriptionAsync(String accountName) { - return getBySubscriptionWithServiceResponseAsync(accountName).map(new Func1, SubscriptionMediaServiceInner>() { - @Override - public SubscriptionMediaServiceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Media Services account. - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SubscriptionMediaServiceInner object - */ - public Observable> getBySubscriptionWithServiceResponseAsync(String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getBySubscription(this.client.subscriptionId(), accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getBySubscriptionDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getBySubscriptionDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<MediaServiceInner> object if successful. - */ - public PagedList listByResourceGroupNext(final String nextPageLink) { - ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByResourceGroupNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<MediaServiceInner> object - */ - public Observable> listByResourceGroupNextAsync(final String nextPageLink) { - return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<MediaServiceInner> object - */ - public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the resource group. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<SubscriptionMediaServiceInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SubscriptionMediaServiceInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SubscriptionMediaServiceInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Media Services accounts. - * List Media Services accounts in the subscription. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationImpl.java deleted file mode 100644 index e756d08369eec..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operation; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.OperationDisplay; - -class OperationImpl extends WrapperImpl implements Operation { - private final MediaManager manager; - OperationImpl(OperationInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public OperationDisplay display() { - return this.inner().display(); - } - - @Override - public String name() { - return this.inner().name(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationInner.java deleted file mode 100644 index d4ecab4f0604a..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationInner.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * An operation. - */ -public class OperationInner { - /** - * The operation name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * The operation display name. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the operation name. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the operation name. - * - * @param name the name value to set - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the operation display name. - * - * @return the display value - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the operation display name. - * - * @param display the display value to set - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsImpl.java deleted file mode 100644 index 735fcd0a93c2f..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * abc - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operations; -import rx.functions.Func1; -import rx.Observable; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operation; - -class OperationsImpl extends WrapperImpl implements Operations { - private final MediaManager manager; - - OperationsImpl(MediaManager manager) { - super(manager.inner().operations()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable listAsync() { - OperationsInner client = this.inner(); - return client.listAsync() - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public Operation call(OperationInner inner) { - return new OperationImpl(inner, manager()); - } - }); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsInner.java deleted file mode 100644 index 79b51277ac2e3..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/OperationsInner.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Operations. - */ -public class OperationsInner { - /** The Retrofit service to perform REST calls. */ - private OperationsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of OperationsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public OperationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(OperationsService.class); - this.client = client; - } - - /** - * The interface defining all the services for Operations to be - * used by Retrofit to perform actually REST calls. - */ - interface OperationsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operations list" }) - @GET("providers/Microsoft.Media/operations") - Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Operations listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<OperationInner> object if successful. - */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync() { - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<OperationInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Operations. - * Lists all the Media Services operations. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/PageImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/PageImpl.java deleted file mode 100644 index 8cde9c5020113..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/PageImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.Page; -import java.util.List; - -/** - * An instance of this class defines a page of Azure resources and a link to - * get the next page of resources, if any. - * - * @param type of Azure resource - */ -public class PageImpl implements Page { - /** - * The link to the next page. - */ - @JsonProperty("@odata.nextLink") - private String nextPageLink; - - /** - * The list of items. - */ - @JsonProperty("value") - private List items; - - /** - * Gets the link to the next page. - * - * @return the link to the next page. - */ - @Override - public String nextPageLink() { - return this.nextPageLink; - } - - /** - * Gets the list of items. - * - * @return the list of items in {@link List}. - */ - @Override - public List items() { - return items; - } - - /** - * Sets the link to the next page. - * - * @param nextPageLink the link to the next page. - * @return this Page object itself. - */ - public PageImpl setNextPageLink(String nextPageLink) { - this.nextPageLink = nextPageLink; - return this; - } - - /** - * Sets the list of items. - * - * @param items the list of items in {@link List}. - * @return this Page object itself. - */ - public PageImpl setItems(List items) { - this.items = items; - return this; - } -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointImpl.java deleted file mode 100644 index fa187e7981c52..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoint; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import java.util.Map; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpointAccessControl; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpointResourceState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CrossSiteAccessPolicies; -import org.joda.time.DateTime; - -class StreamingEndpointImpl extends CreatableUpdatableImpl implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String streamingEndpointName; - - StreamingEndpointImpl(String name, MediaManager manager) { - super(name, new StreamingEndpointInner()); - this.manager = manager; - // Set resource name - this.streamingEndpointName = name; - // - } - - StreamingEndpointImpl(StreamingEndpointInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.streamingEndpointName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); - this.streamingEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingEndpoints"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); - return client.getAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public StreamingEndpointAccessControl accessControl() { - return this.inner().accessControl(); - } - - @Override - public String availabilitySetName() { - return this.inner().availabilitySetName(); - } - - @Override - public Boolean cdnEnabled() { - return this.inner().cdnEnabled(); - } - - @Override - public String cdnProfile() { - return this.inner().cdnProfile(); - } - - @Override - public String cdnProvider() { - return this.inner().cdnProvider(); - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public CrossSiteAccessPolicies crossSiteAccessPolicies() { - return this.inner().crossSiteAccessPolicies(); - } - - @Override - public List customHostNames() { - return this.inner().customHostNames(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public DateTime freeTrialEndTime() { - return this.inner().freeTrialEndTime(); - } - - @Override - public String hostName() { - return this.inner().hostName(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String location() { - return this.inner().location(); - } - - @Override - public Long maxCacheAge() { - return this.inner().maxCacheAge(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public String provisioningState() { - return this.inner().provisioningState(); - } - - @Override - public StreamingEndpointResourceState resourceState() { - return this.inner().resourceState(); - } - - @Override - public int scaleUnits() { - return this.inner().scaleUnits(); - } - - @Override - public Map tags() { - return this.inner().getTags(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { - this.inner().withAccessControl(accessControl); - return this; - } - - @Override - public StreamingEndpointImpl withAvailabilitySetName(String availabilitySetName) { - this.inner().withAvailabilitySetName(availabilitySetName); - return this; - } - - @Override - public StreamingEndpointImpl withCdnEnabled(Boolean cdnEnabled) { - this.inner().withCdnEnabled(cdnEnabled); - return this; - } - - @Override - public StreamingEndpointImpl withCdnProfile(String cdnProfile) { - this.inner().withCdnProfile(cdnProfile); - return this; - } - - @Override - public StreamingEndpointImpl withCdnProvider(String cdnProvider) { - this.inner().withCdnProvider(cdnProvider); - return this; - } - - @Override - public StreamingEndpointImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { - this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); - return this; - } - - @Override - public StreamingEndpointImpl withCustomHostNames(List customHostNames) { - this.inner().withCustomHostNames(customHostNames); - return this; - } - - @Override - public StreamingEndpointImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - - @Override - public StreamingEndpointImpl withLocation(String location) { - this.inner().withLocation(location); - return this; - } - - @Override - public StreamingEndpointImpl withMaxCacheAge(Long maxCacheAge) { - this.inner().withMaxCacheAge(maxCacheAge); - return this; - } - - @Override - public StreamingEndpointImpl withScaleUnits(int scaleUnits) { - this.inner().withScaleUnits(scaleUnits); - return this; - } - - @Override - public StreamingEndpointImpl withTags(Map tags) { - this.inner().withTags(tags); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointInner.java deleted file mode 100644 index e8bbde19ea402..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointInner.java +++ /dev/null @@ -1,378 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpointAccessControl; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpointResourceState; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CrossSiteAccessPolicies; -import org.joda.time.DateTime; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.rest.SkipParentValidation; -import com.microsoft.azure.Resource; - -/** - * The StreamingEndpoint. - */ -@JsonFlatten -@SkipParentValidation -public class StreamingEndpointInner extends Resource { - /** - * The StreamingEndpoint description. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The number of scale units. - */ - @JsonProperty(value = "properties.scaleUnits") - private int scaleUnits; - - /** - * AvailabilitySet name. - */ - @JsonProperty(value = "properties.availabilitySetName") - private String availabilitySetName; - - /** - * The access control definition of the StreamingEndpoint. - */ - @JsonProperty(value = "properties.accessControl") - private StreamingEndpointAccessControl accessControl; - - /** - * Max cache age. - */ - @JsonProperty(value = "properties.maxCacheAge") - private Long maxCacheAge; - - /** - * The custom host names of the StreamingEndpoint. - */ - @JsonProperty(value = "properties.customHostNames") - private List customHostNames; - - /** - * The StreamingEndpoint host name. - */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostName; - - /** - * The CDN enabled flag. - */ - @JsonProperty(value = "properties.cdnEnabled") - private Boolean cdnEnabled; - - /** - * The CDN provider name. - */ - @JsonProperty(value = "properties.cdnProvider") - private String cdnProvider; - - /** - * The CDN profile name. - */ - @JsonProperty(value = "properties.cdnProfile") - private String cdnProfile; - - /** - * The provisioning state of the StreamingEndpoint. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * The resource state of the StreamingEndpoint. Possible values include: - * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private StreamingEndpointResourceState resourceState; - - /** - * The StreamingEndpoint access policies. - */ - @JsonProperty(value = "properties.crossSiteAccessPolicies") - private CrossSiteAccessPolicies crossSiteAccessPolicies; - - /** - * The free trial expiration time. - */ - @JsonProperty(value = "properties.freeTrialEndTime", access = JsonProperty.Access.WRITE_ONLY) - private DateTime freeTrialEndTime; - - /** - * The exact time the StreamingEndpoint was created. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * The exact time the StreamingEndpoint was last modified. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * Get the StreamingEndpoint description. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set the StreamingEndpoint description. - * - * @param description the description value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the number of scale units. - * - * @return the scaleUnits value - */ - public int scaleUnits() { - return this.scaleUnits; - } - - /** - * Set the number of scale units. - * - * @param scaleUnits the scaleUnits value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withScaleUnits(int scaleUnits) { - this.scaleUnits = scaleUnits; - return this; - } - - /** - * Get availabilitySet name. - * - * @return the availabilitySetName value - */ - public String availabilitySetName() { - return this.availabilitySetName; - } - - /** - * Set availabilitySet name. - * - * @param availabilitySetName the availabilitySetName value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withAvailabilitySetName(String availabilitySetName) { - this.availabilitySetName = availabilitySetName; - return this; - } - - /** - * Get the access control definition of the StreamingEndpoint. - * - * @return the accessControl value - */ - public StreamingEndpointAccessControl accessControl() { - return this.accessControl; - } - - /** - * Set the access control definition of the StreamingEndpoint. - * - * @param accessControl the accessControl value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withAccessControl(StreamingEndpointAccessControl accessControl) { - this.accessControl = accessControl; - return this; - } - - /** - * Get max cache age. - * - * @return the maxCacheAge value - */ - public Long maxCacheAge() { - return this.maxCacheAge; - } - - /** - * Set max cache age. - * - * @param maxCacheAge the maxCacheAge value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withMaxCacheAge(Long maxCacheAge) { - this.maxCacheAge = maxCacheAge; - return this; - } - - /** - * Get the custom host names of the StreamingEndpoint. - * - * @return the customHostNames value - */ - public List customHostNames() { - return this.customHostNames; - } - - /** - * Set the custom host names of the StreamingEndpoint. - * - * @param customHostNames the customHostNames value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withCustomHostNames(List customHostNames) { - this.customHostNames = customHostNames; - return this; - } - - /** - * Get the StreamingEndpoint host name. - * - * @return the hostName value - */ - public String hostName() { - return this.hostName; - } - - /** - * Get the CDN enabled flag. - * - * @return the cdnEnabled value - */ - public Boolean cdnEnabled() { - return this.cdnEnabled; - } - - /** - * Set the CDN enabled flag. - * - * @param cdnEnabled the cdnEnabled value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withCdnEnabled(Boolean cdnEnabled) { - this.cdnEnabled = cdnEnabled; - return this; - } - - /** - * Get the CDN provider name. - * - * @return the cdnProvider value - */ - public String cdnProvider() { - return this.cdnProvider; - } - - /** - * Set the CDN provider name. - * - * @param cdnProvider the cdnProvider value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withCdnProvider(String cdnProvider) { - this.cdnProvider = cdnProvider; - return this; - } - - /** - * Get the CDN profile name. - * - * @return the cdnProfile value - */ - public String cdnProfile() { - return this.cdnProfile; - } - - /** - * Set the CDN profile name. - * - * @param cdnProfile the cdnProfile value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withCdnProfile(String cdnProfile) { - this.cdnProfile = cdnProfile; - return this; - } - - /** - * Get the provisioning state of the StreamingEndpoint. - * - * @return the provisioningState value - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the resource state of the StreamingEndpoint. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. - * - * @return the resourceState value - */ - public StreamingEndpointResourceState resourceState() { - return this.resourceState; - } - - /** - * Get the StreamingEndpoint access policies. - * - * @return the crossSiteAccessPolicies value - */ - public CrossSiteAccessPolicies crossSiteAccessPolicies() { - return this.crossSiteAccessPolicies; - } - - /** - * Set the StreamingEndpoint access policies. - * - * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set - * @return the StreamingEndpointInner object itself. - */ - public StreamingEndpointInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { - this.crossSiteAccessPolicies = crossSiteAccessPolicies; - return this; - } - - /** - * Get the free trial expiration time. - * - * @return the freeTrialEndTime value - */ - public DateTime freeTrialEndTime() { - return this.freeTrialEndTime; - } - - /** - * Get the exact time the StreamingEndpoint was created. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get the exact time the StreamingEndpoint was last modified. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsImpl.java deleted file mode 100644 index a16c685dd1fce..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoint; - -class StreamingEndpointsImpl extends WrapperImpl implements StreamingEndpoints { - private final MediaManager manager; - - StreamingEndpointsImpl(MediaManager manager) { - super(manager.inner().streamingEndpoints()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public StreamingEndpointImpl define(String name) { - return wrapModel(name); - } - - private StreamingEndpointImpl wrapModel(StreamingEndpointInner inner) { - return new StreamingEndpointImpl(inner, manager()); - } - - private StreamingEndpointImpl wrapModel(String name) { - return new StreamingEndpointImpl(name, this.manager()); - } - - @Override - public Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - StreamingEndpointsInner client = this.inner(); - return client.startAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); - } - - @Override - public Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - StreamingEndpointsInner client = this.inner(); - return client.stopAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); - } - - @Override - public Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - StreamingEndpointsInner client = this.inner(); - return client.scaleAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - StreamingEndpointsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public StreamingEndpoint call(StreamingEndpointInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - StreamingEndpointsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, streamingEndpointName) - .map(new Func1() { - @Override - public StreamingEndpoint call(StreamingEndpointInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - StreamingEndpointsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsInner.java deleted file mode 100644 index c34d401cc981e..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingEndpointsInner.java +++ /dev/null @@ -1,1944 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEntityScaleUnit; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in StreamingEndpoints. - */ -public class StreamingEndpointsInner { - /** The Retrofit service to perform REST calls. */ - private StreamingEndpointsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of StreamingEndpointsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public StreamingEndpointsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(StreamingEndpointsService.class); - this.client = client; - } - - /** - * The interface defining all the services for StreamingEndpoints to be - * used by Retrofit to perform actually REST calls. - */ - interface StreamingEndpointsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginCreate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") - Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginUpdate" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) - Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints start" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") - Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginStart" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") - Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints stop" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") - Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginStop" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") - Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints scale" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") - Observable> scale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints beginScale" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") - Observable> beginScale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingEndpoints listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingEndpointInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingEndpointInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingEndpointInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get StreamingEndpoint. - * Gets a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); - } - - /** - * Get StreamingEndpoint. - * Gets a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Get StreamingEndpoint. - * Gets a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get StreamingEndpoint. - * Gets a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final Boolean autoStart = null; - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().last().body(); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final Boolean autoStart = null; - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().single().body(); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create StreamingEndpoint. - * Creates a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param autoStart The flag indicates if auto start the Live Event. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner update(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingEndpointInner object if successful. - */ - public StreamingEndpointInner beginUpdate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { - @Override - public StreamingEndpointInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update StreamingEndpoint. - * Updates a existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param parameters StreamingEndpoint properties needed for creation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingEndpointInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginDelete(String resourceGroupName, String accountName, String streamingEndpointName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete StreamingEndpoint. - * Deletes a StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginDeleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void start(String resourceGroupName, String accountName, String streamingEndpointName) { - startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture startAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginStart(String resourceGroupName, String accountName, String streamingEndpointName) { - beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Start StreamingEndpoint. - * Starts an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginStartDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { - stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture stopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginStop(String resourceGroupName, String accountName, String streamingEndpointName) { - beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Stop StreamingEndpoint. - * Stops an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginStopDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void scale(String resourceGroupName, String accountName, String streamingEndpointName) { - scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Integer scaleUnit = null; - StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); - parameters.withScaleUnit(null); - Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void scale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().last().body(); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); - parameters.withScaleUnit(scaleUnit); - Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) { - beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Integer scaleUnit = null; - StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); - parameters.withScaleUnit(null); - return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginScaleDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().single().body(); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Scale StreamingEndpoint. - * Scales an existing StreamingEndpoint. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingEndpointName The name of the StreamingEndpoint. - * @param scaleUnit ScaleUnit The scale unit number of the StreamingEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingEndpointName == null) { - throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); - parameters.withScaleUnit(scaleUnit); - return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginScaleDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginScaleDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingEndpointInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingEndpointInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingEndpointInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List StreamingEndpoints. - * Lists the StreamingEndpoints in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorImpl.java deleted file mode 100644 index 5eac10005ca42..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocator; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import org.joda.time.DateTime; -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocatorUserDefinedContentKey; - -class StreamingLocatorImpl extends CreatableUpdatableImpl implements StreamingLocator, StreamingLocator.Definition, StreamingLocator.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String streamingLocatorName; - - StreamingLocatorImpl(String name, MediaManager manager) { - super(name, new StreamingLocatorInner()); - this.manager = manager; - // Set resource name - this.streamingLocatorName = name; - // - } - - StreamingLocatorImpl(StreamingLocatorInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.streamingLocatorName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.streamingLocatorName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingLocators"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - StreamingLocatorsInner client = this.manager().inner().streamingLocators(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - StreamingLocatorsInner client = this.manager().inner().streamingLocators(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - StreamingLocatorsInner client = this.manager().inner().streamingLocators(); - return client.getAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public String assetName() { - return this.inner().assetName(); - } - - @Override - public List contentKeys() { - return this.inner().contentKeys(); - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String defaultContentKeyPolicyName() { - return this.inner().defaultContentKeyPolicyName(); - } - - @Override - public DateTime endTime() { - return this.inner().endTime(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public DateTime startTime() { - return this.inner().startTime(); - } - - @Override - public UUID streamingLocatorId() { - return this.inner().streamingLocatorId(); - } - - @Override - public String streamingPolicyName() { - return this.inner().streamingPolicyName(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public StreamingLocatorImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public StreamingLocatorImpl withAssetName(String assetName) { - this.inner().withAssetName(assetName); - return this; - } - - @Override - public StreamingLocatorImpl withStreamingPolicyName(String streamingPolicyName) { - this.inner().withStreamingPolicyName(streamingPolicyName); - return this; - } - - @Override - public StreamingLocatorImpl withContentKeys(List contentKeys) { - this.inner().withContentKeys(contentKeys); - return this; - } - - @Override - public StreamingLocatorImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { - this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); - return this; - } - - @Override - public StreamingLocatorImpl withEndTime(DateTime endTime) { - this.inner().withEndTime(endTime); - return this; - } - - @Override - public StreamingLocatorImpl withStartTime(DateTime startTime) { - this.inner().withStartTime(startTime); - return this; - } - - @Override - public StreamingLocatorImpl withStreamingLocatorId(UUID streamingLocatorId) { - this.inner().withStreamingLocatorId(streamingLocatorId); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorInner.java deleted file mode 100644 index 0e8fff1fdcfb7..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorInner.java +++ /dev/null @@ -1,227 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import org.joda.time.DateTime; -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocatorUserDefinedContentKey; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * A Streaming Locator resource. - */ -@JsonFlatten -public class StreamingLocatorInner extends ProxyResource { - /** - * Asset Name. - */ - @JsonProperty(value = "properties.assetName", required = true) - private String assetName; - - /** - * Creation time of Streaming Locator. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * StartTime of Streaming Locator. - */ - @JsonProperty(value = "properties.startTime") - private DateTime startTime; - - /** - * EndTime of Streaming Locator. - */ - @JsonProperty(value = "properties.endTime") - private DateTime endTime; - - /** - * StreamingLocatorId of Streaming Locator. - */ - @JsonProperty(value = "properties.streamingLocatorId") - private UUID streamingLocatorId; - - /** - * Streaming policy name used by this streaming locator. Either specify the - * name of streaming policy you created or use one of the predefined - * streaming polices. The predefined streaming policies available are: - * 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', - * 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', - * 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay'. - */ - @JsonProperty(value = "properties.streamingPolicyName", required = true) - private String streamingPolicyName; - - /** - * Default ContentKeyPolicy used by this Streaming Locator. - */ - @JsonProperty(value = "properties.defaultContentKeyPolicyName") - private String defaultContentKeyPolicyName; - - /** - * ContentKeys used by this Streaming Locator. - */ - @JsonProperty(value = "properties.contentKeys") - private List contentKeys; - - /** - * Get asset Name. - * - * @return the assetName value - */ - public String assetName() { - return this.assetName; - } - - /** - * Set asset Name. - * - * @param assetName the assetName value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withAssetName(String assetName) { - this.assetName = assetName; - return this; - } - - /** - * Get creation time of Streaming Locator. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get startTime of Streaming Locator. - * - * @return the startTime value - */ - public DateTime startTime() { - return this.startTime; - } - - /** - * Set startTime of Streaming Locator. - * - * @param startTime the startTime value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withStartTime(DateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get endTime of Streaming Locator. - * - * @return the endTime value - */ - public DateTime endTime() { - return this.endTime; - } - - /** - * Set endTime of Streaming Locator. - * - * @param endTime the endTime value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withEndTime(DateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get streamingLocatorId of Streaming Locator. - * - * @return the streamingLocatorId value - */ - public UUID streamingLocatorId() { - return this.streamingLocatorId; - } - - /** - * Set streamingLocatorId of Streaming Locator. - * - * @param streamingLocatorId the streamingLocatorId value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withStreamingLocatorId(UUID streamingLocatorId) { - this.streamingLocatorId = streamingLocatorId; - return this; - } - - /** - * Get streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay'. - * - * @return the streamingPolicyName value - */ - public String streamingPolicyName() { - return this.streamingPolicyName; - } - - /** - * Set streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay'. - * - * @param streamingPolicyName the streamingPolicyName value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withStreamingPolicyName(String streamingPolicyName) { - this.streamingPolicyName = streamingPolicyName; - return this; - } - - /** - * Get default ContentKeyPolicy used by this Streaming Locator. - * - * @return the defaultContentKeyPolicyName value - */ - public String defaultContentKeyPolicyName() { - return this.defaultContentKeyPolicyName; - } - - /** - * Set default ContentKeyPolicy used by this Streaming Locator. - * - * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { - this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; - return this; - } - - /** - * Get contentKeys used by this Streaming Locator. - * - * @return the contentKeys value - */ - public List contentKeys() { - return this.contentKeys; - } - - /** - * Set contentKeys used by this Streaming Locator. - * - * @param contentKeys the contentKeys value to set - * @return the StreamingLocatorInner object itself. - */ - public StreamingLocatorInner withContentKeys(List contentKeys) { - this.contentKeys = contentKeys; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsImpl.java deleted file mode 100644 index 65e85e8b67690..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListContentKeysResponse; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ListPathsResponse; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocator; - -class StreamingLocatorsImpl extends WrapperImpl implements StreamingLocators { - private final MediaManager manager; - - StreamingLocatorsImpl(MediaManager manager) { - super(manager.inner().streamingLocators()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public StreamingLocatorImpl define(String name) { - return wrapModel(name); - } - - private StreamingLocatorImpl wrapModel(StreamingLocatorInner inner) { - return new StreamingLocatorImpl(inner, manager()); - } - - private StreamingLocatorImpl wrapModel(String name) { - return new StreamingLocatorImpl(name, this.manager()); - } - - @Override - public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - StreamingLocatorsInner client = this.inner(); - return client.listContentKeysAsync(resourceGroupName, accountName, streamingLocatorName) - .map(new Func1() { - @Override - public ListContentKeysResponse call(ListContentKeysResponseInner inner) { - return new ListContentKeysResponseImpl(inner, manager()); - } - }); - } - - @Override - public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - StreamingLocatorsInner client = this.inner(); - return client.listPathsAsync(resourceGroupName, accountName, streamingLocatorName) - .map(new Func1() { - @Override - public ListPathsResponse call(ListPathsResponseInner inner) { - return new ListPathsResponseImpl(inner, manager()); - } - }); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - StreamingLocatorsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public StreamingLocator call(StreamingLocatorInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - StreamingLocatorsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, streamingLocatorName) - .map(new Func1() { - @Override - public StreamingLocator call(StreamingLocatorInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - StreamingLocatorsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, streamingLocatorName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsInner.java deleted file mode 100644 index b8129853877c2..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingLocatorsInner.java +++ /dev/null @@ -1,972 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.Path; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in StreamingLocators. - */ -public class StreamingLocatorsInner { - /** The Retrofit service to perform REST calls. */ - private StreamingLocatorsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of StreamingLocatorsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public StreamingLocatorsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(StreamingLocatorsService.class); - this.client = client; - } - - /** - * The interface defining all the services for StreamingLocators to be - * used by Retrofit to perform actually REST calls. - */ - interface StreamingLocatorsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Body StreamingLocatorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators listContentKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys") - Observable> listContentKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators listPaths" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths") - Observable> listPaths(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingLocators listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingLocatorInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final String orderby = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingLocatorInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Streaming Locator. - * Get the details of a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingLocatorInner object if successful. - */ - public StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); - } - - /** - * Get a Streaming Locator. - * Get the details of a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); - } - - /** - * Get a Streaming Locator. - * Get the details of a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingLocatorInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, StreamingLocatorInner>() { - @Override - public StreamingLocatorInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Streaming Locator. - * Get the details of a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingLocatorInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingLocatorName == null) { - throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create a Streaming Locator. - * Create a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingLocatorInner object if successful. - */ - public StreamingLocatorInner create(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).toBlocking().single().body(); - } - - /** - * Create a Streaming Locator. - * Create a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters), serviceCallback); - } - - /** - * Create a Streaming Locator. - * Create a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingLocatorInner object - */ - public Observable createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).map(new Func1, StreamingLocatorInner>() { - @Override - public StreamingLocatorInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a Streaming Locator. - * Create a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingLocatorInner object - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingLocatorName == null) { - throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete a Streaming Locator. - * Deletes a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); - } - - /** - * Delete a Streaming Locator. - * Deletes a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); - } - - /** - * Delete a Streaming Locator. - * Deletes a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete a Streaming Locator. - * Deletes a Streaming Locator in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingLocatorName == null) { - throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Content Keys. - * List Content Keys used by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ListContentKeysResponseInner object if successful. - */ - public ListContentKeysResponseInner listContentKeys(String resourceGroupName, String accountName, String streamingLocatorName) { - return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); - } - - /** - * List Content Keys. - * List Content Keys used by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); - } - - /** - * List Content Keys. - * List Content Keys used by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ListContentKeysResponseInner object - */ - public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListContentKeysResponseInner>() { - @Override - public ListContentKeysResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * List Content Keys. - * List Content Keys used by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ListContentKeysResponseInner object - */ - public Observable> listContentKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingLocatorName == null) { - throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listContentKeys(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = listContentKeysDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse listContentKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Paths. - * List Paths supported by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ListPathsResponseInner object if successful. - */ - public ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { - return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); - } - - /** - * List Paths. - * List Paths supported by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); - } - - /** - * List Paths. - * List Paths supported by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ListPathsResponseInner object - */ - public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListPathsResponseInner>() { - @Override - public ListPathsResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * List Paths. - * List Paths supported by this Streaming Locator. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingLocatorName The Streaming Locator name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ListPathsResponseInner object - */ - public Observable> listPathsWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingLocatorName == null) { - throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listPaths(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = listPathsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse listPathsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingLocatorInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingLocatorInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Locators. - * Lists the Streaming Locators in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesImpl.java deleted file mode 100644 index 637b8abd64b04..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicy; - -class StreamingPoliciesImpl extends WrapperImpl implements StreamingPolicies { - private final MediaManager manager; - - StreamingPoliciesImpl(MediaManager manager) { - super(manager.inner().streamingPolicies()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public StreamingPolicyImpl define(String name) { - return wrapModel(name); - } - - private StreamingPolicyImpl wrapModel(StreamingPolicyInner inner) { - return new StreamingPolicyImpl(inner, manager()); - } - - private StreamingPolicyImpl wrapModel(String name) { - return new StreamingPolicyImpl(name, this.manager()); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - StreamingPoliciesInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public StreamingPolicy call(StreamingPolicyInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - StreamingPoliciesInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, streamingPolicyName) - .map(new Func1() { - @Override - public StreamingPolicy call(StreamingPolicyInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - StreamingPoliciesInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, streamingPolicyName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesInner.java deleted file mode 100644 index bb494954c81e5..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPoliciesInner.java +++ /dev/null @@ -1,769 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.Path; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in StreamingPolicies. - */ -public class StreamingPoliciesInner { - /** The Retrofit service to perform REST calls. */ - private StreamingPoliciesService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of StreamingPoliciesInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public StreamingPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(StreamingPoliciesService.class); - this.client = client; - } - - /** - * The interface defining all the services for StreamingPolicies to be - * used by Retrofit to perform actually REST calls. - */ - interface StreamingPoliciesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Body StreamingPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicies listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingPolicyInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final String orderby = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingPolicyInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get a Streaming Policy. - * Get the details of a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingPolicyInner object if successful. - */ - public StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); - } - - /** - * Get a Streaming Policy. - * Get the details of a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); - } - - /** - * Get a Streaming Policy. - * Get the details of a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingPolicyInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, StreamingPolicyInner>() { - @Override - public StreamingPolicyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get a Streaming Policy. - * Get the details of a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingPolicyInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingPolicyName == null) { - throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create a Streaming Policy. - * Create a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the StreamingPolicyInner object if successful. - */ - public StreamingPolicyInner create(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).toBlocking().single().body(); - } - - /** - * Create a Streaming Policy. - * Create a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters), serviceCallback); - } - - /** - * Create a Streaming Policy. - * Create a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingPolicyInner object - */ - public Observable createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).map(new Func1, StreamingPolicyInner>() { - @Override - public StreamingPolicyInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a Streaming Policy. - * Create a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the StreamingPolicyInner object - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingPolicyName == null) { - throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete a Streaming Policy. - * Deletes a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); - } - - /** - * Delete a Streaming Policy. - * Deletes a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); - } - - /** - * Delete a Streaming Policy. - * Deletes a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete a Streaming Policy. - * Deletes a Streaming Policy in the Media Services account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param streamingPolicyName The Streaming Policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (streamingPolicyName == null) { - throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<StreamingPolicyInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<StreamingPolicyInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Streaming Policies. - * Lists the Streaming Policies in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyImpl.java deleted file mode 100644 index e8e77b8f05f3c..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StreamingPolicy; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.EnvelopeEncryption; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CommonEncryptionCenc; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CommonEncryptionCbcs; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.NoEncryption; - -class StreamingPolicyImpl extends CreatableUpdatableImpl implements StreamingPolicy, StreamingPolicy.Definition, StreamingPolicy.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String streamingPolicyName; - - StreamingPolicyImpl(String name, MediaManager manager) { - super(name, new StreamingPolicyInner()); - this.manager = manager; - // Set resource name - this.streamingPolicyName = name; - // - } - - StreamingPolicyImpl(StreamingPolicyInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.streamingPolicyName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.streamingPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingPolicies"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); - return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); - return client.getAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public CommonEncryptionCbcs commonEncryptionCbcs() { - return this.inner().commonEncryptionCbcs(); - } - - @Override - public CommonEncryptionCenc commonEncryptionCenc() { - return this.inner().commonEncryptionCenc(); - } - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String defaultContentKeyPolicyName() { - return this.inner().defaultContentKeyPolicyName(); - } - - @Override - public EnvelopeEncryption envelopeEncryption() { - return this.inner().envelopeEncryption(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public NoEncryption noEncryption() { - return this.inner().noEncryption(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public StreamingPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public StreamingPolicyImpl withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { - this.inner().withCommonEncryptionCbcs(commonEncryptionCbcs); - return this; - } - - @Override - public StreamingPolicyImpl withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { - this.inner().withCommonEncryptionCenc(commonEncryptionCenc); - return this; - } - - @Override - public StreamingPolicyImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { - this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); - return this; - } - - @Override - public StreamingPolicyImpl withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { - this.inner().withEnvelopeEncryption(envelopeEncryption); - return this; - } - - @Override - public StreamingPolicyImpl withNoEncryption(NoEncryption noEncryption) { - this.inner().withNoEncryption(noEncryption); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyInner.java deleted file mode 100644 index 1b0ff0f932028..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/StreamingPolicyInner.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import org.joda.time.DateTime; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.EnvelopeEncryption; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CommonEncryptionCenc; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.CommonEncryptionCbcs; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.NoEncryption; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * A Streaming Policy resource. - */ -@JsonFlatten -public class StreamingPolicyInner extends ProxyResource { - /** - * Creation time of Streaming Policy. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * Default ContentKey used by current Streaming Policy. - */ - @JsonProperty(value = "properties.defaultContentKeyPolicyName") - private String defaultContentKeyPolicyName; - - /** - * Configuration of EnvelopeEncryption. - */ - @JsonProperty(value = "properties.envelopeEncryption") - private EnvelopeEncryption envelopeEncryption; - - /** - * Configuration of CommonEncryptionCenc. - */ - @JsonProperty(value = "properties.commonEncryptionCenc") - private CommonEncryptionCenc commonEncryptionCenc; - - /** - * Configuration of CommonEncryptionCbcs. - */ - @JsonProperty(value = "properties.commonEncryptionCbcs") - private CommonEncryptionCbcs commonEncryptionCbcs; - - /** - * Configuations of NoEncryption. - */ - @JsonProperty(value = "properties.noEncryption") - private NoEncryption noEncryption; - - /** - * Get creation time of Streaming Policy. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get default ContentKey used by current Streaming Policy. - * - * @return the defaultContentKeyPolicyName value - */ - public String defaultContentKeyPolicyName() { - return this.defaultContentKeyPolicyName; - } - - /** - * Set default ContentKey used by current Streaming Policy. - * - * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set - * @return the StreamingPolicyInner object itself. - */ - public StreamingPolicyInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { - this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; - return this; - } - - /** - * Get configuration of EnvelopeEncryption. - * - * @return the envelopeEncryption value - */ - public EnvelopeEncryption envelopeEncryption() { - return this.envelopeEncryption; - } - - /** - * Set configuration of EnvelopeEncryption. - * - * @param envelopeEncryption the envelopeEncryption value to set - * @return the StreamingPolicyInner object itself. - */ - public StreamingPolicyInner withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { - this.envelopeEncryption = envelopeEncryption; - return this; - } - - /** - * Get configuration of CommonEncryptionCenc. - * - * @return the commonEncryptionCenc value - */ - public CommonEncryptionCenc commonEncryptionCenc() { - return this.commonEncryptionCenc; - } - - /** - * Set configuration of CommonEncryptionCenc. - * - * @param commonEncryptionCenc the commonEncryptionCenc value to set - * @return the StreamingPolicyInner object itself. - */ - public StreamingPolicyInner withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { - this.commonEncryptionCenc = commonEncryptionCenc; - return this; - } - - /** - * Get configuration of CommonEncryptionCbcs. - * - * @return the commonEncryptionCbcs value - */ - public CommonEncryptionCbcs commonEncryptionCbcs() { - return this.commonEncryptionCbcs; - } - - /** - * Set configuration of CommonEncryptionCbcs. - * - * @param commonEncryptionCbcs the commonEncryptionCbcs value to set - * @return the StreamingPolicyInner object itself. - */ - public StreamingPolicyInner withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { - this.commonEncryptionCbcs = commonEncryptionCbcs; - return this; - } - - /** - * Get configuations of NoEncryption. - * - * @return the noEncryption value - */ - public NoEncryption noEncryption() { - return this.noEncryption; - } - - /** - * Set configuations of NoEncryption. - * - * @param noEncryption the noEncryption value to set - * @return the StreamingPolicyInner object itself. - */ - public StreamingPolicyInner withNoEncryption(NoEncryption noEncryption) { - this.noEncryption = noEncryption; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceImpl.java deleted file mode 100644 index b844b2b0a9bf9..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.SubscriptionMediaService; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StorageAccount; -import java.util.Map; - -class SubscriptionMediaServiceImpl extends WrapperImpl implements SubscriptionMediaService { - private final MediaManager manager; - SubscriptionMediaServiceImpl(SubscriptionMediaServiceInner inner, MediaManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public String location() { - return this.inner().location(); - } - - @Override - public UUID mediaServiceId() { - return this.inner().mediaServiceId(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public List storageAccounts() { - return this.inner().storageAccounts(); - } - - @Override - public Map tags() { - return this.inner().getTags(); - } - - @Override - public String type() { - return this.inner().type(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceInner.java deleted file mode 100644 index 3573eeb398919..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/SubscriptionMediaServiceInner.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import java.util.UUID; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.StorageAccount; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.rest.SkipParentValidation; -import com.microsoft.azure.Resource; - -/** - * A Media Services account. - */ -@JsonFlatten -@SkipParentValidation -public class SubscriptionMediaServiceInner extends Resource { - /** - * The Media Services account ID. - */ - @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) - private UUID mediaServiceId; - - /** - * The storage accounts for this resource. - */ - @JsonProperty(value = "properties.storageAccounts") - private List storageAccounts; - - /** - * Get the Media Services account ID. - * - * @return the mediaServiceId value - */ - public UUID mediaServiceId() { - return this.mediaServiceId; - } - - /** - * Get the storage accounts for this resource. - * - * @return the storageAccounts value - */ - public List storageAccounts() { - return this.storageAccounts; - } - - /** - * Set the storage accounts for this resource. - * - * @param storageAccounts the storageAccounts value to set - * @return the SubscriptionMediaServiceInner object itself. - */ - public SubscriptionMediaServiceInner withStorageAccounts(List storageAccounts) { - this.storageAccounts = storageAccounts; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformImpl.java deleted file mode 100644 index b5809a3e44996..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transform; -import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import rx.Observable; -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.TransformOutput; - -class TransformImpl extends CreatableUpdatableImpl implements Transform, Transform.Definition, Transform.Update { - private final MediaManager manager; - private String resourceGroupName; - private String accountName; - private String transformName; - - TransformImpl(String name, MediaManager manager) { - super(name, new TransformInner()); - this.manager = manager; - // Set resource name - this.transformName = name; - // - } - - TransformImpl(TransformInner inner, MediaManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.transformName = inner.name(); - // resource ancestor names - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); - this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); - // - } - - @Override - public MediaManager manager() { - return this.manager; - } - - @Override - public Observable createResourceAsync() { - TransformsInner client = this.manager().inner().transforms(); - return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - public Observable updateResourceAsync() { - TransformsInner client = this.manager().inner().transforms(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) - .map(innerToFluentMap(this)); - } - - @Override - protected Observable getInnerAsync() { - TransformsInner client = this.manager().inner().transforms(); - return client.getAsync(this.resourceGroupName, this.accountName, this.transformName); - } - - @Override - public boolean isInCreateMode() { - return this.inner().id() == null; - } - - - @Override - public DateTime created() { - return this.inner().created(); - } - - @Override - public String description() { - return this.inner().description(); - } - - @Override - public String id() { - return this.inner().id(); - } - - @Override - public DateTime lastModified() { - return this.inner().lastModified(); - } - - @Override - public String name() { - return this.inner().name(); - } - - @Override - public List outputs() { - return this.inner().outputs(); - } - - @Override - public String type() { - return this.inner().type(); - } - - @Override - public TransformImpl withExistingMediaservice(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public TransformImpl withOutputs(List outputs) { - this.inner().withOutputs(outputs); - return this; - } - - @Override - public TransformImpl withDescription(String description) { - this.inner().withDescription(description); - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformInner.java deleted file mode 100644 index 72499d90376f8..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformInner.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import org.joda.time.DateTime; -import java.util.List; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.TransformOutput; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.ProxyResource; - -/** - * A Transform encapsulates the rules or instructions for generating desired - * outputs from input media, such as by transcoding or by extracting insights. - * After the Transform is created, it can be applied to input media by creating - * Jobs. - */ -@JsonFlatten -public class TransformInner extends ProxyResource { - /** - * The UTC date and time when the Transform was created, in - * 'YYYY-MM-DDThh:mm:ssZ' format. - */ - @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) - private DateTime created; - - /** - * An optional verbose description of the Transform. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * The UTC date and time when the Transform was last updated, in - * 'YYYY-MM-DDThh:mm:ssZ' format. - */ - @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) - private DateTime lastModified; - - /** - * An array of one or more TransformOutputs that the Transform should - * generate. - */ - @JsonProperty(value = "properties.outputs", required = true) - private List outputs; - - /** - * Get the UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. - * - * @return the created value - */ - public DateTime created() { - return this.created; - } - - /** - * Get an optional verbose description of the Transform. - * - * @return the description value - */ - public String description() { - return this.description; - } - - /** - * Set an optional verbose description of the Transform. - * - * @param description the description value to set - * @return the TransformInner object itself. - */ - public TransformInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. - * - * @return the lastModified value - */ - public DateTime lastModified() { - return this.lastModified; - } - - /** - * Get an array of one or more TransformOutputs that the Transform should generate. - * - * @return the outputs value - */ - public List outputs() { - return this.outputs; - } - - /** - * Set an array of one or more TransformOutputs that the Transform should generate. - * - * @param outputs the outputs value to set - * @return the TransformInner object itself. - */ - public TransformInner withOutputs(List outputs) { - this.outputs = outputs; - return this; - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsImpl.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsImpl.java deleted file mode 100644 index 14c2d8f41f1fa..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms; -import rx.Completable; -import rx.Observable; -import rx.functions.Func1; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transform; - -class TransformsImpl extends WrapperImpl implements Transforms { - private final MediaManager manager; - - TransformsImpl(MediaManager manager) { - super(manager.inner().transforms()); - this.manager = manager; - } - - public MediaManager manager() { - return this.manager; - } - - @Override - public TransformImpl define(String name) { - return wrapModel(name); - } - - private TransformImpl wrapModel(TransformInner inner) { - return new TransformImpl(inner, manager()); - } - - private TransformImpl wrapModel(String name) { - return new TransformImpl(name, this.manager()); - } - - @Override - public Observable listAsync(final String resourceGroupName, final String accountName) { - TransformsInner client = this.inner(); - return client.listAsync(resourceGroupName, accountName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public Transform call(TransformInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Observable getAsync(String resourceGroupName, String accountName, String transformName) { - TransformsInner client = this.inner(); - return client.getAsync(resourceGroupName, accountName, transformName) - .map(new Func1() { - @Override - public Transform call(TransformInner inner) { - return wrapModel(inner); - } - }); - } - - @Override - public Completable deleteAsync(String resourceGroupName, String accountName, String transformName) { - TransformsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, accountName, transformName).toCompletable(); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsInner.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsInner.java deleted file mode 100644 index 3fe7ea7d20493..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/TransformsInner.java +++ /dev/null @@ -1,880 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; - -import retrofit2.Retrofit; -import com.google.common.reflect.TypeToken; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.ApiErrorException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.HTTP; -import retrofit2.http.PATCH; -import retrofit2.http.Path; -import retrofit2.http.PUT; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Transforms. - */ -public class TransformsInner { - /** The Retrofit service to perform REST calls. */ - private TransformsService service; - /** The service client containing this operation class. */ - private AzureMediaServicesImpl client; - - /** - * Initializes an instance of TransformsInner. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public TransformsInner(Retrofit retrofit, AzureMediaServicesImpl client) { - this.service = retrofit.create(TransformsService.class); - this.client = client; - } - - /** - * The interface defining all the services for Transforms to be - * used by Retrofit to perform actually REST calls. - */ - interface TransformsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms list" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_30_30_preview.Transforms listNext" }) - @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<TransformInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName) { - return listWithServiceResponseAsync(resourceGroupName, accountName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { - return listSinglePageAsync(resourceGroupName, accountName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final String filter = null; - final Integer top = null; - final Integer skip = null; - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<TransformInner> object if successful. - */ - public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, skip).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, filter, top, skip), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { - return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param filter Restricts the set of items returned. - * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { - return listSinglePageAsync(resourceGroupName, accountName, filter, top, skip) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. - ServiceResponse> * @param accountName The Media Services account name. - ServiceResponse> * @param filter Restricts the set of items returned. - ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. - ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Get Transform. - * Gets a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the TransformInner object if successful. - */ - public TransformInner get(String resourceGroupName, String accountName, String transformName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); - } - - /** - * Get Transform. - * Gets a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); - } - - /** - * Get Transform. - * Gets a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable getAsync(String resourceGroupName, String accountName, String transformName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, TransformInner>() { - @Override - public TransformInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Get Transform. - * Gets a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Create or Update Transform. - * Creates or updates a new Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the TransformInner object if successful. - */ - public TransformInner createOrUpdate(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); - } - - /** - * Create or Update Transform. - * Creates or updates a new Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); - } - - /** - * Create or Update Transform. - * Creates or updates a new Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { - @Override - public TransformInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or Update Transform. - * Creates or updates a new Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Delete Transform. - * Deletes a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void delete(String resourceGroupName, String accountName, String transformName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); - } - - /** - * Delete Transform. - * Deletes a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); - } - - /** - * Delete Transform. - * Deletes a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteAsync(String resourceGroupName, String accountName, String transformName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Delete Transform. - * Deletes a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * Update Transform. - * Updates a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the TransformInner object if successful. - */ - public TransformInner update(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); - } - - /** - * Update Transform. - * Updates a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); - } - - /** - * Update Transform. - * Updates a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { - @Override - public TransformInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update Transform. - * Updates a Transform. - * - * @param resourceGroupName The name of the resource group within the Azure subscription. - * @param accountName The Media Services account name. - * @param transformName The Transform name. - * @param parameters The request parameters - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TransformInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (transformName == null) { - throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<TransformInner> object if successful. - */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<TransformInner> object - */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * List Transforms. - * Lists the Transforms in the account. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ApiErrorException.class) - .build(response); - } - -} diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/package-info.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/package-info.java deleted file mode 100644 index 8158eb8bfa928..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * This package contains the implementation classes for AzureMediaServices. - */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation; diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/package-info.java b/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/package-info.java deleted file mode 100644 index 1845bccb2ec94..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * This package contains the classes for AzureMediaServices. - */ -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; diff --git a/mediaservices/resource-manager/v2018_30_30_preview/src/test/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaTest.java b/mediaservices/resource-manager/v2018_30_30_preview/src/test/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaTest.java deleted file mode 100644 index 87f8f8d958b32..0000000000000 --- a/mediaservices/resource-manager/v2018_30_30_preview/src/test/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/MediaTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - */ - -package com.microsoft.azure.management.mediaservices.v2018_30_30_preview; -import com.microsoft.azure.arm.core.TestBase; -import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.implementation.MediaManager; -import com.microsoft.azure.management.resources.implementation.ResourceManager; -import com.microsoft.rest.RestClient; -import com.microsoft.azure.arm.utils.SdkContext; -import org.junit.Test; -import org.junit.Assert; -import com.microsoft.azure.arm.resources.Region; -import com.microsoft.azure.management.resources.ResourceGroup; - -public class MediaTest extends TestBase { - protected static ResourceManager resourceManager; - protected static MediaManager mediaManager; - private static String rgName; - @Override - protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { - resourceManager = ResourceManager - .authenticate(restClient) - .withSubscription(defaultSubscription); - mediaManager = MediaManager - .authenticate(restClient, defaultSubscription); - } - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - @Test - public void firstTest() { - rgName = SdkContext.randomResourceName("rg", 20); - ResourceGroup group = resourceManager.resourceGroups() - .define(rgName) - .withRegion(Region.US_WEST.toString()) - .create(); - Assert.assertNotNull(group); - } -} diff --git a/mysql/resource-manager/v2017_12_01/pom.xml b/mysql/resource-manager/v2017_12_01/pom.xml index 49d1456b4151b..ebbb0b5a277d3 100644 --- a/mysql/resource-manager/v2017_12_01/pom.xml +++ b/mysql/resource-manager/v2017_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-mysql diff --git a/network/resource-manager/v2017_10_01/pom.xml b/network/resource-manager/v2017_10_01/pom.xml index 8602a4b2cd979..14a2d0abb63d2 100644 --- a/network/resource-manager/v2017_10_01/pom.xml +++ b/network/resource-manager/v2017_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-network diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/VirtualNetworkGateways.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/VirtualNetworkGateways.java index ea7f6901d6439..410f9b6dcb4ef 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/VirtualNetworkGateways.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/VirtualNetworkGateways.java @@ -14,7 +14,6 @@ import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; -import rx.Completable; import com.microsoft.azure.management.network.v2017_10_01.implementation.VirtualNetworkGatewaysInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.network.v2017_10_01.VirtualNetworkGatewayConnectionListEntity; @@ -42,7 +41,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -53,7 +52,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -63,7 +62,7 @@ public interface VirtualNetworkGateways extends SupportsCreating getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * The GetBgpPeerStatus operation retrieves the status of all BGP peers. @@ -83,7 +82,7 @@ public interface VirtualNetworkGateways extends SupportsCreating supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -125,6 +124,6 @@ public interface VirtualNetworkGateways extends SupportsCreating vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); } diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/BackendAddressPoolImpl.java index 3147ebe0616ea..018ba0972ddfc 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/BackendAddressPoolImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/BackendAddressPoolImpl.java @@ -25,6 +25,7 @@ class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl> getStatu } final String apiVersion = "2017-10-01"; Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/ProbeImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/ProbeImpl.java index 4fe4ecf9c33ae..263df39c8a508 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/ProbeImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/ProbeImpl.java @@ -24,6 +24,7 @@ class ProbeImpl extends IndexableRefreshableWrapperImpl imple ProbeImpl(ProbeInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteFilterRuleImpl.java index da65206e7f5f3..a95d3984483fe 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteFilterRuleImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteFilterRuleImpl.java @@ -38,7 +38,7 @@ class RouteFilterRuleImpl extends CreatableUpdatableImpl imp this.manager = manager; // Set resource name this.routeName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SubnetImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SubnetImpl.java index c2ece0d9d4fb5..67a41bcc43f71 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SubnetImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SubnetImpl.java @@ -37,7 +37,7 @@ class SubnetImpl extends CreatableUpdatableImpl this.manager = manager; // Set resource name this.subnetName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java index 0d51cbbeecb6e..7f1d1ec7c1f68 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -33,6 +33,7 @@ class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends Indexabl VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysImpl.java index 2d0a17b86fddf..f4677fb877b66 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysImpl.java @@ -119,22 +119,22 @@ public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { } @Override - public Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); - } + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} @Override - public Completable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); - } + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} @Override - public Completable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -149,10 +149,10 @@ public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { } @Override - public Completable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -211,9 +211,9 @@ public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConne } @Override - public Completable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toCompletable(); - } + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} } diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringImpl.java index e9e1f8decb76b..71395cfd93c07 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringImpl.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringImpl.java @@ -34,7 +34,7 @@ class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-network diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VirtualNetworkGateways.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VirtualNetworkGateways.java index d59636c5ee5e3..d495912152ce9 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VirtualNetworkGateways.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VirtualNetworkGateways.java @@ -14,7 +14,6 @@ import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; -import rx.Completable; import com.microsoft.azure.management.network.v2018_04_01.implementation.VpnClientIPsecParametersInner; import com.microsoft.azure.management.network.v2018_04_01.implementation.VirtualNetworkGatewaysInner; import com.microsoft.azure.arm.model.HasInner; @@ -43,7 +42,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -54,7 +53,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -64,7 +63,7 @@ public interface VirtualNetworkGateways extends SupportsCreating getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * The GetBgpPeerStatus operation retrieves the status of all BGP peers. @@ -84,7 +83,7 @@ public interface VirtualNetworkGateways extends SupportsCreating supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -147,6 +146,6 @@ public interface VirtualNetworkGateways extends SupportsCreating vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); } diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/BackendAddressPoolImpl.java index c5eafd14fe5bb..0653722b28ce8 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/BackendAddressPoolImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/BackendAddressPoolImpl.java @@ -25,6 +25,7 @@ class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl> getStatu } final String apiVersion = "2018-04-01"; Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ProbeImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ProbeImpl.java index 47f5cc6e70337..8ab45fb80a2f2 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ProbeImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ProbeImpl.java @@ -24,6 +24,7 @@ class ProbeImpl extends IndexableRefreshableWrapperImpl imple ProbeImpl(ProbeInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFilterRuleImpl.java index 398584ae738f6..65e3b33d28678 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFilterRuleImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFilterRuleImpl.java @@ -37,7 +37,7 @@ class RouteFilterRuleImpl extends CreatableUpdatableImpl imp this.manager = manager; // Set resource name this.routeName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetImpl.java index 036b0d0281a87..771a6c86b0747 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetImpl.java @@ -37,7 +37,7 @@ class SubnetImpl extends CreatableUpdatableImpl this.manager = manager; // Set resource name this.subnetName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java index 0ba3f67c8e484..051168b5a04da 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -33,6 +33,7 @@ class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends Indexabl VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysImpl.java index f121fd0db0ae8..058cf280ec0ab 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysImpl.java @@ -120,22 +120,22 @@ public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { } @Override - public Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); - } + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} @Override - public Completable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); - } + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} @Override - public Completable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -150,10 +150,10 @@ public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { } @Override - public Completable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -236,9 +236,9 @@ public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConne } @Override - public Completable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toCompletable(); - } + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} } diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkPeeringImpl.java index 79d23712a8650..f79d3ec9f5462 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkPeeringImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkPeeringImpl.java @@ -34,7 +34,7 @@ class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-network diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java index 7048fd55a4b8d..b7ac63365a210 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java @@ -42,6 +42,36 @@ public class ConnectionStateSnapshot { @JsonProperty(value = "evaluationState") private EvaluationState evaluationState; + /** + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Integer avgLatencyInMs; + + /** + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Integer minLatencyInMs; + + /** + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Integer maxLatencyInMs; + + /** + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Integer probesSent; + + /** + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Integer probesFailed; + /** * List of hops between the source and the destination. */ @@ -128,6 +158,106 @@ public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationSta return this; } + /** + * Get average latency in ms. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Integer avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get minimum latency in ms. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Integer minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get maximum latency in ms. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Integer maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the number of sent probes. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Set the number of sent probes. + * + * @param probesSent the probesSent value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Integer probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Set the number of failed probes. + * + * @param probesFailed the probesFailed value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Integer probesFailed) { + this.probesFailed = probesFailed; + return this; + } + /** * Get list of hops between the source and the destination. * diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java new file mode 100644 index 0000000000000..ebc7b2804da1c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponse { + /** + * Error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java new file mode 100644 index 0000000000000..01fd627d673e2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..ff9dc1fc588ed --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network security group evaluation. + */ +public class EvaluatedNetworkSecurityGroup { + /** + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /** + * The matchedRule property. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /** + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get network security group ID. + * + * @return the networkSecurityGroupId value + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set network security group ID. + * + * @param networkSecurityGroupId the networkSecurityGroupId value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { + this.networkSecurityGroupId = networkSecurityGroupId; + return this; + } + + /** + * Get the matchedRule value. + * + * @return the matchedRule value + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule value. + * + * @param matchedRule the matchedRule value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { + this.matchedRule = matchedRule; + return this; + } + + /** + * Get list of network security rules evaluation results. + * + * @return the rulesEvaluationResult value + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java new file mode 100644 index 0000000000000..c29c5b5cb0616 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Matched rule. + */ +public class MatchedRule { + /** + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get name of the matched network security rule. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the matched network security rule. + * + * @param ruleName the ruleName value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @param action the action value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withAction(String action) { + this.action = action; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 0000000000000..224226c2db347 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to get network configuration diagnostic. + */ +public class NetworkConfigurationDiagnosticParameters { + /** + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * List of traffic queries. + */ + @JsonProperty(value = "queries", required = true) + private List queries; + + /** + * Get the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param targetResourceId the targetResourceId value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get list of traffic queries. + * + * @return the queries value + */ + public List queries() { + return this.queries; + } + + /** + * Set list of traffic queries. + * + * @param queries the queries value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withQueries(List queries) { + this.queries = queries; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..e4cc4bfe17bc9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** + * Type representing NetworkConfigurationDiagnosticResponse. + */ +public interface NetworkConfigurationDiagnosticResponse extends HasInner, HasManager { + /** + * @return the results value. + */ + List results(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..eab7413d051b3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + */ +public class NetworkConfigurationDiagnosticResult { + /** + * The trafficQuery property. + */ + @JsonProperty(value = "trafficQuery") + private TrafficQuery trafficQuery; + + /** + * The networkSecurityGroupResult property. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the trafficQuery value. + * + * @return the trafficQuery value + */ + public TrafficQuery trafficQuery() { + return this.trafficQuery; + } + + /** + * Set the trafficQuery value. + * + * @param trafficQuery the trafficQuery value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withTrafficQuery(TrafficQuery trafficQuery) { + this.trafficQuery = trafficQuery; + return this; + } + + /** + * Get the networkSecurityGroupResult value. + * + * @return the networkSecurityGroupResult value + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult value. + * + * @param networkSecurityGroupResult the networkSecurityGroupResult value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult(NetworkSecurityGroupResult networkSecurityGroupResult) { + this.networkSecurityGroupResult = networkSecurityGroupResult; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..fb373a464c1e5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded provided traffic query. + */ +public class NetworkSecurityGroupResult { + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /** + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the securityRuleAccessResult value + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get list of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 0000000000000..82615fa2c8a5b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network security rules evaluation result. + */ +public class NetworkSecurityRulesEvaluationResult { + /** + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /** + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /** + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /** + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /** + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get name of the network security rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network security rule. + * + * @param name the name value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get value indicating whether protocol is matched. + * + * @return the protocolMatched value + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set value indicating whether protocol is matched. + * + * @param protocolMatched the protocolMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { + this.protocolMatched = protocolMatched; + return this; + } + + /** + * Get value indicating whether source is matched. + * + * @return the sourceMatched value + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set value indicating whether source is matched. + * + * @param sourceMatched the sourceMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { + this.sourceMatched = sourceMatched; + return this; + } + + /** + * Get value indicating whether source port is matched. + * + * @return the sourcePortMatched value + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set value indicating whether source port is matched. + * + * @param sourcePortMatched the sourcePortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { + this.sourcePortMatched = sourcePortMatched; + return this; + } + + /** + * Get value indicating whether destination is matched. + * + * @return the destinationMatched value + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set value indicating whether destination is matched. + * + * @param destinationMatched the destinationMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { + this.destinationMatched = destinationMatched; + return this; + } + + /** + * Get value indicating whether destination port is matched. + * + * @return the destinationPortMatched value + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set value indicating whether destination port is matched. + * + * @param destinationPortMatched the destinationPortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { + this.destinationPortMatched = destinationPortMatched; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java index a462c56dd7af6..f569672a812b7 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -144,4 +144,15 @@ public interface NetworkWatchers extends SupportsCreating listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java new file mode 100644 index 0000000000000..e7e6df6da5e84 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to compare with network configuration. + */ +public class TrafficQuery { + /** + * The direction of the traffic. Accepted values are 'Inbound' and + * 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /** + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /** + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + * Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /** + * Traffice destination port. Accepted values are '*', port (for example, + * 3389) and port range (for example, 80-100). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @param protocol the protocol value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @param source the source value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withSource(String source) { + this.source = source; + return this; + } + + /** + * Get traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value + */ + public String destination() { + return this.destination; + } + + /** + * Set traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @param destination the destination value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @return the destinationPort value + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @param destinationPort the destinationPort value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java index 2d4cdfa896bb8..6fdd150b1835b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java @@ -34,6 +34,16 @@ public interface VirtualNetworkGateways extends SupportsCreating resetAsync(String resourceGroupName, String virtualNetworkGatewayName); + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName); + /** * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. * @@ -43,7 +53,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -54,7 +64,7 @@ public interface VirtualNetworkGateways extends SupportsCreating generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); /** * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -64,7 +74,7 @@ public interface VirtualNetworkGateways extends SupportsCreating getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * The GetBgpPeerStatus operation retrieves the status of all BGP peers. @@ -84,7 +94,7 @@ public interface VirtualNetworkGateways extends SupportsCreating supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); /** * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -147,6 +157,6 @@ public interface VirtualNetworkGateways extends SupportsCreating vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java index de72721f686bd..00ea2682d4aee 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java @@ -25,6 +25,7 @@ class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl> createOrUpdateW * @param connectionMonitorName The name of the connection monitor. * @param parameters Parameters that define the operation to create a connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectionMonitorResultInner object if successful. */ @@ -281,11 +281,11 @@ public Observable> call(Response beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -296,7 +296,7 @@ private ServiceResponse beginCreateOrUpdateDelegat * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectionMonitorResultInner object if successful. */ @@ -373,10 +373,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -387,7 +387,7 @@ private ServiceResponse getDelegate(Response> deleteWithServiceResponseAsync(String r * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginDelete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { @@ -536,11 +536,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -551,7 +551,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { @@ -624,7 +624,7 @@ public Observable> stopWithServiceResponseAsync(String res * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginStop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { @@ -700,11 +700,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -715,7 +715,7 @@ private ServiceResponse beginStopDelegate(Response response) * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { @@ -788,7 +788,7 @@ public Observable> startWithServiceResponseAsync(String re * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name of the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { @@ -864,11 +864,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -879,7 +879,7 @@ private ServiceResponse beginStartDelegate(Response response * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name given to the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectionMonitorQueryResultInner object if successful. */ @@ -953,7 +953,7 @@ public Observable> queryWithS * @param networkWatcherName The name of the Network Watcher resource. * @param connectionMonitorName The name given to the connection monitor. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectionMonitorQueryResultInner object if successful. */ @@ -1030,11 +1030,11 @@ public Observable> call(Respo }); } - private ServiceResponse beginQueryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginQueryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1044,7 +1044,7 @@ private ServiceResponse beginQueryDelegate(Re * @param resourceGroupName The name of the resource group containing Network Watcher. * @param networkWatcherName The name of the Network Watcher resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<ConnectionMonitorResultInner> object if successful. */ @@ -1120,10 +1120,10 @@ public Observable>> call(Resp }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java index 6729ac9c65a8b..93dacff4d5d30 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -32,7 +32,7 @@ class ExpressRouteCircuitAuthorizationImpl extends CreatableUpdatableImpl implements NetworkConfigurationDiagnosticResponse { + private final NetworkManager manager; + NetworkConfigurationDiagnosticResponseImpl(NetworkConfigurationDiagnosticResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List results() { + return this.inner().results(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 0000000000000..943542f188a3c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network configuration diagnostic on the target resource. + */ +public class NetworkConfigurationDiagnosticResponseInner { + /** + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get list of network configuration diagnostic results. + * + * @return the results value + */ + public List results() { + return this.results; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java index e06a5072de88a..ffce6e598219b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java @@ -31,6 +31,7 @@ class NetworkInterfaceNetworkInterfaceIPConfigurationImpl extends IndexableRefre NetworkInterfaceNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java index d6b3b2937da2b..117a85e6ba869 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java @@ -37,7 +37,7 @@ class NetworkSecurityGroupSecurityRuleImpl extends CreatableUpdatableImpl implements NetworkWatchers { protected NetworkWatchersImpl(NetworkManager manager) { @@ -273,6 +275,18 @@ public AvailableProvidersList call(AvailableProvidersListInner inner) { }); } + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, manager()); + } + }); + } + @Override protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { return new NetworkWatcherImpl(inner.name(), inner, manager()); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index 55944e5794dad..282c0d8e345ca 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -13,11 +13,12 @@ import com.microsoft.azure.arm.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListParameters; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_06_01.ErrorResponseException; import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; import com.microsoft.azure.management.network.v2018_06_01.QueryTroubleshootingParameters; import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewParameters; @@ -48,6 +49,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -187,6 +192,14 @@ interface NetworkWatchersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") Observable> beginListAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> getNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> beginGetNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -196,7 +209,7 @@ interface NetworkWatchersService { * @param networkWatcherName The name of the network watcher. * @param parameters Parameters that define the network watcher resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NetworkWatcherInner object if successful. */ @@ -274,11 +287,11 @@ public Observable> call(Response createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -288,7 +301,7 @@ private ServiceResponse createOrUpdateDelegate(Response> call(Response getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -372,7 +385,7 @@ private ServiceResponse getByResourceGroupDelegate(Response * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String networkWatcherName) { @@ -438,7 +451,7 @@ public Observable> deleteWithServiceResponseAsync(String r * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginDelete(String resourceGroupName, String networkWatcherName) { @@ -508,11 +521,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -522,7 +535,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NetworkWatcherInner object if successful. */ @@ -603,7 +616,7 @@ public Observable> call(Response> call(Response updateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -766,10 +779,10 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -845,10 +858,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -859,7 +872,7 @@ private ServiceResponse> listDelegate(Response> call(Response re }); } - private ServiceResponse getTopologyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getTopologyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -951,7 +964,7 @@ private ServiceResponse getTopologyDelegate(Response> verifyIPFlowWi * @param networkWatcherName The name of the network watcher. * @param parameters Parameters that define the IP flow to be verified. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the VerificationIPFlowResultInner object if successful. */ @@ -1104,11 +1117,11 @@ public Observable> call(Response< }); } - private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1119,7 +1132,7 @@ private ServiceResponse beginVerifyIPFlowDelegate * @param networkWatcherName The name of the network watcher. * @param parameters Parameters that define the source and destination endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NextHopResultInner object if successful. */ @@ -1194,7 +1207,7 @@ public Observable> getNextHopWithServiceResp * @param networkWatcherName The name of the network watcher. * @param parameters Parameters that define the source and destination endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NextHopResultInner object if successful. */ @@ -1272,11 +1285,11 @@ public Observable> call(Response beginGetNextHopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetNextHopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1287,7 +1300,7 @@ private ServiceResponse beginGetNextHopDelegate(Response> getVMSecurityRu * @param networkWatcherName The name of the network watcher. * @param targetResourceId ID of the target VM. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SecurityGroupViewResultInner object if successful. */ @@ -1442,11 +1455,11 @@ public Observable> call(Response beginGetVMSecurityRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetVMSecurityRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1457,7 +1470,7 @@ private ServiceResponse beginGetVMSecurityRulesDel * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that define the resource to troubleshoot. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TroubleshootingResultInner object if successful. */ @@ -1532,7 +1545,7 @@ public Observable> getTroubleshootin * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that define the resource to troubleshoot. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TroubleshootingResultInner object if successful. */ @@ -1610,11 +1623,11 @@ public Observable> call(Response beginGetTroubleshootingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetTroubleshootingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1625,7 +1638,7 @@ private ServiceResponse beginGetTroubleshootingDeleg * @param networkWatcherName The name of the network watcher resource. * @param targetResourceId The target resource ID to query the troubleshooting result. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TroubleshootingResultInner object if successful. */ @@ -1701,7 +1714,7 @@ public Observable> getTroubleshootin * @param networkWatcherName The name of the network watcher resource. * @param targetResourceId The target resource ID to query the troubleshooting result. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TroubleshootingResultInner object if successful. */ @@ -1780,11 +1793,11 @@ public Observable> call(Response beginGetTroubleshootingResultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetTroubleshootingResultDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1795,7 +1808,7 @@ private ServiceResponse beginGetTroubleshootingResul * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that define the configuration of flow log. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FlowLogInformationInner object if successful. */ @@ -1870,7 +1883,7 @@ public Observable> setFlowLogConfigurat * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that define the configuration of flow log. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FlowLogInformationInner object if successful. */ @@ -1948,11 +1961,11 @@ public Observable> call(Response beginSetFlowLogConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginSetFlowLogConfigurationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1963,7 +1976,7 @@ private ServiceResponse beginSetFlowLogConfigurationDel * @param networkWatcherName The name of the network watcher resource. * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FlowLogInformationInner object if successful. */ @@ -2039,7 +2052,7 @@ public Observable> getFlowLogStatusWith * @param networkWatcherName The name of the network watcher resource. * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FlowLogInformationInner object if successful. */ @@ -2118,11 +2131,11 @@ public Observable> call(Response beginGetFlowLogStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetFlowLogStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2133,7 +2146,7 @@ private ServiceResponse beginGetFlowLogStatusDelegate(R * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that determine how the connectivity check will be performed. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectivityInformationInner object if successful. */ @@ -2208,7 +2221,7 @@ public Observable> checkConnectivi * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that determine how the connectivity check will be performed. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConnectivityInformationInner object if successful. */ @@ -2286,11 +2299,11 @@ public Observable> call(Response beginCheckConnectivityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCheckConnectivityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2301,7 +2314,7 @@ private ServiceResponse beginCheckConnectivityDele * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that determine Azure reachability report configuration. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AzureReachabilityReportInner object if successful. */ @@ -2376,7 +2389,7 @@ public Observable> getAzureReachab * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that determine Azure reachability report configuration. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AzureReachabilityReportInner object if successful. */ @@ -2454,11 +2467,11 @@ public Observable> call(Response beginGetAzureReachabilityReportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetAzureReachabilityReportDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2469,7 +2482,7 @@ private ServiceResponse beginGetAzureReachabilityR * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that scope the list of available providers. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AvailableProvidersListInner object if successful. */ @@ -2544,7 +2557,7 @@ public Observable> listAvailablePro * @param networkWatcherName The name of the network watcher resource. * @param parameters Parameters that scope the list of available providers. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AvailableProvidersListInner object if successful. */ @@ -2622,11 +2635,179 @@ public Observable> call(Response beginListAvailableProvidersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginListAvailableProvidersDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java index 260fed446c67e..646fd70c318dc 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java @@ -38,7 +38,7 @@ class PacketCaptureResultImpl extends CreatableUpdatableImpl> createWithServiceRe * @param packetCaptureName The name of the packet capture session. * @param parameters Parameters that define the create packet capture operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PacketCaptureResultInner object if successful. */ @@ -273,10 +277,10 @@ public Observable> call(Response beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -287,7 +291,7 @@ private ServiceResponse beginCreateDelegate(Response> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -378,7 +382,7 @@ private ServiceResponse getDelegate(Response> deleteWithServiceResponseAsync(String r * @param networkWatcherName The name of the network watcher. * @param packetCaptureName The name of the packet capture session. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { @@ -527,11 +531,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -542,7 +546,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @param networkWatcherName The name of the network watcher. * @param packetCaptureName The name of the packet capture session. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { @@ -615,7 +619,7 @@ public Observable> stopWithServiceResponseAsync(String res * @param networkWatcherName The name of the network watcher. * @param packetCaptureName The name of the packet capture session. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { @@ -691,11 +695,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -706,7 +710,7 @@ private ServiceResponse beginStopDelegate(Response response) * @param networkWatcherName The name of the Network Watcher resource. * @param packetCaptureName The name given to the packet capture session. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PacketCaptureQueryStatusResultInner object if successful. */ @@ -770,7 +774,7 @@ public Observable> getStatu } final String apiVersion = "2018-06-01"; Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -780,7 +784,7 @@ public Observable> getStatu * @param networkWatcherName The name of the Network Watcher resource. * @param packetCaptureName The name given to the packet capture session. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PacketCaptureQueryStatusResultInner object if successful. */ @@ -857,11 +861,11 @@ public Observable> call(Res }); } - private ServiceResponse beginGetStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginGetStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -871,7 +875,7 @@ private ServiceResponse beginGetStatusDeleg * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the Network Watcher resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<PacketCaptureResultInner> object if successful. */ @@ -947,10 +951,10 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java index 9b748f318df1d..09e813e04a79f 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java @@ -24,6 +24,7 @@ class ProbeImpl extends IndexableRefreshableWrapperImpl imple ProbeImpl(ProbeInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java index 9e803d9fac4d5..48434403cc6b7 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java @@ -37,7 +37,7 @@ class RouteFilterRuleImpl extends CreatableUpdatableImpl imp this.manager = manager; // Set resource name this.routeName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java index 912b38d60173a..4c607a03d6003 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java @@ -37,7 +37,7 @@ class SubnetImpl extends CreatableUpdatableImpl this.manager = manager; // Set resource name this.subnetName = inner.name(); - // resource ancestor names + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java index 9fbf5df29747a..5d92ff4e81dfb 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -33,6 +33,7 @@ class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends Indexabl VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { super(null, inner); this.manager = manager; + // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java index 605cbe0c8669a..3b49f09fecb81 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java @@ -120,22 +120,28 @@ public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { } @Override - public Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); + return client.resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); } @Override - public Completable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); - } + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} @Override - public Completable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -150,10 +156,10 @@ public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { } @Override - public Completable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { VirtualNetworkGatewaysInner client = this.inner(); - return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); - } + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} @Override public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { @@ -236,9 +242,9 @@ public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConne } @Override - public Completable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); - return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toCompletable(); - } + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java index bdc1fc7f48911..ed60768343ff5 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java @@ -113,6 +113,14 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways resetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> resetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginResetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> beginResetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways generatevpnclientpackage" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1451,6 +1459,156 @@ private ServiceResponse beginResetDelegate(Response< .build(response); } + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetVpnClientSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetVpnClientSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. * diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java index fc50beecef8a6..41450c99799ba 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java @@ -34,7 +34,7 @@ class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl + + 4.0.0 + com.microsoft.azure.network.v2018_07_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Access.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Access.java new file mode 100644 index 0000000000000..d2e144616125f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Access.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Access. + */ +public final class Access extends ExpandableStringEnum { + /** Static value Allow for Access. */ + public static final Access ALLOW = fromString("Allow"); + + /** Static value Deny for Access. */ + public static final Access DENY = fromString("Deny"); + + /** + * Creates or finds a Access from its string representation. + * @param name a name to look for + * @return the corresponding Access + */ + @JsonCreator + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** + * @return known Access values + */ + public static Collection values() { + return values(Access.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AddressSpace.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AddressSpace.java new file mode 100644 index 0000000000000..6604ea585d263 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AddressSpace.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + */ +public class AddressSpace { + /** + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get a list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set a list of address blocks reserved for this virtual network in CIDR notation. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the AddressSpace object itself. + */ + public AddressSpace withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateway.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateway.java new file mode 100644 index 0000000000000..c5a36de64c106 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateway.java @@ -0,0 +1,712 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewayInner; + +/** + * Type representing ApplicationGateway. + */ +public interface ApplicationGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authenticationCertificates value. + */ + List authenticationCertificates(); + + /** + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the backendHttpSettingsCollection value. + */ + List backendHttpSettingsCollection(); + + /** + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the frontendPorts value. + */ + List frontendPorts(); + + /** + * @return the gatewayIPConfigurations value. + */ + List gatewayIPConfigurations(); + + /** + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * @return the operationalState value. + */ + ApplicationGatewayOperationalState operationalState(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + ApplicationGatewaySku sku(); + + /** + * @return the sslCertificates value. + */ + List sslCertificates(); + + /** + * @return the sslPolicy value. + */ + ApplicationGatewaySslPolicy sslPolicy(); + + /** + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the ApplicationGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationgateway definition allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @param authenticationCertificates Authentication certificates of the application gateway resource + * @return the next definition stage + */ + WithCreate withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway definition allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next definition stage + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Backend address pool of the application gateway resource + * @return the next definition stage + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway definition allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @return the next definition stage + */ + WithCreate withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway definition allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @param enableFips Whether FIPS is enabled on the application gateway resource + * @return the next definition stage + */ + WithCreate withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway definition allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource + * @return the next definition stage + */ + WithCreate withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the applicationgateway definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @return the next definition stage + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + * @param frontendPorts Frontend ports of the application gateway resource + * @return the next definition stage + */ + WithCreate withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway definition allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @param gatewayIPConfigurations Subnets of application the gateway resource + * @return the next definition stage + */ + WithCreate withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @param httpListeners Http listeners of the application gateway resource + * @return the next definition stage + */ + WithCreate withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway definition allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Probes of the application gateway resource + * @return the next definition stage + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the applicationgateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway definition allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @param redirectConfigurations Redirect configurations of the application gateway resource + * @return the next definition stage + */ + WithCreate withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @param requestRoutingRules Request routing rules of the application gateway resource + * @return the next definition stage + */ + WithCreate withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU of the application gateway resource + * @return the next definition stage + */ + WithCreate withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway definition allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @param sslCertificates SSL certificates of the application gateway resource + * @return the next definition stage + */ + WithCreate withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway definition allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @param sslPolicy SSL policy of the application gateway resource + * @return the next definition stage + */ + WithCreate withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway definition allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @param urlPathMaps URL path map of the application gateway resource + * @return the next definition stage + */ + WithCreate withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway definition allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next definition stage + */ + WithCreate withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting where the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthenticationCertificates, DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithBackendHttpSettingsCollection, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithUrlPathMaps, DefinitionStages.WithWebApplicationFirewallConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a ApplicationGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthenticationCertificates, UpdateStages.WithAutoscaleConfiguration, UpdateStages.WithBackendAddressPools, UpdateStages.WithBackendHttpSettingsCollection, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { + } + + /** + * Grouping of ApplicationGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationgateway update allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @param authenticationCertificates Authentication certificates of the application gateway resource + * @return the next update stage + */ + Update withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next update stage + */ + Update withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Backend address pool of the application gateway resource + * @return the next update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @return the next update stage + */ + Update withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @param enableFips Whether FIPS is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @return the next update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + * @param frontendPorts Frontend ports of the application gateway resource + * @return the next update stage + */ + Update withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway update allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @param gatewayIPConfigurations Subnets of application the gateway resource + * @return the next update stage + */ + Update withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @param httpListeners Http listeners of the application gateway resource + * @return the next update stage + */ + Update withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Probes of the application gateway resource + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the applicationgateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway update allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @param redirectConfigurations Redirect configurations of the application gateway resource + * @return the next update stage + */ + Update withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @param requestRoutingRules Request routing rules of the application gateway resource + * @return the next update stage + */ + Update withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU of the application gateway resource + * @return the next update stage + */ + Update withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway update allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @param sslCertificates SSL certificates of the application gateway resource + * @return the next update stage + */ + Update withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @param sslPolicy SSL policy of the application gateway resource + * @return the next update stage + */ + Update withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway update allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @param urlPathMaps URL path map of the application gateway resource + * @return the next update stage + */ + Update withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next update stage + */ + Update withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting where the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAuthenticationCertificate.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 0000000000000..21d9bc648be1a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authentication certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayAuthenticationCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Provisioning state of the authentication certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the authentication certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the authentication certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the authentication certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleBounds.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleBounds.java new file mode 100644 index 0000000000000..494f18213b25c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleBounds.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale bounds on number of Application Gateway + * instance. + */ +public class ApplicationGatewayAutoscaleBounds { + /** + * Lower bound on number of Application Gateway instances. + */ + @JsonProperty(value = "min", required = true) + private int min; + + /** + * Upper bound on number of Application Gateway instances. + */ + @JsonProperty(value = "max", required = true) + private int max; + + /** + * Get lower bound on number of Application Gateway instances. + * + * @return the min value + */ + public int min() { + return this.min; + } + + /** + * Set lower bound on number of Application Gateway instances. + * + * @param min the min value to set + * @return the ApplicationGatewayAutoscaleBounds object itself. + */ + public ApplicationGatewayAutoscaleBounds withMin(int min) { + this.min = min; + return this; + } + + /** + * Get upper bound on number of Application Gateway instances. + * + * @return the max value + */ + public int max() { + return this.max; + } + + /** + * Set upper bound on number of Application Gateway instances. + * + * @param max the max value to set + * @return the ApplicationGatewayAutoscaleBounds object itself. + */ + public ApplicationGatewayAutoscaleBounds withMax(int max) { + this.max = max; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleConfiguration.java new file mode 100644 index 0000000000000..1986eae84f637 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAutoscaleConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale configuration. + */ +public class ApplicationGatewayAutoscaleConfiguration { + /** + * Autoscale bounds. + */ + @JsonProperty(value = "bounds", required = true) + private ApplicationGatewayAutoscaleBounds bounds; + + /** + * Get autoscale bounds. + * + * @return the bounds value + */ + public ApplicationGatewayAutoscaleBounds bounds() { + return this.bounds; + } + + /** + * Set autoscale bounds. + * + * @param bounds the bounds value to set + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withBounds(ApplicationGatewayAutoscaleBounds bounds) { + this.bounds = bounds; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableSslOptions.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 0000000000000..28baea4e7fa21 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableSslOptions.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing ApplicationGatewayAvailableSslOptions. + */ +public interface ApplicationGatewayAvailableSslOptions extends HasInner, HasManager { + /** + * @return the availableCipherSuites value. + */ + List availableCipherSuites(); + + /** + * @return the availableProtocols value. + */ + List availableProtocols(); + + /** + * @return the defaultPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the predefinedPolicies value. + */ + List predefinedPolicies(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableWafRuleSetsResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..bf2a4b7bd7038 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayAvailableWafRuleSetsResult. + */ +public interface ApplicationGatewayAvailableWafRuleSetsResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddress.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..6fab2febffc33 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddress.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backend address of an application gateway. + */ +public class ApplicationGatewayBackendAddress { + /** + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get fully qualified domain name (FQDN). + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified domain name (FQDN). + * + * @param fqdn the fqdn value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get iP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set iP address. + * + * @param ipAddress the ipAddress value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddressPool.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 0000000000000..54bc1854b4199 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Backend Address Pool of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendAddressPool extends SubResource { + /** + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations") + private List backendIPConfigurations; + + /** + * Backend addresses. + */ + @JsonProperty(value = "properties.backendAddresses") + private List backendAddresses; + + /** + * Provisioning state of the backend address pool resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend address pool that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get collection of references to IPs defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Set collection of references to IPs defined in network interfaces. + * + * @param backendIPConfigurations the backendIPConfigurations value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendIPConfigurations(List backendIPConfigurations) { + this.backendIPConfigurations = backendIPConfigurations; + return this; + } + + /** + * Get backend addresses. + * + * @return the backendAddresses value + */ + public List backendAddresses() { + return this.backendAddresses; + } + + /** + * Set backend addresses. + * + * @param backendAddresses the backendAddresses value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendAddresses(List backendAddresses) { + this.backendAddresses = backendAddresses; + return this; + } + + /** + * Get provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend address pool that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend address pool that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealth.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealth.java new file mode 100644 index 0000000000000..b283ee4aad52c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayBackendHealth. + */ +public interface ApplicationGatewayBackendHealth extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthHttpSettings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 0000000000000..cdde013da501f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealthHttp settings. + */ +public class ApplicationGatewayBackendHealthHttpSettings { + /** + * Reference of an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /** + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value + */ + public List servers() { + return this.servers; + } + + /** + * Set list of ApplicationGatewayBackendHealthServer resources. + * + * @param servers the servers value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withServers(List servers) { + this.servers = servers; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthPool.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..b5550317c686d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealth pool. + */ +public class ApplicationGatewayBackendHealthPool { + /** + * Reference of an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /** + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get reference of an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set reference of an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendAddressPool(ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServer.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..13d4695384de3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway backendhealth http settings. + */ +public class ApplicationGatewayBackendHealthServer { + /** + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Reference of IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIPConfigurationInner ipConfiguration; + + /** + * Health of backend server. Possible values include: 'Unknown', 'Up', + * 'Down', 'Partial', 'Draining'. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /** + * Get iP address or FQDN of backend server. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set iP address or FQDN of backend server. + * + * @param address the address value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get reference of IP configuration of backend server. + * + * @return the ipConfiguration value + */ + public NetworkInterfaceIPConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set reference of IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withIpConfiguration(NetworkInterfaceIPConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @return the health value + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @param health the health value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServerHealth.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..1afbcf7fb7f70 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHealthServerHealth.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayBackendHealthServerHealth. + */ +public final class ApplicationGatewayBackendHealthServerHealth extends ExpandableStringEnum { + /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); + + /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); + + /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); + + /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); + + /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayBackendHealthServerHealth + */ + @JsonCreator + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** + * @return known ApplicationGatewayBackendHealthServerHealth values + */ + public static Collection values() { + return values(ApplicationGatewayBackendHealthServerHealth.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHttpSettings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 0000000000000..b320f7509e93a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,444 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backend address pool settings of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendHttpSettings extends SubResource { + /** + * The destination port on the backend. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * The protocol used to communicate with the backend. Possible values are + * 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /** + * Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "properties.requestTimeout") + private Integer requestTimeout; + + /** + * Probe resource of an application gateway. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "properties.connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /** + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendAddress") + private Boolean pickHostNameFromBackendAddress; + + /** + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "properties.affinityCookieName") + private String affinityCookieName; + + /** + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "properties.probeEnabled") + private Boolean probeEnabled; + + /** + * Path which should be used as a prefix for all HTTP requests. Null means + * no path will be prefixed. Default value is null. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend http settings that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the destination port on the backend. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port on the backend. + * + * @param port the port value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @return the cookieBasedAffinity value + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.cookieBasedAffinity; + } + + /** + * Set cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @param cookieBasedAffinity the cookieBasedAffinity value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { + this.cookieBasedAffinity = cookieBasedAffinity; + return this; + } + + /** + * Get request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the requestTimeout value + */ + public Integer requestTimeout() { + return this.requestTimeout; + } + + /** + * Set request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param requestTimeout the requestTimeout value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get probe resource of an application gateway. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set probe resource of an application gateway. + * + * @param probe the probe value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get array of references to application gateway authentication certificates. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set array of references to application gateway authentication certificates. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get connection draining of the backend http settings resource. + * + * @return the connectionDraining value + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.connectionDraining; + } + + /** + * Set connection draining of the backend http settings resource. + * + * @param connectionDraining the connectionDraining value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withConnectionDraining(ApplicationGatewayConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + /** + * Get host header to be sent to the backend servers. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host header to be sent to the backend servers. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @return the pickHostNameFromBackendAddress value + */ + public Boolean pickHostNameFromBackendAddress() { + return this.pickHostNameFromBackendAddress; + } + + /** + * Set whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @param pickHostNameFromBackendAddress the pickHostNameFromBackendAddress value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPickHostNameFromBackendAddress(Boolean pickHostNameFromBackendAddress) { + this.pickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + return this; + } + + /** + * Get cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value + */ + public String affinityCookieName() { + return this.affinityCookieName; + } + + /** + * Set cookie name to use for the affinity cookie. + * + * @param affinityCookieName the affinityCookieName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { + this.affinityCookieName = affinityCookieName; + return this; + } + + /** + * Get whether the probe is enabled. Default value is false. + * + * @return the probeEnabled value + */ + public Boolean probeEnabled() { + return this.probeEnabled; + } + + /** + * Set whether the probe is enabled. Default value is false. + * + * @param probeEnabled the probeEnabled value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { + this.probeEnabled = probeEnabled; + return this; + } + + /** + * Get path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @param path the path value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPath(String path) { + this.path = path; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend http settings that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend http settings that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayConnectionDraining.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayConnectionDraining.java new file mode 100644 index 0000000000000..cfa102e8745a7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayConnectionDraining.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection draining allows open connections to a backend server to be active + * for a specified time after the backend server got removed from the + * configuration. + */ +public class ApplicationGatewayConnectionDraining { + /** + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get whether connection draining is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether connection draining is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @return the drainTimeoutInSec value + */ + public int drainTimeoutInSec() { + return this.drainTimeoutInSec; + } + + /** + * Set the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @param drainTimeoutInSec the drainTimeoutInSec value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { + this.drainTimeoutInSec = drainTimeoutInSec; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayCookieBasedAffinity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 0000000000000..3bd66e31ae502 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayCookieBasedAffinity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayCookieBasedAffinity. + */ +public final class ApplicationGatewayCookieBasedAffinity extends ExpandableStringEnum { + /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayCookieBasedAffinity + */ + @JsonCreator + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** + * @return known ApplicationGatewayCookieBasedAffinity values + */ + public static Collection values() { + return values(ApplicationGatewayCookieBasedAffinity.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallDisabledRuleGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 0000000000000..cc89b69d57a3d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allows to disable rules within a rule group or an entire rule group. + */ +public class ApplicationGatewayFirewallDisabledRuleGroup { + /** + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the name of the rule group that will be disabled. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the rule group that will be disabled. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallMode.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallMode.java new file mode 100644 index 0000000000000..34fde86989cc5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayFirewallMode. + */ +public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { + /** Static value Detection for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); + + /** Static value Prevention for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayFirewallMode + */ + @JsonCreator + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** + * @return known ApplicationGatewayFirewallMode values + */ + public static Collection values() { + return values(ApplicationGatewayFirewallMode.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRule.java new file mode 100644 index 0000000000000..a526f7a6a5819 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRule.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule. + */ +public class ApplicationGatewayFirewallRule { + /** + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /** + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the identifier of the web application firewall rule. + * + * @return the ruleId value + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set the identifier of the web application firewall rule. + * + * @param ruleId the ruleId value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleId(int ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description of the web application firewall rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..d20ca754abd21 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule group. + */ +public class ApplicationGatewayFirewallRuleGroup { + /** + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the name of the web application firewall rule group. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the web application firewall rule group. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the description of the web application firewall rule group. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule group. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules of the web application firewall rule group. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules of the web application firewall rule group. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleSet.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 0000000000000..f9e4b4bbdb8a8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFirewallRuleSet.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A web application firewall rule set. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayFirewallRuleSet extends Resource { + /** + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleGroups", required = true) + private List ruleGroups; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioning state of the web application firewall rule set. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the web application firewall rule set. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the type of the web application firewall rule set. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the web application firewall rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the rule groups of the web application firewall rule set. + * + * @return the ruleGroups value + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the rule groups of the web application firewall rule set. + * + * @param ruleGroups the ruleGroups value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendIPConfiguration.java new file mode 100644 index 0000000000000..d56230f96956d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendIPConfiguration.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendIPConfiguration extends SubResource { + /** + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * PrivateIP allocation method. Possible values include: 'Static', + * 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * Provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend IP configuration that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get privateIPAddress of the network interface IP Configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set privateIPAddress of the network interface IP Configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendPort.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendPort.java new file mode 100644 index 0000000000000..388cdb2d0d4b8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayFrontendPort.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Frontend port of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendPort extends SubResource { + /** + * Frontend port. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Provisioning state of the frontend port resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend port that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend port. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set frontend port. + * + * @param port the port value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend port that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend port that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayHttpListener.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..70787e510a6be --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayHttpListener.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Http listener of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayHttpListener extends SubResource { + /** + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendPort") + private SubResource frontendPort; + + /** + * Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name of HTTP listener. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "properties.sslCertificate") + private SubResource sslCertificate; + + /** + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "properties.requireServerNameIndication") + private Boolean requireServerNameIndication; + + /** + * Provisioning state of the HTTP listener resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the HTTP listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend IP configuration resource of an application gateway. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set frontend IP configuration resource of an application gateway. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get frontend port resource of an application gateway. + * + * @return the frontendPort value + */ + public SubResource frontendPort() { + return this.frontendPort; + } + + /** + * Set frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name of HTTP listener. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host name of HTTP listener. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get sSL certificate resource of an application gateway. + * + * @return the sslCertificate value + */ + public SubResource sslCertificate() { + return this.sslCertificate; + } + + /** + * Set sSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + /** + * Get applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @return the requireServerNameIndication value + */ + public Boolean requireServerNameIndication() { + return this.requireServerNameIndication; + } + + /** + * Set applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @param requireServerNameIndication the requireServerNameIndication value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { + this.requireServerNameIndication = requireServerNameIndication; + return this; + } + + /** + * Get provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the HTTP listener that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the HTTP listener that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayIPConfiguration.java new file mode 100644 index 0000000000000..89f25f5d3b776 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayIPConfiguration.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + */ +@JsonFlatten +public class ApplicationGatewayIPConfiguration extends SubResource { + /** + * Reference of the subnet resource. A subnet from where application + * gateway gets its private address. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Provisioning state of the application gateway subnet resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the IP configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayOperationalState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayOperationalState.java new file mode 100644 index 0000000000000..dd1b2ffeeb73c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayOperationalState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayOperationalState. + */ +public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { + /** Static value Stopped for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); + + /** Static value Starting for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); + + /** Static value Running for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayOperationalState + */ + @JsonCreator + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** + * @return known ApplicationGatewayOperationalState values + */ + public static Collection values() { + return values(ApplicationGatewayOperationalState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayPathRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayPathRule.java new file mode 100644 index 0000000000000..d386d66cdc834 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayPathRule.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Path rule of URL path map of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayPathRule extends SubResource { + /** + * Path rules of URL path map. + */ + @JsonProperty(value = "properties.paths") + private List paths; + + /** + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Path rule of URL path map resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the path rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get path rules of URL path map. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set path rules of URL path map. + * + * @param paths the paths value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get backend address pool resource of URL path map path rule. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of URL path map path rule. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of URL path map path rule. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of URL path map path rule. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get redirect configuration resource of URL path map path rule. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of URL path map path rule. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the path rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the path rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbe.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbe.java new file mode 100644 index 0000000000000..2329f218ee084 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbe.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Probe of the application gateway. + */ +@JsonFlatten +public class ApplicationGatewayProbe extends SubResource { + /** + * The protocol used for the probe. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name to send the probe to. + */ + @JsonProperty(value = "properties.host") + private String host; + + /** + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * The probing interval in seconds. This is the time interval between two + * consecutive probes. Acceptable values are from 1 second to 86400 + * seconds. + */ + @JsonProperty(value = "properties.interval") + private Integer interval; + + /** + * the probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The probe retry count. Backend server is marked down after consecutive + * probe failure count reaches UnhealthyThreshold. Acceptable values are + * from 1 second to 20. + */ + @JsonProperty(value = "properties.unhealthyThreshold") + private Integer unhealthyThreshold; + + /** + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendHttpSettings") + private Boolean pickHostNameFromBackendHttpSettings; + + /** + * Minimum number of servers that are always marked healthy. Default value + * is 0. + */ + @JsonProperty(value = "properties.minServers") + private Integer minServers; + + /** + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "properties.match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the probe that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name to send the probe to. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set host name to send the probe to. + * + * @param host the host value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @param path the path value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @return the interval value + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @param interval the interval value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @return the unhealthyThreshold value + */ + public Integer unhealthyThreshold() { + return this.unhealthyThreshold; + } + + /** + * Set the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @param unhealthyThreshold the unhealthyThreshold value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + /** + * Get whether the host header should be picked from the backend http settings. Default value is false. + * + * @return the pickHostNameFromBackendHttpSettings value + */ + public Boolean pickHostNameFromBackendHttpSettings() { + return this.pickHostNameFromBackendHttpSettings; + } + + /** + * Set whether the host header should be picked from the backend http settings. Default value is false. + * + * @param pickHostNameFromBackendHttpSettings the pickHostNameFromBackendHttpSettings value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostNameFromBackendHttpSettings(Boolean pickHostNameFromBackendHttpSettings) { + this.pickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + return this; + } + + /** + * Get minimum number of servers that are always marked healthy. Default value is 0. + * + * @return the minServers value + */ + public Integer minServers() { + return this.minServers; + } + + /** + * Set minimum number of servers that are always marked healthy. Default value is 0. + * + * @param minServers the minServers value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMinServers(Integer minServers) { + this.minServers = minServers; + return this; + } + + /** + * Get criterion for classifying a healthy probe response. + * + * @return the match value + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set criterion for classifying a healthy probe response. + * + * @param match the match value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the probe that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the probe that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbeHealthResponseMatch.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbeHealthResponseMatch.java new file mode 100644 index 0000000000000..8e87a150e46db --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway probe health response match. + */ +public class ApplicationGatewayProbeHealthResponseMatch { + /** + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /** + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get body that must be contained in the health response. Default value is empty. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set body that must be contained in the health response. Default value is empty. + * + * @param body the body value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { + this.body = body; + return this; + } + + /** + * Get allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @return the statusCodes value + */ + public List statusCodes() { + return this.statusCodes; + } + + /** + * Set allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @param statusCodes the statusCodes value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { + this.statusCodes = statusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProtocol.java new file mode 100644 index 0000000000000..c1dc74cc89fd2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayProtocol. + */ +public final class ApplicationGatewayProtocol extends ExpandableStringEnum { + /** Static value Http for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTP = fromString("Http"); + + /** Static value Https for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayProtocol + */ + @JsonCreator + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** + * @return known ApplicationGatewayProtocol values + */ + public static Collection values() { + return values(ApplicationGatewayProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 0000000000000..32c8e10082e2e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Redirect configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRedirectConfiguration extends SubResource { + /** + * Supported http redirection types - Permanent, Temporary, Found, + * SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', + * 'Temporary'. + */ + @JsonProperty(value = "properties.redirectType") + private ApplicationGatewayRedirectType redirectType; + + /** + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "properties.targetListener") + private SubResource targetListener; + + /** + * Url to redirect the request to. + */ + @JsonProperty(value = "properties.targetUrl") + private String targetUrl; + + /** + * Include path in the redirected url. + */ + @JsonProperty(value = "properties.includePath") + private Boolean includePath; + + /** + * Include query string in the redirected url. + */ + @JsonProperty(value = "properties.includeQueryString") + private Boolean includeQueryString; + + /** + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Name of the redirect configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @return the redirectType value + */ + public ApplicationGatewayRedirectType redirectType() { + return this.redirectType; + } + + /** + * Set supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @param redirectType the redirectType value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRedirectType(ApplicationGatewayRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get reference to a listener to redirect the request to. + * + * @return the targetListener value + */ + public SubResource targetListener() { + return this.targetListener; + } + + /** + * Set reference to a listener to redirect the request to. + * + * @param targetListener the targetListener value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetListener(SubResource targetListener) { + this.targetListener = targetListener; + return this; + } + + /** + * Get url to redirect the request to. + * + * @return the targetUrl value + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set url to redirect the request to. + * + * @param targetUrl the targetUrl value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get include path in the redirected url. + * + * @return the includePath value + */ + public Boolean includePath() { + return this.includePath; + } + + /** + * Set include path in the redirected url. + * + * @param includePath the includePath value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludePath(Boolean includePath) { + this.includePath = includePath; + return this; + } + + /** + * Get include query string in the redirected url. + * + * @return the includeQueryString value + */ + public Boolean includeQueryString() { + return this.includeQueryString; + } + + /** + * Set include query string in the redirected url. + * + * @param includeQueryString the includeQueryString value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludeQueryString(Boolean includeQueryString) { + this.includeQueryString = includeQueryString; + return this; + } + + /** + * Get request routing specifying redirect configuration. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing specifying redirect configuration. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set url path maps specifying default redirect configuration. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get path rules specifying redirect configuration. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rules specifying redirect configuration. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get name of the redirect configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the redirect configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectType.java new file mode 100644 index 0000000000000..73bbea87ebf66 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRedirectType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRedirectType. + */ +public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { + /** Static value Permanent for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); + + /** Static value Found for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); + + /** Static value SeeOther for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); + + /** Static value Temporary for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRedirectType + */ + @JsonCreator + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** + * @return known ApplicationGatewayRedirectType values + */ + public static Collection values() { + return values(ApplicationGatewayRedirectType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 0000000000000..d01f01a7776a0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request routing rule of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRequestRoutingRule extends SubResource { + /** + * Rule type. Possible values include: 'Basic', 'PathBasedRouting'. + */ + @JsonProperty(value = "properties.ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /** + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "properties.httpListener") + private SubResource httpListener; + + /** + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "properties.urlPathMap") + private SubResource urlPathMap; + + /** + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Provisioning state of the request routing rule resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the request routing rule that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @return the ruleType value + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.ruleType; + } + + /** + * Set rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @param ruleType the ruleType value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get backend address pool resource of the application gateway. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of the application gateway. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get http listener resource of the application gateway. + * + * @return the httpListener value + */ + public SubResource httpListener() { + return this.httpListener; + } + + /** + * Set http listener resource of the application gateway. + * + * @param httpListener the httpListener value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withHttpListener(SubResource httpListener) { + this.httpListener = httpListener; + return this; + } + + /** + * Get uRL path map resource of the application gateway. + * + * @return the urlPathMap value + */ + public SubResource urlPathMap() { + return this.urlPathMap; + } + + /** + * Set uRL path map resource of the application gateway. + * + * @param urlPathMap the urlPathMap value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withUrlPathMap(SubResource urlPathMap) { + this.urlPathMap = urlPathMap; + return this; + } + + /** + * Get redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of the application gateway. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the request routing rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the request routing rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRuleType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRuleType.java new file mode 100644 index 0000000000000..94a319e4a8e71 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayRequestRoutingRuleType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRequestRoutingRuleType. + */ +public final class ApplicationGatewayRequestRoutingRuleType extends ExpandableStringEnum { + /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); + + /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRequestRoutingRuleType + */ + @JsonCreator + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** + * @return known ApplicationGatewayRequestRoutingRuleType values + */ + public static Collection values() { + return values(ApplicationGatewayRequestRoutingRuleType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySku.java new file mode 100644 index 0000000000000..dfba318457e41 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySku.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of an application gateway. + */ +public class ApplicationGatewaySku { + /** + * Name of an application gateway SKU. Possible values include: + * 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + * 'WAF_Large', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /** + * Tier of an application gateway. Possible values include: 'Standard', + * 'WAF', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /** + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @return the name value + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @param name the name value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @return the tier value + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @param tier the tier value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get capacity (instance count) of an application gateway. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set capacity (instance count) of an application gateway. + * + * @param capacity the capacity value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySkuName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..d8a28d7a3c863 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySkuName.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySkuName. + */ +public final class ApplicationGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard_Small for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); + + /** Static value Standard_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); + + /** Static value Standard_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); + + /** Static value WAF_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); + + /** Static value WAF_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); + + /** Static value Standard_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySkuName + */ + @JsonCreator + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** + * @return known ApplicationGatewaySkuName values + */ + public static Collection values() { + return values(ApplicationGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCertificate.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCertificate.java new file mode 100644 index 0000000000000..7692912417875 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCertificate.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * SSL certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewaySslCertificate extends SubResource { + /** + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Password for the pfx file specified in data. Only applicable in PUT + * request. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * Base-64 encoded Public cert data corresponding to pfx specified in data. + * Only applicable in GET request. + */ + @JsonProperty(value = "properties.publicCertData") + private String publicCertData; + + /** + * Provisioning state of the SSL certificate resource Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the SSL certificate that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @param data the data value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get password for the pfx file specified in data. Only applicable in PUT request. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password for the pfx file specified in data. Only applicable in PUT request. + * + * @param password the password value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @param publicCertData the publicCertData value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the SSL certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the SSL certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCipherSuite.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCipherSuite.java new file mode 100644 index 0000000000000..c40824153bf06 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslCipherSuite. + */ +public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslCipherSuite + */ + @JsonCreator + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** + * @return known ApplicationGatewaySslCipherSuite values + */ + public static Collection values() { + return values(ApplicationGatewaySslCipherSuite.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicy.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicy.java new file mode 100644 index 0000000000000..066f5dcf18326 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway Ssl policy. + */ +public class ApplicationGatewaySslPolicy { + /** + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /** + * Type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /** + * Name of Ssl predefined policy. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /** + * Ssl cipher suites to be enabled in the specified order to application + * gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set ssl protocols to be disabled on application gateway. + * + * @param disabledSslProtocols the disabledSslProtocols value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withDisabledSslProtocols(List disabledSslProtocols) { + this.disabledSslProtocols = disabledSslProtocols; + return this; + } + + /** + * Get type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @return the policyType value + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @param policyType the policyType value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the policyName value + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param policyName the policyName value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order to application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyName.java new file mode 100644 index 0000000000000..0480b764d27b7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyName. + */ +public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { + /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = fromString("AppGwSslPolicy20150501"); + + /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = fromString("AppGwSslPolicy20170401"); + + /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = fromString("AppGwSslPolicy20170401S"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyName + */ + @JsonCreator + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** + * @return known ApplicationGatewaySslPolicyName values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyType.java new file mode 100644 index 0000000000000..4b8221f8c5d28 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPolicyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyType. + */ +public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { + /** Static value Predefined for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); + + /** Static value Custom for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyType + */ + @JsonCreator + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** + * @return known ApplicationGatewaySslPolicyType values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPredefinedPolicy.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 0000000000000..4b3f3ebd04ae9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** + * Type representing ApplicationGatewaySslPredefinedPolicy. + */ +public interface ApplicationGatewaySslPredefinedPolicy extends HasInner, HasManager { + /** + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslProtocol.java new file mode 100644 index 0000000000000..24b9a3a01d0a2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewaySslProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslProtocol. + */ +public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { + /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); + + /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); + + /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslProtocol + */ + @JsonCreator + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** + * @return known ApplicationGatewaySslProtocol values + */ + public static Collection values() { + return values(ApplicationGatewaySslProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayTier.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayTier.java new file mode 100644 index 0000000000000..f0ef353357278 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayTier. + */ +public final class ApplicationGatewayTier extends ExpandableStringEnum { + /** Static value Standard for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD = fromString("Standard"); + + /** Static value WAF for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF = fromString("WAF"); + + /** Static value Standard_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayTier + */ + @JsonCreator + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** + * @return known ApplicationGatewayTier values + */ + public static Collection values() { + return values(ApplicationGatewayTier.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayUrlPathMap.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayUrlPathMap.java new file mode 100644 index 0000000000000..61dc71658cdae --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayUrlPathMap.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + */ +@JsonFlatten +public class ApplicationGatewayUrlPathMap extends SubResource { + /** + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /** + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /** + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /** + * Path rule of URL path map resource. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the URL path map that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value + */ + public SubResource defaultBackendAddressPool() { + return this.defaultBackendAddressPool; + } + + /** + * Set default backend address pool resource of URL path map. + * + * @param defaultBackendAddressPool the defaultBackendAddressPool value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { + this.defaultBackendAddressPool = defaultBackendAddressPool; + return this; + } + + /** + * Get default backend http settings resource of URL path map. + * + * @return the defaultBackendHttpSettings value + */ + public SubResource defaultBackendHttpSettings() { + return this.defaultBackendHttpSettings; + } + + /** + * Set default backend http settings resource of URL path map. + * + * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { + this.defaultBackendHttpSettings = defaultBackendHttpSettings; + return this; + } + + /** + * Get default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value + */ + public SubResource defaultRedirectConfiguration() { + return this.defaultRedirectConfiguration; + } + + /** + * Set default redirect configuration resource of URL path map. + * + * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rule of URL path map resource. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the URL path map that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the URL path map that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayWebApplicationFirewallConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 0000000000000..6f88c0600ceb5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway web application firewall configuration. + */ +public class ApplicationGatewayWebApplicationFirewallConfiguration { + /** + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention'. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /** + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /** + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /** + * Maxium request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /** + * Get whether the web application firewall is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether the web application firewall is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @return the firewallMode value + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @param firewallMode the firewallMode value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode(ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the disabled rule groups. + * + * @return the disabledRuleGroups value + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set the disabled rule groups. + * + * @param disabledRuleGroups the disabledRuleGroups value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups(List disabledRuleGroups) { + this.disabledRuleGroups = disabledRuleGroups; + return this; + } + + /** + * Get whether allow WAF to check request Body. + * + * @return the requestBodyCheck value + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set whether allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get maxium request body size for WAF. + * + * @return the maxRequestBodySize value + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set maxium request body size for WAF. + * + * @param maxRequestBodySize the maxRequestBodySize value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { + this.maxRequestBodySize = maxRequestBodySize; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateways.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateways.java new file mode 100644 index 0000000000000..b5502d0aefb6e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationGateways.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationGateways. + */ +public interface ApplicationGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableWafRuleSetsAsync(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslOptionsAsync(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslPredefinedPoliciesAsync(); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSslPredefinedPolicyAsync(String predefinedPolicyName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..09193e29c6a94 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroup.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing ApplicationSecurityGroup. + */ +public interface ApplicationSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ApplicationSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a ApplicationSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ApplicationSecurityGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroups.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroups.java new file mode 100644 index 0000000000000..6c79cbb3bda18 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ApplicationSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationSecurityGroups. + */ +public interface ApplicationSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AssociationType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AssociationType.java new file mode 100644 index 0000000000000..cf534f1e68960 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AssociationType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AssociationType. + */ +public final class AssociationType extends ExpandableStringEnum { + /** Static value Associated for AssociationType. */ + public static final AssociationType ASSOCIATED = fromString("Associated"); + + /** Static value Contains for AssociationType. */ + public static final AssociationType CONTAINS = fromString("Contains"); + + /** + * Creates or finds a AssociationType from its string representation. + * @param name a name to look for + * @return the corresponding AssociationType + */ + @JsonCreator + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** + * @return known AssociationType values + */ + public static Collection values() { + return values(AssociationType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthenticationMethod.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthenticationMethod.java new file mode 100644 index 0000000000000..aad3aeddb6470 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthenticationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationMethod. + */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value EAPTLS for AuthenticationMethod. */ + public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); + + /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ + public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationMethod + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** + * @return known AuthenticationMethod values + */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthorizationUseStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthorizationUseStatus.java new file mode 100644 index 0000000000000..d787ff00d7ac7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AuthorizationUseStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthorizationUseStatus. + */ +public final class AuthorizationUseStatus extends ExpandableStringEnum { + /** Static value Available for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** Static value InUse for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * @param name a name to look for + * @return the corresponding AuthorizationUseStatus + */ + @JsonCreator + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** + * @return known AuthorizationUseStatus values + */ + public static Collection values() { + return values(AuthorizationUseStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Availability.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Availability.java new file mode 100644 index 0000000000000..7bc4f25eb8445 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Availability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Availability of the metric. + */ +public class Availability { + /** + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /** + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /** + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the time grain of the availability. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the time grain of the availability. + * + * @param timeGrain the timeGrain value to set + * @return the Availability object itself. + */ + public Availability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the retention of the availability. + * + * @return the retention value + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention of the availability. + * + * @param retention the retention value to set + * @return the Availability object itself. + */ + public Availability withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get duration of the availability blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the availability blob. + * + * @param blobDuration the blobDuration value to set + * @return the Availability object itself. + */ + public Availability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableEndpointServices.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableEndpointServices.java new file mode 100644 index 0000000000000..2186ffe0cc42e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableEndpointServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.EndpointServiceResult; + +/** + * Type representing AvailableEndpointServices. + */ +public interface AvailableEndpointServices { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersList.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersList.java new file mode 100644 index 0000000000000..7c8172367c668 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersList.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.AvailableProvidersListInner; +import java.util.List; + +/** + * Type representing AvailableProvidersList. + */ +public interface AvailableProvidersList extends HasInner, HasManager { + /** + * @return the countries value. + */ + List countries(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..ddb1d7d305165 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCity.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * City or town details. + */ +public class AvailableProvidersListCity { + /** + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the city or town name. + * + * @return the cityName value + */ + public String cityName() { + return this.cityName; + } + + /** + * Set the city or town name. + * + * @param cityName the cityName value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withCityName(String cityName) { + this.cityName = cityName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withProviders(List providers) { + this.providers = providers; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCountry.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCountry.java new file mode 100644 index 0000000000000..731e7ebf67f02 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListCountry.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Country details. + */ +public class AvailableProvidersListCountry { + /** + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the country name. + * + * @return the countryName value + */ + public String countryName() { + return this.countryName; + } + + /** + * Set the country name. + * + * @param countryName the countryName value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withCountryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available states in the country. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set list of available states in the country. + * + * @param states the states value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListParameters.java new file mode 100644 index 0000000000000..f940077e76b65 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Constraints that determine the list of available Internet service providers. + */ +public class AvailableProvidersListParameters { + /** + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /** + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get a list of Azure regions. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set a list of Azure regions. + * + * @param azureLocations the azureLocations value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the country for available providers list. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the country for available providers list. + * + * @param country the country value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state for available providers list. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state for available providers list. + * + * @param state the state value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city or town for available providers list. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city or town for available providers list. + * + * @param city the city value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListState.java new file mode 100644 index 0000000000000..e07235dfde143 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AvailableProvidersListState.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * State details. + */ +public class AvailableProvidersListState { + /** + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the state name. + * + * @return the stateName value + */ + public String stateName() { + return this.stateName; + } + + /** + * Set the state name. + * + * @param stateName the stateName value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withStateName(String stateName) { + this.stateName = stateName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available cities or towns in the state. + * + * @return the cities value + */ + public List cities() { + return this.cities; + } + + /** + * Set list of available cities or towns in the state. + * + * @param cities the cities value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withCities(List cities) { + this.cities = cities; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureAsyncOperationResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureAsyncOperationResult.java new file mode 100644 index 0000000000000..c7ad98271714d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureAsyncOperationResult.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Status of the Azure async operation. Possible values are: 'InProgress', + * 'Succeeded', and 'Failed'. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private NetworkOperationStatus status; + + /** + * The error property. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public NetworkOperationStatus status() { + return this.status; + } + + /** + * Set status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withStatus(NetworkOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewall.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewall.java new file mode 100644 index 0000000000000..193bd5d884542 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewall.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.AzureFirewallInner; + +/** + * Type representing AzureFirewall. + */ +public interface AzureFirewall extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationRuleCollections value. + */ + List applicationRuleCollections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the networkRuleCollections value. + */ + List networkRuleCollections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the AzureFirewall definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of AzureFirewall definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AzureFirewall definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the AzureFirewall definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the azurefirewall definition allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @param applicationRuleCollections Collection of application rule collections used by a Azure Firewall + * @return the next definition stage + */ + WithCreate withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configuration of the Azure Firewall resource + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall definition allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + * @param networkRuleCollections Collection of network rule collections used by a Azure Firewall + * @return the next definition stage + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApplicationRuleCollections, DefinitionStages.WithIpConfigurations, DefinitionStages.WithNetworkRuleCollections, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a AzureFirewall update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApplicationRuleCollections, UpdateStages.WithIpConfigurations, UpdateStages.WithNetworkRuleCollections, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of AzureFirewall update stages. + */ + interface UpdateStages { + /** + * The stage of the azurefirewall update allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @param applicationRuleCollections Collection of application rule collections used by a Azure Firewall + * @return the next update stage + */ + Update withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configuration of the Azure Firewall resource + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall update allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + * @param networkRuleCollections Collection of network rule collections used by a Azure Firewall + * @return the next update stage + */ + Update withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRule.java new file mode 100644 index 0000000000000..04cb5e605e69e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRule.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of an application rule. + */ +public class AzureFirewallApplicationRule { + /** + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of URLs for this rule. + */ + @JsonProperty(value = "targetUrls") + private List targetUrls; + + /** + * Get name of the application rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the application rule. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get array of ApplicationRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of ApplicationRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of URLs for this rule. + * + * @return the targetUrls value + */ + public List targetUrls() { + return this.targetUrls; + } + + /** + * Set list of URLs for this rule. + * + * @param targetUrls the targetUrls value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withTargetUrls(List targetUrls) { + this.targetUrls = targetUrls; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleCollection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 0000000000000..47ac1c93ae295 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Application rule collection resource. + */ +@JsonFlatten +public class AzureFirewallApplicationRuleCollection extends SubResource { + /** + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the application rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the application rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a application rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a application rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocol.java new file mode 100644 index 0000000000000..0e1b0864bbe14 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocol.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the application rule protocol. + */ +public class AzureFirewallApplicationRuleProtocol { + /** + * Protocol type. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /** + * Port number for the protocol, cannot be greater than 64000. This field + * is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get protocol type. Possible values include: 'Http', 'Https'. + * + * @return the protocolType value + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set protocol type. Possible values include: 'Http', 'Https'. + * + * @param protocolType the protocolType value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType(AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @param port the port value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocolType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 0000000000000..efb637b58e6e6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallApplicationRuleProtocolType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallApplicationRuleProtocolType. + */ +public final class AzureFirewallApplicationRuleProtocolType extends ExpandableStringEnum { + /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); + + /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallApplicationRuleProtocolType + */ + @JsonCreator + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** + * @return known AzureFirewallApplicationRuleProtocolType values + */ + public static Collection values() { + return values(AzureFirewallApplicationRuleProtocolType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallIPConfiguration.java new file mode 100644 index 0000000000000..2b8debd0a7446 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallIPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an Azure Firewall. + */ +@JsonFlatten +public class AzureFirewallIPConfiguration extends SubResource { + /** + * The Firewall Internal Load Balancer IP to be used as the next hop in + * User Defined Routes. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Reference of the subnet resource. This resource must be named + * 'AzureFirewallSubnet'. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. This field is a mandatory input. + */ + @JsonProperty(value = "properties.internalPublicIpAddress") + private SubResource internalPublicIpAddress; + + /** + * Reference of the PublicIP resource. This field is populated in the + * output. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @param subnet the subnet value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. This field is a mandatory input. + * + * @return the internalPublicIpAddress value + */ + public SubResource internalPublicIpAddress() { + return this.internalPublicIpAddress; + } + + /** + * Set reference of the PublicIP resource. This field is a mandatory input. + * + * @param internalPublicIpAddress the internalPublicIpAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withInternalPublicIpAddress(SubResource internalPublicIpAddress) { + this.internalPublicIpAddress = internalPublicIpAddress; + return this; + } + + /** + * Get reference of the PublicIP resource. This field is populated in the output. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. This field is populated in the output. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRule.java new file mode 100644 index 0000000000000..4987476302ec8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the network rule. + */ +public class AzureFirewallNetworkRule { + /** + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Get name of the network rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network rule. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of AzureFirewallNetworkRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get list of destination IP addresses. + * + * @return the destinationAddresses value + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set list of destination IP addresses. + * + * @param destinationAddresses the destinationAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set list of destination ports. + * + * @param destinationPorts the destinationPorts value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleCollection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 0000000000000..b68e4958ffe7b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNetworkRuleCollection extends SubResource { + /** + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the network rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the network rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a network rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a network rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleProtocol.java new file mode 100644 index 0000000000000..85258fd28e3d0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallNetworkRuleProtocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallNetworkRuleProtocol. + */ +public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { + /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); + + /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); + + /** Static value Any for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); + + /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallNetworkRuleProtocol + */ + @JsonCreator + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** + * @return known AzureFirewallNetworkRuleProtocol values + */ + public static Collection values() { + return values(AzureFirewallNetworkRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCAction.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCAction.java new file mode 100644 index 0000000000000..3825700cd4816 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCAction.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the AzureFirewallRCAction. + */ +public class AzureFirewallRCAction { + /** + * The type of action. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type of action. Possible values include: 'Allow', 'Deny'. + * + * @return the type value + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Allow', 'Deny'. + * + * @param type the type value to set + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCActionType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCActionType.java new file mode 100644 index 0000000000000..1a4d016838669 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewallRCActionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallRCActionType. + */ +public final class AzureFirewallRCActionType extends ExpandableStringEnum { + /** Static value Allow for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); + + /** Static value Deny for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType DENY = fromString("Deny"); + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallRCActionType + */ + @JsonCreator + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** + * @return known AzureFirewallRCActionType values + */ + public static Collection values() { + return values(AzureFirewallRCActionType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewalls.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewalls.java new file mode 100644 index 0000000000000..0c7ae018e2057 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureFirewalls.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.AzureFirewallsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewalls. + */ +public interface AzureFirewalls extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReport.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReport.java new file mode 100644 index 0000000000000..a2b6c8d1c1ae7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReport.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.AzureReachabilityReportInner; +import java.util.List; + +/** + * Type representing AzureReachabilityReport. + */ +public interface AzureReachabilityReport extends HasInner, HasManager { + /** + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * @return the reachabilityReport value. + */ + List reachabilityReport(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportItem.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportItem.java new file mode 100644 index 0000000000000..5e31cf2421275 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportItem.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details for a given provider location. + */ +public class AzureReachabilityReportItem { + /** + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /** + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the Internet service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the Internet service provider. + * + * @param provider the provider value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the Azure region. + * + * @return the azureLocation value + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the Azure region. + * + * @param azureLocation the azureLocation value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get list of latency details for each of the time series. + * + * @return the latencies value + */ + public List latencies() { + return this.latencies; + } + + /** + * Set list of latency details for each of the time series. + * + * @param latencies the latencies value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withLatencies(List latencies) { + this.latencies = latencies; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLatencyInfo.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 0000000000000..0993c54e762d0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details on latency for a time series. + */ +public class AzureReachabilityReportLatencyInfo { + /** + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private DateTime timeStamp; + + /** + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the time stamp. + * + * @return the timeStamp value + */ + public DateTime timeStamp() { + return this.timeStamp; + } + + /** + * Set the time stamp. + * + * @param timeStamp the timeStamp value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimeStamp(DateTime timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + /** + * Get the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @return the score value + */ + public Integer score() { + return this.score; + } + + /** + * Set the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @param score the score value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withScore(Integer score) { + this.score = score; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLocation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLocation.java new file mode 100644 index 0000000000000..bc8df0f6896ff --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportLocation.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a geographic location. + */ +public class AzureReachabilityReportLocation { + /** + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the name of the country. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the name of the country. + * + * @param country the country value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the name of the state. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the name of the state. + * + * @param state the state value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withState(String state) { + this.state = state; + return this; + } + + /** + * Get the name of the city or town. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the name of the city or town. + * + * @param city the city value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportParameters.java new file mode 100644 index 0000000000000..5fe21f1280ac9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/AzureReachabilityReportParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Geographic and time constraints for Azure reachability report. + */ +public class AzureReachabilityReportParameters { + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private DateTime endTime; + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set list of Internet service providers. + * + * @param providers the providers value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get optional Azure regions to scope the query to. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set optional Azure regions to scope the query to. + * + * @param azureLocations the azureLocations value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the start time for the Azure reachability report. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the Azure reachability report. + * + * @param startTime the startTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time for the Azure reachability report. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time for the Azure reachability report. + * + * @param endTime the endTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BGPCommunity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BGPCommunity.java new file mode 100644 index 0000000000000..48726651e1701 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BGPCommunity.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bgp community information offered in Service Community resources. + */ +public class BGPCommunity { + /** + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /** + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /** + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /** + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /** + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get the region which the service support. e.g. For O365, region is Global. + * + * @return the serviceSupportedRegion value + */ + public String serviceSupportedRegion() { + return this.serviceSupportedRegion; + } + + /** + * Set the region which the service support. e.g. For O365, region is Global. + * + * @param serviceSupportedRegion the serviceSupportedRegion value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceSupportedRegion(String serviceSupportedRegion) { + this.serviceSupportedRegion = serviceSupportedRegion; + return this; + } + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the communityName value + */ + public String communityName() { + return this.communityName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param communityName the communityName value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityName(String communityName) { + this.communityName = communityName; + return this; + } + + /** + * Get the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @return the communityValue value + */ + public String communityValue() { + return this.communityValue; + } + + /** + * Set the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @param communityValue the communityValue value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityValue(String communityValue) { + this.communityValue = communityValue; + return this; + } + + /** + * Get the prefixes that the bgp community contains. + * + * @return the communityPrefixes value + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set the prefixes that the bgp community contains. + * + * @param communityPrefixes the communityPrefixes value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityPrefixes(List communityPrefixes) { + this.communityPrefixes = communityPrefixes; + return this; + } + + /** + * Get customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set customer is authorized to use bgp community or not. + * + * @param isAuthorizedToUse the isAuthorizedToUse value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { + this.isAuthorizedToUse = isAuthorizedToUse; + return this; + } + + /** + * Get the service group of the bgp community contains. + * + * @return the serviceGroup value + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set the service group of the bgp community contains. + * + * @param serviceGroup the serviceGroup value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceGroup(String serviceGroup) { + this.serviceGroup = serviceGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BackendAddressPool.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BackendAddressPool.java new file mode 100644 index 0000000000000..cf0d280950153 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BackendAddressPool.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing BackendAddressPool. + */ +public interface BackendAddressPool extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendIPConfigurations value. + */ + List backendIPConfigurations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRule value. + */ + SubResource outboundRule(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerState.java new file mode 100644 index 0000000000000..6aef1d0e8f4bd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BgpPeerState. + */ +public final class BgpPeerState extends ExpandableStringEnum { + /** Static value Unknown for BgpPeerState. */ + public static final BgpPeerState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for BgpPeerState. */ + public static final BgpPeerState STOPPED = fromString("Stopped"); + + /** Static value Idle for BgpPeerState. */ + public static final BgpPeerState IDLE = fromString("Idle"); + + /** Static value Connecting for BgpPeerState. */ + public static final BgpPeerState CONNECTING = fromString("Connecting"); + + /** Static value Connected for BgpPeerState. */ + public static final BgpPeerState CONNECTED = fromString("Connected"); + + /** + * Creates or finds a BgpPeerState from its string representation. + * @param name a name to look for + * @return the corresponding BgpPeerState + */ + @JsonCreator + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** + * @return known BgpPeerState values + */ + public static Collection values() { + return values(BgpPeerState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatus.java new file mode 100644 index 0000000000000..35e5e12fca476 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatus.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP peer status details. + */ +public class BgpPeerStatus { + /** + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /** + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Integer asn; + + /** + * The BGP peer state. Possible values include: 'Unknown', 'Stopped', + * 'Idle', 'Connecting', 'Connected'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /** + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /** + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /** + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /** + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** + * Get the virtual network gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the remote BGP peer. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the autonomous system number of the remote BGP peer. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Get the BGP peer state. Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected'. + * + * @return the state value + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get for how long the peering has been up. + * + * @return the connectedDuration value + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the number of routes learned from this peer. + * + * @return the routesReceived value + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the number of BGP messages sent. + * + * @return the messagesSent value + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the number of BGP messages received. + * + * @return the messagesReceived value + */ + public Long messagesReceived() { + return this.messagesReceived; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatusListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..9bd1998f9dc26 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpPeerStatusListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.BgpPeerStatusListResultInner; +import java.util.List; + +/** + * Type representing BgpPeerStatusListResult. + */ +public interface BgpPeerStatusListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunities.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunities.java new file mode 100644 index 0000000000000..cc404867aa0a5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunities.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.BgpServiceCommunitiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BgpServiceCommunities. + */ +public interface BgpServiceCommunities extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunity.java new file mode 100644 index 0000000000000..436790307df7a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpServiceCommunity.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.BgpServiceCommunityInner; + +/** + * Type representing BgpServiceCommunity. + */ +public interface BgpServiceCommunity extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bgpCommunities value. + */ + List bgpCommunities(); + + /** + * @return the serviceName value. + */ + String serviceName(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpSettings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpSettings.java new file mode 100644 index 0000000000000..c2551656c1c1f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/BgpSettings.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP settings details. + */ +public class BgpSettings { + /** + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /** + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /** + * Get the BGP speaker's ASN. + * + * @return the asn value + */ + public Long asn() { + return this.asn; + } + + /** + * Set the BGP speaker's ASN. + * + * @param asn the asn value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Get the weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set the weight added to routes learned from this BGP speaker. + * + * @param peerWeight the peerWeight value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withPeerWeight(Integer peerWeight) { + this.peerWeight = peerWeight; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/CircuitConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..be053d4bcb643 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/CircuitConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CircuitConnectionStatus. + */ +public final class CircuitConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding CircuitConnectionStatus + */ + @JsonCreator + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** + * @return known CircuitConnectionStatus values + */ + public static Collection values() { + return values(CircuitConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorDestination.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorDestination.java new file mode 100644 index 0000000000000..104efa64cde6a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorDestination.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the destination of connection monitor. + */ +public class ConnectionMonitorDestination { + /** + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /** + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the destination by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get address of the connection monitor destination (IP or domain name). + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set address of the connection monitor destination (IP or domain name). + * + * @param address the address value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the destination port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorParameters.java new file mode 100644 index 0000000000000..dc20be922f022 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the operation to create a connection monitor. + */ +public class ConnectionMonitorParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorQueryResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorQueryResult.java new file mode 100644 index 0000000000000..27492aa2b1317 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorQueryResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** + * Type representing ConnectionMonitorQueryResult. + */ +public interface ConnectionMonitorQueryResult extends HasInner, HasManager { + /** + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * @return the states value. + */ + List states(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorResult.java new file mode 100644 index 0000000000000..fa6d666efab37 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorResult.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionMonitorResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing ConnectionMonitorResult. + */ +public interface ConnectionMonitorResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoStart value. + */ + Boolean autoStart(); + + /** + * @return the destination value. + */ + ConnectionMonitorDestination destination(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monitoringIntervalInSeconds value. + */ + Integer monitoringIntervalInSeconds(); + + /** + * @return the monitoringStatus value. + */ + String monitoringStatus(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the source value. + */ + ConnectionMonitorSource source(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ConnectionMonitorResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithDestination, DefinitionStages.WithSource, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConnectionMonitorResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConnectionMonitorResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + * @param resourceGroupName The name of the resource group containing Network Watcher + * @param networkWatcherName The name of the Network Watcher resource + * @return the next definition stage + */ + WithDestination withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination the destination parameter value + * @return the next definition stage + */ + WithSource withDestination(ConnectionMonitorDestination destination); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source the source parameter value + * @return the next definition stage + */ + WithCreate withSource(ConnectionMonitorSource source); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart Determines if the connection monitor will start automatically once created + * @return the next definition stage + */ + WithCreate withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next definition stage + */ + WithCreate withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoStart, DefinitionStages.WithLocation, DefinitionStages.WithMonitoringIntervalInSeconds, DefinitionStages.WithTags { + } + } + /** + * The template for a ConnectionMonitorResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoStart, UpdateStages.WithLocation, UpdateStages.WithMonitoringIntervalInSeconds, UpdateStages.WithTags { + } + + /** + * Grouping of ConnectionMonitorResult update stages. + */ + interface UpdateStages { + /** + * The stage of the connectionmonitorresult update allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart Determines if the connection monitor will start automatically once created + * @return the next update stage + */ + Update withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next update stage + */ + Update withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSource.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSource.java new file mode 100644 index 0000000000000..7a8abe06b2958 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSource.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the source of connection monitor. + */ +public class ConnectionMonitorSource { + /** + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the source by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the source by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSourceStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSourceStatus.java new file mode 100644 index 0000000000000..9e3ce6ae083fd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitorSourceStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionMonitorSourceStatus. + */ +public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { + /** Static value Uknown for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus UKNOWN = fromString("Uknown"); + + /** Static value Active for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionMonitorSourceStatus + */ + @JsonCreator + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** + * @return known ConnectionMonitorSourceStatus values + */ + public static Collection values() { + return values(ConnectionMonitorSourceStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitors.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitors.java new file mode 100644 index 0000000000000..7f622672515ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionMonitors.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionMonitorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConnectionMonitors. + */ +public interface ConnectionMonitors extends SupportsCreating, HasInner { + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionResetSharedKey.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionResetSharedKey.java new file mode 100644 index 0000000000000..86da676b229ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionResetSharedKey.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionResetSharedKeyInner; + +/** + * Type representing ConnectionResetSharedKey. + */ +public interface ConnectionResetSharedKey extends HasInner, HasManager { + /** + * @return the keyLength value. + */ + int keyLength(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionSharedKey.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionSharedKey.java new file mode 100644 index 0000000000000..edc53477eaf55 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionSharedKey.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionSharedKeyInner; + +/** + * Type representing ConnectionSharedKey. + */ +public interface ConnectionSharedKey extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionState.java new file mode 100644 index 0000000000000..9cb68a102d6a6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionState. + */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Reachable for ConnectionState. */ + public static final ConnectionState REACHABLE = fromString("Reachable"); + + /** Static value Unreachable for ConnectionState. */ + public static final ConnectionState UNREACHABLE = fromString("Unreachable"); + + /** Static value Unknown for ConnectionState. */ + public static final ConnectionState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionState from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionState + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** + * @return known ConnectionState values + */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStateSnapshot.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStateSnapshot.java new file mode 100644 index 0000000000000..01aa1300b6b48 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStateSnapshot.java @@ -0,0 +1,270 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection state snapshot. + */ +public class ConnectionStateSnapshot { + /** + * The connection state. Possible values include: 'Reachable', + * 'Unreachable', 'Unknown'. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /** + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Connectivity analysis evaluation state. Possible values include: + * 'NotStarted', 'InProgress', 'Completed'. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /** + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Integer avgLatencyInMs; + + /** + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Integer minLatencyInMs; + + /** + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Integer maxLatencyInMs; + + /** + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Integer probesSent; + + /** + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Integer probesFailed; + + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @return the connectionState value + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @param connectionState the connectionState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the start time of the connection snapshot. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the connection snapshot. + * + * @param startTime the startTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the connection snapshot. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the connection snapshot. + * + * @param endTime the endTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @return the evaluationState value + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @param evaluationState the evaluationState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get average latency in ms. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Integer avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get minimum latency in ms. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Integer minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get maximum latency in ms. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Integer maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the number of sent probes. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Set the number of sent probes. + * + * @param probesSent the probesSent value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Integer probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Set the number of failed probes. + * + * @param probesFailed the probesFailed value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Integer probesFailed) { + this.probesFailed = probesFailed; + return this; + } + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStatus.java new file mode 100644 index 0000000000000..4db7b50d47460 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionStatus. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Degraded for ConnectionStatus. */ + public static final ConnectionStatus DEGRADED = fromString("Degraded"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionStatus + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * @return known ConnectionStatus values + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityDestination.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityDestination.java new file mode 100644 index 0000000000000..1c2ba2ea42ca7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityDestination.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define destination of connection. + */ +public class ConnectivityDestination { + /** + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource to which a connection attempt will be made. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource to which a connection attempt will be made. + * + * @param resourceId the resourceId value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the IP address or URI the resource to which a connection attempt will be made. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address or URI the resource to which a connection attempt will be made. + * + * @param address the address value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get port on which check connectivity will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port on which check connectivity will be performed. + * + * @param port the port value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityHop.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityHop.java new file mode 100644 index 0000000000000..eaaf612ef0329 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityHop.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a hop between the source and the destination. + */ +public class ConnectivityHop { + /** + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /** + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type of the hop. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the ID of the hop. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the IP address of the hop. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get the ID of the resource corresponding to this hop. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get list of next hop identifiers. + * + * @return the nextHopIds value + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get list of issues. + * + * @return the issues value + */ + public List issues() { + return this.issues; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityInformation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityInformation.java new file mode 100644 index 0000000000000..118103ddef87f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityInformation.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectivityInformationInner; +import java.util.List; + +/** + * Type representing ConnectivityInformation. + */ +public interface ConnectivityInformation extends HasInner, HasManager { + /** + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * @return the hops value. + */ + List hops(); + + /** + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * @return the probesSent value. + */ + Integer probesSent(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityIssue.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityIssue.java new file mode 100644 index 0000000000000..999039125cb9c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityIssue.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an issue encountered in the process of checking for + * connectivity. + */ +public class ConnectivityIssue { + /** + * The origin of the issue. Possible values include: 'Local', 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /** + * The severity of the issue. Possible values include: 'Error', 'Warning'. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /** + * The type of issue. Possible values include: 'Unknown', 'AgentStopped', + * 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', + * 'UserDefinedRoute', 'PortThrottled', 'Platform'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /** + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** + * Get the origin of the issue. Possible values include: 'Local', 'Inbound', 'Outbound'. + * + * @return the origin value + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity of the issue. Possible values include: 'Error', 'Warning'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type of issue. Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform'. + * + * @return the type value + */ + public IssueType type() { + return this.type; + } + + /** + * Get provides additional context on the issue. + * + * @return the context value + */ + public List> context() { + return this.context; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityParameters.java new file mode 100644 index 0000000000000..59219b1d78fe7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivityParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that determine how the connectivity check will be performed. + */ +public class ConnectivityParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /** + * Network protocol. Possible values include: 'Tcp', 'Http', 'Https', + * 'Icmp'. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /** + * The protocolConfiguration property. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withSource(ConnectivitySource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withDestination(ConnectivityDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @return the protocol value + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @param protocol the protocol value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolConfiguration value. + * + * @return the protocolConfiguration value + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set the protocolConfiguration value. + * + * @param protocolConfiguration the protocolConfiguration value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { + this.protocolConfiguration = protocolConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivitySource.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivitySource.java new file mode 100644 index 0000000000000..83fdd31d3b872 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ConnectivitySource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source of the connection. + */ +public class ConnectivitySource { + /** + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource from which a connectivity check will be initiated. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource from which a connectivity check will be initiated. + * + * @param resourceId the resourceId value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port from which a connectivity check will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port from which a connectivity check will be performed. + * + * @param port the port value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlan.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlan.java new file mode 100644 index 0000000000000..16a904e00131c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlan.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.DdosProtectionPlanInner; + +/** + * Type representing DdosProtectionPlan. + */ +public interface DdosProtectionPlan extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * The entirety of the DdosProtectionPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DdosProtectionPlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DdosProtectionPlan definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DdosProtectionPlan definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a DdosProtectionPlan update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of DdosProtectionPlan update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlans.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlans.java new file mode 100644 index 0000000000000..f36cdfb30e261 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DdosProtectionPlans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.DdosProtectionPlansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DdosProtectionPlans. + */ +public interface DdosProtectionPlans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DefaultSecurityRules.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DefaultSecurityRules.java new file mode 100644 index 0000000000000..e0b7d26f19462 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DefaultSecurityRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.DefaultSecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DefaultSecurityRules. + */ +public interface DefaultSecurityRules extends HasInner { + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DeviceProperties.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DeviceProperties.java new file mode 100644 index 0000000000000..f29ceed870f15 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DeviceProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of properties of the device. + */ +public class DeviceProperties { + /** + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /** + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /** + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get name of the device Vendor. + * + * @return the deviceVendor value + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set name of the device Vendor. + * + * @param deviceVendor the deviceVendor value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceVendor(String deviceVendor) { + this.deviceVendor = deviceVendor; + return this; + } + + /** + * Get model of the device. + * + * @return the deviceModel value + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set model of the device. + * + * @param deviceModel the deviceModel value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + /** + * Get link speed. + * + * @return the linkSpeedInMbps value + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhGroup.java new file mode 100644 index 0000000000000..3be4f0f9ae9c4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhGroup.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DhGroup. + */ +public final class DhGroup extends ExpandableStringEnum { + /** Static value None for DhGroup. */ + public static final DhGroup NONE = fromString("None"); + + /** Static value DHGroup1 for DhGroup. */ + public static final DhGroup DHGROUP1 = fromString("DHGroup1"); + + /** Static value DHGroup2 for DhGroup. */ + public static final DhGroup DHGROUP2 = fromString("DHGroup2"); + + /** Static value DHGroup14 for DhGroup. */ + public static final DhGroup DHGROUP14 = fromString("DHGroup14"); + + /** Static value DHGroup2048 for DhGroup. */ + public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); + + /** Static value ECP256 for DhGroup. */ + public static final DhGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for DhGroup. */ + public static final DhGroup ECP384 = fromString("ECP384"); + + /** Static value DHGroup24 for DhGroup. */ + public static final DhGroup DHGROUP24 = fromString("DHGroup24"); + + /** + * Creates or finds a DhGroup from its string representation. + * @param name a name to look for + * @return the corresponding DhGroup + */ + @JsonCreator + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** + * @return known DhGroup values + */ + public static Collection values() { + return values(DhGroup.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhcpOptions.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhcpOptions.java new file mode 100644 index 0000000000000..ce98ec4b5bb19 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/DhcpOptions.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in + * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + * options. + */ +public class DhcpOptions { + /** + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the list of DNS servers IP addresses. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set + * @return the DhcpOptions object itself. + */ + public DhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Dimension.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Dimension.java new file mode 100644 index 0000000000000..81c0d1bb9d239 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Dimension.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of the metric. + */ +public class Dimension { + /** + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internal name of the dimension. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internal name of the dimension. + * + * @param internalName the internalName value to set + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Direction.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Direction.java new file mode 100644 index 0000000000000..4c744bc9a1625 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Direction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Direction. + */ +public final class Direction extends ExpandableStringEnum { + /** Static value Inbound for Direction. */ + public static final Direction INBOUND = fromString("Inbound"); + + /** Static value Outbound for Direction. */ + public static final Direction OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Direction from its string representation. + * @param name a name to look for + * @return the corresponding Direction + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** + * @return known Direction values + */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroup.java new file mode 100644 index 0000000000000..b091572b220d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security group. + */ +public class EffectiveNetworkSecurityGroup { + /** + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /** + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /** + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private Map> tagMap; + + /** + * Get the ID of network security group that is applied. + * + * @return the networkSecurityGroup value + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the ID of network security group that is applied. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get associated resources. + * + * @return the association value + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set associated resources. + * + * @param association the association value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { + this.association = association; + return this; + } + + /** + * Get a collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set a collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Get mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value + */ + public Map> tagMap() { + return this.tagMap; + } + + /** + * Set mapping of tags to list of IP Addresses included within the tag. + * + * @param tagMap the tagMap value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withTagMap(Map> tagMap) { + this.tagMap = tagMap; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupAssociation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 0000000000000..689fbc46f0223 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The effective network security group association. + */ +public class EffectiveNetworkSecurityGroupAssociation { + /** + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /** + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** + * Get the ID of the subnet if assigned. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the ID of the subnet if assigned. + * + * @param subnet the subnet value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ID of the network interface if assigned. + * + * @return the networkInterface value + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set the ID of the network interface if assigned. + * + * @param networkInterface the networkInterface value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { + this.networkInterface = networkInterface; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..1d214183e6846 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** + * Type representing EffectiveNetworkSecurityGroupListResult. + */ +public interface EffectiveNetworkSecurityGroupListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..2ae00290eb3f1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveNetworkSecurityRule.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security rules. + */ +public class EffectiveNetworkSecurityRule { + /** + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /** + * The network protocol this rule applies to. Possible values are: 'Tcp', + * 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /** + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /** + * The source port ranges. Expected values include a single integer between + * 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an + * asterix (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or + * an asterix (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /** + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, + * and the asterix (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), + * System Tags, and the asterix (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /** + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /** + * Whether network traffic is allowed or denied. Possible values are: + * 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /** + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * The direction of the rule. Possible values are: 'Inbound and Outbound'. + * Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get the name of the security rule specified by the user (if created by the user). + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the security rule specified by the user (if created by the user). + * + * @param name the name value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the source address prefix. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the source address prefix. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destination address prefix. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set the expanded source address prefix. + * + * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { + this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + return this; + } + + /** + * Get expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set expanded destination address prefix. + * + * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix(List expandedDestinationAddressPrefix) { + this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + return this; + } + + /** + * Get whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. + * + * @param priority the priority value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRoute.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRoute.java new file mode 100644 index 0000000000000..e8a6a8e444ccf --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRoute.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective Route. + */ +public class EffectiveRoute { + /** + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Who created the route. Possible values are: 'Unknown', 'User', + * 'VirtualNetworkGateway', and 'Default'. Possible values include: + * 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /** + * The value of effective route. Possible values are: 'Active' and + * 'Invalid'. Possible values include: 'Active', 'Invalid'. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /** + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /** + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name of the user defined route. This is optional. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the user defined route. This is optional. + * + * @param name the name value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @return the source value + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @param source the source value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @return the state value + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @param state the state value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefixes of the effective routes in CIDR notation. + * + * @param addressPrefix the addressPrefix value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withAddressPrefix(List addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address of the next hop of the effective route. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..12c73b52214ee --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.EffectiveRouteListResultInner; +import java.util.List; + +/** + * Type representing EffectiveRouteListResult. + */ +public interface EffectiveRouteListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteSource.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteSource.java new file mode 100644 index 0000000000000..2d338abd305c4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteSource.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteSource. + */ +public final class EffectiveRouteSource extends ExpandableStringEnum { + /** Static value Unknown for EffectiveRouteSource. */ + public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); + + /** Static value User for EffectiveRouteSource. */ + public static final EffectiveRouteSource USER = fromString("User"); + + /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ + public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value Default for EffectiveRouteSource. */ + public static final EffectiveRouteSource DEFAULT = fromString("Default"); + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteSource + */ + @JsonCreator + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** + * @return known EffectiveRouteSource values + */ + public static Collection values() { + return values(EffectiveRouteSource.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteState.java new file mode 100644 index 0000000000000..74a5a4698bafc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveRouteState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteState. + */ +public final class EffectiveRouteState extends ExpandableStringEnum { + /** Static value Active for EffectiveRouteState. */ + public static final EffectiveRouteState ACTIVE = fromString("Active"); + + /** Static value Invalid for EffectiveRouteState. */ + public static final EffectiveRouteState INVALID = fromString("Invalid"); + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteState + */ + @JsonCreator + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** + * @return known EffectiveRouteState values + */ + public static Collection values() { + return values(EffectiveRouteState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveSecurityRuleProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..fa2fa86723817 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EffectiveSecurityRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveSecurityRuleProtocol. + */ +public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value All for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveSecurityRuleProtocol + */ + @JsonCreator + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** + * @return known EffectiveSecurityRuleProtocol values + */ + public static Collection values() { + return values(EffectiveSecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EndpointServiceResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EndpointServiceResult.java new file mode 100644 index 0000000000000..fb2bcdb63d5c1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EndpointServiceResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.EndpointServiceResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing EndpointServiceResult. + */ +public interface EndpointServiceResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Error.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Error.java new file mode 100644 index 0000000000000..24b073507bfa2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Error.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * The innerError property. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public String innerError() { + return this.innerError; + } + + /** + * Set the innerError value. + * + * @param innerError the innerError value to set + * @return the Error object itself. + */ + public Error withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorDetails.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorDetails.java new file mode 100644 index 0000000000000..8fb8d369ac5ee --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorDetails.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetails model. + */ +public class ErrorDetails { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorException.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorException.java new file mode 100644 index 0000000000000..c5c0adbbcfbec --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponse.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponse.java new file mode 100644 index 0000000000000..2c103b08e8cea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponse { + /** + * Error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponseException.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponseException.java new file mode 100644 index 0000000000000..edb450182d147 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluatedNetworkSecurityGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..8e437b17a6805 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network security group evaluation. + */ +public class EvaluatedNetworkSecurityGroup { + /** + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /** + * The matchedRule property. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /** + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get network security group ID. + * + * @return the networkSecurityGroupId value + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set network security group ID. + * + * @param networkSecurityGroupId the networkSecurityGroupId value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { + this.networkSecurityGroupId = networkSecurityGroupId; + return this; + } + + /** + * Get the matchedRule value. + * + * @return the matchedRule value + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule value. + * + * @param matchedRule the matchedRule value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { + this.matchedRule = matchedRule; + return this; + } + + /** + * Get list of network security rules evaluation results. + * + * @return the rulesEvaluationResult value + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluationState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluationState.java new file mode 100644 index 0000000000000..aa2fa8d0d71d2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/EvaluationState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EvaluationState. + */ +public final class EvaluationState extends ExpandableStringEnum { + /** Static value NotStarted for EvaluationState. */ + public static final EvaluationState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for EvaluationState. */ + public static final EvaluationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for EvaluationState. */ + public static final EvaluationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a EvaluationState from its string representation. + * @param name a name to look for + * @return the corresponding EvaluationState + */ + @JsonCreator + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** + * @return known EvaluationState values + */ + public static Collection values() { + return values(EvaluationState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuit.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuit.java new file mode 100644 index 0000000000000..5b4e2e7f2ca7a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuit.java @@ -0,0 +1,424 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitInner; + +/** + * Type representing ExpressRouteCircuit. + */ +public interface ExpressRouteCircuit extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowClassicOperations value. + */ + Boolean allowClassicOperations(); + + /** + * @return the allowGlobalReach value. + */ + Boolean allowGlobalReach(); + + /** + * @return the authorizations value. + */ + List authorizations(); + + /** + * @return the circuitProvisioningState value. + */ + String circuitProvisioningState(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProperties value. + */ + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sku value. + */ + ExpressRouteCircuitSku sku(); + + /** + * The entirety of the ExpressRouteCircuit definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuit definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuit definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCircuit definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecircuit definition allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next definition stage + */ + WithCreate withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify AllowGlobalReach. + */ + interface WithAllowGlobalReach { + /** + * Specifies allowGlobalReach. + * @param allowGlobalReach Flag to enable Global Reach on the circuit + * @return the next definition stage + */ + WithCreate withAllowGlobalReach(Boolean allowGlobalReach); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + * @param authorizations The list of authorizations + * @return the next definition stage + */ + WithCreate withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @param circuitProvisioningState The CircuitProvisioningState state of the resource + * @return the next definition stage + */ + WithCreate withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + * @param serviceKey The ServiceKey + * @return the next definition stage + */ + WithCreate withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes The ServiceProviderNotes + * @return the next definition stage + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next definition stage + */ + WithCreate withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next definition stage + */ + WithCreate withSku(ExpressRouteCircuitSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowClassicOperations, DefinitionStages.WithAllowGlobalReach, DefinitionStages.WithAuthorizations, DefinitionStages.WithCircuitProvisioningState, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithPeerings, DefinitionStages.WithProvisioningState, DefinitionStages.WithServiceKey, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProperties, DefinitionStages.WithServiceProviderProvisioningState, DefinitionStages.WithSku { + } + } + /** + * The template for a ExpressRouteCircuit update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowClassicOperations, UpdateStages.WithAllowGlobalReach, UpdateStages.WithAuthorizations, UpdateStages.WithCircuitProvisioningState, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithPeerings, UpdateStages.WithProvisioningState, UpdateStages.WithServiceKey, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProperties, UpdateStages.WithServiceProviderProvisioningState, UpdateStages.WithSku { + } + + /** + * Grouping of ExpressRouteCircuit update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuit update allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next update stage + */ + Update withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify AllowGlobalReach. + */ + interface WithAllowGlobalReach { + /** + * Specifies allowGlobalReach. + * @param allowGlobalReach Flag to enable Global Reach on the circuit + * @return the next update stage + */ + Update withAllowGlobalReach(Boolean allowGlobalReach); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + * @param authorizations The list of authorizations + * @return the next update stage + */ + Update withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @param circuitProvisioningState The CircuitProvisioningState state of the resource + * @return the next update stage + */ + Update withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + * @param serviceKey The ServiceKey + * @return the next update stage + */ + Update withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes The ServiceProviderNotes + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next update stage + */ + Update withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next update stage + */ + Update withSku(ExpressRouteCircuitSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitArpTable.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitArpTable.java new file mode 100644 index 0000000000000..3b0f000013230 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitArpTable.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ARP table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitArpTable { + /** + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /** + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /** + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get entry age in minutes. + * + * @return the age value + */ + public Integer age() { + return this.age; + } + + /** + * Set entry age in minutes. + * + * @param age the age value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get interface address. + * + * @return the interfaceProperty value + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set interface address. + * + * @param interfaceProperty the interfaceProperty value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the IP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address. + * + * @param ipAddress the ipAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the MAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address. + * + * @param macAddress the macAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorization.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorization.java new file mode 100644 index 0000000000000..7da941e981918 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCircuitAuthorization. + */ +public interface ExpressRouteCircuitAuthorization extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitAuthorization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitAuthorization definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next definition stage + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithAuthorizationUseStatus, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a ExpressRouteCircuitAuthorization update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next update stage + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorizations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 0000000000000..3a5c57cdeae60 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitAuthorizations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitAuthorizationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitAuthorizations. + */ +public interface ExpressRouteCircuitAuthorizations extends SupportsCreating, HasInner { + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..a941e275c874b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnection.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing ExpressRouteCircuitConnection. + */ +public interface ExpressRouteCircuitConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPeering, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitConnection definition. + */ + interface Blank extends WithPeering { + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Peering. + */ + interface WithPeering { + /** + * Specifies resourceGroupName, circuitName, peeringName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @param peeringName The name of the peering + * @return the next definition stage + */ + WithCreate withExistingPeering(String resourceGroupName, String circuitName, String peeringName); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection + * @return the next definition stage + */ + WithCreate withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the peered circuit + * @return the next definition stage + */ + WithCreate withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeerExpressRouteCircuitPeering { + } + } + /** + * The template for a ExpressRouteCircuitConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAuthorizationKey, UpdateStages.WithExpressRouteCircuitPeering, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeerExpressRouteCircuitPeering { + } + + /** + * Grouping of ExpressRouteCircuitConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitconnection update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection + * @return the next update stage + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the peered circuit + * @return the next update stage + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnections.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..d80681a2327d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitConnections.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitConnections. + */ +public interface ExpressRouteCircuitConnections extends SupportsCreating, HasInner { + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeering.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeering.java new file mode 100644 index 0000000000000..e4b3f62067abc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeering.java @@ -0,0 +1,662 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitPeering. + */ +public interface ExpressRouteCircuitPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilter value. + */ + RouteFilter routeFilter(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCircuitPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitPeering definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next definition stage + */ + WithCreate withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next definition stage + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next definition stage + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next definition stage + */ + WithCreate withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next definition stage + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next definition stage + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAzureASN, DefinitionStages.WithConnections, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryAzurePort, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteFilter, DefinitionStages.WithSecondaryAzurePort, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithStats, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCircuitPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureASN, UpdateStages.WithConnections, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryAzurePort, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithProvisioningState, UpdateStages.WithRouteFilter, UpdateStages.WithSecondaryAzurePort, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithStats, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCircuitPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitpeering update allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next update stage + */ + Update withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next update stage + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next update stage + */ + Update withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next update stage + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next update stage + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 0000000000000..ad18aa2471bed --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ +public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState extends ExpandableStringEnum { + /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = fromString("NotConfigured"); + + /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); + + /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); + + /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = fromString("ValidationNeeded"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..379a7e1f3ee1f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the peering configuration. + */ +public class ExpressRouteCircuitPeeringConfig { + /** + * The reference of AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /** + * The communities of bgp peering. Spepcified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /** + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded'. + */ + @JsonProperty(value = "advertisedPublicPrefixesState") + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /** + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /** + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerASN; + + /** + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** + * Get the reference of AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the reference of AdvertisedPublicPrefixes. + * + * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { + this.advertisedPublicPrefixes = advertisedPublicPrefixes; + return this; + } + + /** + * Get the communities of bgp peering. Spepcified for microsoft peering. + * + * @return the advertisedCommunities value + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set the communities of bgp peering. Spepcified for microsoft peering. + * + * @param advertisedCommunities the advertisedCommunities value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { + this.advertisedCommunities = advertisedCommunities; + return this; + } + + /** + * Get advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @return the advertisedPublicPrefixesState value + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Set advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @param advertisedPublicPrefixesState the advertisedPublicPrefixesState value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixesState(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState) { + this.advertisedPublicPrefixesState = advertisedPublicPrefixesState; + return this; + } + + /** + * Get the legacy mode of the peering. + * + * @return the legacyMode value + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set the legacy mode of the peering. + * + * @param legacyMode the legacyMode value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { + this.legacyMode = legacyMode; + return this; + } + + /** + * Get the CustomerASN of the peering. + * + * @return the customerASN value + */ + public Integer customerASN() { + return this.customerASN; + } + + /** + * Set the CustomerASN of the peering. + * + * @param customerASN the customerASN value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withCustomerASN(Integer customerASN) { + this.customerASN = customerASN; + return this; + } + + /** + * Get the RoutingRegistryName of the configuration. + * + * @return the routingRegistryName value + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set the RoutingRegistryName of the configuration. + * + * @param routingRegistryName the routingRegistryName value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { + this.routingRegistryName = routingRegistryName; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringState.java new file mode 100644 index 0000000000000..f33d70aa3dd74 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringState. + */ +public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeerings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeerings.java new file mode 100644 index 0000000000000..61dae63d2a3cd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitPeerings. + */ +public interface ExpressRouteCircuitPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitReference.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitReference.java new file mode 100644 index 0000000000000..4f6ba15e9dc02 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ExpressRouteCircuitReference model. + */ +public class ExpressRouteCircuitReference { + /** + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get corresponding Express Route Circuit Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set corresponding Express Route Circuit Id. + * + * @param id the id value to set + * @return the ExpressRouteCircuitReference object itself. + */ + public ExpressRouteCircuitReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTable.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 0000000000000..1a94b713c5e3b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTable.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTable { + /** + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /** + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /** + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /** + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /** + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get iP address of a network entity. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Set iP address of a network entity. + * + * @param network the network value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNetwork(String network) { + this.network = network; + return this; + } + + /** + * Get nextHop address. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set nextHop address. + * + * @param nextHop the nextHop value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Get local preference value as set with the set local-preference route-map configuration command. + * + * @return the locPrf value + */ + public String locPrf() { + return this.locPrf; + } + + /** + * Set local preference value as set with the set local-preference route-map configuration command. + * + * @param locPrf the locPrf value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { + this.locPrf = locPrf; + return this; + } + + /** + * Get route Weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + + /** + * Set route Weight. + * + * @param weight the weight value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get autonomous system paths to the destination network. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set autonomous system paths to the destination network. + * + * @param path the path value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTableSummary.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 0000000000000..1340e4ef00c2b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTableSummary { + /** + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get iP address of the neighbor. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of the neighbor. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get bGP version number spoken to the neighbor. + * + * @return the v value + */ + public Integer v() { + return this.v; + } + + /** + * Set bGP version number spoken to the neighbor. + * + * @param v the v value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { + this.v = v; + return this; + } + + /** + * Get autonomous system number. + * + * @return the as value + */ + public Integer as() { + return this.as; + } + + /** + * Set autonomous system number. + * + * @param as the as value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { + this.as = as; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the statePfxRcd value + */ + public String statePfxRcd() { + return this.statePfxRcd; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param statePfxRcd the statePfxRcd value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { + this.statePfxRcd = statePfxRcd; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitServiceProviderProperties.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 0000000000000..2d706904afec8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitServiceProviderProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitServiceProviderProperties { + /** + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /** + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /** + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName. + * + * @return the serviceProviderName value + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName. + * + * @param serviceProviderName the serviceProviderName value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + return this; + } + + /** + * Get the peering location. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the BandwidthInMbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSku.java new file mode 100644 index 0000000000000..42c2df7c81103 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSku.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains SKU in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU. Possible values are 'Standard' and 'Premium'. + * Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /** + * The family of the SKU. Possible values are: 'UnlimitedData' and + * 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @return the family value + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @param family the family value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuFamily.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 0000000000000..3e5cb30db0ca0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuFamily.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuFamily. + */ +public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { + /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); + + /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuFamily + */ + @JsonCreator + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** + * @return known ExpressRouteCircuitSkuFamily values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuFamily.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuTier.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuTier.java new file mode 100644 index 0000000000000..f3be27f7b772c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitSkuTier.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuTier. + */ +public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { + /** Static value Standard for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuTier + */ + @JsonCreator + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** + * @return known ExpressRouteCircuitSkuTier values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuTier.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitStats.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitStats.java new file mode 100644 index 0000000000000..e2e7551ba9a5e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitStats.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitStats. + */ +public interface ExpressRouteCircuitStats extends HasInner, HasManager { + /** + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuits.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..c4ffd4b36606a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuits.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuits. + */ +public interface ExpressRouteCircuits extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatsAsync(String resourceGroupName, String circuitName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsArpTableListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsArpTableListResult.java new file mode 100644 index 0000000000000..ad912cffb5784 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsArpTableListResult. + */ +public interface ExpressRouteCircuitsArpTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 0000000000000..a0f9678e46ac4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableListResult. + */ +public interface ExpressRouteCircuitsRoutesTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..ea166e8e82bc3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnection.java new file mode 100644 index 0000000000000..18ffa813c4fa6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnection.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionInner; + +/** + * Type representing ExpressRouteCrossConnection. + */ +public interface ExpressRouteCrossConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bandwidthInMbps value. + */ + Integer bandwidthInMbps(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuit value. + */ + ExpressRouteCircuitReference expressRouteCircuit(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sTag value. + */ + Integer sTag(); + + /** + * The entirety of the ExpressRouteCrossConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next definition stage + */ + WithCreate withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next definition stage + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next definition stage + */ + WithCreate withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes Additional read only notes set by the connectivity provider + * @return the next definition stage + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInMbps, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithPeeringLocation, DefinitionStages.WithPeerings, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProvisioningState { + } + } + /** + * The template for a ExpressRouteCrossConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInMbps, UpdateStages.WithExpressRouteCircuit, UpdateStages.WithPeeringLocation, UpdateStages.WithPeerings, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProvisioningState { + } + + /** + * Grouping of ExpressRouteCrossConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnection update allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next update stage + */ + Update withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next update stage + */ + Update withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next update stage + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes Additional read only notes set by the connectivity provider + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeering.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..ac2c21adb9e76 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,475 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCrossConnectionPeering. + */ +public interface ExpressRouteCrossConnectionPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCrossConnectionPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCrossConnection, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnectionPeering definition. + */ + interface Blank extends WithExpressRouteCrossConnection { + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify ExpressRouteCrossConnection. + */ + interface WithExpressRouteCrossConnection { + /** + * Specifies resourceGroupName, crossConnectionName. + * @param resourceGroupName The name of the resource group + * @param crossConnectionName The name of the ExpressRouteCrossConnection + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCrossConnectionPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeerings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 0000000000000..6388ce1f49f35 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnectionPeerings. + */ +public interface ExpressRouteCrossConnectionPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String crossConnectionName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionRoutesTableSummary.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 0000000000000..1ce5fbe2e6322 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCrossConnectionRoutesTableSummary { + /** + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get iP address of Neighbor router. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of Neighbor router. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get autonomous system number. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Set autonomous system number. + * + * @param asn the asn value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the stateOrPrefixesReceived value + */ + public String stateOrPrefixesReceived() { + return this.stateOrPrefixesReceived; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { + this.stateOrPrefixesReceived = stateOrPrefixesReceived; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnections.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnections.java new file mode 100644 index 0000000000000..ecb5d00dafc2a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnections.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnections. + */ +public interface ExpressRouteCrossConnections extends SupportsCreating, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..ee55d6a9fbd5f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCrossConnectionsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringState.java new file mode 100644 index 0000000000000..768c8279c3fbb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringState. + */ +public final class ExpressRoutePeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringState + */ + @JsonCreator + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** + * @return known ExpressRoutePeeringState values + */ + public static Collection values() { + return values(ExpressRoutePeeringState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringType.java new file mode 100644 index 0000000000000..9f071c4d0b3b8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRoutePeeringType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringType. + */ +public final class ExpressRoutePeeringType extends ExpandableStringEnum { + /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); + + /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); + + /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringType + */ + @JsonCreator + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** + * @return known ExpressRoutePeeringType values + */ + public static Collection values() { + return values(ExpressRoutePeeringType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProvider.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProvider.java new file mode 100644 index 0000000000000..9fff5b1fb820e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProvider.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteServiceProviderInner; + +/** + * Type representing ExpressRouteServiceProvider. + */ +public interface ExpressRouteServiceProvider extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bandwidthsOffered value. + */ + List bandwidthsOffered(); + + /** + * @return the peeringLocations value. + */ + List peeringLocations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviderBandwidthsOffered.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviderBandwidthsOffered.java new file mode 100644 index 0000000000000..b7b1b6f90ac83 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviderBandwidthsOffered.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + */ +public class ExpressRouteServiceProviderBandwidthsOffered { + /** + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /** + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the OfferName. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Set the OfferName. + * + * @param offerName the offerName value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { + this.offerName = offerName; + return this; + } + + /** + * Get the ValueInMbps. + * + * @return the valueInMbps value + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviders.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviders.java new file mode 100644 index 0000000000000..127d4131f2473 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ExpressRouteServiceProviders.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteServiceProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteServiceProviders. + */ +public interface ExpressRouteServiceProviders extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogInformation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogInformation.java new file mode 100644 index 0000000000000..ac6947666991b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogInformation.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.FlowLogInformationInner; + +/** + * Type representing FlowLogInformation. + */ +public interface FlowLogInformation extends HasInner, HasManager { + /** + * @return the enabled value. + */ + boolean enabled(); + + /** + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * @return the storageId value. + */ + String storageId(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogStatusParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogStatusParameters.java new file mode 100644 index 0000000000000..15a7eee11f77a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FlowLogStatusParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. + */ +public class FlowLogStatusParameters { + /** + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource where getting the flow log and traffic analytics (optional) status. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource where getting the flow log and traffic analytics (optional) status. + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogStatusParameters object itself. + */ + public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FrontendIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FrontendIPConfiguration.java new file mode 100644 index 0000000000000..2e513ae2f0810 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/FrontendIPConfiguration.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing FrontendIPConfiguration. + */ +public interface FrontendIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the zones value. + */ + List zones(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRoute.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRoute.java new file mode 100644 index 0000000000000..d75bcbc11a7a7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRoute.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gateway routing details. + */ +public class GatewayRoute { + /** + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /** + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /** + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /** + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /** + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the route's network prefix. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Get the route's next hop. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the peer this route was learned from. + * + * @return the sourcePeer value + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the source this route was learned from. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the route's AS path sequence. + * + * @return the asPath value + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the route's weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRouteListResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRouteListResult.java new file mode 100644 index 0000000000000..43daec6444f5c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GatewayRouteListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.GatewayRouteListResultInner; +import java.util.List; + +/** + * Type representing GatewayRouteListResult. + */ +public interface GatewayRouteListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GetVpnSitesConfigurationRequest.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GetVpnSitesConfigurationRequest.java new file mode 100644 index 0000000000000..783a6fd083897 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/GetVpnSitesConfigurationRequest.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of Vpn-Sites. + */ +public class GetVpnSitesConfigurationRequest { + /** + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /** + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** + * Get list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Set list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @param vpnSites the vpnSites value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { + this.vpnSites = vpnSites; + return this; + } + + /** + * Get the sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the sas-url to download the configurations for vpn-sites. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPConfiguration.java new file mode 100644 index 0000000000000..720b48d2cb8ab --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HTTP configuration of the connectivity check. + */ +public class HTTPConfiguration { + /** + * HTTP method. Possible values include: 'Get'. + */ + @JsonProperty(value = "method") + private HTTPMethod method; + + /** + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** + * Get hTTP method. Possible values include: 'Get'. + * + * @return the method value + */ + public HTTPMethod method() { + return this.method; + } + + /** + * Set hTTP method. Possible values include: 'Get'. + * + * @param method the method value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withMethod(HTTPMethod method) { + this.method = method; + return this; + } + + /** + * Get list of HTTP headers. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set list of HTTP headers. + * + * @param headers the headers value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get valid status codes. + * + * @return the validStatusCodes value + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set valid status codes. + * + * @param validStatusCodes the validStatusCodes value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withValidStatusCodes(List validStatusCodes) { + this.validStatusCodes = validStatusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPHeader.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPHeader.java new file mode 100644 index 0000000000000..0c27721057f9c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPHeader.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the HTTP header. + */ +public class HTTPHeader { + /** + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value in HTTP header. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name in HTTP header. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name in HTTP header. + * + * @param name the name value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value in HTTP header. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value in HTTP header. + * + * @param value the value value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPMethod.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPMethod.java new file mode 100644 index 0000000000000..5a9b2e7179cb5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HTTPMethod.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HTTPMethod. + */ +public final class HTTPMethod extends ExpandableStringEnum { + /** Static value Get for HTTPMethod. */ + public static final HTTPMethod GET = fromString("Get"); + + /** + * Creates or finds a HTTPMethod from its string representation. + * @param name a name to look for + * @return the corresponding HTTPMethod + */ + @JsonCreator + public static HTTPMethod fromString(String name) { + return fromString(name, HTTPMethod.class); + } + + /** + * @return known HTTPMethod values + */ + public static Collection values() { + return values(HTTPMethod.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnection.java new file mode 100644 index 0000000000000..93ede117a8e40 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnection.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing HubVirtualNetworkConnection. + */ +public interface HubVirtualNetworkConnection extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnectionStatus.java new file mode 100644 index 0000000000000..eb77eb06d312d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HubVirtualNetworkConnectionStatus. + */ +public final class HubVirtualNetworkConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubVirtualNetworkConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding HubVirtualNetworkConnectionStatus + */ + @JsonCreator + public static HubVirtualNetworkConnectionStatus fromString(String name) { + return fromString(name, HubVirtualNetworkConnectionStatus.class); + } + + /** + * @return known HubVirtualNetworkConnectionStatus values + */ + public static Collection values() { + return values(HubVirtualNetworkConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnections.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnections.java new file mode 100644 index 0000000000000..080c3a51e67fa --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/HubVirtualNetworkConnections.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.HubVirtualNetworkConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HubVirtualNetworkConnections. + */ +public interface HubVirtualNetworkConnections extends HasInner { + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualHubName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAddressAvailabilityResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAddressAvailabilityResult.java new file mode 100644 index 0000000000000..6bbc10e9601a9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAddressAvailabilityResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.IPAddressAvailabilityResultInner; +import java.util.List; + +/** + * Type representing IPAddressAvailabilityResult. + */ +public interface IPAddressAvailabilityResult extends HasInner, HasManager { + /** + * @return the available value. + */ + Boolean available(); + + /** + * @return the availableIPAddresses value. + */ + List availableIPAddresses(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAllocationMethod.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAllocationMethod.java new file mode 100644 index 0000000000000..e89ff998e6867 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPAllocationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPAllocationMethod. + */ +public final class IPAllocationMethod extends ExpandableStringEnum { + /** Static value Static for IPAllocationMethod. */ + public static final IPAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IPAllocationMethod. */ + public static final IPAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IPAllocationMethod from its string representation. + * @param name a name to look for + * @return the corresponding IPAllocationMethod + */ + @JsonCreator + public static IPAllocationMethod fromString(String name) { + return fromString(name, IPAllocationMethod.class); + } + + /** + * @return known IPAllocationMethod values + */ + public static Collection values() { + return values(IPAllocationMethod.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPConfiguration.java new file mode 100644 index 0000000000000..722951ac33a89 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.management.network.v2018_07_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PublicIPAddressInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration. + */ +@JsonFlatten +public class IPConfiguration extends SubResource { + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPVersion.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPVersion.java new file mode 100644 index 0000000000000..da99081b1950e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IPVersion.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPVersion. + */ +public final class IPVersion extends ExpandableStringEnum { + /** Static value IPv4 for IPVersion. */ + public static final IPVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IPVersion. */ + public static final IPVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IPVersion from its string representation. + * @param name a name to look for + * @return the corresponding IPVersion + */ + @JsonCreator + public static IPVersion fromString(String name) { + return fromString(name, IPVersion.class); + } + + /** + * @return known IPVersion values + */ + public static Collection values() { + return values(IPVersion.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeEncryption.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeEncryption.java new file mode 100644 index 0000000000000..86a4d51be74bd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeEncryption.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeEncryption. + */ +public final class IkeEncryption extends ExpandableStringEnum { + /** Static value DES for IkeEncryption. */ + public static final IkeEncryption DES = fromString("DES"); + + /** Static value DES3 for IkeEncryption. */ + public static final IkeEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IkeEncryption. */ + public static final IkeEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IkeEncryption. */ + public static final IkeEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IkeEncryption. */ + public static final IkeEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES256 for IkeEncryption. */ + public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeEncryption. */ + public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IkeEncryption + */ + @JsonCreator + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** + * @return known IkeEncryption values + */ + public static Collection values() { + return values(IkeEncryption.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeIntegrity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeIntegrity.java new file mode 100644 index 0000000000000..6c2ae75ec3b87 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IkeIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeIntegrity. + */ +public final class IkeIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IkeIntegrity. */ + public static final IkeIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IkeIntegrity. */ + public static final IkeIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IkeIntegrity. */ + public static final IkeIntegrity SHA256 = fromString("SHA256"); + + /** Static value SHA384 for IkeIntegrity. */ + public static final IkeIntegrity SHA384 = fromString("SHA384"); + + /** Static value GCMAES256 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IkeIntegrity + */ + @JsonCreator + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** + * @return known IkeIntegrity values + */ + public static Collection values() { + return values(IkeIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatPool.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatPool.java new file mode 100644 index 0000000000000..d084ce50e441f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatPool.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT pool of the load balancer. + */ +@JsonFlatten +public class InboundNatPool extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. + * Acceptable values range between 1 and 65534. + */ + @JsonProperty(value = "properties.frontendPortRangeStart", required = true) + private int frontendPortRangeStart; + + /** + * The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable + * values range between 1 and 65535. + */ + @JsonProperty(value = "properties.frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "properties.backendPort", required = true) + private int backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @return the frontendPortRangeStart value + */ + public int frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeStart(int frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @return the frontendPortRangeEnd value + */ + public int frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeEnd(int frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @return the backendPort value + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRule.java new file mode 100644 index 0000000000000..374a3047e7f08 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRule.java @@ -0,0 +1,398 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing InboundNatRule. + */ +public interface InboundNatRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backendIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the InboundNatRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLoadBalancer, DefinitionStages.WithCreate { + } + + /** + * Grouping of InboundNatRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InboundNatRule definition. + */ + interface Blank extends WithLoadBalancer { + } + + /** + * The stage of the inboundnatrule definition allowing to specify LoadBalancer. + */ + interface WithLoadBalancer { + /** + * Specifies resourceGroupName, loadBalancerName. + * @param resourceGroupName The name of the resource group + * @param loadBalancerName The name of the load balancer + * @return the next definition stage + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + + /** + * The stage of the inboundnatrule definition allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535 + * @return the next definition stage + */ + WithCreate withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @param enableFloatingIP Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint + * @return the next definition stage + */ + WithCreate withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule definition allowing to specify EnableTcpReset. + */ + interface WithEnableTcpReset { + /** + * Specifies enableTcpReset. + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP + * @return the next definition stage + */ + WithCreate withEnableTcpReset(Boolean enableTcpReset); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @param frontendIPConfiguration A reference to frontend IP addresses + * @return the next definition stage + */ + WithCreate withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534 + * @return the next definition stage + */ + WithCreate withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the inboundnatrule definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP + * @return the next definition stage + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Possible values include: 'Udp', 'Tcp', 'All' + * @return the next definition stage + */ + WithCreate withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBackendPort, DefinitionStages.WithEnableFloatingIP, DefinitionStages.WithEnableTcpReset, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfiguration, DefinitionStages.WithFrontendPort, DefinitionStages.WithId, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithName, DefinitionStages.WithProtocol, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a InboundNatRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBackendPort, UpdateStages.WithEnableFloatingIP, UpdateStages.WithEnableTcpReset, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfiguration, UpdateStages.WithFrontendPort, UpdateStages.WithId, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithName, UpdateStages.WithProtocol, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of InboundNatRule update stages. + */ + interface UpdateStages { + /** + * The stage of the inboundnatrule update allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535 + * @return the next update stage + */ + Update withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @param enableFloatingIP Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint + * @return the next update stage + */ + Update withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableTcpReset. + */ + interface WithEnableTcpReset { + /** + * Specifies enableTcpReset. + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP + * @return the next update stage + */ + Update withEnableTcpReset(Boolean enableTcpReset); + } + + /** + * The stage of the inboundnatrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @param frontendIPConfiguration A reference to frontend IP addresses + * @return the next update stage + */ + Update withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534 + * @return the next update stage + */ + Update withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the inboundnatrule update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the inboundnatrule update allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Possible values include: 'Udp', 'Tcp', 'All' + * @return the next update stage + */ + Update withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRules.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRules.java new file mode 100644 index 0000000000000..7aa3bbe231b71 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/InboundNatRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.InboundNatRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InboundNatRules. + */ +public interface InboundNatRules extends SupportsCreating, HasInner { + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpFlowProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpFlowProtocol.java new file mode 100644 index 0000000000000..3921647ed6b9b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpFlowProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpFlowProtocol. + */ +public final class IpFlowProtocol extends ExpandableStringEnum { + /** Static value TCP for IpFlowProtocol. */ + public static final IpFlowProtocol TCP = fromString("TCP"); + + /** Static value UDP for IpFlowProtocol. */ + public static final IpFlowProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * @param name a name to look for + * @return the corresponding IpFlowProtocol + */ + @JsonCreator + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** + * @return known IpFlowProtocol values + */ + public static Collection values() { + return values(IpFlowProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpTag.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpTag.java new file mode 100644 index 0000000000000..189f4e008de81 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpTag.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IpTag associated with the object. + */ +public class IpTag { + /** + * Gets or sets the ipTag type: Example FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /** + * Gets or sets value of the IpTag associated with the public IP. Example + * SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get gets or sets the ipTag type: Example FirstPartyUsage. + * + * @return the ipTagType value + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set gets or sets the ipTag type: Example FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @param tag the tag value to set + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecEncryption.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecEncryption.java new file mode 100644 index 0000000000000..22f03f9bedc82 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecEncryption.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecEncryption. + */ +public final class IpsecEncryption extends ExpandableStringEnum { + /** Static value None for IpsecEncryption. */ + public static final IpsecEncryption NONE = fromString("None"); + + /** Static value DES for IpsecEncryption. */ + public static final IpsecEncryption DES = fromString("DES"); + + /** Static value DES3 for IpsecEncryption. */ + public static final IpsecEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IpsecEncryption. */ + public static final IpsecEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IpsecEncryption. */ + public static final IpsecEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IpsecEncryption. */ + public static final IpsecEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES128 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IpsecEncryption + */ + @JsonCreator + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** + * @return known IpsecEncryption values + */ + public static Collection values() { + return values(IpsecEncryption.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecIntegrity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecIntegrity.java new file mode 100644 index 0000000000000..0a4c34eb66342 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecIntegrity. + */ +public final class IpsecIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IpsecIntegrity. */ + public static final IpsecIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA256 = fromString("SHA256"); + + /** Static value GCMAES128 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IpsecIntegrity + */ + @JsonCreator + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** + * @return known IpsecIntegrity values + */ + public static Collection values() { + return values(IpsecIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecPolicy.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecPolicy.java new file mode 100644 index 0000000000000..2251d25436bb0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IpsecPolicy.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec Policy configuration for a virtual network gateway connection. + */ +public class IpsecPolicy { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Ipv6ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..4d92d8c1635a2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains IPv6 peering config. + */ +public class Ipv6ExpressRouteCircuitPeeringConfig { + /** + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private RouteFilterInner routeFilter; + + /** + * The state of peering. Possible values are: 'Disabled' and 'Enabled'. + * Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IssueType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IssueType.java new file mode 100644 index 0000000000000..4e5fcb62d1f50 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/IssueType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IssueType. + */ +public final class IssueType extends ExpandableStringEnum { + /** Static value Unknown for IssueType. */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** Static value AgentStopped for IssueType. */ + public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value GuestFirewall for IssueType. */ + public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); + + /** Static value DnsResolution for IssueType. */ + public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value SocketBind for IssueType. */ + public static final IssueType SOCKET_BIND = fromString("SocketBind"); + + /** Static value NetworkSecurityRule for IssueType. */ + public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); + + /** Static value UserDefinedRoute for IssueType. */ + public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); + + /** Static value PortThrottled for IssueType. */ + public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); + + /** Static value Platform for IssueType. */ + public static final IssueType PLATFORM = fromString("Platform"); + + /** + * Creates or finds a IssueType from its string representation. + * @param name a name to look for + * @return the corresponding IssueType + */ + @JsonCreator + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * @return known IssueType values + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancer.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancer.java new file mode 100644 index 0000000000000..b7362c16c6e1f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancer.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ProbeInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerInner; + +/** + * Type representing LoadBalancer. + */ +public interface LoadBalancer extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * The entirety of the LoadBalancer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LoadBalancer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LoadBalancer definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LoadBalancer definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the loadbalancer definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Collection of backend address pools used by a load balancer + * @return the next definition stage + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the loadbalancer definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Object representing the frontend IPs to be used for the load balancer + * @return the next definition stage + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer definition allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @param inboundNatPools Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next definition stage + */ + WithCreate withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer definition allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @param inboundNatRules Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next definition stage + */ + WithCreate withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning + * @return the next definition stage + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next definition stage + */ + WithCreate withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Collection of probe objects used in the load balancer + * @return the next definition stage + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the loadbalancer definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next definition stage + */ + WithCreate withSku(LoadBalancerSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithInboundNatPools, DefinitionStages.WithInboundNatRules, DefinitionStages.WithLoadBalancingRules, DefinitionStages.WithOutboundRules, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku { + } + } + /** + * The template for a LoadBalancer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBackendAddressPools, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithInboundNatPools, UpdateStages.WithInboundNatRules, UpdateStages.WithLoadBalancingRules, UpdateStages.WithOutboundRules, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSku { + } + + /** + * Grouping of LoadBalancer update stages. + */ + interface UpdateStages { + /** + * The stage of the loadbalancer update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Collection of backend address pools used by a load balancer + * @return the next update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the loadbalancer update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Object representing the frontend IPs to be used for the load balancer + * @return the next update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @param inboundNatPools Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next update stage + */ + Update withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @param inboundNatRules Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next update stage + */ + Update withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer update allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning + * @return the next update stage + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer update allowing to specify OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next update stage + */ + Update withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Collection of probe objects used in the load balancer + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the loadbalancer update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next update stage + */ + Update withSku(LoadBalancerSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerBackendAddressPools.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerBackendAddressPools.java new file mode 100644 index 0000000000000..280418727996b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerBackendAddressPools.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerBackendAddressPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerBackendAddressPools. + */ +public interface LoadBalancerBackendAddressPools extends HasInner { + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerFrontendIPConfigurations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerFrontendIPConfigurations.java new file mode 100644 index 0000000000000..d269450698897 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerFrontendIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerFrontendIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerFrontendIPConfigurations. + */ +public interface LoadBalancerFrontendIPConfigurations extends HasInner { + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerLoadBalancingRules.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerLoadBalancingRules.java new file mode 100644 index 0000000000000..9a577a77dc6a5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerLoadBalancingRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerLoadBalancingRules. + */ +public interface LoadBalancerLoadBalancingRules extends HasInner { + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterface.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterface.java new file mode 100644 index 0000000000000..2ba712ba212b2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterface.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancerNetworkInterface. + */ +public interface LoadBalancerNetworkInterface extends HasInner, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterfaces.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterfaces.java new file mode 100644 index 0000000000000..67aeed8bdb7d4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerNetworkInterfacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerNetworkInterfaces. + */ +public interface LoadBalancerNetworkInterfaces extends HasInner { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerProbes.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerProbes.java new file mode 100644 index 0000000000000..5cba706128265 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerProbes.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerProbesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerProbes. + */ +public interface LoadBalancerProbes extends HasInner { + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSku.java new file mode 100644 index 0000000000000..43b6e71dfd06d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a load balancer. + */ +public class LoadBalancerSku { + /** + * Name of a load balancer SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /** + * Get name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSkuName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSkuName.java new file mode 100644 index 0000000000000..cd13e708891e0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancerSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadBalancerSkuName. + */ +public final class LoadBalancerSkuName extends ExpandableStringEnum { + /** Static value Basic for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName BASIC = fromString("Basic"); + + /** Static value Standard for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * @param name a name to look for + * @return the corresponding LoadBalancerSkuName + */ + @JsonCreator + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** + * @return known LoadBalancerSkuName values + */ + public static Collection values() { + return values(LoadBalancerSkuName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancers.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancers.java new file mode 100644 index 0000000000000..b7ee4f358a16a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancers.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancers. + */ +public interface LoadBalancers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancingRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancingRule.java new file mode 100644 index 0000000000000..d4de50b61b7fd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadBalancingRule.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancingRule. + */ +public interface LoadBalancingRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the disableOutboundSnat value. + */ + Boolean disableOutboundSnat(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + int frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the probe value. + */ + SubResource probe(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadDistribution.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadDistribution.java new file mode 100644 index 0000000000000..c368f6c0d655f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LoadDistribution.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadDistribution. + */ +public final class LoadDistribution extends ExpandableStringEnum { + /** Static value Default for LoadDistribution. */ + public static final LoadDistribution DEFAULT = fromString("Default"); + + /** Static value SourceIP for LoadDistribution. */ + public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); + + /** Static value SourceIPProtocol for LoadDistribution. */ + public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); + + /** + * Creates or finds a LoadDistribution from its string representation. + * @param name a name to look for + * @return the corresponding LoadDistribution + */ + @JsonCreator + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** + * @return known LoadDistribution values + */ + public static Collection values() { + return values(LoadDistribution.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateway.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateway.java new file mode 100644 index 0000000000000..b1a33d4936bc6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateway.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LocalNetworkGatewayInner; + +/** + * Type representing LocalNetworkGateway. + */ +public interface LocalNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayIpAddress value. + */ + String gatewayIpAddress(); + + /** + * @return the localNetworkAddressSpace value. + */ + AddressSpace localNetworkAddressSpace(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the LocalNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LocalNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LocalNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LocalNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the localnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @param gatewayIpAddress IP address of local network gateway + * @return the next definition stage + */ + WithCreate withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @param localNetworkAddressSpace Local network site address space + * @return the next definition stage + */ + WithCreate withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithEtag, DefinitionStages.WithGatewayIpAddress, DefinitionStages.WithLocalNetworkAddressSpace, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a LocalNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithEtag, UpdateStages.WithGatewayIpAddress, UpdateStages.WithLocalNetworkAddressSpace, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of LocalNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the localnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway update allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @param gatewayIpAddress IP address of local network gateway + * @return the next update stage + */ + Update withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway update allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @param localNetworkAddressSpace Local network site address space + * @return the next update stage + */ + Update withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateways.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateways.java new file mode 100644 index 0000000000000..9650138e8b47f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LocalNetworkGateways.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LocalNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocalNetworkGateways. + */ +public interface LocalNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LogSpecification.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LogSpecification.java new file mode 100644 index 0000000000000..09e7a85604174 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of logging specification. + */ +public class LogSpecification { + /** + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name of the specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the specification. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the specification. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get duration of the blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the blob. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MatchedRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MatchedRule.java new file mode 100644 index 0000000000000..7de7a832e7211 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MatchedRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Matched rule. + */ +public class MatchedRule { + /** + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get name of the matched network security rule. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the matched network security rule. + * + * @param ruleName the ruleName value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @param action the action value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withAction(String action) { + this.action = action; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MetricSpecification.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MetricSpecification.java new file mode 100644 index 0000000000000..7fcc4609debc8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/MetricSpecification.java @@ -0,0 +1,382 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of metrics specification. + */ +public class MetricSpecification { + /** + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /** + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /** + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /** + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /** + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get units the metric to be displayed in. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set units the metric to be displayed in. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregation type. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get list of availability. + * + * @return the availabilities value + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set list of availability. + * + * @param availabilities the availabilities value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set whether regional MDM account enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set whether gaps would be filled with zeros. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get pattern for the filter of the metric. + * + * @return the metricFilterPattern value + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set pattern for the filter of the metric. + * + * @param metricFilterPattern the metricFilterPattern value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get list of dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set list of dimensions. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get whether the metric is internal. + * + * @return the isInternal value + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set whether the metric is internal. + * + * @param isInternal the isInternal value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the source MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the source MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the source MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resource Id dimension name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 0000000000000..39f0e1e885261 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to get network configuration diagnostic. + */ +public class NetworkConfigurationDiagnosticParameters { + /** + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * List of traffic queries. + */ + @JsonProperty(value = "queries", required = true) + private List queries; + + /** + * Get the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param targetResourceId the targetResourceId value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get list of traffic queries. + * + * @return the queries value + */ + public List queries() { + return this.queries; + } + + /** + * Set list of traffic queries. + * + * @param queries the queries value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withQueries(List queries) { + this.queries = queries; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResponse.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..122b52e5be16c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** + * Type representing NetworkConfigurationDiagnosticResponse. + */ +public interface NetworkConfigurationDiagnosticResponse extends HasInner, HasManager { + /** + * @return the results value. + */ + List results(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..a0ee4c1e1c545 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + */ +public class NetworkConfigurationDiagnosticResult { + /** + * The trafficQuery property. + */ + @JsonProperty(value = "trafficQuery") + private TrafficQuery trafficQuery; + + /** + * The networkSecurityGroupResult property. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the trafficQuery value. + * + * @return the trafficQuery value + */ + public TrafficQuery trafficQuery() { + return this.trafficQuery; + } + + /** + * Set the trafficQuery value. + * + * @param trafficQuery the trafficQuery value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withTrafficQuery(TrafficQuery trafficQuery) { + this.trafficQuery = trafficQuery; + return this; + } + + /** + * Get the networkSecurityGroupResult value. + * + * @return the networkSecurityGroupResult value + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult value. + * + * @param networkSecurityGroupResult the networkSecurityGroupResult value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult(NetworkSecurityGroupResult networkSecurityGroupResult) { + this.networkSecurityGroupResult = networkSecurityGroupResult; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterface.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterface.java new file mode 100644 index 0000000000000..4100de7fa27b1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterface.java @@ -0,0 +1,391 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceInner; + +/** + * Type representing NetworkInterface. + */ +public interface NetworkInterface extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + + /** + * The entirety of the NetworkInterface definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterface definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterface definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkInterface definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkinterface definition allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The DNS settings in network interface + * @return the next definition stage + */ + WithCreate withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface definition allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled + * @return the next definition stage + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface definition allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + * @param enableIPForwarding Indicates whether IP forwarding is enabled on this network interface + * @return the next definition stage + */ + WithCreate withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterface definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations A list of IPConfigurations of the network interface + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface definition allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next definition stage + */ + WithCreate withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface definition allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next definition stage + */ + WithCreate withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface definition allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + * @param virtualMachine The reference of a virtual machine + * @return the next definition stage + */ + WithCreate withVirtualMachine(SubResource virtualMachine); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEnableAcceleratedNetworking, DefinitionStages.WithEnableIPForwarding, DefinitionStages.WithEtag, DefinitionStages.WithIpConfigurations, DefinitionStages.WithMacAddress, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithPrimary, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithVirtualMachine { + } + } + /** + * The template for a NetworkInterface update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEnableAcceleratedNetworking, UpdateStages.WithEnableIPForwarding, UpdateStages.WithEtag, UpdateStages.WithIpConfigurations, UpdateStages.WithMacAddress, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithPrimary, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithVirtualMachine { + } + + /** + * Grouping of NetworkInterface update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterface update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The DNS settings in network interface + * @return the next update stage + */ + Update withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface update allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled + * @return the next update stage + */ + Update withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface update allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + * @param enableIPForwarding Indicates whether IP forwarding is enabled on this network interface + * @return the next update stage + */ + Update withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterface update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations A list of IPConfigurations of the network interface + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface update allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next update stage + */ + Update withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface update allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next update stage + */ + Update withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface update allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + * @param virtualMachine The reference of a virtual machine + * @return the next update stage + */ + Update withVirtualMachine(SubResource virtualMachine); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceAssociation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceAssociation.java new file mode 100644 index 0000000000000..b017e5aa74841 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class NetworkInterfaceAssociation { + /** + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get network interface ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the NetworkInterfaceAssociation object itself. + */ + public NetworkInterfaceAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceDnsSettings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceDnsSettings.java new file mode 100644 index 0000000000000..7fc6be8bffd65 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceDnsSettings.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS settings of a network interface. + */ +public class NetworkInterfaceDnsSettings { + /** + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers") + private List appliedDnsServers; + + /** + * Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /** + * Fully qualified DNS name supporting internal communications between VMs + * in the same virtual network. + */ + @JsonProperty(value = "internalFqdn") + private String internalFqdn; + + /** + * Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by + * concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix") + private String internalDomainNameSuffix; + + /** + * Get list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @param dnsServers the dnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @return the appliedDnsServers value + */ + public List appliedDnsServers() { + return this.appliedDnsServers; + } + + /** + * Set if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @param appliedDnsServers the appliedDnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withAppliedDnsServers(List appliedDnsServers) { + this.appliedDnsServers = appliedDnsServers; + return this; + } + + /** + * Get relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @return the internalDnsNameLabel value + */ + public String internalDnsNameLabel() { + return this.internalDnsNameLabel; + } + + /** + * Set relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @param internalDnsNameLabel the internalDnsNameLabel value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { + this.internalDnsNameLabel = internalDnsNameLabel; + return this; + } + + /** + * Get fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @return the internalFqdn value + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Set fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @param internalFqdn the internalFqdn value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalFqdn(String internalFqdn) { + this.internalFqdn = internalFqdn; + return this; + } + + /** + * Get even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @return the internalDomainNameSuffix value + */ + public String internalDomainNameSuffix() { + return this.internalDomainNameSuffix; + } + + /** + * Set even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @param internalDomainNameSuffix the internalDomainNameSuffix value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDomainNameSuffix(String internalDomainNameSuffix) { + this.internalDomainNameSuffix = internalDomainNameSuffix; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceIPConfigurations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceIPConfigurations.java new file mode 100644 index 0000000000000..c43d2b12f0e3c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceIPConfigurations. + */ +public interface NetworkInterfaceIPConfigurations extends HasInner { + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancer.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancer.java new file mode 100644 index 0000000000000..a2d9ef29aae3e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LoadBalancerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NetworkInterfaceLoadBalancer. + */ +public interface NetworkInterfaceLoadBalancer extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancers.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancers.java new file mode 100644 index 0000000000000..7e9bf09c57f5f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceLoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceLoadBalancers. + */ +public interface NetworkInterfaceLoadBalancers extends HasInner { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..3b1a380ccab4d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkInterfaceNetworkInterfaceIPConfiguration. + */ +public interface NetworkInterfaceNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaces.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaces.java new file mode 100644 index 0000000000000..64b9b46991606 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkInterfaces.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterface; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +/** + * Type representing NetworkInterfaces. + */ +public interface NetworkInterfaces { + /** + * Begins definition for a new NetworkInterface resource. + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank defineNetworkInterface(String name); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkOperationStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkOperationStatus.java new file mode 100644 index 0000000000000..dd54229d5bd0d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkOperationStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkOperationStatus. + */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkOperationStatus + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** + * @return known NetworkOperationStatus values + */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..8a8811e2890ee --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroup.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroup. + */ +public interface NetworkSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the defaultSecurityRules value. + */ + List defaultSecurityRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the securityRules value. + */ + List securityRules(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the NetworkSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networksecuritygroup definition allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next definition stage + */ + WithCreate withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next definition stage + */ + WithCreate withSecurityRules(List securityRules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDefaultSecurityRules, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSecurityRules { + } + } + /** + * The template for a NetworkSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDefaultSecurityRules, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSecurityRules { + } + + /** + * Grouping of NetworkSecurityGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroup update allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next update stage + */ + Update withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup update allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next update stage + */ + Update withSecurityRules(List securityRules); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..9118bfdc690fa --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupResult.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded provided traffic query. + */ +public class NetworkSecurityGroupResult { + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /** + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the securityRuleAccessResult value + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get list of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRule.java new file mode 100644 index 0000000000000..badd3f923340a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRule.java @@ -0,0 +1,590 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroupSecurityRule. + */ +public interface NetworkSecurityGroupSecurityRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * The entirety of the NetworkSecurityGroupSecurityRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithAccess, DefinitionStages.WithDirection, DefinitionStages.WithProtocol, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroupSecurityRule definition. + */ + interface Blank extends WithNetworkSecurityGroup { + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies resourceGroupName, networkSecurityGroupName. + * @param resourceGroupName The name of the resource group + * @param networkSecurityGroupName The name of the network security group + * @return the next definition stage + */ + WithAccess withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithDirection withAccess(SecurityRuleAccess access); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound' + * @return the next definition stage + */ + WithProtocol withDirection(SecurityRuleDirection direction); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + * @return the next definition stage + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used + * @return the next definition stage + */ + WithCreate withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next definition stage + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next definition stage + */ + WithCreate withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next definition stage + */ + WithCreate withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next definition stage + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule + * @return the next definition stage + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @param sourceAddressPrefix The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from + * @return the next definition stage + */ + WithCreate withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next definition stage + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next definition stage + */ + WithCreate withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next definition stage + */ + WithCreate withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next definition stage + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDestinationAddressPrefix, DefinitionStages.WithDestinationAddressPrefixes, DefinitionStages.WithDestinationApplicationSecurityGroups, DefinitionStages.WithDestinationPortRange, DefinitionStages.WithDestinationPortRanges, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPriority, DefinitionStages.WithProvisioningState, DefinitionStages.WithSourceAddressPrefix, DefinitionStages.WithSourceAddressPrefixes, DefinitionStages.WithSourceApplicationSecurityGroups, DefinitionStages.WithSourcePortRange, DefinitionStages.WithSourcePortRanges { + } + } + /** + * The template for a NetworkSecurityGroupSecurityRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDestinationAddressPrefix, UpdateStages.WithDestinationAddressPrefixes, UpdateStages.WithDestinationApplicationSecurityGroups, UpdateStages.WithDestinationPortRange, UpdateStages.WithDestinationPortRanges, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithProvisioningState, UpdateStages.WithSourceAddressPrefix, UpdateStages.WithSourceAddressPrefixes, UpdateStages.WithSourceApplicationSecurityGroups, UpdateStages.WithSourcePortRange, UpdateStages.WithSourcePortRanges { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used + * @return the next update stage + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next update stage + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next update stage + */ + Update withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next update stage + */ + Update withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next update stage + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule + * @return the next update stage + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @param sourceAddressPrefix The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from + * @return the next update stage + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next update stage + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next update stage + */ + Update withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next update stage + */ + Update withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next update stage + */ + Update withSourcePortRanges(List sourcePortRanges); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRuleModel.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRuleModel.java new file mode 100644 index 0000000000000..d7d57fb562acc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroupSecurityRuleModel.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkSecurityGroupSecurityRuleModel. + */ +public interface NetworkSecurityGroupSecurityRuleModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroups.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroups.java new file mode 100644 index 0000000000000..3295a3ad1be08 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkSecurityGroups. + */ +public interface NetworkSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityRulesEvaluationResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 0000000000000..a440ccc15234b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network security rules evaluation result. + */ +public class NetworkSecurityRulesEvaluationResult { + /** + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /** + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /** + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /** + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /** + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get name of the network security rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network security rule. + * + * @param name the name value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get value indicating whether protocol is matched. + * + * @return the protocolMatched value + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set value indicating whether protocol is matched. + * + * @param protocolMatched the protocolMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { + this.protocolMatched = protocolMatched; + return this; + } + + /** + * Get value indicating whether source is matched. + * + * @return the sourceMatched value + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set value indicating whether source is matched. + * + * @param sourceMatched the sourceMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { + this.sourceMatched = sourceMatched; + return this; + } + + /** + * Get value indicating whether source port is matched. + * + * @return the sourcePortMatched value + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set value indicating whether source port is matched. + * + * @param sourcePortMatched the sourcePortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { + this.sourcePortMatched = sourcePortMatched; + return this; + } + + /** + * Get value indicating whether destination is matched. + * + * @return the destinationMatched value + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set value indicating whether destination is matched. + * + * @param destinationMatched the destinationMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { + this.destinationMatched = destinationMatched; + return this; + } + + /** + * Get value indicating whether destination port is matched. + * + * @return the destinationPortMatched value + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set value indicating whether destination port is matched. + * + * @param destinationPortMatched the destinationPortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { + this.destinationPortMatched = destinationPortMatched; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatcher.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatcher.java new file mode 100644 index 0000000000000..b843729709155 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatcher.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkWatcherInner; + +/** + * Type representing NetworkWatcher. + */ +public interface NetworkWatcher extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the NetworkWatcher definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkWatcher definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkWatcher definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkWatcher definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkwatcher definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag { + } + } + /** + * The template for a NetworkWatcher update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag { + } + + /** + * Grouping of NetworkWatcher update stages. + */ + interface UpdateStages { + /** + * The stage of the networkwatcher update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatchers.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatchers.java new file mode 100644 index 0000000000000..3094957a68f2c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NetworkWatchers.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.FlowLogInformationInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkWatchersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkWatchers. + */ +public interface NetworkWatchers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopParameters.java new file mode 100644 index 0000000000000..563b7f149ec49 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source and destination endpoint. + */ +public class NextHopParameters { + /** + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIPAddress; + + /** + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the resource identifier of the target resource against which the action is to be performed. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the resource identifier of the target resource against which the action is to be performed. + * + * @param targetResourceId the targetResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the source IP address. + * + * @return the sourceIPAddress value + */ + public String sourceIPAddress() { + return this.sourceIPAddress; + } + + /** + * Set the source IP address. + * + * @param sourceIPAddress the sourceIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withSourceIPAddress(String sourceIPAddress) { + this.sourceIPAddress = sourceIPAddress; + return this; + } + + /** + * Get the destination IP address. + * + * @return the destinationIPAddress value + */ + public String destinationIPAddress() { + return this.destinationIPAddress; + } + + /** + * Set the destination IP address. + * + * @param destinationIPAddress the destinationIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withDestinationIPAddress(String destinationIPAddress) { + this.destinationIPAddress = destinationIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopResult.java new file mode 100644 index 0000000000000..abad06f75e285 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NextHopResultInner; + +/** + * Type representing NextHopResult. + */ +public interface NextHopResult extends HasInner, HasManager { + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * @return the routeTableId value. + */ + String routeTableId(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopType.java new file mode 100644 index 0000000000000..0c67665c33c76 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/NextHopType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NextHopType. + */ +public final class NextHopType extends ExpandableStringEnum { + /** Static value Internet for NextHopType. */ + public static final NextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for NextHopType. */ + public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value VirtualNetworkGateway for NextHopType. */ + public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for NextHopType. */ + public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value HyperNetGateway for NextHopType. */ + public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); + + /** Static value None for NextHopType. */ + public static final NextHopType NONE = fromString("None"); + + /** + * Creates or finds a NextHopType from its string representation. + * @param name a name to look for + * @return the corresponding NextHopType + */ + @JsonCreator + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** + * @return known NextHopType values + */ + public static Collection values() { + return values(NextHopType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operation.java new file mode 100644 index 0000000000000..a4535fcaab662 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationDisplay.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationDisplay.java new file mode 100644 index 0000000000000..e27b52854eb69 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Network. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Network. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of the operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of the operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationPropertiesFormatServiceSpecification.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 0000000000000..4404089260de3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specification of the service. + */ +public class OperationPropertiesFormatServiceSpecification { + /** + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get operation service specification. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set operation service specification. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get operation log specification. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set operation log specification. + * + * @param logSpecifications the logSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operations.java new file mode 100644 index 0000000000000..43e6d3786cada --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Origin.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Origin.java new file mode 100644 index 0000000000000..ad6849c81c1b4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Origin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Origin. + */ +public final class Origin extends ExpandableStringEnum { + /** Static value Local for Origin. */ + public static final Origin LOCAL = fromString("Local"); + + /** Static value Inbound for Origin. */ + public static final Origin INBOUND = fromString("Inbound"); + + /** Static value Outbound for Origin. */ + public static final Origin OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Origin from its string representation. + * @param name a name to look for + * @return the corresponding Origin + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * @return known Origin values + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OutboundRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OutboundRule.java new file mode 100644 index 0000000000000..40ca53f40983f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/OutboundRule.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Outbound pool of the load balancer. + */ +@JsonFlatten +public class OutboundRule extends SubResource { + /** + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "properties.allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /** + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations", required = true) + private List frontendIPConfigurations; + + /** + * A reference to a pool of DIPs. Outbound traffic is randomly load + * balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool", required = true) + private SubResource backendAddressPool; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', + * 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private String protocol; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * The timeout for the TCP idle connection. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the number of outbound ports to be used for NAT. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the Frontend IP addresses of the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set the Frontend IP addresses of the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the OutboundRule object itself. + */ + public OutboundRule withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureFilter.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureFilter.java new file mode 100644 index 0000000000000..1cdf06433be80 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureFilter.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + */ +public class PacketCaptureFilter { + /** + * Protocol to be filtered on. Possible values include: 'TCP', 'UDP', + * 'Any'. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIPAddress; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIPAddress; + + /** + * Local port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /** + * Remote port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** + * Get protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @return the protocol value + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @param protocol the protocol value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localIPAddress the localIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localPort the localPort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remotePort the remotePort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureParameters.java new file mode 100644 index 0000000000000..051dc0befc1b9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureParameters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the create packet capture operation. + */ +public class PacketCaptureParameters { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureQueryStatusResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureQueryStatusResult.java new file mode 100644 index 0000000000000..b76d30ccb5d96 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureQueryStatusResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PacketCaptureQueryStatusResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PacketCaptureQueryStatusResult. + */ +public interface PacketCaptureQueryStatusResult extends HasInner, HasManager { + /** + * @return the captureStartTime value. + */ + DateTime captureStartTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * @return the stopReason value. + */ + String stopReason(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureResult.java new file mode 100644 index 0000000000000..463f5cd01704f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureResult.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PacketCaptureResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing PacketCaptureResult. + */ +public interface PacketCaptureResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the bytesToCapturePerPacket value. + */ + Integer bytesToCapturePerPacket(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the filters value. + */ + List filters(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * @return the totalBytesPerSession value. + */ + Integer totalBytesPerSession(); + + /** + * The entirety of the PacketCaptureResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithStorageLocation, DefinitionStages.WithTarget, DefinitionStages.WithCreate { + } + + /** + * Grouping of PacketCaptureResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PacketCaptureResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the packetcaptureresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + * @param resourceGroupName The name of the resource group + * @param networkWatcherName The name of the network watcher + * @return the next definition stage + */ + WithStorageLocation withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify StorageLocation. + */ + interface WithStorageLocation { + /** + * Specifies storageLocation. + * @param storageLocation the storageLocation parameter value + * @return the next definition stage + */ + WithTarget withStorageLocation(PacketCaptureStorageLocation storageLocation); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Target. + */ + interface WithTarget { + /** + * Specifies target. + * @param target The ID of the targeted resource, only VM is currently supported + * @return the next definition stage + */ + WithCreate withTarget(String target); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next definition stage + */ + WithCreate withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters the filters parameter value + * @return the next definition stage + */ + WithCreate withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next definition stage + */ + WithCreate withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next definition stage + */ + WithCreate withTotalBytesPerSession(Integer totalBytesPerSession); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBytesToCapturePerPacket, DefinitionStages.WithFilters, DefinitionStages.WithTimeLimitInSeconds, DefinitionStages.WithTotalBytesPerSession { + } + } + /** + * The template for a PacketCaptureResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBytesToCapturePerPacket, UpdateStages.WithFilters, UpdateStages.WithTimeLimitInSeconds, UpdateStages.WithTotalBytesPerSession { + } + + /** + * Grouping of PacketCaptureResult update stages. + */ + interface UpdateStages { + /** + * The stage of the packetcaptureresult update allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next update stage + */ + Update withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult update allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters the filters parameter value + * @return the next update stage + */ + Update withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next update stage + */ + Update withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next update stage + */ + Update withTotalBytesPerSession(Integer totalBytesPerSession); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureStorageLocation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureStorageLocation.java new file mode 100644 index 0000000000000..cc3bf94d0480b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptureStorageLocation.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the storage location for a packet capture session. + */ +public class PacketCaptureStorageLocation { + /** + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /** + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /** + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @param storageId the storageId value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @param filePath the filePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptures.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptures.java new file mode 100644 index 0000000000000..d6ed2ed6b34d1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PacketCaptures.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PacketCapturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PacketCaptures. + */ +public interface PacketCaptures extends SupportsCreating, HasInner { + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilter.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilter.java new file mode 100644 index 0000000000000..3ed3799cbe9da --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilter.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitPeeringInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +public class PatchRouteFilter extends SubResource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilterRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilterRule.java new file mode 100644 index 0000000000000..4cfa1451eaf3b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PatchRouteFilterRule.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class PatchRouteFilterRule extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of PatchRouteFilterRule class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public PatchRouteFilterRule() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcError.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcError.java new file mode 100644 index 0000000000000..ef2e116ce805c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcError.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcError. + */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates or finds a PcError from its string representation. + * @param name a name to look for + * @return the corresponding PcError + */ + @JsonCreator + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** + * @return known PcError values + */ + public static Collection values() { + return values(PcError.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcProtocol.java new file mode 100644 index 0000000000000..eb634dda9d27c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcProtocol. + */ +public final class PcProtocol extends ExpandableStringEnum { + /** Static value TCP for PcProtocol. */ + public static final PcProtocol TCP = fromString("TCP"); + + /** Static value UDP for PcProtocol. */ + public static final PcProtocol UDP = fromString("UDP"); + + /** Static value Any for PcProtocol. */ + public static final PcProtocol ANY = fromString("Any"); + + /** + * Creates or finds a PcProtocol from its string representation. + * @param name a name to look for + * @return the corresponding PcProtocol + */ + @JsonCreator + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** + * @return known PcProtocol values + */ + public static Collection values() { + return values(PcProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcStatus.java new file mode 100644 index 0000000000000..3f08a957a64d6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PcStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcStatus. + */ +public final class PcStatus extends ExpandableStringEnum { + /** Static value NotStarted for PcStatus. */ + public static final PcStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PcStatus. */ + public static final PcStatus RUNNING = fromString("Running"); + + /** Static value Stopped for PcStatus. */ + public static final PcStatus STOPPED = fromString("Stopped"); + + /** Static value Error for PcStatus. */ + public static final PcStatus ERROR = fromString("Error"); + + /** Static value Unknown for PcStatus. */ + public static final PcStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PcStatus from its string representation. + * @param name a name to look for + * @return the corresponding PcStatus + */ + @JsonCreator + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** + * @return known PcStatus values + */ + public static Collection values() { + return values(PcStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PfsGroup.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PfsGroup.java new file mode 100644 index 0000000000000..421b8437fa9e0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PfsGroup.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PfsGroup. + */ +public final class PfsGroup extends ExpandableStringEnum { + /** Static value None for PfsGroup. */ + public static final PfsGroup NONE = fromString("None"); + + /** Static value PFS1 for PfsGroup. */ + public static final PfsGroup PFS1 = fromString("PFS1"); + + /** Static value PFS2 for PfsGroup. */ + public static final PfsGroup PFS2 = fromString("PFS2"); + + /** Static value PFS2048 for PfsGroup. */ + public static final PfsGroup PFS2048 = fromString("PFS2048"); + + /** Static value ECP256 for PfsGroup. */ + public static final PfsGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for PfsGroup. */ + public static final PfsGroup ECP384 = fromString("ECP384"); + + /** Static value PFS24 for PfsGroup. */ + public static final PfsGroup PFS24 = fromString("PFS24"); + + /** Static value PFS14 for PfsGroup. */ + public static final PfsGroup PFS14 = fromString("PFS14"); + + /** Static value PFSMM for PfsGroup. */ + public static final PfsGroup PFSMM = fromString("PFSMM"); + + /** + * Creates or finds a PfsGroup from its string representation. + * @param name a name to look for + * @return the corresponding PfsGroup + */ + @JsonCreator + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** + * @return known PfsGroup values + */ + public static Collection values() { + return values(PfsGroup.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Policies.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Policies.java new file mode 100644 index 0000000000000..7601380eb876c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Policies.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Policies for vpn gateway. + */ +public class Policies { + /** + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /** + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /** + * Get true if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set true if branch to branch traffic is allowed. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set + * @return the Policies object itself. + */ + public Policies withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get true if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value + */ + public Boolean allowVnetToVnetTraffic() { + return this.allowVnetToVnetTraffic; + } + + /** + * Set true if Vnet to Vnet traffic is allowed. + * + * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set + * @return the Policies object itself. + */ + public Policies withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Probe.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Probe.java new file mode 100644 index 0000000000000..28fd36668a64e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Probe.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ProbeInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing Probe. + */ +public interface Probe extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the intervalInSeconds value. + */ + Integer intervalInSeconds(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the numberOfProbes value. + */ + Integer numberOfProbes(); + + /** + * @return the port value. + */ + int port(); + + /** + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the requestPath value. + */ + String requestPath(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProbeProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProbeProtocol.java new file mode 100644 index 0000000000000..aeb3c8060be12 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProbeProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProbeProtocol. + */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value Http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("Http"); + + /** Static value Tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("Tcp"); + + /** Static value Https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ProbeProtocol + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** + * @return known ProbeProtocol values + */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProcessorArchitecture.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProcessorArchitecture.java new file mode 100644 index 0000000000000..f8c495752dcb0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProcessorArchitecture.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProcessorArchitecture. + */ +public final class ProcessorArchitecture extends ExpandableStringEnum { + /** Static value Amd64 for ProcessorArchitecture. */ + public static final ProcessorArchitecture AMD64 = fromString("Amd64"); + + /** Static value X86 for ProcessorArchitecture. */ + public static final ProcessorArchitecture X86 = fromString("X86"); + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * @param name a name to look for + * @return the corresponding ProcessorArchitecture + */ + @JsonCreator + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** + * @return known ProcessorArchitecture values + */ + public static Collection values() { + return values(ProcessorArchitecture.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Protocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Protocol.java new file mode 100644 index 0000000000000..2c06b70828c4c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Protocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Protocol. + */ +public final class Protocol extends ExpandableStringEnum { + /** Static value Tcp for Protocol. */ + public static final Protocol TCP = fromString("Tcp"); + + /** Static value Http for Protocol. */ + public static final Protocol HTTP = fromString("Http"); + + /** Static value Https for Protocol. */ + public static final Protocol HTTPS = fromString("Https"); + + /** Static value Icmp for Protocol. */ + public static final Protocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a Protocol from its string representation. + * @param name a name to look for + * @return the corresponding Protocol + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * @return known Protocol values + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProtocolConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProtocolConfiguration.java new file mode 100644 index 0000000000000..e94bd1571bea9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProtocolConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration of the protocol. + */ +public class ProtocolConfiguration { + /** + * The hTTPConfiguration property. + */ + @JsonProperty(value = "HTTPConfiguration") + private HTTPConfiguration hTTPConfiguration; + + /** + * Get the hTTPConfiguration value. + * + * @return the hTTPConfiguration value + */ + public HTTPConfiguration hTTPConfiguration() { + return this.hTTPConfiguration; + } + + /** + * Set the hTTPConfiguration value. + * + * @param hTTPConfiguration the hTTPConfiguration value to set + * @return the ProtocolConfiguration object itself. + */ + public ProtocolConfiguration withHTTPConfiguration(HTTPConfiguration hTTPConfiguration) { + this.hTTPConfiguration = hTTPConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProvisioningState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProvisioningState.java new file mode 100644 index 0000000000000..9620da9456884 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddress.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddress.java new file mode 100644 index 0000000000000..7ce63f477a8eb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddress.java @@ -0,0 +1,423 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PublicIPAddressInner; + +/** + * Type representing PublicIPAddress. + */ +public interface PublicIPAddress extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + PublicIPAddressDnsSettings dnsSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the ipConfiguration value. + */ + IPConfiguration ipConfiguration(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the publicIPAllocationMethod value. + */ + IPAllocationMethod publicIPAllocationMethod(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPAddressSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPAddress definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPAddress definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPAddress definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPAddress definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipaddress definition allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The FQDN of the DNS record associated with the public IP address + * @return the next definition stage + */ + WithCreate withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipaddress definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the public IP address + * @return the next definition stage + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress definition allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address associated with the public IP address resource + * @return the next definition stage + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress definition allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP address + * @return the next definition stage + */ + WithCreate withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @return the next definition stage + */ + WithCreate withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @param publicIPPrefix The Public IP Prefix this Public IP Address should be allocated from + * @return the next definition stage + */ + WithCreate withPublicIPPrefix(SubResource publicIPPrefix); + } + + /** + * The stage of the publicipaddress definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP address SKU + * @return the next definition stage + */ + WithCreate withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEtag, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithIpAddress, DefinitionStages.WithIpTags, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithPublicIPAllocationMethod, DefinitionStages.WithPublicIPPrefix, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPAddress update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEtag, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithIpAddress, UpdateStages.WithIpTags, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithPublicIPAllocationMethod, UpdateStages.WithPublicIPPrefix, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPAddress update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipaddress update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The FQDN of the DNS record associated with the public IP address + * @return the next update stage + */ + Update withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipaddress update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the public IP address + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address associated with the public IP address resource + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP address + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @return the next update stage + */ + Update withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @param publicIPPrefix The Public IP Prefix this Public IP Address should be allocated from + * @return the next update stage + */ + Update withPublicIPPrefix(SubResource publicIPPrefix); + } + + /** + * The stage of the publicipaddress update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP address SKU + * @return the next update stage + */ + Update withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressDnsSettings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressDnsSettings.java new file mode 100644 index 0000000000000..379e95c3a72bd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressDnsSettings.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains FQDN of the DNS record associated with the public IP address. + */ +public class PublicIPAddressDnsSettings { + /** + * Gets or sets the Domain name label.The concatenation of the domain name + * label and the regionalized DNS zone make up the fully qualified domain + * name associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /** + * Gets the FQDN, Fully qualified domain name of the A DNS record + * associated with the public IP. This is the concatenation of the + * domainNameLabel and the regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain + * name that resolves to this public IP address. If the reverseFqdn is + * specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** + * Get gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @return the domainNameLabel value + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @param domainNameLabel the domainNameLabel value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSku.java new file mode 100644 index 0000000000000..1a96bba0e0845 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP address. + */ +public class PublicIPAddressSku { + /** + * Name of a public IP address SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPAddressSkuName name; + + /** + * Get name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public PublicIPAddressSkuName name() { + return this.name; + } + + /** + * Set name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the PublicIPAddressSku object itself. + */ + public PublicIPAddressSku withName(PublicIPAddressSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSkuName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSkuName.java new file mode 100644 index 0000000000000..b4a89c4031346 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddressSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicIPAddressSkuName. + */ +public final class PublicIPAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIPAddressSkuName from its string representation. + * @param name a name to look for + * @return the corresponding PublicIPAddressSkuName + */ + @JsonCreator + public static PublicIPAddressSkuName fromString(String name) { + return fromString(name, PublicIPAddressSkuName.class); + } + + /** + * @return known PublicIPAddressSkuName values + */ + public static Collection values() { + return values(PublicIPAddressSkuName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddresses.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddresses.java new file mode 100644 index 0000000000000..3dae57b65c084 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPAddresses.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PublicIPAddressesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPAddresses. + */ +public interface PublicIPAddresses extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefix.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefix.java new file mode 100644 index 0000000000000..c1df5029cc8df --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefix.java @@ -0,0 +1,359 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PublicIPPrefixInner; + +/** + * Type representing PublicIPPrefix. + */ +public interface PublicIPPrefix extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipPrefix value. + */ + String ipPrefix(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the prefixLength value. + */ + Integer prefixLength(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddresses value. + */ + List publicIPAddresses(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPPrefixSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPPrefix definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPPrefix definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPPrefix definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPPrefix definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipprefix definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next definition stage + */ + WithCreate withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP prefix + * @return the next definition stage + */ + WithCreate withIpTags(List ipTags); + } + + /** + * The stage of the publicipprefix definition allowing to specify PrefixLength. + */ + interface WithPrefixLength { + /** + * Specifies prefixLength. + * @param prefixLength The Length of the Public IP Prefix + * @return the next definition stage + */ + WithCreate withPrefixLength(Integer prefixLength); + } + + /** + * The stage of the publicipprefix definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next definition stage + */ + WithCreate withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP prefix SKU + * @return the next definition stage + */ + WithCreate withSku(PublicIPPrefixSku sku); + } + + /** + * The stage of the publicipprefix definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithIpPrefix, DefinitionStages.WithIpTags, DefinitionStages.WithPrefixLength, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddresses, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPPrefix update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithIpPrefix, UpdateStages.WithIpTags, UpdateStages.WithPrefixLength, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddresses, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPPrefix update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipprefix update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipprefix update allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next update stage + */ + Update withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP prefix + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipprefix update allowing to specify PrefixLength. + */ + interface WithPrefixLength { + /** + * Specifies prefixLength. + * @param prefixLength The Length of the Public IP Prefix + * @return the next update stage + */ + Update withPrefixLength(Integer prefixLength); + } + + /** + * The stage of the publicipprefix update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next update stage + */ + Update withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP prefix SKU + * @return the next update stage + */ + Update withSku(PublicIPPrefixSku sku); + } + + /** + * The stage of the publicipprefix update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSku.java new file mode 100644 index 0000000000000..db46afc089764 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP prefix. + */ +public class PublicIPPrefixSku { + /** + * Name of a public IP prefix SKU. Possible values include: 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPPrefixSkuName name; + + /** + * Get name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @return the name value + */ + public PublicIPPrefixSkuName name() { + return this.name; + } + + /** + * Set name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @param name the name value to set + * @return the PublicIPPrefixSku object itself. + */ + public PublicIPPrefixSku withName(PublicIPPrefixSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSkuName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSkuName.java new file mode 100644 index 0000000000000..79aacd982e3d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixSkuName.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicIPPrefixSkuName. + */ +public final class PublicIPPrefixSkuName extends ExpandableStringEnum { + /** Static value Standard for PublicIPPrefixSkuName. */ + public static final PublicIPPrefixSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIPPrefixSkuName from its string representation. + * @param name a name to look for + * @return the corresponding PublicIPPrefixSkuName + */ + @JsonCreator + public static PublicIPPrefixSkuName fromString(String name) { + return fromString(name, PublicIPPrefixSkuName.class); + } + + /** + * @return known PublicIPPrefixSkuName values + */ + public static Collection values() { + return values(PublicIPPrefixSkuName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixes.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixes.java new file mode 100644 index 0000000000000..378eea06f5048 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/PublicIPPrefixes.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.PublicIPPrefixesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPPrefixes. + */ +public interface PublicIPPrefixes extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/QueryTroubleshootingParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/QueryTroubleshootingParameters.java new file mode 100644 index 0000000000000..ff0c594be0fe2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/QueryTroubleshootingParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the resource to query the troubleshooting result. + */ +public class QueryTroubleshootingParameters { + /** + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource ID to query the troubleshooting result. + * + * @param targetResourceId the targetResourceId value to set + * @return the QueryTroubleshootingParameters object itself. + */ + public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ReferencedPublicIpAddress.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ReferencedPublicIpAddress.java new file mode 100644 index 0000000000000..462028461b36d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ReferencedPublicIpAddress.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ReferencedPublicIpAddress model. + */ +public class ReferencedPublicIpAddress { + /** + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the PublicIPAddress Reference. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the PublicIPAddress Reference. + * + * @param id the id value to set + * @return the ReferencedPublicIpAddress object itself. + */ + public ReferencedPublicIpAddress withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ResourceNavigationLink.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ResourceNavigationLink.java new file mode 100644 index 0000000000000..282a75003e1d3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ResourceNavigationLink.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ResourceNavigationLink resource. + */ +@JsonFlatten +public class ResourceNavigationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ResourceNavigationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ResourceNavigationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RetentionPolicyParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RetentionPolicyParameters.java new file mode 100644 index 0000000000000..26a9344960737 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RetentionPolicyParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the retention policy for flow log. + */ +public class RetentionPolicyParameters { + /** + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get number of days to retain flow log records. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set number of days to retain flow log records. + * + * @param days the days value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get flag to enable/disable retention. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable retention. + * + * @param enabled the enabled value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Route.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Route.java new file mode 100644 index 0000000000000..4ba7cae9570d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Route.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing Route. + */ +public interface Route extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the Route definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteTable, DefinitionStages.WithNextHopType, DefinitionStages.WithCreate { + } + + /** + * Grouping of Route definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Route definition. + */ + interface Blank extends WithRouteTable { + } + + /** + * The stage of the route definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies resourceGroupName, routeTableName. + * @param resourceGroupName The name of the resource group + * @param routeTableName The name of the route table + * @return the next definition stage + */ + WithNextHopType withExistingRouteTable(String resourceGroupName, String routeTableName); + } + + /** + * The stage of the route definition allowing to specify NextHopType. + */ + interface WithNextHopType { + /** + * Specifies nextHopType. + * @param nextHopType The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + * @return the next definition stage + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + + /** + * The stage of the route definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The destination CIDR to which the route applies + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the route definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the route definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the route definition allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance + * @return the next definition stage + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNextHopIpAddress, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a Route update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNextHopIpAddress, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of Route update stages. + */ + interface UpdateStages { + /** + * The stage of the route update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The destination CIDR to which the route applies + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the route update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the route update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the route update allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance + * @return the next update stage + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilter.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilter.java new file mode 100644 index 0000000000000..137a4f2bee299 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilter.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterInner; + +/** + * Type representing RouteFilter. + */ +public interface RouteFilter extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rules value. + */ + List rules(); + + /** + * The entirety of the RouteFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilter definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteFilter definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routefilter definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the routefilter definition allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next definition stage + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithPeerings, DefinitionStages.WithRules { + } + } + /** + * The template for a RouteFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithPeerings, UpdateStages.WithRules { + } + + /** + * Grouping of RouteFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilter update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the routefilter update allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next update stage + */ + Update withRules(List rules); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRule.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRule.java new file mode 100644 index 0000000000000..a4f136ee1ec22 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRule.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing RouteFilterRule. + */ +public interface RouteFilterRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the communities value. + */ + List communities(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilterRuleType value. + */ + String routeFilterRuleType(); + + /** + * The entirety of the RouteFilterRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteFilter, DefinitionStages.WithAccess, DefinitionStages.WithCommunities, DefinitionStages.WithRouteFilterRuleType, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilterRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilterRule definition. + */ + interface Blank extends WithRouteFilter { + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies resourceGroupName, routeFilterName. + * @param resourceGroupName The name of the resource group + * @param routeFilterName The name of the route filter + * @return the next definition stage + */ + WithAccess withExistingRouteFilter(String resourceGroupName, String routeFilterName); + } + + /** + * The stage of the routefilterrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithCommunities withAccess(Access access); + } + + /** + * The stage of the routefilterrule definition allowing to specify Communities. + */ + interface WithCommunities { + /** + * Specifies communities. + * @param communities The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020'] + * @return the next definition stage + */ + WithRouteFilterRuleType withCommunities(List communities); + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilterRuleType. + */ + interface WithRouteFilterRuleType { + /** + * Specifies routeFilterRuleType. + * @param routeFilterRuleType The rule type of the rule. Valid value is: 'Community' + * @return the next definition stage + */ + WithCreate withRouteFilterRuleType(String routeFilterRuleType); + } + + /** + * The stage of the routefilterrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the routefilterrule definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the routefilterrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a RouteFilterRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId { + } + + /** + * Grouping of RouteFilterRule update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilterrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRules.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRules.java new file mode 100644 index 0000000000000..ec296114324d6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilterRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFilterRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilterRules. + */ +public interface RouteFilterRules extends SupportsCreating, HasInner { + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilters.java new file mode 100644 index 0000000000000..c1bcf5e142112 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteFilters.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilters. + */ +public interface RouteFilters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteNextHopType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteNextHopType.java new file mode 100644 index 0000000000000..8327c64f1d610 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteNextHopType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RouteNextHopType. + */ +public final class RouteNextHopType extends ExpandableStringEnum { + /** Static value VirtualNetworkGateway for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for RouteNextHopType. */ + public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value Internet for RouteNextHopType. */ + public static final RouteNextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value None for RouteNextHopType. */ + public static final RouteNextHopType NONE = fromString("None"); + + /** + * Creates or finds a RouteNextHopType from its string representation. + * @param name a name to look for + * @return the corresponding RouteNextHopType + */ + @JsonCreator + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** + * @return known RouteNextHopType values + */ + public static Collection values() { + return values(RouteNextHopType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTable.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTable.java new file mode 100644 index 0000000000000..ca00b77807212 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTable.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteTableInner; + +/** + * Type representing RouteTable. + */ +public interface RouteTable extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableBgpRoutePropagation value. + */ + Boolean disableBgpRoutePropagation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routes value. + */ + List routes(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the RouteTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteTable definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteTable definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routetable definition allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next definition stage + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the routetable definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable definition allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next definition stage + */ + WithCreate withRoutes(List routes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableBgpRoutePropagation, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithRoutes { + } + } + /** + * The template for a RouteTable update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableBgpRoutePropagation, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithRoutes { + } + + /** + * Grouping of RouteTable update stages. + */ + interface UpdateStages { + /** + * The stage of the routetable update allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next update stage + */ + Update withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the routetable update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable update allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next update stage + */ + Update withRoutes(List routes); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTables.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTables.java new file mode 100644 index 0000000000000..09fcbb6b38daa --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/RouteTables.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteTablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteTables. + */ +public interface RouteTables extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Routes.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Routes.java new file mode 100644 index 0000000000000..60b41a2b735ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Routes.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RoutesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Routes. + */ +public interface Routes extends SupportsCreating, HasInner { + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String routeTableName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupNetworkInterface.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupNetworkInterface.java new file mode 100644 index 0000000000000..705d96d6b58e9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupNetworkInterface.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and all its associated security rules. + */ +public class SecurityGroupNetworkInterface { + /** + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The securityRuleAssociations property. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get iD of the network interface. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the network interface. + * + * @param id the id value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withId(String id) { + this.id = id; + return this; + } + + /** + * Get the securityRuleAssociations value. + * + * @return the securityRuleAssociations value + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set the securityRuleAssociations value. + * + * @param securityRuleAssociations the securityRuleAssociations value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withSecurityRuleAssociations(SecurityRuleAssociations securityRuleAssociations) { + this.securityRuleAssociations = securityRuleAssociations; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewParameters.java new file mode 100644 index 0000000000000..89cbe4b7f92e4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the VM to check security groups for. + */ +public class SecurityGroupViewParameters { + /** + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get iD of the target VM. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set iD of the target VM. + * + * @param targetResourceId the targetResourceId value to set + * @return the SecurityGroupViewParameters object itself. + */ + public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..4eff7a114e24e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityGroupViewResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityGroupViewResultInner; +import java.util.List; + +/** + * Type representing SecurityGroupViewResult. + */ +public interface SecurityGroupViewResult extends HasInner, HasManager { + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAccess.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAccess.java new file mode 100644 index 0000000000000..d275d112868c9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAccess.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleAccess. + */ +public final class SecurityRuleAccess extends ExpandableStringEnum { + /** Static value Allow for SecurityRuleAccess. */ + public static final SecurityRuleAccess ALLOW = fromString("Allow"); + + /** Static value Deny for SecurityRuleAccess. */ + public static final SecurityRuleAccess DENY = fromString("Deny"); + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleAccess + */ + @JsonCreator + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** + * @return known SecurityRuleAccess values + */ + public static Collection values() { + return values(SecurityRuleAccess.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAssociations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAssociations.java new file mode 100644 index 0000000000000..29c44660a64e6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleAssociations.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * All security rules associated with the network interface. + */ +public class SecurityRuleAssociations { + /** + * The networkInterfaceAssociation property. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /** + * The subnetAssociation property. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /** + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /** + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get the networkInterfaceAssociation value. + * + * @return the networkInterfaceAssociation value + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set the networkInterfaceAssociation value. + * + * @param networkInterfaceAssociation the networkInterfaceAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withNetworkInterfaceAssociation(NetworkInterfaceAssociation networkInterfaceAssociation) { + this.networkInterfaceAssociation = networkInterfaceAssociation; + return this; + } + + /** + * Get the subnetAssociation value. + * + * @return the subnetAssociation value + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set the subnetAssociation value. + * + * @param subnetAssociation the subnetAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { + this.subnetAssociation = subnetAssociation; + return this; + } + + /** + * Get collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set collection of default security rules of the network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleDirection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleDirection.java new file mode 100644 index 0000000000000..2e923e41b3300 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleDirection.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleDirection. + */ +public final class SecurityRuleDirection extends ExpandableStringEnum { + /** Static value Inbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleDirection + */ + @JsonCreator + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** + * @return known SecurityRuleDirection values + */ + public static Collection values() { + return values(SecurityRuleDirection.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleProtocol.java new file mode 100644 index 0000000000000..3858c774c906e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleProtocol. + */ +public final class SecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value * for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ASTERISK = fromString("*"); + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleProtocol + */ + @JsonCreator + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** + * @return known SecurityRuleProtocol values + */ + public static Collection values() { + return values(SecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRules.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRules.java new file mode 100644 index 0000000000000..5c6f798d32960 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SecurityRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SecurityRules. + */ +public interface SecurityRules extends SupportsCreating, HasInner { + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicies.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..1870459c44631 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicies.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicies. + */ +public interface ServiceEndpointPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicy.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicy.java new file mode 100644 index 0000000000000..48b41d2fb15a8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicy.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing ServiceEndpointPolicy. + */ +public interface ServiceEndpointPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the serviceEndpointPolicyDefinitions value. + */ + List serviceEndpointPolicyDefinitions(); + + /** + * The entirety of the ServiceEndpointPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ServiceEndpointPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the service endpoint policy resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the service endpoint policy + * @return the next definition stage + */ + WithCreate withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithServiceEndpointPolicyDefinitions { + } + } + /** + * The template for a ServiceEndpointPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithServiceEndpointPolicyDefinitions { + } + + /** + * Grouping of ServiceEndpointPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicy update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the serviceendpointpolicy update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the service endpoint policy resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the serviceendpointpolicy update allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the service endpoint policy + * @return the next update stage + */ + Update withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinition.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinition.java new file mode 100644 index 0000000000000..cfcf59b756119 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing ServiceEndpointPolicyDefinition. + */ +public interface ServiceEndpointPolicyDefinition extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the service value. + */ + String service(); + + /** + * @return the serviceResources value. + */ + List serviceResources(); + + /** + * The entirety of the ServiceEndpointPolicyDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServiceEndpointPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicyDefinition definition. + */ + interface Blank extends WithServiceEndpointPolicy { + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ServiceEndpointPolicy. + */ + interface WithServiceEndpointPolicy { + /** + * Specifies resourceGroupName, serviceEndpointPolicyName. + * @param resourceGroupName The name of the resource group + * @param serviceEndpointPolicyName The name of the service endpoint policy + * @return the next definition stage + */ + WithCreate withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies service. + * @param service service endpoint name + * @return the next definition stage + */ + WithCreate withService(String service); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ServiceResources. + */ + interface WithServiceResources { + /** + * Specifies serviceResources. + * @param serviceResources A list of service resources + * @return the next definition stage + */ + WithCreate withServiceResources(List serviceResources); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithProvisioningState, DefinitionStages.WithService, DefinitionStages.WithServiceResources { + } + } + /** + * The template for a ServiceEndpointPolicyDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithProvisioningState, UpdateStages.WithService, UpdateStages.WithServiceResources { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Service. + */ + interface WithService { + /** + * Specifies service. + * @param service service endpoint name + * @return the next update stage + */ + Update withService(String service); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify ServiceResources. + */ + interface WithServiceResources { + /** + * Specifies serviceResources. + * @param serviceResources A list of service resources + * @return the next update stage + */ + Update withServiceResources(List serviceResources); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinitions.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinitions.java new file mode 100644 index 0000000000000..c5305004c4760 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPolicyDefinitions.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPolicyDefinitionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicyDefinitions. + */ +public interface ServiceEndpointPolicyDefinitions extends SupportsCreating, HasInner { + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPropertiesFormat.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPropertiesFormat.java new file mode 100644 index 0000000000000..a2b2b3a6d4508 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service endpoint properties. + */ +public class ServiceEndpointPropertiesFormat { + /** + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /** + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Get the type of the endpoint service. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set the type of the endpoint service. + * + * @param service the service value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of locations. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set a list of locations. + * + * @param locations the locations value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceProviderProvisioningState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..47972ff51f6c4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/ServiceProviderProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceProviderProvisioningState. + */ +public final class ServiceProviderProvisioningState extends ExpandableStringEnum { + /** Static value NotProvisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ServiceProviderProvisioningState + */ + @JsonCreator + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** + * @return known ServiceProviderProvisioningState values + */ + public static Collection values() { + return values(ServiceProviderProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Severity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Severity.java new file mode 100644 index 0000000000000..8667b0019ead4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Severity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Creates or finds a Severity from its string representation. + * @param name a name to look for + * @return the corresponding Severity + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * @return known Severity values + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnet.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnet.java new file mode 100644 index 0000000000000..fc242baccb3b3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnet.java @@ -0,0 +1,372 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SubnetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.RouteTableInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing Subnet. + */ +public interface Subnet extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * @return the serviceEndpointPolicies value. + */ + List serviceEndpointPolicies(); + + /** + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * The entirety of the Subnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of Subnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Subnet definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the subnet definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + * @param resourceGroupName The name of the resource group + * @param virtualNetworkName The name of the virtual network + * @return the next definition stage + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the subnet definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The address prefix for the subnet + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the subnet definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the subnet definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the subnet definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet definition allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next definition stage + */ + WithCreate withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next definition stage + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @param serviceEndpointPolicies An array of service endpoint policies + * @return the next definition stage + */ + WithCreate withServiceEndpointPolicies(List serviceEndpointPolicies); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next definition stage + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceNavigationLinks, DefinitionStages.WithRouteTable, DefinitionStages.WithServiceEndpointPolicies, DefinitionStages.WithServiceEndpoints { + } + } + /** + * The template for a Subnet update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithProvisioningState, UpdateStages.WithResourceNavigationLinks, UpdateStages.WithRouteTable, UpdateStages.WithServiceEndpointPolicies, UpdateStages.WithServiceEndpoints { + } + + /** + * Grouping of Subnet update stages. + */ + interface UpdateStages { + /** + * The stage of the subnet update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The address prefix for the subnet + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the subnet update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the subnet update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the subnet update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet update allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next update stage + */ + Update withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next update stage + */ + Update withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @param serviceEndpointPolicies An array of service endpoint policies + * @return the next update stage + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next update stage + */ + Update withServiceEndpoints(List serviceEndpoints); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SubnetAssociation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SubnetAssociation.java new file mode 100644 index 0000000000000..9e66939e689c6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/SubnetAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class SubnetAssociation { + /** + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get subnet ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the SubnetAssociation object itself. + */ + public SubnetAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnets.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnets.java new file mode 100644 index 0000000000000..cd8c9b65e7ede --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Subnets.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SubnetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Subnets. + */ +public interface Subnets extends SupportsCreating, HasInner { + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TagsObject.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TagsObject.java new file mode 100644 index 0000000000000..7dc3da8c32be1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TagsObject.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tags object for patch operations. + */ +public class TagsObject { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Topology.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Topology.java new file mode 100644 index 0000000000000..a750d38c4dd77 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Topology.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.TopologyInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Topology. + */ +public interface Topology extends HasInner, HasManager { + /** + * @return the createdDateTime value. + */ + DateTime createdDateTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the resources value. + */ + List resources(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyAssociation.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyAssociation.java new file mode 100644 index 0000000000000..0b5ab985f2023 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyAssociation.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resources that have an association with the parent resource. + */ +public class TopologyAssociation { + /** + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The association type of the child resource to the parent resource. + * Possible values include: 'Associated', 'Contains'. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get the name of the resource that is associated with the parent resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is associated with the parent resource. + * + * @param name the name value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the resource that is associated with the parent resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource that is associated with the parent resource. + * + * @param resourceId the resourceId value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @return the associationType value + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @param associationType the associationType value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyParameters.java new file mode 100644 index 0000000000000..e3378d0f8c400 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the representation of topology. + */ +public class TopologyParameters { + /** + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /** + * The reference of the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /** + * The reference of the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set the name of the target resource group to perform topology on. + * + * @param targetResourceGroupName the targetResourceGroupName value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { + this.targetResourceGroupName = targetResourceGroupName; + return this; + } + + /** + * Get the reference of the Virtual Network resource. + * + * @return the targetVirtualNetwork value + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the reference of the Virtual Network resource. + * + * @param targetVirtualNetwork the targetVirtualNetwork value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { + this.targetVirtualNetwork = targetVirtualNetwork; + return this; + } + + /** + * Get the reference of the Subnet resource. + * + * @return the targetSubnet value + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the reference of the Subnet resource. + * + * @param targetSubnet the targetSubnet value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetSubnet(SubResource targetSubnet) { + this.targetSubnet = targetSubnet; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyResource.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyResource.java new file mode 100644 index 0000000000000..70dfa7a9aa751 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TopologyResource.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network resource topology information for the given resource group. + */ +public class TopologyResource { + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource. + * + * @param name the name value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get iD of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the resource. + * + * @param id the id value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get holds the associations the resource has with other resources in the resource group. + * + * @return the associations value + */ + public List associations() { + return this.associations; + } + + /** + * Set holds the associations the resource has with other resources in the resource group. + * + * @param associations the associations value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withAssociations(List associations) { + this.associations = associations; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsConfigurationProperties.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 0000000000000..2f82d32cb7366 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsConfigurationProperties.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsConfigurationProperties { + /** + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion", required = true) + private String workspaceRegion; + + /** + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId", required = true) + private String workspaceResourceId; + + /** + * Get flag to enable/disable traffic analytics. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable traffic analytics. + * + * @param enabled the enabled value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the resource guid of the attached workspace. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the resource guid of the attached workspace. + * + * @param workspaceId the workspaceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the location of the attached workspace. + * + * @return the workspaceRegion value + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set the location of the attached workspace. + * + * @param workspaceRegion the workspaceRegion value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { + this.workspaceRegion = workspaceRegion; + return this; + } + + /** + * Get resource Id of the attached workspace. + * + * @return the workspaceResourceId value + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set resource Id of the attached workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsProperties.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsProperties.java new file mode 100644 index 0000000000000..1e357f59dc6ac --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficAnalyticsProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsProperties { + /** + * The networkWatcherFlowAnalyticsConfiguration property. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration", required = true) + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get the networkWatcherFlowAnalyticsConfiguration value. + * + * @return the networkWatcherFlowAnalyticsConfiguration value + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set the networkWatcherFlowAnalyticsConfiguration value. + * + * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set + * @return the TrafficAnalyticsProperties object itself. + */ + public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration(TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { + this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficQuery.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficQuery.java new file mode 100644 index 0000000000000..00efd9dcf7a4f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TrafficQuery.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to compare with network configuration. + */ +public class TrafficQuery { + /** + * The direction of the traffic. Accepted values are 'Inbound' and + * 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /** + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /** + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + * Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /** + * Traffice destination port. Accepted values are '*', port (for example, + * 3389) and port range (for example, 80-100). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @param protocol the protocol value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @param source the source value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withSource(String source) { + this.source = source; + return this; + } + + /** + * Get traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value + */ + public String destination() { + return this.destination; + } + + /** + * Set traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @param destination the destination value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @return the destinationPort value + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @param destinationPort the destinationPort value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TransportProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TransportProtocol.java new file mode 100644 index 0000000000000..b59dbd5ce6159 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TransportProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TransportProtocol. + */ +public final class TransportProtocol extends ExpandableStringEnum { + /** Static value Udp for TransportProtocol. */ + public static final TransportProtocol UDP = fromString("Udp"); + + /** Static value Tcp for TransportProtocol. */ + public static final TransportProtocol TCP = fromString("Tcp"); + + /** Static value All for TransportProtocol. */ + public static final TransportProtocol ALL = fromString("All"); + + /** + * Creates or finds a TransportProtocol from its string representation. + * @param name a name to look for + * @return the corresponding TransportProtocol + */ + @JsonCreator + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** + * @return known TransportProtocol values + */ + public static Collection values() { + return values(TransportProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingDetails.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingDetails.java new file mode 100644 index 0000000000000..77bb5f7e616a4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingDetails.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information gained from troubleshooting of specified resource. + */ +public class TroubleshootingDetails { + /** + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /** + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id of the get troubleshoot operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the get troubleshoot operation. + * + * @param id the id value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get reason type of failure. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set reason type of failure. + * + * @param reasonType the reasonType value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get a summary of troubleshooting. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set a summary of troubleshooting. + * + * @param summary the summary value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get details on troubleshooting results. + * + * @return the detail value + */ + public String detail() { + return this.detail; + } + + /** + * Set details on troubleshooting results. + * + * @param detail the detail value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withDetail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get list of recommended actions. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set list of recommended actions. + * + * @param recommendedActions the recommendedActions value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingParameters.java new file mode 100644 index 0000000000000..cacfb0b6cea22 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the resource to troubleshoot. + */ +@JsonFlatten +public class TroubleshootingParameters { + /** + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "properties.storagePath", required = true) + private String storagePath; + + /** + * Get the target resource to troubleshoot. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource to troubleshoot. + * + * @param targetResourceId the targetResourceId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the ID for the storage account to save the troubleshoot result. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID for the storage account to save the troubleshoot result. + * + * @param storageId the storageId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the path to the blob to save the troubleshoot result in. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the path to the blob to save the troubleshoot result in. + * + * @param storagePath the storagePath value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingRecommendedActions.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingRecommendedActions.java new file mode 100644 index 0000000000000..d4775ab0f9431 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingRecommendedActions.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommended actions based on discovered issues. + */ +public class TroubleshootingRecommendedActions { + /** + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /** + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /** + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /** + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get iD of the recommended action. + * + * @return the actionId value + */ + public String actionId() { + return this.actionId; + } + + /** + * Set iD of the recommended action. + * + * @param actionId the actionId value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get description of recommended actions. + * + * @return the actionText value + */ + public String actionText() { + return this.actionText; + } + + /** + * Set description of recommended actions. + * + * @param actionText the actionText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionText(String actionText) { + this.actionText = actionText; + return this; + } + + /** + * Get the uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set the uri linking to a documentation for the recommended troubleshooting actions. + * + * @param actionUri the actionUri value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUri(String actionUri) { + this.actionUri = actionUri; + return this; + } + + /** + * Get the information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set the information from the URI for the recommended troubleshooting actions. + * + * @param actionUriText the actionUriText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { + this.actionUriText = actionUriText; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingResult.java new file mode 100644 index 0000000000000..0ec8e197244c6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TroubleshootingResult.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.TroubleshootingResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing TroubleshootingResult. + */ +public interface TroubleshootingResult extends HasInner, HasManager { + /** + * @return the code value. + */ + String code(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the results value. + */ + List results(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionHealth.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..780236f5d5263 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionHealth.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewayConnection properties. + */ +public class TunnelConnectionHealth { + /** + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /** + * Virtual network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** + * Get tunnel name. + * + * @return the tunnel value + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get virtual network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionStatus.java new file mode 100644 index 0000000000000..55ecb748b5833 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/TunnelConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TunnelConnectionStatus. + */ +public final class TunnelConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a TunnelConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding TunnelConnectionStatus + */ + @JsonCreator + public static TunnelConnectionStatus fromString(String name) { + return fromString(name, TunnelConnectionStatus.class); + } + + /** + * @return known TunnelConnectionStatus values + */ + public static Collection values() { + return values(TunnelConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usage.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usage.java new file mode 100644 index 0000000000000..8a5c9d37b2daf --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + long currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + long limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/UsageName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/UsageName.java new file mode 100644 index 0000000000000..756b6d612a5c5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/UsageName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names. + */ +public class UsageName { + /** + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /** + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set a string describing the resource name. + * + * @param value the value value to set + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set a localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usages.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usages.java new file mode 100644 index 0000000000000..f51dc3b150b3c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowParameters.java new file mode 100644 index 0000000000000..ce61d83bbd61b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowParameters.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the IP flow to be verified. + */ +public class VerificationIPFlowParameters { + /** + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The direction of the packet represented as a 5-tuple. Possible values + * include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Possible values include: 'TCP', 'UDP'. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /** + * The local port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /** + * The remote port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /** + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIPAddress; + + /** + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of them, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform next-hop on. + * + * @param targetResourceId the targetResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param localPort the localPort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param remotePort the remotePort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Get the local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set the local IP address. Acceptable values are valid IPv4 addresses. + * + * @param localIPAddress the localIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowResult.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowResult.java new file mode 100644 index 0000000000000..3f9636a196fbd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VerificationIPFlowResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VerificationIPFlowResultInner; + +/** + * Type representing VerificationIPFlowResult. + */ +public interface VerificationIPFlowResult extends HasInner, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the ruleName value. + */ + String ruleName(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHub.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHub.java new file mode 100644 index 0000000000000..a10d783dcfa90 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHub.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualHubInner; + +/** + * Type representing VirtualHub. + */ +public interface VirtualHub extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hubVirtualNetworkConnections value. + */ + List hubVirtualNetworkConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * The entirety of the VirtualHub definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualHub definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualHub definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualHub definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualhub definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix Address-prefix for this VirtualHub + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub definition allowing to specify HubVirtualNetworkConnections. + */ + interface WithHubVirtualNetworkConnections { + /** + * Specifies hubVirtualNetworkConnections. + * @param hubVirtualNetworkConnections list of all vnet connections with this VirtualHub + * @return the next definition stage + */ + WithCreate withHubVirtualNetworkConnections(List hubVirtualNetworkConnections); + } + + /** + * The stage of the virtualhub definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the VirtualHub belongs + * @return the next definition stage + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressPrefix, DefinitionStages.WithHubVirtualNetworkConnections, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualWan { + } + } + /** + * The template for a VirtualHub update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressPrefix, UpdateStages.WithHubVirtualNetworkConnections, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualWan { + } + + /** + * Grouping of VirtualHub update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualhub update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix Address-prefix for this VirtualHub + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub update allowing to specify HubVirtualNetworkConnections. + */ + interface WithHubVirtualNetworkConnections { + /** + * Specifies hubVirtualNetworkConnections. + * @param hubVirtualNetworkConnections list of all vnet connections with this VirtualHub + * @return the next update stage + */ + Update withHubVirtualNetworkConnections(List hubVirtualNetworkConnections); + } + + /** + * The stage of the virtualhub update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the VirtualHub belongs + * @return the next update stage + */ + Update withVirtualWan(SubResource virtualWan); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHubs.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHubs.java new file mode 100644 index 0000000000000..bcdbc35d8c551 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualHubs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualHubs. + */ +public interface VirtualHubs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..5f3f77cf32877 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetNetworkInterfaceIPConfiguration. + */ +public interface VirtualMachineScaleSetNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetwork.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetwork.java new file mode 100644 index 0000000000000..28288bd9ca60d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetwork.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkInner; + +/** + * Type representing VirtualNetwork. + */ +public interface VirtualNetwork extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the ddosProtectionPlan value. + */ + SubResource ddosProtectionPlan(); + + /** + * @return the dhcpOptions value. + */ + DhcpOptions dhcpOptions(); + + /** + * @return the enableDdosProtection value. + */ + Boolean enableDdosProtection(); + + /** + * @return the enableVmProtection value. + */ + Boolean enableVmProtection(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * @return the virtualNetworkPeerings value. + */ + List virtualNetworkPeerings(); + + /** + * The entirety of the VirtualNetwork definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetwork definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetwork definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetwork definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetwork definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets + * @return the next definition stage + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork definition allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network + * @return the next definition stage + */ + WithCreate withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork definition allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network + * @return the next definition stage + */ + WithCreate withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork definition allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource + * @return the next definition stage + */ + WithCreate withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork definition allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network + * @return the next definition stage + */ + WithCreate withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork definition allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @param subnets A list of subnets in a Virtual Network + * @return the next definition stage + */ + WithCreate withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork definition allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next definition stage + */ + WithCreate withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithDdosProtectionPlan, DefinitionStages.WithDhcpOptions, DefinitionStages.WithEnableDdosProtection, DefinitionStages.WithEnableVmProtection, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSubnets, DefinitionStages.WithVirtualNetworkPeerings { + } + } + /** + * The template for a VirtualNetwork update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithDdosProtectionPlan, UpdateStages.WithDhcpOptions, UpdateStages.WithEnableDdosProtection, UpdateStages.WithEnableVmProtection, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSubnets, UpdateStages.WithVirtualNetworkPeerings { + } + + /** + * Grouping of VirtualNetwork update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetwork update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork update allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network + * @return the next update stage + */ + Update withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork update allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network + * @return the next update stage + */ + Update withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource + * @return the next update stage + */ + Update withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network + * @return the next update stage + */ + Update withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetwork update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork update allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @param subnets A list of subnets in a Virtual Network + * @return the next update stage + */ + Update withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork update allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next update stage + */ + Update withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkConnectionGatewayReference.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 0000000000000..07ace56769f49 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkConnectionGatewayReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + */ +public class VirtualNetworkConnectionGatewayReference { + /** + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @param id the id value to set + * @return the VirtualNetworkConnectionGatewayReference object itself. + */ + public VirtualNetworkConnectionGatewayReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateway.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateway.java new file mode 100644 index 0000000000000..64d0f5582a900 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateway.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewayInner; + +/** + * Type representing VirtualNetworkGateway. + */ +public interface VirtualNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeActive value. + */ + Boolean activeActive(); + + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayDefaultSite value. + */ + SubResource gatewayDefaultSite(); + + /** + * @return the gatewayType value. + */ + VirtualNetworkGatewayType gatewayType(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + VirtualNetworkGatewaySku sku(); + + /** + * @return the vpnClientConfiguration value. + */ + VpnClientConfiguration vpnClientConfiguration(); + + /** + * @return the vpnType value. + */ + VpnType vpnType(); + + /** + * The entirety of the VirtualNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next definition stage + */ + WithCreate withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Virtual network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting + * @return the next definition stage + */ + WithCreate withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next definition stage + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configurations for virtual network gateway + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway + * @return the next definition stage + */ + WithCreate withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + * @param vpnClientConfiguration The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations + * @return the next definition stage + */ + WithCreate withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next definition stage + */ + WithCreate withVpnType(VpnType vpnType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveActive, DefinitionStages.WithBgpSettings, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithGatewayDefaultSite, DefinitionStages.WithGatewayType, DefinitionStages.WithIpConfigurations, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithVpnClientConfiguration, DefinitionStages.WithVpnType { + } + } + /** + * The template for a VirtualNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveActive, UpdateStages.WithBgpSettings, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithGatewayDefaultSite, UpdateStages.WithGatewayType, UpdateStages.WithIpConfigurations, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithVpnClientConfiguration, UpdateStages.WithVpnType { + } + + /** + * Grouping of VirtualNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgateway update allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next update stage + */ + Update withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Virtual network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting + * @return the next update stage + */ + Update withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next update stage + */ + Update withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configurations for virtual network gateway + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway + * @return the next update stage + */ + Update withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + * @param vpnClientConfiguration The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations + * @return the next update stage + */ + Update withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next update stage + */ + Update withVpnType(VpnType vpnType); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnection.java new file mode 100644 index 0000000000000..224c376050ed6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnection.java @@ -0,0 +1,479 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.LocalNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewayConnectionInner; + +/** + * Type representing VirtualNetworkGatewayConnection. + */ +public interface VirtualNetworkGatewayConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + LocalNetworkGateway localNetworkGateway2(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkGateway virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkGateway virtualNetworkGateway2(); + + /** + * The entirety of the VirtualNetworkGatewayConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithConnectionType, DefinitionStages.WithVirtualNetworkGateway1, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGatewayConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGatewayConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionType. + */ + interface WithConnectionType { + /** + * Specifies connectionType. + * @param connectionType Gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @return the next definition stage +*/ + WithVirtualNetworkGateway1 withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway1. + */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies virtualNetworkGateway1. + * @param virtualNetworkGateway1 The reference to virtual network gateway resource + * @return the next definition stage +*/ + WithCreate withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next definition stage + */ + WithCreate withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next definition stage + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @param localNetworkGateway2 The reference to local network gateway resource + * @return the next definition stage + */ + WithCreate withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @param peer The reference to peerings resource + * @return the next definition stage + */ + WithCreate withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors + * @return the next definition stage + */ + WithCreate withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next definition stage + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithExpressRouteGatewayBypass, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocalNetworkGateway2, DefinitionStages.WithPeer, DefinitionStages.WithResourceGuid, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithUsePolicyBasedTrafficSelectors, DefinitionStages.WithVirtualNetworkGateway2 { + } + } + /** + * The template for a VirtualNetworkGatewayConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthorizationKey, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithExpressRouteGatewayBypass, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocalNetworkGateway2, UpdateStages.WithPeer, UpdateStages.WithResourceGuid, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithUsePolicyBasedTrafficSelectors, UpdateStages.WithVirtualNetworkGateway2 { + } + + /** + * Grouping of VirtualNetworkGatewayConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next update stage + */ + Update withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @param localNetworkGateway2 The reference to local network gateway resource + * @return the next update stage + */ + Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @param peer The reference to peerings resource + * @return the next update stage + */ + Update withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors + * @return the next update stage + */ + Update withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next update stage + */ + Update withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionListEntity.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 0000000000000..22ad540e938e5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionListEntity.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewayConnectionListEntityInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing VirtualNetworkGatewayConnectionListEntity. + */ +public interface VirtualNetworkGatewayConnectionListEntity extends HasInner, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference localNetworkGateway2(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 0000000000000..c2ed228d9ce2c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionStatus. + */ +public final class VirtualNetworkGatewayConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionStatus + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionStatus values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 0000000000000..ef907cd430122 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionType. + */ +public final class VirtualNetworkGatewayConnectionType extends ExpandableStringEnum { + /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); + + /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); + + /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionType + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnections.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnections.java new file mode 100644 index 0000000000000..7f72913f03e95 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayConnections.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_07_01.implementation.ConnectionSharedKeyInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewayConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkGatewayConnections. + */ +public interface VirtualNetworkGatewayConnections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayIPConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayIPConfiguration.java new file mode 100644 index 0000000000000..92e8e5527fab6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayIPConfiguration.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration for virtual network gateway. + */ +@JsonFlatten +public class VirtualNetworkGatewayIPConfiguration extends SubResource { + /** + * The private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySku.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySku.java new file mode 100644 index 0000000000000..88575eed856cd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySku.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewaySku details. + */ +public class VirtualNetworkGatewaySku { + /** + * Gateway SKU name. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /** + * Gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /** + * The capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the name value + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param name the name value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the tier value + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param tier the tier value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity. + * + * @param capacity the capacity value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuName.java new file mode 100644 index 0000000000000..3147f81e04c55 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuName. + */ +public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuName + */ + @JsonCreator + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** + * @return known VirtualNetworkGatewaySkuName values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuTier.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 0000000000000..b1ec4454cfaea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuTier. + */ +public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuTier + */ + @JsonCreator + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** + * @return known VirtualNetworkGatewaySkuTier values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuTier.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayType.java new file mode 100644 index 0000000000000..8f5f5f5037b6b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGatewayType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayType. + */ +public final class VirtualNetworkGatewayType extends ExpandableStringEnum { + /** Static value Vpn for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); + + /** Static value ExpressRoute for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayType + */ + @JsonCreator + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** + * @return known VirtualNetworkGatewayType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateways.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateways.java new file mode 100644 index 0000000000000..49c1375ee35a7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkGateways.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnClientIPsecParametersInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionListEntity; + +/** + * Type representing VirtualNetworkGateways. + */ +public interface VirtualNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeering.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeering.java new file mode 100644 index 0000000000000..b15399f2827fd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeering.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing VirtualNetworkPeering. + */ +public interface VirtualNetworkPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peeringState value. + */ + VirtualNetworkPeeringState peeringState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * The entirety of the VirtualNetworkPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkPeering definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + * @param resourceGroupName The name of the resource group + * @param virtualNetworkName The name of the virtual network + * @return the next definition stage + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed + * @return the next definition stage + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this virtual network + * @return the next definition stage + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @param allowVirtualNetworkAccess Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space + * @return the next definition stage + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next definition stage + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next definition stage + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering) + * @return the next definition stage + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway + * @return the next definition stage + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAllowForwardedTraffic, DefinitionStages.WithAllowGatewayTransit, DefinitionStages.WithAllowVirtualNetworkAccess, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeeringState, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteAddressSpace, DefinitionStages.WithRemoteVirtualNetwork, DefinitionStages.WithUseRemoteGateways { + } + } + /** + * The template for a VirtualNetworkPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllowForwardedTraffic, UpdateStages.WithAllowGatewayTransit, UpdateStages.WithAllowVirtualNetworkAccess, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeeringState, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteAddressSpace, UpdateStages.WithRemoteVirtualNetwork, UpdateStages.WithUseRemoteGateways { + } + + /** + * Grouping of VirtualNetworkPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed + * @return the next update stage + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this virtual network + * @return the next update stage + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @param allowVirtualNetworkAccess Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space + * @return the next update stage + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next update stage + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next update stage + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering) + * @return the next update stage + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway + * @return the next update stage + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeeringState.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeeringState.java new file mode 100644 index 0000000000000..883d3627c6ab2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeeringState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkPeeringState. + */ +public final class VirtualNetworkPeeringState extends ExpandableStringEnum { + /** Static value Initiated for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); + + /** Static value Connected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkPeeringState + */ + @JsonCreator + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** + * @return known VirtualNetworkPeeringState values + */ + public static Collection values() { + return values(VirtualNetworkPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeerings.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeerings.java new file mode 100644 index 0000000000000..58aad51be22d0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkPeerings. + */ +public interface VirtualNetworkPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsage.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsage.java new file mode 100644 index 0000000000000..765ba6e7f48af --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworkUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; + +/** + * Type representing VirtualNetworkUsage. + */ +public interface VirtualNetworkUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsageName.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsageName.java new file mode 100644 index 0000000000000..b28fae3eedaa5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworkUsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage strings container. + */ +public class VirtualNetworkUsageName { + /** + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get localized subnet size and usage string. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get subnet size and usage string. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworks.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworks.java new file mode 100644 index 0000000000000..23d53a908e3d3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualNetworks.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualNetworksInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkUsage; + +/** + * Type representing VirtualNetworks. + */ +public interface VirtualNetworks extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWAN.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWAN.java new file mode 100644 index 0000000000000..0540794ada50e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWAN.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualWANInner; + +/** + * Type representing VirtualWAN. + */ +public interface VirtualWAN extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableVpnEncryption value. + */ + Boolean disableVpnEncryption(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHubs value. + */ + List virtualHubs(); + + /** + * @return the vpnSites value. + */ + List vpnSites(); + + /** + * The entirety of the VirtualWAN definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualWAN definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualWAN definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualWAN definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualwan definition allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @param disableVpnEncryption Vpn encryption to be disabled or not + * @return the next definition stage + */ + WithCreate withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableVpnEncryption, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a VirtualWAN update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableVpnEncryption, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of VirtualWAN update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualwan update allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @param disableVpnEncryption Vpn encryption to be disabled or not + * @return the next update stage + */ + Update withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWANs.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWANs.java new file mode 100644 index 0000000000000..d17d71126a882 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VirtualWANs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VirtualWANsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualWANs. + */ +public interface VirtualWANs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientConfiguration.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientConfiguration.java new file mode 100644 index 0000000000000..0d2d57ba7b727 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientConfiguration.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConfiguration for P2S client. + */ +public class VpnClientConfiguration { + /** + * The reference of the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /** + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /** + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /** + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /** + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /** + * The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /** + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get vpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set vpnClientRootCertificate for virtual network gateway. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRootCertificates(List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get vpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set vpnClientRevokedCertificate for Virtual network gateway. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRevokedCertificates(List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get vpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set vpnClientProtocols for Virtual network gateway. + * + * @param vpnClientProtocols the vpnClientProtocols value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { + this.vpnClientProtocols = vpnClientProtocols; + return this; + } + + /** + * Get vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientIPsecParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..0fcbeb0538d90 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientIPsecParameters.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnClientIPsecParametersInner; + +/** + * Type representing VpnClientIPsecParameters. + */ +public interface VpnClientIPsecParameters extends HasInner, HasManager { + /** + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientParameters.java new file mode 100644 index 0000000000000..e3303bfdcdb31 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientParameters.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class VpnClientParameters { + /** + * VPN client Processor Architecture. Possible values are: 'AMD64' and + * 'X86'. Possible values include: 'Amd64', 'X86'. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /** + * VPN client Authentication Method. Possible values are: 'EAPTLS' and + * 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external + * radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /** + * A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based + * authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** + * Get vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @return the processorArchitecture value + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @param processorArchitecture the processorArchitecture value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @return the radiusServerAuthCertificate value + */ + public String radiusServerAuthCertificate() { + return this.radiusServerAuthCertificate; + } + + /** + * Set the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { + this.radiusServerAuthCertificate = radiusServerAuthCertificate; + return this; + } + + /** + * Get a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @return the clientRootCertificates value + */ + public List clientRootCertificates() { + return this.clientRootCertificates; + } + + /** + * Set a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @param clientRootCertificates the clientRootCertificates value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { + this.clientRootCertificates = clientRootCertificates; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientProtocol.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientProtocol.java new file mode 100644 index 0000000000000..9d2029108e470 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnClientProtocol. + */ +public final class VpnClientProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnClientProtocol. */ + public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value SSTP for VpnClientProtocol. */ + public static final VpnClientProtocol SSTP = fromString("SSTP"); + + /** Static value OpenVPN for VpnClientProtocol. */ + public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * @param name a name to look for + * @return the corresponding VpnClientProtocol + */ + @JsonCreator + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** + * @return known VpnClientProtocol values + */ + public static Collection values() { + return values(VpnClientProtocol.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRevokedCertificate.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..9ae99ca1a5c27 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRootCertificate.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRootCertificate.java new file mode 100644 index 0000000000000..00e297a5a9f4f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the VPN client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnection.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnection.java new file mode 100644 index 0000000000000..121d6207c7666 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnection.java @@ -0,0 +1,396 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import java.util.Map; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing VpnConnection. + */ +public interface VpnConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the connectionBandwidthInMbps value. + */ + Integer connectionBandwidthInMbps(); + + /** + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the VpnConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVpnGateway, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnConnection definition. + */ + interface Blank extends WithVpnGateway { + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies resourceGroupName, gatewayName. + * @param resourceGroupName The resource group name of the VpnGateway + * @param gatewayName The name of the gateway + * @return the next definition stage + */ + WithCreate withExistingVpnGateway(String resourceGroupName, String gatewayName); + } + + /** + * The stage of the vpnconnection definition allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next definition stage + */ + WithCreate withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the vpnconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next definition stage + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the vpnconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection definition allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next definition stage + */ + WithCreate withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight routing weight for vpn connection + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConnectionStatus, DefinitionStages.WithEnableBgp, DefinitionStages.WithId, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteVpnSite, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithTags { + } + } + /** + * The template for a VpnConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConnectionStatus, UpdateStages.WithEnableBgp, UpdateStages.WithId, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteVpnSite, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithTags { + } + + /** + * Grouping of VpnConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnconnection update allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next update stage + */ + Update withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the vpnconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the vpnconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection update allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next update stage + */ + Update withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight routing weight for vpn connection + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnectionStatus.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnectionStatus.java new file mode 100644 index 0000000000000..4de9c7ee306f1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnConnectionStatus. + */ +public final class VpnConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VpnConnectionStatus. */ + public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VpnConnectionStatus. */ + public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VpnConnectionStatus + */ + @JsonCreator + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** + * @return known VpnConnectionStatus values + */ + public static Collection values() { + return values(VpnConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnections.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnections.java new file mode 100644 index 0000000000000..d22adb51eaf96 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnConnections. + */ +public interface VpnConnections extends SupportsCreating, HasInner { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnDeviceScriptParameters.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnDeviceScriptParameters.java new file mode 100644 index 0000000000000..c3e26cd4915f7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnDeviceScriptParameters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn device configuration script generation parameters. + */ +public class VpnDeviceScriptParameters { + /** + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /** + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /** + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor for the vpn device. + * + * @return the vendor value + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor for the vpn device. + * + * @param vendor the vendor value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the device family for the vpn device. + * + * @return the deviceFamily value + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set the device family for the vpn device. + * + * @param deviceFamily the deviceFamily value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { + this.deviceFamily = deviceFamily; + return this; + } + + /** + * Get the firmware version for the vpn device. + * + * @return the firmwareVersion value + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set the firmware version for the vpn device. + * + * @param firmwareVersion the firmwareVersion value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateway.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateway.java new file mode 100644 index 0000000000000..ef3d77c737109 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateway.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnConnectionInner; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnGatewayInner; + +/** + * Type representing VpnGateway. + */ +public interface VpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the policies value. + */ + Policies policies(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * The entirety of the VpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpngateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections list of all vpn connections to the gateway + * @return the next definition stage + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the vpngateway definition allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + * @param policies The policies applied to this vpn gateway + * @return the next definition stage + */ + WithCreate withPolicies(Policies policies); + } + + /** + * The stage of the vpngateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next definition stage + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithConnections, DefinitionStages.WithPolicies, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub { + } + } + /** + * The template for a VpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithConnections, UpdateStages.WithPolicies, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub { + } + + /** + * Grouping of VpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the vpngateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections list of all vpn connections to the gateway + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the vpngateway update allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + * @param policies The policies applied to this vpn gateway + * @return the next update stage + */ + Update withPolicies(Policies policies); + } + + /** + * The stage of the vpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next update stage + */ + Update withVirtualHub(SubResource virtualHub); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateways.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateways.java new file mode 100644 index 0000000000000..4a5a66d2861ae --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnGateways. + */ +public interface VpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSite.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSite.java new file mode 100644 index 0000000000000..b3c368c4ff66f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSite.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_07_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnSiteInner; + +/** + * Type representing VpnSite. + */ +public interface VpnSite extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the bgpProperties value. + */ + BgpSettings bgpProperties(); + + /** + * @return the deviceProperties value. + */ + DeviceProperties deviceProperties(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the siteKey value. + */ + String siteKey(); + + /** + * @return the virtualWAN value. + */ + SubResource virtualWAN(); + + /** + * The entirety of the VpnSite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnSite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnSite definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnSite definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpnsite definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges + * @return the next definition stage + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite definition allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + * @param bgpProperties The set of bgp properties + * @return the next definition stage + */ + WithCreate withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite definition allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @param deviceProperties The device properties + * @return the next definition stage + */ + WithCreate withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite definition allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The ip-address for the vpn-site + * @return the next definition stage + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite definition allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @param siteKey The key for vpn-site that can be used for connections + * @return the next definition stage + */ + WithCreate withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite definition allowing to specify VirtualWAN. + */ + interface WithVirtualWAN { + /** + * Specifies virtualWAN. + * @param virtualWAN The VirtualWAN to which the vpnSite belongs + * @return the next definition stage + */ + WithCreate withVirtualWAN(SubResource virtualWAN); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithBgpProperties, DefinitionStages.WithDeviceProperties, DefinitionStages.WithIpAddress, DefinitionStages.WithProvisioningState, DefinitionStages.WithSiteKey, DefinitionStages.WithVirtualWAN { + } + } + /** + * The template for a VpnSite update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithBgpProperties, UpdateStages.WithDeviceProperties, UpdateStages.WithIpAddress, UpdateStages.WithProvisioningState, UpdateStages.WithSiteKey, UpdateStages.WithVirtualWAN { + } + + /** + * Grouping of VpnSite update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnsite update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite update allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + * @param bgpProperties The set of bgp properties + * @return the next update stage + */ + Update withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite update allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @param deviceProperties The device properties + * @return the next update stage + */ + Update withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The ip-address for the vpn-site + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite update allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @param siteKey The key for vpn-site that can be used for connections + * @return the next update stage + */ + Update withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite update allowing to specify VirtualWAN. + */ + interface WithVirtualWAN { + /** + * Specifies virtualWAN. + * @param virtualWAN The VirtualWAN to which the vpnSite belongs + * @return the next update stage + */ + Update withVirtualWAN(SubResource virtualWAN); + } + + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSiteId.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSiteId.java new file mode 100644 index 0000000000000..940d1c9f768f6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSiteId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnSite Resource. + */ +public class VpnSiteId { + /** + * The resource-uri of the vpn-site for which config is to be fetched. + */ + @JsonProperty(value = "vpnSite", access = JsonProperty.Access.WRITE_ONLY) + private String vpnSite; + + /** + * Get the resource-uri of the vpn-site for which config is to be fetched. + * + * @return the vpnSite value + */ + public String vpnSite() { + return this.vpnSite; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSites.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSites.java new file mode 100644 index 0000000000000..f9988dec6fe20 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSites.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnSitesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSites. + */ +public interface VpnSites extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSitesConfigurations.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSitesConfigurations.java new file mode 100644 index 0000000000000..6744986ad933a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnSitesConfigurations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import rx.Completable; +import com.microsoft.azure.management.network.v2018_07_01.implementation.VpnSitesConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSitesConfigurations. + */ +public interface VpnSitesConfigurations extends HasInner { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request); + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnType.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnType.java new file mode 100644 index 0000000000000..30336e09964da --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/VpnType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnType. + */ +public final class VpnType extends ExpandableStringEnum { + /** Static value PolicyBased for VpnType. */ + public static final VpnType POLICY_BASED = fromString("PolicyBased"); + + /** Static value RouteBased for VpnType. */ + public static final VpnType ROUTE_BASED = fromString("RouteBased"); + + /** + * Creates or finds a VpnType from its string representation. + * @param name a name to look for + * @return the corresponding VpnType + */ + @JsonCreator + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** + * @return known VpnType values + */ + public static Collection values() { + return values(VpnType.class); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 0000000000000..ae4ecb7b7e4d6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslProtocol; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class ApplicationGatewayAvailableSslOptionsImpl extends WrapperImpl implements ApplicationGatewayAvailableSslOptions { + private final NetworkManager manager; + ApplicationGatewayAvailableSslOptionsImpl(ApplicationGatewayAvailableSslOptionsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List availableCipherSuites() { + return this.inner().availableCipherSuites(); + } + + @Override + public List availableProtocols() { + return this.inner().availableProtocols(); + } + + @Override + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.inner().defaultPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List predefinedPolicies() { + return this.inner().predefinedPolicies(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java new file mode 100644 index 0000000000000..303641e0942a4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayAvailableSslOptionsInner extends Resource { + /** + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "properties.predefinedPolicies") + private List predefinedPolicies; + + /** + * Name of the Ssl predefined policy applied by default to application + * gateway. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "properties.defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /** + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "properties.availableCipherSuites") + private List availableCipherSuites; + + /** + * List of available Ssl protocols. + */ + @JsonProperty(value = "properties.availableProtocols") + private List availableProtocols; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of available Ssl predefined policy. + * + * @return the predefinedPolicies value + */ + public List predefinedPolicies() { + return this.predefinedPolicies; + } + + /** + * Set list of available Ssl predefined policy. + * + * @param predefinedPolicies the predefinedPolicies value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { + this.predefinedPolicies = predefinedPolicies; + return this; + } + + /** + * Get name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the defaultPolicy value + */ + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.defaultPolicy; + } + + /** + * Set name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param defaultPolicy the defaultPolicy value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { + this.defaultPolicy = defaultPolicy; + return this; + } + + /** + * Get list of available Ssl cipher suites. + * + * @return the availableCipherSuites value + */ + public List availableCipherSuites() { + return this.availableCipherSuites; + } + + /** + * Set list of available Ssl cipher suites. + * + * @param availableCipherSuites the availableCipherSuites value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites(List availableCipherSuites) { + this.availableCipherSuites = availableCipherSuites; + return this; + } + + /** + * Get list of available Ssl protocols. + * + * @return the availableProtocols value + */ + public List availableProtocols() { + return this.availableProtocols; + } + + /** + * Set list of available Ssl protocols. + * + * @param availableProtocols the availableProtocols value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols(List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java new file mode 100644 index 0000000000000..10c93262c80a8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFirewallRuleSet; + +class ApplicationGatewayAvailableWafRuleSetsResultImpl extends WrapperImpl implements ApplicationGatewayAvailableWafRuleSetsResult { + private final NetworkManager manager; + ApplicationGatewayAvailableWafRuleSetsResultImpl(ApplicationGatewayAvailableWafRuleSetsResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java new file mode 100644 index 0000000000000..0c93b960c18fe --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + */ +public class ApplicationGatewayAvailableWafRuleSetsResultInner { + /** + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of application gateway rule sets. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of application gateway rule sets. + * + * @param value the value value to set + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 0000000000000..490b9fee89c5b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHealthPool; + +class ApplicationGatewayBackendHealthImpl extends WrapperImpl implements ApplicationGatewayBackendHealth { + private final NetworkManager manager; + ApplicationGatewayBackendHealthImpl(ApplicationGatewayBackendHealthInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthInner.java new file mode 100644 index 0000000000000..d4cc190ad93ad --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of ApplicationGatewayBackendHealthPool resources. + */ +public class ApplicationGatewayBackendHealthInner { + /** + * The backendAddressPools property. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get the backendAddressPools value. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools value. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayBackendHealthInner object itself. + */ + public ApplicationGatewayBackendHealthInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayImpl.java new file mode 100644 index 0000000000000..0146f9fd14b72 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,311 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAutoscaleConfiguration; + +class ApplicationGatewayImpl extends GroupableResourceCoreImpl implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { + ApplicationGatewayImpl(String name, ApplicationGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List authenticationCertificates() { + return this.inner().authenticationCertificates(); + } + + @Override + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.inner().autoscaleConfiguration(); + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + + @Override + public List backendHttpSettingsCollection() { + return this.inner().backendHttpSettingsCollection(); + } + + @Override + public Boolean enableFips() { + return this.inner().enableFips(); + } + + @Override + public Boolean enableHttp2() { + return this.inner().enableHttp2(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public List frontendPorts() { + return this.inner().frontendPorts(); + } + + @Override + public List gatewayIPConfigurations() { + return this.inner().gatewayIPConfigurations(); + } + + @Override + public List httpListeners() { + return this.inner().httpListeners(); + } + + @Override + public ApplicationGatewayOperationalState operationalState() { + return this.inner().operationalState(); + } + + @Override + public List probes() { + return this.inner().probes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List redirectConfigurations() { + return this.inner().redirectConfigurations(); + } + + @Override + public List requestRoutingRules() { + return this.inner().requestRoutingRules(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public ApplicationGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public List sslCertificates() { + return this.inner().sslCertificates(); + } + + @Override + public ApplicationGatewaySslPolicy sslPolicy() { + return this.inner().sslPolicy(); + } + + @Override + public List urlPathMaps() { + return this.inner().urlPathMaps(); + } + + @Override + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.inner().webApplicationFirewallConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ApplicationGatewayImpl withAuthenticationCertificates(List authenticationCertificates) { + this.inner().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.inner().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.inner().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.inner().withEnableFips(enableFips); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.inner().withEnableHttp2(enableHttp2); + return this; + } + + @Override + public ApplicationGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.inner().withFrontendPorts(frontendPorts); + return this; + } + + @Override + public ApplicationGatewayImpl withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.inner().withGatewayIPConfigurations(gatewayIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.inner().withHttpListeners(httpListeners); + return this; + } + + @Override + public ApplicationGatewayImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public ApplicationGatewayImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ApplicationGatewayImpl withRedirectConfigurations(List redirectConfigurations) { + this.inner().withRedirectConfigurations(redirectConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withRequestRoutingRules(List requestRoutingRules) { + this.inner().withRequestRoutingRules(requestRoutingRules); + return this; + } + + @Override + public ApplicationGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.inner().withSslCertificates(sslCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.inner().withSslPolicy(sslPolicy); + return this; + } + + @Override + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.inner().withUrlPathMaps(urlPathMaps); + return this; + } + + @Override + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.inner().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayInner.java new file mode 100644 index 0000000000000..7d513b0a5f844 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewayInner.java @@ -0,0 +1,656 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAutoscaleConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Application gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayInner extends Resource { + /** + * SKU of the application gateway resource. + */ + @JsonProperty(value = "properties.sku") + private ApplicationGatewaySku sku; + + /** + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /** + * Operational state of the application gateway resource. Possible values + * include: 'Stopped', 'Starting', 'Running', 'Stopping'. + */ + @JsonProperty(value = "properties.operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /** + * Subnets of application the gateway resource. + */ + @JsonProperty(value = "properties.gatewayIPConfigurations") + private List gatewayIPConfigurations; + + /** + * Authentication certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * SSL certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.sslCertificates") + private List sslCertificates; + + /** + * Frontend IP addresses of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Frontend ports of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendPorts") + private List frontendPorts; + + /** + * Probes of the application gateway resource. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Backend address pool of the application gateway resource. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Backend http settings of the application gateway resource. + */ + @JsonProperty(value = "properties.backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Http listeners of the application gateway resource. + */ + @JsonProperty(value = "properties.httpListeners") + private List httpListeners; + + /** + * URL path map of the application gateway resource. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Redirect configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.redirectConfigurations") + private List redirectConfigurations; + + /** + * Web application firewall configuration. + */ + @JsonProperty(value = "properties.webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /** + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableHttp2") + private Boolean enableHttp2; + + /** + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableFips") + private Boolean enableFips; + + /** + * Autoscale Configuration. + */ + @JsonProperty(value = "properties.autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /** + * Resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Provisioning state of the application gateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get sKU of the application gateway resource. + * + * @return the sku value + */ + public ApplicationGatewaySku sku() { + return this.sku; + } + + /** + * Set sKU of the application gateway resource. + * + * @param sku the sku value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get sSL policy of the application gateway resource. + * + * @return the sslPolicy value + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set sSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'. + * + * @return the operationalState value + */ + public ApplicationGatewayOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get subnets of application the gateway resource. + * + * @return the gatewayIPConfigurations value + */ + public List gatewayIPConfigurations() { + return this.gatewayIPConfigurations; + } + + /** + * Set subnets of application the gateway resource. + * + * @param gatewayIPConfigurations the gatewayIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.gatewayIPConfigurations = gatewayIPConfigurations; + return this; + } + + /** + * Get authentication certificates of the application gateway resource. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set authentication certificates of the application gateway resource. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get sSL certificates of the application gateway resource. + * + * @return the sslCertificates value + */ + public List sslCertificates() { + return this.sslCertificates; + } + + /** + * Set sSL certificates of the application gateway resource. + * + * @param sslCertificates the sslCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslCertificates(List sslCertificates) { + this.sslCertificates = sslCertificates; + return this; + } + + /** + * Get frontend IP addresses of the application gateway resource. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set frontend IP addresses of the application gateway resource. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get frontend ports of the application gateway resource. + * + * @return the frontendPorts value + */ + public List frontendPorts() { + return this.frontendPorts; + } + + /** + * Set frontend ports of the application gateway resource. + * + * @param frontendPorts the frontendPorts value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { + this.frontendPorts = frontendPorts; + return this; + } + + /** + * Get probes of the application gateway resource. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set probes of the application gateway resource. + * + * @param probes the probes value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get backend address pool of the application gateway resource. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set backend address pool of the application gateway resource. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get backend http settings of the application gateway resource. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set backend http settings of the application gateway resource. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get http listeners of the application gateway resource. + * + * @return the httpListeners value + */ + public List httpListeners() { + return this.httpListeners; + } + + /** + * Set http listeners of the application gateway resource. + * + * @param httpListeners the httpListeners value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get uRL path map of the application gateway resource. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set uRL path map of the application gateway resource. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing rules of the application gateway resource. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get redirect configurations of the application gateway resource. + * + * @return the redirectConfigurations value + */ + public List redirectConfigurations() { + return this.redirectConfigurations; + } + + /** + * Set redirect configurations of the application gateway resource. + * + * @param redirectConfigurations the redirectConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRedirectConfigurations(List redirectConfigurations) { + this.redirectConfigurations = redirectConfigurations; + return this; + } + + /** + * Get web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.webApplicationFirewallConfiguration; + } + + /** + * Set web application firewall configuration. + * + * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + return this; + } + + /** + * Get whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value + */ + public Boolean enableHttp2() { + return this.enableHttp2; + } + + /** + * Set whether HTTP2 is enabled on the application gateway resource. + * + * @param enableHttp2 the enableHttp2 value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { + this.enableHttp2 = enableHttp2; + return this; + } + + /** + * Get whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set whether FIPS is enabled on the application gateway resource. + * + * @param enableFips the enableFips value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get autoscale Configuration. + * + * @return the autoscaleConfiguration value + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get resource GUID property of the application gateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set resource GUID property of the application gateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting where the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..9bd40786562d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPredefinedPolicy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslProtocol; + +class ApplicationGatewaySslPredefinedPolicyImpl extends WrapperImpl implements ApplicationGatewaySslPredefinedPolicy { + private final NetworkManager manager; + ApplicationGatewaySslPredefinedPolicyImpl(ApplicationGatewaySslPredefinedPolicyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List cipherSuites() { + return this.inner().cipherSuites(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.inner().minProtocolVersion(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java new file mode 100644 index 0000000000000..a32a19483f984 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * An Ssl predefined policy. + */ +@JsonFlatten +public class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /** + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Ssl cipher suites to be enabled in the specified order for application + * gateway. + */ + @JsonProperty(value = "properties.cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "properties.minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get name of the Ssl predefined policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Ssl predefined policy. + * + * @param name the name value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order for application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysImpl.java new file mode 100644 index 0000000000000..6e83908de5b41 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewaySslPredefinedPolicy; + +class ApplicationGatewaysImpl extends GroupableResourcesCoreImpl implements ApplicationGateways { + protected ApplicationGatewaysImpl(NetworkManager manager) { + super(manager.inner().applicationGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listAll()); + } + + @Override + public Observable listAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAllAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable startAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.startAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.stopAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.backendHealthAsync(resourceGroupName, applicationGatewayName) + .map(new Func1() { + @Override + public ApplicationGatewayBackendHealth call(ApplicationGatewayBackendHealthInner inner) { + return new ApplicationGatewayBackendHealthImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableWafRuleSetsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableWafRuleSetsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResult call(ApplicationGatewayAvailableWafRuleSetsResultInner inner) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, manager()); + } + }); + } + + @Override + protected ApplicationGatewayImpl wrapModel(ApplicationGatewayInner inner) { + return new ApplicationGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationGatewayImpl wrapModel(String name) { + return new ApplicationGatewayImpl(name, new ApplicationGatewayInner(), this.manager()); + } + + @Override + public Observable listAvailableSslOptionsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslOptionsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableSslOptions call(ApplicationGatewayAvailableSslOptionsInner inner) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableSslPredefinedPoliciesAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslPredefinedPoliciesAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + ApplicationGatewaysInner client = this.inner(); + return client.getSslPredefinedPolicyAsync(predefinedPolicyName) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysInner.java new file mode 100644 index 0000000000000..821d7da168b35 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationGatewaysInner.java @@ -0,0 +1,2355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationGateways. + */ +public class ApplicationGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ApplicationGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAll" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + Observable> listAll(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways backendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> backendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways beginBackendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> beginBackendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAvailableWafRuleSets" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + Observable> listAvailableWafRuleSets(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAvailableSslOptions" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + Observable> listAvailableSslOptions(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAvailableSslPredefinedPolicies" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies") + Observable> listAvailableSslPredefinedPolicies(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways getSslPredefinedPolicy" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}") + Observable> getSslPredefinedPolicy(@Path("subscriptionId") String subscriptionId, @Path("predefinedPolicyName") String predefinedPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAllNext" }) + @GET + Observable> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways listAvailableSslPredefinedPoliciesNext" }) + @GET + Observable> listAvailableSslPredefinedPoliciesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAll() { + ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { + return listAllSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String applicationGatewayName) { + startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String applicationGatewayName) { + return startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.start(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String applicationGatewayName) { + beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginStart(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String applicationGatewayName) { + stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String applicationGatewayName) { + return stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.stop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String applicationGatewayName) { + beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginStop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBackendHealthDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object if successful. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableWafRuleSetsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableWafRuleSetsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableWafRuleSetsResultInner>() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable> listAvailableWafRuleSetsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listAvailableWafRuleSets(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableWafRuleSetsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableWafRuleSetsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableSslOptionsInner object if successful. + */ + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableSslOptionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableSslOptionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableSslOptionsInner>() { + @Override + public ApplicationGatewayAvailableSslOptionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable> listAvailableSslOptionsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listAvailableSslOptions(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableSslOptionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableSslOptionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPolicies() { + ServiceResponse> response = listAvailableSslPredefinedPoliciesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesAsync() { + return listAvailableSslPredefinedPoliciesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesWithServiceResponseAsync() { + return listAvailableSslPredefinedPoliciesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listAvailableSslPredefinedPolicies(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewaySslPredefinedPolicyInner object if successful. + */ + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).toBlocking().single().body(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSslPredefinedPolicyAsync(String predefinedPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName), serviceCallback); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).map(new Func1, ApplicationGatewaySslPredefinedPolicyInner>() { + @Override + public ApplicationGatewaySslPredefinedPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable> getSslPredefinedPolicyWithServiceResponseAsync(String predefinedPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (predefinedPolicyName == null) { + throw new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getSslPredefinedPolicy(this.client.subscriptionId(), predefinedPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSslPredefinedPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSslPredefinedPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAllNext(final String nextPageLink) { + ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPoliciesNext(final String nextPageLink) { + ServiceResponse> response = listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAvailableSslPredefinedPoliciesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..743d17da88c14 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; +import rx.Observable; + +class ApplicationSecurityGroupImpl extends GroupableResourceCoreImpl implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + ApplicationSecurityGroupImpl(String name, ApplicationSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupInner.java new file mode 100644 index 0000000000000..a07a410be7ef3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An application security group in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationSecurityGroupInner extends Resource { + /** + * The resource GUID property of the application security group resource. + * It uniquely identifies a resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the application security group resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsImpl.java new file mode 100644 index 0000000000000..0e07ac42d40f0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ApplicationSecurityGroupsImpl extends GroupableResourcesCoreImpl implements ApplicationSecurityGroups { + protected ApplicationSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().applicationSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(ApplicationSecurityGroupInner inner) { + return new ApplicationSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(String name) { + return new ApplicationSecurityGroupImpl(name, new ApplicationSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsInner.java new file mode 100644 index 0000000000000..9ad7ed547bc87 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ApplicationSecurityGroupsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationSecurityGroups. + */ +public class ApplicationSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesImpl.java new file mode 100644 index 0000000000000..21730f9a61e40 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.AvailableEndpointServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.EndpointServiceResult; + +class AvailableEndpointServicesImpl extends WrapperImpl implements AvailableEndpointServices { + private final NetworkManager manager; + + AvailableEndpointServicesImpl(NetworkManager manager) { + super(manager.inner().availableEndpointServices()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private EndpointServiceResultImpl wrapEndpointServiceResultModel(EndpointServiceResultInner inner) { + return new EndpointServiceResultImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableEndpointServicesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EndpointServiceResult call(EndpointServiceResultInner inner) { + return wrapEndpointServiceResultModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesInner.java new file mode 100644 index 0000000000000..9cb3482f06c4b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableEndpointServicesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableEndpointServices. + */ +public class AvailableEndpointServicesInner { + /** The Retrofit service to perform REST calls. */ + private AvailableEndpointServicesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableEndpointServicesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableEndpointServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableEndpointServices to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableEndpointServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AvailableEndpointServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AvailableEndpointServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..959970aa8c1ce --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersListCountry; + +class AvailableProvidersListImpl extends WrapperImpl implements AvailableProvidersList { + private final NetworkManager manager; + AvailableProvidersListImpl(AvailableProvidersListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List countries() { + return this.inner().countries(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListInner.java new file mode 100644 index 0000000000000..5b2a62ae5d553 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AvailableProvidersListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of available countries with details. + */ +public class AvailableProvidersListInner { + /** + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get list of available countries. + * + * @return the countries value + */ + public List countries() { + return this.countries; + } + + /** + * Set list of available countries. + * + * @param countries the countries value to set + * @return the AvailableProvidersListInner object itself. + */ + public AvailableProvidersListInner withCountries(List countries) { + this.countries = countries; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..2f7d7339b4cc6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewall; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; + +class AzureFirewallImpl extends GroupableResourceCoreImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + AzureFirewallImpl(String name, AzureFirewallInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationRuleCollections() { + return this.inner().applicationRuleCollections(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public List networkRuleCollections() { + return this.inner().networkRuleCollections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureFirewallImpl withApplicationRuleCollections(List applicationRuleCollections) { + this.inner().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public AzureFirewallImpl withNetworkRuleCollections(List networkRuleCollections) { + this.inner().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallInner.java new file mode 100644 index 0000000000000..fa61fe1b4e0fb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallInner.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallInner extends Resource { + /** + * Collection of application rule collections used by a Azure Firewall. + */ + @JsonProperty(value = "properties.applicationRuleCollections") + private List applicationRuleCollections; + + /** + * Collection of network rule collections used by a Azure Firewall. + */ + @JsonProperty(value = "properties.networkRuleCollections") + private List networkRuleCollections; + + /** + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of application rule collections used by a Azure Firewall. + * + * @return the applicationRuleCollections value + */ + public List applicationRuleCollections() { + return this.applicationRuleCollections; + } + + /** + * Set collection of application rule collections used by a Azure Firewall. + * + * @param applicationRuleCollections the applicationRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withApplicationRuleCollections(List applicationRuleCollections) { + this.applicationRuleCollections = applicationRuleCollections; + return this; + } + + /** + * Get collection of network rule collections used by a Azure Firewall. + * + * @return the networkRuleCollections value + */ + public List networkRuleCollections() { + return this.networkRuleCollections; + } + + /** + * Set collection of network rule collections used by a Azure Firewall. + * + * @param networkRuleCollections the networkRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNetworkRuleCollections(List networkRuleCollections) { + this.networkRuleCollections = networkRuleCollections; + return this; + } + + /** + * Get iP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configuration of the Azure Firewall resource. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsImpl.java new file mode 100644 index 0000000000000..a8e51e1004ad9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewall; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallsImpl extends GroupableResourcesCoreImpl implements AzureFirewalls { + protected AzureFirewallsImpl(NetworkManager manager) { + super(manager.inner().azureFirewalls(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AzureFirewallImpl define(String name) { + return wrapModel(name); + } + + @Override + protected AzureFirewallImpl wrapModel(AzureFirewallInner inner) { + return new AzureFirewallImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallImpl wrapModel(String name) { + return new AzureFirewallImpl(name, new AzureFirewallInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsInner.java new file mode 100644 index 0000000000000..2a50f1583d8a5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureFirewallsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AzureFirewalls. + */ +public class AzureFirewallsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewalls to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String azureFirewallName) { + deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().last().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String azureFirewallName) { + return deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String azureFirewallName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String azureFirewallName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner beginCreateOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..5aac18ae56ed0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReport; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportItem; + +class AzureReachabilityReportImpl extends WrapperImpl implements AzureReachabilityReport { + private final NetworkManager manager; + AzureReachabilityReportImpl(AzureReachabilityReportInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String aggregationLevel() { + return this.inner().aggregationLevel(); + } + + @Override + public AzureReachabilityReportLocation providerLocation() { + return this.inner().providerLocation(); + } + + @Override + public List reachabilityReport() { + return this.inner().reachabilityReport(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportInner.java new file mode 100644 index 0000000000000..f131bb9dac3d2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/AzureReachabilityReportInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details. + */ +public class AzureReachabilityReportInner { + /** + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @return the aggregationLevel value + */ + public String aggregationLevel() { + return this.aggregationLevel; + } + + /** + * Set the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @param aggregationLevel the aggregationLevel value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { + this.aggregationLevel = aggregationLevel; + return this; + } + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Azure reachability report items. + * + * @return the reachabilityReport value + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set list of Azure reachability report items. + * + * @param reachabilityReport the reachabilityReport value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { + this.reachabilityReport = reachabilityReport; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolImpl.java new file mode 100644 index 0000000000000..d2b79c1c28056 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.SubResource; + +class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl implements BackendAddressPool { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String backendAddressPoolName; + + BackendAddressPoolImpl(BackendAddressPoolInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.backendAddressPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "backendAddressPools"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerBackendAddressPoolsInner client = this.manager().inner().loadBalancerBackendAddressPools(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.backendAddressPoolName); + } + + + + @Override + public List backendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().backendIPConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().backendIPConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource outboundRule() { + return this.inner().outboundRule(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolInner.java new file mode 100644 index 0000000000000..95217e61b3a38 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BackendAddressPoolInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Pool of backend IP addresses. + */ +@JsonFlatten +public class BackendAddressPoolInner extends SubResource { + /** + * Gets collection of references to IP addresses defined in network + * interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIPConfigurations; + + /** + * Gets load balancing rules that use this backend address pool. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * Gets outbound rules that use this backend address pool. + */ + @JsonProperty(value = "properties.outboundRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundRule; + + /** + * Get provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get gets collection of references to IP addresses defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Get gets load balancing rules that use this backend address pool. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get gets outbound rules that use this backend address pool. + * + * @return the outboundRule value + */ + public SubResource outboundRule() { + return this.outboundRule; + } + + /** + * Get get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultImpl.java new file mode 100644 index 0000000000000..565eddc150aa7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.BgpPeerStatusListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BgpPeerStatus; + +class BgpPeerStatusListResultImpl extends WrapperImpl implements BgpPeerStatusListResult { + private final NetworkManager manager; + BgpPeerStatusListResultImpl(BgpPeerStatusListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultInner.java new file mode 100644 index 0000000000000..14436efed55fe --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpPeerStatusListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list BGP peer status API service call. + */ +public class BgpPeerStatusListResultInner { + /** + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of BGP peers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of BGP peers. + * + * @param value the value value to set + * @return the BgpPeerStatusListResultInner object itself. + */ + public BgpPeerStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesImpl.java new file mode 100644 index 0000000000000..79dce940b8cdf --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunity; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class BgpServiceCommunitiesImpl extends GroupableResourcesCoreImpl implements BgpServiceCommunities { + protected BgpServiceCommunitiesImpl(NetworkManager manager) { + super(manager.inner().bgpServiceCommunities(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + BgpServiceCommunitiesInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + BgpServiceCommunitiesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + BgpServiceCommunitiesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BgpServiceCommunity call(BgpServiceCommunityInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(BgpServiceCommunityInner inner) { + return new BgpServiceCommunityImpl(inner.name(), inner, manager()); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesInner.java new file mode 100644 index 0000000000000..81e2acf5a9e99 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunitiesInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BgpServiceCommunities. + */ +public class BgpServiceCommunitiesInner { + /** The Retrofit service to perform REST calls. */ + private BgpServiceCommunitiesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BgpServiceCommunitiesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(BgpServiceCommunitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BgpServiceCommunities to be + * used by Retrofit to perform actually REST calls. + */ + interface BgpServiceCommunitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunities list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunities listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..c72aeb19b42c3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunity; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BGPCommunity; + +class BgpServiceCommunityImpl extends GroupableResourceCoreImpl implements BgpServiceCommunity { + BgpServiceCommunityImpl(String name, BgpServiceCommunityInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bgpCommunities() { + return this.inner().bgpCommunities(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityInner.java new file mode 100644 index 0000000000000..f85590b4b92c6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/BgpServiceCommunityInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BGPCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service Community Properties. + */ +@JsonFlatten +@SkipParentValidation +public class BgpServiceCommunityInner extends Resource { + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Get a list of bgp communities. + */ + @JsonProperty(value = "properties.bgpCommunities") + private List bgpCommunities; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param serviceName the serviceName value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get get a list of bgp communities. + * + * @return the bgpCommunities value + */ + public List bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set get a list of bgp communities. + * + * @param bgpCommunities the bgpCommunities value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorInner.java new file mode 100644 index 0000000000000..8d8ec973b87db --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorInner { + /** + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get connection monitor location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set connection monitor location. + * + * @param location the location value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get connection monitor tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set connection monitor tags. + * + * @param tags the tags value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultImpl.java new file mode 100644 index 0000000000000..89d75c5995575 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionStateSnapshot; + +class ConnectionMonitorQueryResultImpl extends WrapperImpl implements ConnectionMonitorQueryResult { + private final NetworkManager manager; + ConnectionMonitorQueryResultImpl(ConnectionMonitorQueryResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorSourceStatus sourceStatus() { + return this.inner().sourceStatus(); + } + + @Override + public List states() { + return this.inner().states(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultInner.java new file mode 100644 index 0000000000000..681d8d2b8bd4a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of connection states snaphots. + */ +public class ConnectionMonitorQueryResultInner { + /** + * Status of connection monitor source. Possible values include: 'Uknown', + * 'Active', 'Inactive'. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /** + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @return the sourceStatus value + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @param sourceStatus the sourceStatus value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get information about connection states. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set information about connection states. + * + * @param states the states value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 0000000000000..bcb59f71c449d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ConnectionMonitorResultImpl extends CreatableUpdatableImpl implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String connectionMonitorName; + private ConnectionMonitorInner createOrUpdateParameter; + + ConnectionMonitorResultImpl(String name, NetworkManager manager) { + super(name, new ConnectionMonitorResultInner()); + this.manager = manager; + // Set resource name + this.connectionMonitorName = name; + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + ConnectionMonitorResultImpl(ConnectionMonitorResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionMonitorName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.connectionMonitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "connectionMonitors"); + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public Boolean autoStart() { + return this.inner().autoStart(); + } + + @Override + public ConnectionMonitorDestination destination() { + return this.inner().destination(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer monitoringIntervalInSeconds() { + return this.inner().monitoringIntervalInSeconds(); + } + + @Override + public String monitoringStatus() { + return this.inner().monitoringStatus(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionMonitorSource source() { + return this.inner().source(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ConnectionMonitorResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createOrUpdateParameter.withDestination(destination); + return this; + } + + @Override + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createOrUpdateParameter.withSource(source); + return this; + } + + @Override + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createOrUpdateParameter.withAutoStart(autoStart); + return this; + } + + @Override + public ConnectionMonitorResultImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createOrUpdateParameter.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + @Override + public ConnectionMonitorResultImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultInner.java new file mode 100644 index 0000000000000..62a943e0631c5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorResultInner.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Information about the connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorResultInner extends Resource { + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * The provisioning state of the connection monitor. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "properties.monitoringStatus") + private String monitoringStatus; + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date and time when the connection monitor was started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date and time when the connection monitor was started. + * + * @param startTime the startTime value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the monitoring status of the connection monitor. + * + * @return the monitoringStatus value + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoring status of the connection monitor. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringStatus(String monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 0000000000000..567f2e06301ac --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitorResult; + +class ConnectionMonitorsImpl extends WrapperImpl implements ConnectionMonitors { + private final NetworkManager manager; + + ConnectionMonitorsImpl(NetworkManager manager) { + super(manager.inner().connectionMonitors()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorResultImpl define(String name) { + return wrapModel(name); + } + + private ConnectionMonitorResultImpl wrapModel(ConnectionMonitorResultInner inner) { + return new ConnectionMonitorResultImpl(inner, manager()); + } + + private ConnectionMonitorResultImpl wrapModel(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorQueryResult call(ConnectionMonitorQueryResultInner inner) { + return new ConnectionMonitorQueryResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + ConnectionMonitorsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsInner.java new file mode 100644 index 0000000000000..c3e2636442374 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionMonitorsInner.java @@ -0,0 +1,1130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_07_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ConnectionMonitors. + */ +public class ConnectionMonitorsInner { + /** The Retrofit service to perform REST calls. */ + private ConnectionMonitorsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConnectionMonitorsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ConnectionMonitorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConnectionMonitors to be + * used by Retrofit to perform actually REST calls. + */ + interface ConnectionMonitorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors query" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> query(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors beginQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> beginQuery(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner beginCreateOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.start(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner query(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> queryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.query(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginQueryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ConnectionMonitorResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..1a9411ffa4e87 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionResetSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionResetSharedKeyImpl extends WrapperImpl implements ConnectionResetSharedKey { + private final NetworkManager manager; + ConnectionResetSharedKeyImpl(ConnectionResetSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public int keyLength() { + return this.inner().keyLength(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..0e3fdc5594e92 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionResetSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network connection reset shared key. + */ +public class ConnectionResetSharedKeyInner { + /** + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get the virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value + */ + public int keyLength() { + return this.keyLength; + } + + /** + * Set the virtual network connection reset shared key length, should between 1 and 128. + * + * @param keyLength the keyLength value to set + * @return the ConnectionResetSharedKeyInner object itself. + */ + public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { + this.keyLength = keyLength; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..4c3f489b731e5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectionSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionSharedKeyImpl extends WrapperImpl implements ConnectionSharedKey { + private final NetworkManager manager; + ConnectionSharedKeyImpl(ConnectionSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyInner.java new file mode 100644 index 0000000000000..c86dc14415c70 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectionSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Response for GetConnectionSharedKey API service call. + */ +public class ConnectionSharedKeyInner extends SubResource { + /** + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the virtual network connection shared key value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the virtual network connection shared key value. + * + * @param value the value value to set + * @return the ConnectionSharedKeyInner object itself. + */ + public ConnectionSharedKeyInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationImpl.java new file mode 100644 index 0000000000000..25af693d4626e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityHop; + +class ConnectivityInformationImpl extends WrapperImpl implements ConnectivityInformation { + private final NetworkManager manager; + ConnectivityInformationImpl(ConnectivityInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Integer avgLatencyInMs() { + return this.inner().avgLatencyInMs(); + } + + @Override + public ConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public List hops() { + return this.inner().hops(); + } + + @Override + public Integer maxLatencyInMs() { + return this.inner().maxLatencyInMs(); + } + + @Override + public Integer minLatencyInMs() { + return this.inner().minLatencyInMs(); + } + + @Override + public Integer probesFailed() { + return this.inner().probesFailed(); + } + + @Override + public Integer probesSent() { + return this.inner().probesSent(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationInner.java new file mode 100644 index 0000000000000..23d2e406fc818 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ConnectivityInformationInner.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityHop; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information on the connectivity status. + */ +public class ConnectivityInformationInner { + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * The connection status. Possible values include: 'Unknown', 'Connected', + * 'Disconnected', 'Degraded'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /** + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /** + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /** + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /** + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /** + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded'. + * + * @return the connectionStatus value + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get average latency in milliseconds. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get minimum latency in milliseconds. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get maximum latency in milliseconds. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get total number of probes sent. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 0000000000000..29f90db0d0b07 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlan; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; + +class DdosProtectionPlanImpl extends GroupableResourceCoreImpl implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + DdosProtectionPlanImpl(String name, DdosProtectionPlanInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List virtualNetworks() { + return this.inner().virtualNetworks(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanInner.java new file mode 100644 index 0000000000000..a5db26d0abafc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlanInner.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A DDoS protection plan in a resource group. + */ +@JsonFlatten +public class DdosProtectionPlanInner extends Resource { + /** + * The resource GUID property of the DDoS protection plan resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the DDoS protection plan resource. Possible + * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + */ + @JsonProperty(value = "properties.virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworks; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the DDoS protection plan resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + * + * @return the virtualNetworks value + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansImpl.java new file mode 100644 index 0000000000000..3ddd5b78b4666 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlan; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DdosProtectionPlansImpl extends GroupableResourcesCoreImpl implements DdosProtectionPlans { + protected DdosProtectionPlansImpl(NetworkManager manager) { + super(manager.inner().ddosProtectionPlans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DdosProtectionPlansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DdosProtectionPlanImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(DdosProtectionPlanInner inner) { + return new DdosProtectionPlanImpl(inner.name(), inner, manager()); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(String name) { + return new DdosProtectionPlanImpl(name, new DdosProtectionPlanInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java new file mode 100644 index 0000000000000..b5e1fd8e6f14b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DdosProtectionPlans. + */ +public class DdosProtectionPlansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DdosProtectionPlansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DdosProtectionPlansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DdosProtectionPlansService.class); + this.client = client; + } + + /** + * The interface defining all the services for DdosProtectionPlans to be + * used by Retrofit to perform actually REST calls. + */ + interface DdosProtectionPlansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ddosProtectionPlanName) { + deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().last().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner createOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginCreateOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesImpl.java new file mode 100644 index 0000000000000..a07f9581bd2e4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.DefaultSecurityRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroupSecurityRuleModel; + +class DefaultSecurityRulesImpl extends WrapperImpl implements DefaultSecurityRules { + private final NetworkManager manager; + + DefaultSecurityRulesImpl(NetworkManager manager) { + super(manager.inner().defaultSecurityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkSecurityGroupSecurityRuleModelImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + DefaultSecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + DefaultSecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesInner.java new file mode 100644 index 0000000000000..e12413ff4590a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DefaultSecurityRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DefaultSecurityRules. + */ +public class DefaultSecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private DefaultSecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DefaultSecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DefaultSecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DefaultSecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface DefaultSecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DefaultSecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DefaultSecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("defaultSecurityRuleName") String defaultSecurityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.DefaultSecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName), serviceCallback); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (defaultSecurityRuleName == null) { + throw new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DnsNameAvailabilityResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DnsNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..ac4d4176e8a46 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DnsNameAvailabilityResultInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for the CheckDnsNameAvailability API service call. + */ +public class DnsNameAvailabilityResultInner { + /** + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get domain availability (True/False). + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set domain availability (True/False). + * + * @param available the available value to set + * @return the DnsNameAvailabilityResultInner object itself. + */ + public DnsNameAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..e2744e9e6c6ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveNetworkSecurityGroup; + +class EffectiveNetworkSecurityGroupListResultImpl extends WrapperImpl implements EffectiveNetworkSecurityGroupListResult { + private final NetworkManager manager; + EffectiveNetworkSecurityGroupListResultImpl(EffectiveNetworkSecurityGroupListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java new file mode 100644 index 0000000000000..947e892de6663 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective network security groups API service call. + */ +public class EffectiveNetworkSecurityGroupListResultInner { + /** + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective network security groups. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective network security groups. + * + * @param value the value value to set + * @return the EffectiveNetworkSecurityGroupListResultInner object itself. + */ + public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..515de25c6d317 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.EffectiveRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveRoute; + +class EffectiveRouteListResultImpl extends WrapperImpl implements EffectiveRouteListResult { + private final NetworkManager manager; + EffectiveRouteListResultImpl(EffectiveRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultInner.java new file mode 100644 index 0000000000000..5de0c6472e424 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EffectiveRouteListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective route API service call. + */ +public class EffectiveRouteListResultInner { + /** + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective routes. + * + * @param value the value value to set + * @return the EffectiveRouteListResultInner object itself. + */ + public EffectiveRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..9c63d4ab890c9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.EndpointServiceResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EndpointServiceResultImpl extends WrapperImpl implements EndpointServiceResult { + private final NetworkManager manager; + + EndpointServiceResultImpl(EndpointServiceResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultInner.java new file mode 100644 index 0000000000000..e613940429743 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/EndpointServiceResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Endpoint service. + */ +public class EndpointServiceResultInner extends SubResource { + /** + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the endpoint service. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the endpoint service. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..e952165a4eb95 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.AuthorizationUseStatus; + +class ExpressRouteCircuitAuthorizationImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitAuthorization, ExpressRouteCircuitAuthorization.Definition, ExpressRouteCircuitAuthorization.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String authorizationName; + + ExpressRouteCircuitAuthorizationImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitAuthorizationInner()); + this.manager = manager; + // Set resource name + this.authorizationName = name; + // + } + + ExpressRouteCircuitAuthorizationImpl(ExpressRouteCircuitAuthorizationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.authorizationName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.authorizationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public AuthorizationUseStatus authorizationUseStatus() { + return this.inner().authorizationUseStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.inner().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 0000000000000..6d34aa3f49782 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AuthorizationUseStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authorization in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitAuthorizationInner extends SubResource { + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse'. + */ + @JsonProperty(value = "properties.authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @return the authorizationUseStatus value + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Set authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @param authorizationUseStatus the authorizationUseStatus value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java new file mode 100644 index 0000000000000..1dabe82ef97d9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorization; + +class ExpressRouteCircuitAuthorizationsImpl extends WrapperImpl implements ExpressRouteCircuitAuthorizations { + private final NetworkManager manager; + + ExpressRouteCircuitAuthorizationsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitAuthorizations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(ExpressRouteCircuitAuthorizationInner inner) { + return new ExpressRouteCircuitAuthorizationImpl(inner, manager()); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, authorizationName) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, authorizationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsInner.java new file mode 100644 index 0000000000000..553bef2fb2d9d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitAuthorizationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitAuthorizations. + */ +public class ExpressRouteCircuitAuthorizationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitAuthorizationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitAuthorizationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitAuthorizationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitAuthorizations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitAuthorizationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String authorizationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..07ae5975a2790 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.CircuitConnectionStatus; + +class ExpressRouteCircuitConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitConnection, ExpressRouteCircuitConnection.Definition, ExpressRouteCircuitConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + private String connectionName; + + ExpressRouteCircuitConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteCircuitConnectionImpl(ExpressRouteCircuitConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "connections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public CircuitConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peerExpressRouteCircuitPeering() { + return this.inner().peerExpressRouteCircuitPeering(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitConnectionImpl withExistingPeering(String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.inner().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..09f0064acc7e3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionInner.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.CircuitConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@JsonFlatten +public class ExpressRouteCircuitConnectionInner extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /** + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * Express Route Circuit Connection State. Possible values are: 'Connected' + * and 'Disconnected'. Possible values include: 'Connected', 'Connecting', + * 'Disconnected'. + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Provisioning state of the circuit connection resource. Possible values + * are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @return the expressRouteCircuitPeering value + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get express Route Circuit Connection State. Possible values are: 'Connected' and 'Disconnected'. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get provisioning state of the circuit connection resource. Possible values are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..799dda60305c4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnection; + +class ExpressRouteCircuitConnectionsImpl extends WrapperImpl implements ExpressRouteCircuitConnections { + private final NetworkManager manager; + + ExpressRouteCircuitConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(ExpressRouteCircuitConnectionInner inner) { + return new ExpressRouteCircuitConnectionImpl(inner, manager()); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteCircuitConnection call(ExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsInner.java new file mode 100644 index 0000000000000..e08862b449e83 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitConnectionsInner.java @@ -0,0 +1,553 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitConnections. + */ +public class ExpressRouteCircuitConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner get(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..eaf770cfb152d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuit; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_07_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitServiceProviderProperties; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitImpl extends GroupableResourceCoreImpl implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { + ExpressRouteCircuitImpl(String name, ExpressRouteCircuitInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowClassicOperations() { + return this.inner().allowClassicOperations(); + } + + @Override + public Boolean allowGlobalReach() { + return this.inner().allowGlobalReach(); + } + + @Override + public List authorizations() { + List lst = new ArrayList(); + if (this.inner().authorizations() != null) { + for (ExpressRouteCircuitAuthorizationInner inner : this.inner().authorizations()) { + lst.add( new ExpressRouteCircuitAuthorizationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String circuitProvisioningState() { + return this.inner().circuitProvisioningState(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String serviceKey() { + return this.inner().serviceKey(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.inner().serviceProviderProperties(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public ExpressRouteCircuitSku sku() { + return this.inner().sku(); + } + + @Override + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.inner().withAllowClassicOperations(allowClassicOperations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAllowGlobalReach(Boolean allowGlobalReach) { + this.inner().withAllowGlobalReach(allowGlobalReach); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.inner().withAuthorizations(authorizations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.inner().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCircuitImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.inner().withServiceKey(serviceKey); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.inner().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitInner.java new file mode 100644 index 0000000000000..abd3db72bdc9e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitInner.java @@ -0,0 +1,384 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_07_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitServiceProviderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCircuit resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCircuitInner extends Resource { + /** + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /** + * Allow classic operations. + */ + @JsonProperty(value = "properties.allowClassicOperations") + private Boolean allowClassicOperations; + + /** + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.circuitProvisioningState") + private String circuitProvisioningState; + + /** + * The ServiceProviderProvisioningState state of the resource. Possible + * values are 'NotProvisioned', 'Provisioning', 'Provisioned', and + * 'Deprovisioning'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * The list of authorizations. + */ + @JsonProperty(value = "properties.authorizations") + private List authorizations; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The ServiceKey. + */ + @JsonProperty(value = "properties.serviceKey") + private String serviceKey; + + /** + * The ServiceProviderNotes. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * The ServiceProviderProperties. + */ + @JsonProperty(value = "properties.serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Flag to enable Global Reach on the circuit. + */ + @JsonProperty(value = "properties.allowGlobalReach") + private Boolean allowGlobalReach; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the SKU. + * + * @return the sku value + */ + public ExpressRouteCircuitSku sku() { + return this.sku; + } + + /** + * Set the SKU. + * + * @param sku the sku value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withSku(ExpressRouteCircuitSku sku) { + this.sku = sku; + return this; + } + + /** + * Get allow classic operations. + * + * @return the allowClassicOperations value + */ + public Boolean allowClassicOperations() { + return this.allowClassicOperations; + } + + /** + * Set allow classic operations. + * + * @param allowClassicOperations the allowClassicOperations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { + this.allowClassicOperations = allowClassicOperations; + return this; + } + + /** + * Get the CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value + */ + public String circuitProvisioningState() { + return this.circuitProvisioningState; + } + + /** + * Set the CircuitProvisioningState state of the resource. + * + * @param circuitProvisioningState the circuitProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { + this.circuitProvisioningState = circuitProvisioningState; + return this; + } + + /** + * Get the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the list of authorizations. + * + * @return the authorizations value + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the list of authorizations. + * + * @param authorizations the authorizations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the ServiceKey. + * + * @return the serviceKey value + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Set the ServiceKey. + * + * @param serviceKey the serviceKey value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + this.serviceKey = serviceKey; + return this; + } + + /** + * Get the ServiceProviderNotes. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the ServiceProviderProperties. + * + * @return the serviceProviderProperties value + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.serviceProviderProperties; + } + + /** + * Set the ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.serviceProviderProperties = serviceProviderProperties; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get flag to enable Global Reach on the circuit. + * + * @return the allowGlobalReach value + */ + public Boolean allowGlobalReach() { + return this.allowGlobalReach; + } + + /** + * Set flag to enable Global Reach on the circuit. + * + * @param allowGlobalReach the allowGlobalReach value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowGlobalReach(Boolean allowGlobalReach) { + this.allowGlobalReach = allowGlobalReach; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringImpl.java new file mode 100644 index 0000000000000..72b13666739c6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,329 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_07_01.Ipv6ExpressRouteCircuitPeeringConfig; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilter; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + + ExpressRouteCircuitPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCircuitPeeringImpl(ExpressRouteCircuitPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (ExpressRouteCircuitConnectionInner inner : this.inner().connections()) { + lst.add( new ExpressRouteCircuitConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteFilter routeFilter() { + RouteFilterInner inner = this.inner().routeFilter(); + if (inner != null) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.inner().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withAzureASN(Integer azureASN) { + this.inner().withAzureASN(azureASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.inner().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withRouteFilter(RouteFilterInner routeFilter) { + this.inner().withRouteFilter(routeFilter); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.inner().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.inner().withStats(stats); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringInner.java new file mode 100644 index 0000000000000..fb07c93b393d6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,538 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_07_01.Ipv6ExpressRouteCircuitPeeringConfig; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN") + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort") + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort") + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets peering stats. + */ + @JsonProperty(value = "properties.stats") + private ExpressRouteCircuitStatsInner stats; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "properties.routeFilter") + private RouteFilterInner routeFilter; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * The list of circuit connections associated with Azure Private Peering + * for this circuit. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Set the Azure ASN. + * + * @param azureASN the azureASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withAzureASN(Integer azureASN) { + this.azureASN = azureASN; + return this; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Set the primary port. + * + * @param primaryAzurePort the primaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { + this.primaryAzurePort = primaryAzurePort; + return this; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Set the secondary port. + * + * @param secondaryAzurePort the secondaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { + this.secondaryAzurePort = secondaryAzurePort; + return this; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets peering stats. + * + * @return the stats value + */ + public ExpressRouteCircuitStatsInner stats() { + return this.stats; + } + + /** + * Set gets peering stats. + * + * @param stats the stats value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { + this.stats = stats; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @param connections the connections value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsImpl.java new file mode 100644 index 0000000000000..a8d0703daf73d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitPeeringsImpl extends WrapperImpl implements ExpressRouteCircuitPeerings { + private final NetworkManager manager; + + ExpressRouteCircuitPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(ExpressRouteCircuitPeeringInner inner) { + return new ExpressRouteCircuitPeeringImpl(inner, manager()); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsInner.java new file mode 100644 index 0000000000000..017a855d9c4be --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitPeerings. + */ +public class ExpressRouteCircuitPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..45baff1a74232 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitStats; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ExpressRouteCircuitStatsImpl extends WrapperImpl implements ExpressRouteCircuitStats { + private final NetworkManager manager; + ExpressRouteCircuitStatsImpl(ExpressRouteCircuitStatsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Long primarybytesIn() { + return this.inner().primarybytesIn(); + } + + @Override + public Long primarybytesOut() { + return this.inner().primarybytesOut(); + } + + @Override + public Long secondarybytesIn() { + return this.inner().secondarybytesIn(); + } + + @Override + public Long secondarybytesOut() { + return this.inner().secondarybytesOut(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsInner.java new file mode 100644 index 0000000000000..cbf8152a67fdb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains stats associated with the peering. + */ +public class ExpressRouteCircuitStatsInner { + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get gets BytesIn of the peering. + * + * @return the primarybytesIn value + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param primarybytesIn the primarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { + this.primarybytesIn = primarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the primarybytesOut value + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param primarybytesOut the primarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { + this.primarybytesOut = primarybytesOut; + return this; + } + + /** + * Get gets BytesIn of the peering. + * + * @return the secondarybytesIn value + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param secondarybytesIn the secondarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { + this.secondarybytesIn = secondarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the secondarybytesOut value + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param secondarybytesOut the secondarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { + this.secondarybytesOut = secondarybytesOut; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..51090472cc934 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitArpTable; + +class ExpressRouteCircuitsArpTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsArpTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsArpTableListResultImpl(ExpressRouteCircuitsArpTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 0000000000000..7c7b75e28560a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsArpTableListResultInner { + /** + * Gets list of the ARP table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get gets list of the ARP table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set gets list of the ARP table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsImpl.java new file mode 100644 index 0000000000000..e45cec9bf3124 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuit; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCircuits { + protected ExpressRouteCircuitsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuits(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCircuitsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCircuitImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(ExpressRouteCircuitInner inner) { + return new ExpressRouteCircuitImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(String name) { + return new ExpressRouteCircuitImpl(name, new ExpressRouteCircuitInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResult call(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getStatsAsync(resourceGroupName, circuitName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getPeeringStatsAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java new file mode 100644 index 0000000000000..d0c28425c2e90 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java @@ -0,0 +1,2021 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuits. + */ +public class ExpressRouteCircuitsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuits to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits getStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats") + Observable> getStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits getPeeringStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + Observable> getPeeringStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getStats(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getPeeringStats(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPeeringStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPeeringStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..a68c5c87a9e3c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitRoutesTable; + +class ExpressRouteCircuitsRoutesTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableListResultImpl(ExpressRouteCircuitsRoutesTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 0000000000000..a2ffa7c2c4c14 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableListResultInner { + /** + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..ad963323d6e73 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitRoutesTableSummary; + +class ExpressRouteCircuitsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableSummaryListResultImpl(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..00acc85dfe4ba --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 0000000000000..13ca671a6dd0e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_07_01.ServiceProviderProvisioningState; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionImpl extends GroupableResourceCoreImpl implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + ExpressRouteCrossConnectionImpl(String name, ExpressRouteCrossConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer bandwidthInMbps() { + return this.inner().bandwidthInMbps(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.inner().expressRouteCircuit(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCrossConnectionPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCrossConnectionPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public Integer sTag() { + return this.inner().sTag(); + } + + @Override + public ExpressRouteCrossConnectionImpl withBandwidthInMbps(Integer bandwidthInMbps) { + this.inner().withBandwidthInMbps(bandwidthInMbps); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.inner().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionInner.java new file mode 100644 index 0000000000000..953e130e23589 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_07_01.ServiceProviderProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCrossConnection resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCrossConnectionInner extends Resource { + /** + * The name of the primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The name of the secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "properties.sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer sTag; + + /** + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "properties.bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "properties.expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /** + * The provisioning state of the circuit in the connectivity provider + * system. Possible values are 'NotProvisioned', 'Provisioning', + * 'Provisioned'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the name of the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the identifier of the circuit traffic. + * + * @return the sTag value + */ + public Integer sTag() { + return this.sTag; + } + + /** + * Get the peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location of the ExpressRoute circuit. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the circuit bandwidth In Mbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Get the ExpressRouteCircuit. + * + * @return the expressRouteCircuit value + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.expressRouteCircuit; + } + + /** + * Set the ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.expressRouteCircuit = expressRouteCircuit; + return this; + } + + /** + * Get the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set additional read only notes set by the connectivity provider. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 0000000000000..9bb4e30cab17f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_07_01.Ipv6ExpressRouteCircuitPeeringConfig; + +class ExpressRouteCrossConnectionPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCrossConnectionPeering, ExpressRouteCrossConnectionPeering.Definition, ExpressRouteCrossConnectionPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String crossConnectionName; + private String peeringName; + + ExpressRouteCrossConnectionPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCrossConnectionPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCrossConnectionPeeringImpl(ExpressRouteCrossConnectionPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.crossConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCrossConnections"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.getAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName) { + this.resourceGroupName = resourceGroupName; + this.crossConnectionName = crossConnectionName; + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringInner.java new file mode 100644 index 0000000000000..ebc47f2b27095 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringInner.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_07_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRoute Cross Connection resource. + */ +@JsonFlatten +public class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java new file mode 100644 index 0000000000000..e0dc9cd78702b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionPeeringsImpl extends WrapperImpl implements ExpressRouteCrossConnectionPeerings { + private final NetworkManager manager; + + ExpressRouteCrossConnectionPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnectionPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(ExpressRouteCrossConnectionPeeringInner inner) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, manager()); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String crossConnectionName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, crossConnectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, crossConnectionName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, crossConnectionName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java new file mode 100644 index 0000000000000..e61ba7d3f91b1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnectionPeerings. + */ +public class ExpressRouteCrossConnectionPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnectionPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String crossConnectionName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, crossConnectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String crossConnectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, crossConnectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String crossConnectionName) { + return listWithServiceResponseAsync(resourceGroupName, crossConnectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String crossConnectionName) { + return listSinglePageAsync(resourceGroupName, crossConnectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner get(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner createOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsImpl.java new file mode 100644 index 0000000000000..01e00b2fa829c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnection; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitsRoutesTableListResult; + +class ExpressRouteCrossConnectionsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCrossConnections { + protected ExpressRouteCrossConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCrossConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(ExpressRouteCrossConnectionInner inner) { + return new ExpressRouteCrossConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionImpl(name, new ExpressRouteCrossConnectionInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult call(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsInner.java new file mode 100644 index 0000000000000..187312fa05499 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsInner.java @@ -0,0 +1,1676 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnections. + */ +public class ExpressRouteCrossConnectionsInner implements InnerSupportsGet, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..52080a880f462 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionRoutesTableSummary; + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..8965863f5b8ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + */ +public class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 0000000000000..294c78d0f089f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProvider; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviderBandwidthsOffered; + +class ExpressRouteServiceProviderImpl extends GroupableResourceCoreImpl implements ExpressRouteServiceProvider { + ExpressRouteServiceProviderImpl(String name, ExpressRouteServiceProviderInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bandwidthsOffered() { + return this.inner().bandwidthsOffered(); + } + + @Override + public List peeringLocations() { + return this.inner().peeringLocations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderInner.java new file mode 100644 index 0000000000000..1fb9992c87f41 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProviderInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviderBandwidthsOffered; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A ExpressRouteResourceProvider object. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteServiceProviderInner extends Resource { + /** + * Get a list of peering locations. + */ + @JsonProperty(value = "properties.peeringLocations") + private List peeringLocations; + + /** + * Gets bandwidths offered. + */ + @JsonProperty(value = "properties.bandwidthsOffered") + private List bandwidthsOffered; + + /** + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get get a list of peering locations. + * + * @return the peeringLocations value + */ + public List peeringLocations() { + return this.peeringLocations; + } + + /** + * Set get a list of peering locations. + * + * @param peeringLocations the peeringLocations value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + return this; + } + + /** + * Get gets bandwidths offered. + * + * @return the bandwidthsOffered value + */ + public List bandwidthsOffered() { + return this.bandwidthsOffered; + } + + /** + * Set gets bandwidths offered. + * + * @param bandwidthsOffered the bandwidthsOffered value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withBandwidthsOffered(List bandwidthsOffered) { + this.bandwidthsOffered = bandwidthsOffered; + return this; + } + + /** + * Get gets the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersImpl.java new file mode 100644 index 0000000000000..9258096889e1e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProvider; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteServiceProvidersImpl extends GroupableResourcesCoreImpl implements ExpressRouteServiceProviders { + protected ExpressRouteServiceProvidersImpl(NetworkManager manager) { + super(manager.inner().expressRouteServiceProviders(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteServiceProvidersInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRouteServiceProvidersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteServiceProvidersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteServiceProvider call(ExpressRouteServiceProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(ExpressRouteServiceProviderInner inner) { + return new ExpressRouteServiceProviderImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersInner.java new file mode 100644 index 0000000000000..d338df0b686b4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteServiceProvidersInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteServiceProviders. + */ +public class ExpressRouteServiceProvidersInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteServiceProvidersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteServiceProvidersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteServiceProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteServiceProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteServiceProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviders list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviders listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationImpl.java new file mode 100644 index 0000000000000..64aff3f4c36d8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.FlowLogInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.TrafficAnalyticsProperties; +import com.microsoft.azure.management.network.v2018_07_01.RetentionPolicyParameters; + +class FlowLogInformationImpl extends WrapperImpl implements FlowLogInformation { + private final NetworkManager manager; + FlowLogInformationImpl(FlowLogInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public boolean enabled() { + return this.inner().enabled(); + } + + @Override + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.inner().flowAnalyticsConfiguration(); + } + + @Override + public RetentionPolicyParameters retentionPolicy() { + return this.inner().retentionPolicy(); + } + + @Override + public String storageId() { + return this.inner().storageId(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationInner.java new file mode 100644 index 0000000000000..cf7b266756470 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FlowLogInformationInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.RetentionPolicyParameters; +import com.microsoft.azure.management.network.v2018_07_01.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information on the configuration of flow log and traffic analytics + * (optional) . + */ +@JsonFlatten +public class FlowLogInformationInner { + /** + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * The retentionPolicy property. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /** + * The flowAnalyticsConfiguration property. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /** + * Get the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get iD of the storage account which is used to store the flow log. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set iD of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get flag to enable/disable flow logging. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable flow logging. + * + * @param enabled the enabled value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy value. + * + * @return the retentionPolicy value + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy value. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the flowAnalyticsConfiguration value. + * + * @return the flowAnalyticsConfiguration value + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set the flowAnalyticsConfiguration value. + * + * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationImpl.java new file mode 100644 index 0000000000000..92a4ae156e3cb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.FrontendIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class FrontendIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements FrontendIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String frontendIPConfigurationName; + + FrontendIPConfigurationImpl(FrontendIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.frontendIPConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "frontendIPConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerFrontendIPConfigurationsInner client = this.manager().inner().loadBalancerFrontendIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.frontendIPConfigurationName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + return this.inner().inboundNatRules(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + return this.inner().outboundRules(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List zones() { + return this.inner().zones(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationInner.java new file mode 100644 index 0000000000000..64ebf4abd448a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/FrontendIPConfigurationInner.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP address of the load balancer. + */ +@JsonFlatten +public class FrontendIPConfigurationInner extends SubResource { + /** + * Read only. Inbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /** + * Read only. Inbound pools URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /** + * Read only. Outbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /** + * Gets load balancing rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The Private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the Public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * The reference of the Public IP Prefix resource. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get read only. Inbound rules URIs that use this frontend IP. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get read only. Inbound pools URIs that use this frontend IP. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Get read only. Outbound rules URIs that use this frontend IP. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Get gets load balancing rules URIs that use this frontend IP. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the Public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the Public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the reference of the Public IP Prefix resource. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the reference of the Public IP Prefix resource. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultImpl.java new file mode 100644 index 0000000000000..e66ffce29a8c9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.GatewayRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.GatewayRoute; + +class GatewayRouteListResultImpl extends WrapperImpl implements GatewayRouteListResult { + private final NetworkManager manager; + GatewayRouteListResultImpl(GatewayRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultInner.java new file mode 100644 index 0000000000000..5929c73e4b921 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/GatewayRouteListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of virtual network gateway routes. + */ +public class GatewayRouteListResultInner { + /** + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of gateway routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of gateway routes. + * + * @param value the value value to set + * @return the GatewayRouteListResultInner object itself. + */ + public GatewayRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..d28728c6ec4a3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnection; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class HubVirtualNetworkConnectionImpl extends IndexableRefreshableWrapperImpl implements HubVirtualNetworkConnection { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualHubName; + private String connectionName; + + HubVirtualNetworkConnectionImpl(HubVirtualNetworkConnectionInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualHubs"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "hubVirtualNetworkConnections"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + HubVirtualNetworkConnectionsInner client = this.manager().inner().hubVirtualNetworkConnections(); + return client.getAsync(this.resourceGroupName, this.virtualHubName, this.connectionName); + } + + + + @Override + public Boolean allowHubToRemoteVnetTransit() { + return this.inner().allowHubToRemoteVnetTransit(); + } + + @Override + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.inner().allowRemoteVnetToUseHubVnetGateways(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionInner.java new file mode 100644 index 0000000000000..d345e4d69c771 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * HubVirtualNetworkConnection Resource. + */ +@JsonFlatten +@SkipParentValidation +public class HubVirtualNetworkConnectionInner extends Resource { + /** + * Reference to the remote virtual network. + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "properties.allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /** + * Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "properties.allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set reference to the remote virtual network. + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get virtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value + */ + public Boolean allowHubToRemoteVnetTransit() { + return this.allowHubToRemoteVnetTransit; + } + + /** + * Set virtualHub to RemoteVnet transit to enabled or not. + * + * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { + this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + return this; + } + + /** + * Get allow RemoteVnet to use Virtual Hub's gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value + */ + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.allowRemoteVnetToUseHubVnetGateways; + } + + /** + * Set allow RemoteVnet to use Virtual Hub's gateways. + * + * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways(Boolean allowRemoteVnetToUseHubVnetGateways) { + this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsImpl.java new file mode 100644 index 0000000000000..7b2f177f27445 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnections; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnection; + +class HubVirtualNetworkConnectionsImpl extends WrapperImpl implements HubVirtualNetworkConnections { + private final NetworkManager manager; + + HubVirtualNetworkConnectionsImpl(NetworkManager manager) { + super(manager.inner().hubVirtualNetworkConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private HubVirtualNetworkConnectionImpl wrapModel(HubVirtualNetworkConnectionInner inner) { + return new HubVirtualNetworkConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualHubName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualHubName, connectionName) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsInner.java new file mode 100644 index 0000000000000..f8bcb71a7a104 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/HubVirtualNetworkConnectionsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HubVirtualNetworkConnections. + */ +public class HubVirtualNetworkConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private HubVirtualNetworkConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HubVirtualNetworkConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(HubVirtualNetworkConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HubVirtualNetworkConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface HubVirtualNetworkConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HubVirtualNetworkConnectionInner object if successful. + */ + public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualHubName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).map(new Func1, HubVirtualNetworkConnectionInner>() { + @Override + public HubVirtualNetworkConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualHubName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualHubName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualHubName) { + return listWithServiceResponseAsync(resourceGroupName, virtualHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualHubName) { + return listSinglePageAsync(resourceGroupName, virtualHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + ServiceResponse> * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..0d3029502f201 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.IPAddressAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class IPAddressAvailabilityResultImpl extends WrapperImpl implements IPAddressAvailabilityResult { + private final NetworkManager manager; + IPAddressAvailabilityResultImpl(IPAddressAvailabilityResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean available() { + return this.inner().available(); + } + + @Override + public List availableIPAddresses() { + return this.inner().availableIPAddresses(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultInner.java new file mode 100644 index 0000000000000..b7594e972da06 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IPAddressAvailabilityResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for CheckIPAddressAvailability API service call. + */ +public class IPAddressAvailabilityResultInner { + /** + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIPAddresses; + + /** + * Get private IP address availability. + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set private IP address availability. + * + * @param available the available value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get contains other available private IP addresses if the asked for address is taken. + * + * @return the availableIPAddresses value + */ + public List availableIPAddresses() { + return this.availableIPAddresses; + } + + /** + * Set contains other available private IP addresses if the asked for address is taken. + * + * @param availableIPAddresses the availableIPAddresses value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailableIPAddresses(List availableIPAddresses) { + this.availableIPAddresses = availableIPAddresses; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IdParsingUtils.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..dfcb7715f7802 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..ca818ed85a1d4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class InboundNatRuleImpl extends CreatableUpdatableImpl implements InboundNatRule, InboundNatRule.Definition, InboundNatRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String inboundNatRuleName; + + InboundNatRuleImpl(String name, NetworkManager manager) { + super(name, new InboundNatRuleInner()); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = name; + // + } + + InboundNatRuleImpl(InboundNatRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.inboundNatRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "inboundNatRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().backendIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public Integer frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public InboundNatRuleImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + @Override + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.inner().withBackendPort(backendPort); + return this; + } + + @Override + public InboundNatRuleImpl withEnableFloatingIP(Boolean enableFloatingIP) { + this.inner().withEnableFloatingIP(enableFloatingIP); + return this; + } + + @Override + public InboundNatRuleImpl withEnableTcpReset(Boolean enableTcpReset) { + this.inner().withEnableTcpReset(enableTcpReset); + return this; + } + + @Override + public InboundNatRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.inner().withFrontendIPConfiguration(frontendIPConfiguration); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.inner().withFrontendPort(frontendPort); + return this; + } + + @Override + public InboundNatRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public InboundNatRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public InboundNatRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleInner.java new file mode 100644 index 0000000000000..137686b1c94c2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRuleInner.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT rule of the load balancer. + */ +@JsonFlatten +public class InboundNatRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP + * configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "properties.backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIPConfigurationInner backendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values range from 1 to + * 65534. + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /** + * The port used for the internal endpoint. Acceptable values range from 1 + * to 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. + * + * @return the backendIPConfiguration value + */ + public NetworkInterfaceIPConfigurationInner backendIPConfiguration() { + return this.backendIPConfiguration; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @return the frontendPort value + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @param frontendPort the frontendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesImpl.java new file mode 100644 index 0000000000000..7895277d00ced --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; + +class InboundNatRulesImpl extends WrapperImpl implements InboundNatRules { + private final NetworkManager manager; + + InboundNatRulesImpl(NetworkManager manager) { + super(manager.inner().inboundNatRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public InboundNatRuleImpl define(String name) { + return wrapModel(name); + } + + private InboundNatRuleImpl wrapModel(InboundNatRuleInner inner) { + return new InboundNatRuleImpl(inner, manager()); + } + + private InboundNatRuleImpl wrapModel(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + InboundNatRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesInner.java new file mode 100644 index 0000000000000..6c014d7c47b03 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/InboundNatRulesInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InboundNatRules. + */ +public class InboundNatRulesInner { + /** The Retrofit service to perform REST calls. */ + private InboundNatRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InboundNatRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InboundNatRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for InboundNatRules to be + * used by Retrofit to perform actually REST calls. + */ + interface InboundNatRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.InboundNatRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner createOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsImpl.java new file mode 100644 index 0000000000000..c9642fc3705a0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerBackendAddressPools; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; + +class LoadBalancerBackendAddressPoolsImpl extends WrapperImpl implements LoadBalancerBackendAddressPools { + private final NetworkManager manager; + + LoadBalancerBackendAddressPoolsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerBackendAddressPools()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private BackendAddressPoolImpl wrapModel(BackendAddressPoolInner inner) { + return new BackendAddressPoolImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsInner.java new file mode 100644 index 0000000000000..1ab7220190e5b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerBackendAddressPoolsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerBackendAddressPools. + */ +public class LoadBalancerBackendAddressPoolsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerBackendAddressPoolsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerBackendAddressPoolsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerBackendAddressPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerBackendAddressPools to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerBackendAddressPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerBackendAddressPools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerBackendAddressPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("backendAddressPoolName") String backendAddressPoolName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerBackendAddressPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackendAddressPoolInner object if successful. + */ + public BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).toBlocking().single().body(); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName), serviceCallback); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).map(new Func1, BackendAddressPoolInner>() { + @Override + public BackendAddressPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (backendAddressPoolName == null) { + throw new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, loadBalancerName, backendAddressPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java new file mode 100644 index 0000000000000..c75aa918780b7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerFrontendIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.FrontendIPConfiguration; + +class LoadBalancerFrontendIPConfigurationsImpl extends WrapperImpl implements LoadBalancerFrontendIPConfigurations { + private final NetworkManager manager; + + LoadBalancerFrontendIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerFrontendIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private FrontendIPConfigurationImpl wrapModel(FrontendIPConfigurationInner inner) { + return new FrontendIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java new file mode 100644 index 0000000000000..4baf3c177901c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerFrontendIPConfigurations. + */ +public class LoadBalancerFrontendIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerFrontendIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerFrontendIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerFrontendIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerFrontendIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerFrontendIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerFrontendIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerFrontendIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("frontendIPConfigurationName") String frontendIPConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerFrontendIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FrontendIPConfigurationInner object if successful. + */ + public FrontendIPConfigurationInner get(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).toBlocking().single().body(); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName), serviceCallback); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).map(new Func1, FrontendIPConfigurationInner>() { + @Override + public FrontendIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (frontendIPConfigurationName == null) { + throw new IllegalArgumentException("Parameter frontendIPConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerImpl.java new file mode 100644 index 0000000000000..8dda92f2ea39f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerImpl.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancer; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_07_01.OutboundRule; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_07_01.Probe; + +class LoadBalancerImpl extends GroupableResourceCoreImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + LoadBalancerImpl(String name, LoadBalancerInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List outboundRules() { + return this.inner().outboundRules(); + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public LoadBalancerImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LoadBalancerImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.inner().withInboundNatPools(inboundNatPools); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.inner().withInboundNatRules(inboundNatRules); + return this; + } + + @Override + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.inner().withLoadBalancingRules(loadBalancingRules); + return this; + } + + @Override + public LoadBalancerImpl withOutboundRules(List outboundRules) { + this.inner().withOutboundRules(outboundRules); + return this; + } + + @Override + public LoadBalancerImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public LoadBalancerImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public LoadBalancerImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerInner.java new file mode 100644 index 0000000000000..e41b5d53c02d3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerInner.java @@ -0,0 +1,352 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_07_01.OutboundRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * LoadBalancer resource. + */ +@JsonFlatten +@SkipParentValidation +public class LoadBalancerInner extends Resource { + /** + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /** + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Object collection representing the load balancing rules Gets the + * provisioning. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /** + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with + * defining an inbound NAT pool. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to + * reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatRules") + private List inboundNatRules; + + /** + * Defines an external port range for inbound NAT to a single backend port + * on NICs associated with a load balancer. Inbound NAT rules are created + * automatically for each NIC associated with the Load Balancer using an + * external port from this range. Defining an Inbound NAT pool on your Load + * Balancer is mutually exclusive with defining inbound Nat rules. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are + * associated with individual virtual machines cannot reference an inbound + * NAT pool. They have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatPools") + private List inboundNatPools; + + /** + * The outbound rules. + */ + @JsonProperty(value = "properties.outboundRules") + private List outboundRules; + + /** + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the load balancer SKU. + * + * @return the sku value + */ + public LoadBalancerSku sku() { + return this.sku; + } + + /** + * Set the load balancer SKU. + * + * @param sku the sku value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withSku(LoadBalancerSku sku) { + this.sku = sku; + return this; + } + + /** + * Get object representing the frontend IPs to be used for the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set object representing the frontend IPs to be used for the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set collection of backend address pools used by a load balancer. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get object collection representing the load balancing rules Gets the provisioning. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set object collection representing the load balancing rules Gets the provisioning. + * + * @param loadBalancingRules the loadBalancingRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get collection of probe objects used in the load balancer. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set collection of probe objects used in the load balancer. + * + * @param probes the probes value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Set collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatRules(List inboundNatRules) { + this.inboundNatRules = inboundNatRules; + return this; + } + + /** + * Get defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Set defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatPools the inboundNatPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + + /** + * Get the outbound rules. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Set the outbound rules. + * + * @param outboundRules the outboundRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withOutboundRules(List outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the resource GUID property of the load balancer resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the load balancer resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesImpl.java new file mode 100644 index 0000000000000..ebf5595f8ce6e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerLoadBalancingRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancingRule; + +class LoadBalancerLoadBalancingRulesImpl extends WrapperImpl implements LoadBalancerLoadBalancingRules { + private final NetworkManager manager; + + LoadBalancerLoadBalancingRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerLoadBalancingRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancingRuleImpl wrapModel(LoadBalancingRuleInner inner) { + return new LoadBalancingRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesInner.java new file mode 100644 index 0000000000000..4870de3a89224 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerLoadBalancingRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerLoadBalancingRules. + */ +public class LoadBalancerLoadBalancingRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerLoadBalancingRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerLoadBalancingRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerLoadBalancingRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerLoadBalancingRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerLoadBalancingRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerLoadBalancingRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerLoadBalancingRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("loadBalancingRuleName") String loadBalancingRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerLoadBalancingRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancingRuleInner object if successful. + */ + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).map(new Func1, LoadBalancingRuleInner>() { + @Override + public LoadBalancingRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (loadBalancingRuleName == null) { + throw new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, loadBalancerName, loadBalancingRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfaceImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfaceImpl.java new file mode 100644 index 0000000000000..c629fb2b04a07 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfaceImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceDnsSettings; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroup; +import java.util.Map; +import com.microsoft.azure.SubResource; + +class LoadBalancerNetworkInterfaceImpl extends WrapperImpl implements LoadBalancerNetworkInterface { + private final NetworkManager manager; + + LoadBalancerNetworkInterfaceImpl(NetworkInterfaceInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesImpl.java new file mode 100644 index 0000000000000..2477a2e0c415f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterface; + +class LoadBalancerNetworkInterfacesImpl extends WrapperImpl implements LoadBalancerNetworkInterfaces { + private final NetworkManager manager; + + LoadBalancerNetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerNetworkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancerNetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerNetworkInterfacesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesInner.java new file mode 100644 index 0000000000000..a5339cbe0d944 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerNetworkInterfacesInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerNetworkInterfaces. + */ +public class LoadBalancerNetworkInterfacesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerNetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerNetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerNetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerNetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerNetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesImpl.java new file mode 100644 index 0000000000000..6b3391b9145ab --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerProbes; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Probe; + +class LoadBalancerProbesImpl extends WrapperImpl implements LoadBalancerProbes { + private final NetworkManager manager; + + LoadBalancerProbesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerProbes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ProbeImpl wrapModel(ProbeInner inner) { + return new ProbeImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerProbesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + LoadBalancerProbesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, probeName) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesInner.java new file mode 100644 index 0000000000000..82ef445e4522a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancerProbesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerProbes. + */ +public class LoadBalancerProbesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerProbesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerProbesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerProbesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerProbes to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerProbesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerProbes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerProbes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("probeName") String probeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancerProbes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProbeInner object if successful. + */ + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).toBlocking().single().body(); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String probeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName), serviceCallback); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).map(new Func1, ProbeInner>() { + @Override + public ProbeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String probeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (probeName == null) { + throw new IllegalArgumentException("Parameter probeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, loadBalancerName, probeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersImpl.java new file mode 100644 index 0000000000000..39172a1c97eed --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancer; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LoadBalancersImpl extends GroupableResourcesCoreImpl implements LoadBalancers { + protected LoadBalancersImpl(NetworkManager manager) { + super(manager.inner().loadBalancers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + LoadBalancersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LoadBalancerImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new LoadBalancerImpl(inner.name(), inner, manager()); + } + + @Override + protected LoadBalancerImpl wrapModel(String name) { + return new LoadBalancerImpl(name, new LoadBalancerInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersInner.java new file mode 100644 index 0000000000000..c29dd4ba75ddd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancersInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancers. + */ +public class LoadBalancersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private LoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LoadBalancers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 0000000000000..1238c85fa7051 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancingRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.LoadDistribution; +import com.microsoft.azure.management.network.v2018_07_01.TransportProtocol; + +class LoadBalancingRuleImpl extends IndexableRefreshableWrapperImpl implements LoadBalancingRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String loadBalancingRuleName; + + LoadBalancingRuleImpl(LoadBalancingRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.loadBalancingRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancingRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerLoadBalancingRulesInner client = this.manager().inner().loadBalancerLoadBalancingRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.loadBalancingRuleName); + } + + + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean disableOutboundSnat() { + return this.inner().disableOutboundSnat(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public int frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public LoadDistribution loadDistribution() { + return this.inner().loadDistribution(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource probe() { + return this.inner().probe(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleInner.java new file mode 100644 index 0000000000000..c2ff324a9bbc6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LoadBalancingRuleInner.java @@ -0,0 +1,403 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_07_01.LoadDistribution; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancing rule for a load balancer. + */ +@JsonFlatten +public class LoadBalancingRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * The reference of the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The load distribution policy for this rule. Possible values are + * 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: + * 'Default', 'SourceIP', 'SourceIPProtocol'. + */ + @JsonProperty(value = "properties.loadDistribution") + private LoadDistribution loadDistribution; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 0 and + * 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.frontendPort", required = true) + private int frontendPort; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 0 and 65535. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + */ + @JsonProperty(value = "properties.disableOutboundSnat") + private Boolean disableOutboundSnat; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the reference of the load balancer probe used by the load balancing rule. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the reference of the load balancer probe used by the load balancing rule. + * + * @param probe the probe value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @return the loadDistribution value + */ + public LoadDistribution loadDistribution() { + return this.loadDistribution; + } + + /** + * Set the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @param loadDistribution the loadDistribution value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { + this.loadDistribution = loadDistribution; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value + */ + public int frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @param frontendPort the frontendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @param backendPort the backendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @return the disableOutboundSnat value + */ + public Boolean disableOutboundSnat() { + return this.disableOutboundSnat; + } + + /** + * Set configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @param disableOutboundSnat the disableOutboundSnat value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { + this.disableOutboundSnat = disableOutboundSnat; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayImpl.java new file mode 100644 index 0000000000000..fc519f3bea95d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; + +class LocalNetworkGatewayImpl extends GroupableResourceCoreImpl implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + LocalNetworkGatewayImpl(String name, LocalNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayIpAddress() { + return this.inner().gatewayIpAddress(); + } + + @Override + public AddressSpace localNetworkAddressSpace() { + return this.inner().localNetworkAddressSpace(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public LocalNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.inner().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + @Override + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.inner().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + @Override + public LocalNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayInner.java new file mode 100644 index 0000000000000..00d76e69b3d63 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewayInner.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class LocalNetworkGatewayInner extends Resource { + /** + * Local network site address space. + */ + @JsonProperty(value = "properties.localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /** + * IP address of local network gateway. + */ + @JsonProperty(value = "properties.gatewayIpAddress") + private String gatewayIpAddress; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the LocalNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the LocalNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get local network site address space. + * + * @return the localNetworkAddressSpace value + */ + public AddressSpace localNetworkAddressSpace() { + return this.localNetworkAddressSpace; + } + + /** + * Set local network site address space. + * + * @param localNetworkAddressSpace the localNetworkAddressSpace value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.localNetworkAddressSpace = localNetworkAddressSpace; + return this; + } + + /** + * Get iP address of local network gateway. + * + * @return the gatewayIpAddress value + */ + public String gatewayIpAddress() { + return this.gatewayIpAddress; + } + + /** + * Set iP address of local network gateway. + * + * @param gatewayIpAddress the gatewayIpAddress value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { + this.gatewayIpAddress = gatewayIpAddress; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the LocalNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the LocalNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..c7e9b6d45f46c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LocalNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements LocalNetworkGateways { + protected LocalNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().localNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocalNetworkGateway call(LocalNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LocalNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(LocalNetworkGatewayInner inner) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(String name) { + return new LocalNetworkGatewayImpl(name, new LocalNetworkGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysInner.java new file mode 100644 index 0000000000000..1ee2cd534d992 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/LocalNetworkGatewaysInner.java @@ -0,0 +1,1048 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocalNetworkGateways. + */ +public class LocalNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private LocalNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocalNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LocalNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocalNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface LocalNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String localNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String localNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..741884e8facc3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticResult; + +class NetworkConfigurationDiagnosticResponseImpl extends WrapperImpl implements NetworkConfigurationDiagnosticResponse { + private final NetworkManager manager; + NetworkConfigurationDiagnosticResponseImpl(NetworkConfigurationDiagnosticResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List results() { + return this.inner().results(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 0000000000000..3cd8abf733373 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network configuration diagnostic on the target resource. + */ +public class NetworkConfigurationDiagnosticResponseInner { + /** + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get list of network configuration diagnostic results. + * + * @return the results value + */ + public List results() { + return this.results; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationInner.java new file mode 100644 index 0000000000000..613ee818f42c9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationInner.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IPConfiguration in a network interface. + */ +@JsonFlatten +public class NetworkInterfaceIPConfigurationInner extends SubResource { + /** + * The reference of ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /** + * The reference of LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /** + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Defines how a private IP address is assigned. Possible values are: + * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Available from Api-Version 2016-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IPVersion privateIPAddressVersion; + + /** + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets whether this is a primary customer address on the network + * interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * The provisioning state of the network interface IP configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the reference of ApplicationGatewayBackendAddressPool resource. + * + * @return the applicationGatewayBackendAddressPools value + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the reference of ApplicationGatewayBackendAddressPool resource. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the reference of LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the reference of LoadBalancerBackendAddressPool resource. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get a list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value + */ + public List loadBalancerInboundNatRules() { + return this.loadBalancerInboundNatRules; + } + + /** + * Set a list of references of LoadBalancerInboundNatRules. + * + * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerInboundNatRules(List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the privateIPAddressVersion value + */ + public IPVersion privateIPAddressVersion() { + return this.privateIPAddressVersion; + } + + /** + * Set available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param privateIPAddressVersion the privateIPAddressVersion value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + this.privateIPAddressVersion = privateIPAddressVersion; + return this; + } + + /** + * Get subnet bound to the IP configuration. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set subnet bound to the IP configuration. + * + * @param subnet the subnet value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets whether this is a primary customer address on the network interface. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary customer address on the network interface. + * + * @param primary the primary value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get public IP address bound to the IP configuration. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set public IP address bound to the IP configuration. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get application security groups in which the IP configuration is included. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups in which the IP configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsImpl.java new file mode 100644 index 0000000000000..5d195c8d588b8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceNetworkInterfaceIPConfiguration; + +class NetworkInterfaceIPConfigurationsImpl extends WrapperImpl implements NetworkInterfaceIPConfigurations { + private final NetworkManager manager; + + NetworkInterfaceIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceNetworkInterfaceIPConfigurationImpl wrapModel(NetworkInterfaceIPConfigurationInner inner) { + return new NetworkInterfaceNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsInner.java new file mode 100644 index 0000000000000..4930685abcebe --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceIPConfigurations. + */ +public class NetworkInterfaceIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner get(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceImpl.java new file mode 100644 index 0000000000000..885ab428432fc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterface; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceDnsSettings; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroup; + +class NetworkInterfaceImpl extends GroupableResourceCoreImpl implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + NetworkInterfaceImpl(String name, NetworkInterfaceInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + + @Override + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.inner().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableIPForwarding(Boolean enableIPForwarding) { + this.inner().withEnableIPForwarding(enableIPForwarding); + return this; + } + + @Override + public NetworkInterfaceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public NetworkInterfaceImpl withMacAddress(String macAddress) { + this.inner().withMacAddress(macAddress); + return this; + } + + @Override + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public NetworkInterfaceImpl withPrimary(Boolean primary) { + this.inner().withPrimary(primary); + return this; + } + + @Override + public NetworkInterfaceImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkInterfaceImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkInterfaceImpl withVirtualMachine(SubResource virtualMachine) { + this.inner().withVirtualMachine(virtualMachine); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceInner.java new file mode 100644 index 0000000000000..7c802222ba425 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceInner.java @@ -0,0 +1,338 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A network interface in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkInterfaceInner extends Resource { + /** + * The reference of a virtual machine. + */ + @JsonProperty(value = "properties.virtualMachine") + private SubResource virtualMachine; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The DNS settings in network interface. + */ + @JsonProperty(value = "properties.dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /** + * The MAC address of the network interface. + */ + @JsonProperty(value = "properties.macAddress") + private String macAddress; + + /** + * Gets whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * If the network interface is accelerated networking enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /** + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the reference of a virtual machine. + * + * @return the virtualMachine value + */ + public SubResource virtualMachine() { + return this.virtualMachine; + } + + /** + * Set the reference of a virtual machine. + * + * @param virtualMachine the virtualMachine value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withVirtualMachine(SubResource virtualMachine) { + this.virtualMachine = virtualMachine; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get a list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the DNS settings in network interface. + * + * @return the dnsSettings value + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the DNS settings in network interface. + * + * @param dnsSettings the dnsSettings value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the MAC address of the network interface. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address of the network interface. + * + * @param macAddress the macAddress value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get gets whether this is a primary network interface on a virtual machine. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary network interface on a virtual machine. + * + * @param primary the primary value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get if the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set if the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + return this; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network interface resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancerImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancerImpl.java new file mode 100644 index 0000000000000..3aeab2a2ef005 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancerImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_07_01.OutboundRule; +import com.microsoft.azure.management.network.v2018_07_01.Probe; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerSku; +import java.util.Map; + +class NetworkInterfaceLoadBalancerImpl extends WrapperImpl implements NetworkInterfaceLoadBalancer { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancerImpl(LoadBalancerInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + return this.inner().outboundRules(); + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersImpl.java new file mode 100644 index 0000000000000..93585c4a27fb4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancer; + +class NetworkInterfaceLoadBalancersImpl extends WrapperImpl implements NetworkInterfaceLoadBalancers { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancersImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceLoadBalancers()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceLoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new NetworkInterfaceLoadBalancerImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceLoadBalancersInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceLoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersInner.java new file mode 100644 index 0000000000000..89ec4214fc315 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceLoadBalancersInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceLoadBalancers. + */ +public class NetworkInterfaceLoadBalancersInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceLoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceLoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceLoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceLoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceLoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..0eebe49f748b6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class NetworkInterfaceNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements NetworkInterfaceNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String ipConfigurationName; + + NetworkInterfaceNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceIPConfigurationsInner client = this.manager().inner().networkInterfaceIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesImpl.java new file mode 100644 index 0000000000000..67385477c055d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterface; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveRouteListResult; +import com.microsoft.azure.management.network.v2018_07_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class NetworkInterfacesImpl extends WrapperImpl implements NetworkInterfaces { + private final NetworkManager manager; + + NetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().networkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceImpl defineNetworkInterface(String name) { + return wrapNetworkInterfaceModel(name); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(String name) { + return new NetworkInterfaceImpl(name, new NetworkInterfaceInner(), this.manager()); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(NetworkInterfaceInner inner) { + return new NetworkInterfaceImpl(inner.name(), inner, manager()); + } + + private VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(NetworkInterfaceIPConfigurationInner inner) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + private Observable getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(String resourceGroupName, String name) { + NetworkInterfacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + private Observable getNetworkInterfaceIPConfigurationInnerUsingNetworkInterfacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(id, "virtualMachineScaleSets"); + String virtualmachineIndex = IdParsingUtils.getValueFromIdByName(id, "virtualMachines"); + String networkInterfaceName = IdParsingUtils.getValueFromIdByName(id, "networkInterfaces"); + String ipConfigurationName = IdParsingUtils.getValueFromIdByName(id, "ipConfigurations"); + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(resourceGroupName, name).map(new Func1 () { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkInterfacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + NetworkInterfacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveRouteListResult call(EffectiveRouteListResultInner inner) { + return new EffectiveRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveNetworkSecurityGroupListResult call(EffectiveNetworkSecurityGroupListResultInner inner) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java new file mode 100644 index 0000000000000..10ddf37dabd41 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java @@ -0,0 +1,2966 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaces. + */ +public class NetworkInterfacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces getEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> getEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces beginGetEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> beginGetEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> listEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces beginListEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> beginListEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces") + Observable> listVirtualMachineScaleSetVMNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + Observable> listVirtualMachineScaleSetNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces getVirtualMachineScaleSetNetworkInterface" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}") + Observable> getVirtualMachineScaleSetNetworkInterface(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurations" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> listVirtualMachineScaleSetIpConfigurations(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces getVirtualMachineScaleSetIpConfiguration" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> getVirtualMachineScaleSetIpConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurationsNext" }) + @GET + Observable> listVirtualMachineScaleSetIpConfigurationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetEffectiveRouteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetEffectiveRouteTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListEffectiveNetworkSecurityGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListEffectiveNetworkSecurityGroupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetNetworkInterfaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + ServiceResponse> * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetIpConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurationsNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetIpConfigurationsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManagementClientImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManagementClientImpl.java new file mode 100644 index 0000000000000..a43d5ef65148c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,1015 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the NetworkManagementClientImpl class. + */ +public class NetworkManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private NetworkManagementClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NetworkManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NetworkManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AzureFirewallsInner object to access its operations. + */ + private AzureFirewallsInner azureFirewalls; + + /** + * Gets the AzureFirewallsInner object to access its operations. + * @return the AzureFirewallsInner object. + */ + public AzureFirewallsInner azureFirewalls() { + return this.azureFirewalls; + } + + /** + * The ApplicationGatewaysInner object to access its operations. + */ + private ApplicationGatewaysInner applicationGateways; + + /** + * Gets the ApplicationGatewaysInner object to access its operations. + * @return the ApplicationGatewaysInner object. + */ + public ApplicationGatewaysInner applicationGateways() { + return this.applicationGateways; + } + + /** + * The ApplicationSecurityGroupsInner object to access its operations. + */ + private ApplicationSecurityGroupsInner applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsInner object to access its operations. + * @return the ApplicationSecurityGroupsInner object. + */ + public ApplicationSecurityGroupsInner applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * The DdosProtectionPlansInner object to access its operations. + */ + private DdosProtectionPlansInner ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansInner object to access its operations. + * @return the DdosProtectionPlansInner object. + */ + public DdosProtectionPlansInner ddosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** + * The AvailableEndpointServicesInner object to access its operations. + */ + private AvailableEndpointServicesInner availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesInner object to access its operations. + * @return the AvailableEndpointServicesInner object. + */ + public AvailableEndpointServicesInner availableEndpointServices() { + return this.availableEndpointServices; + } + + /** + * The ExpressRouteCircuitAuthorizationsInner object to access its operations. + */ + private ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsInner object to access its operations. + * @return the ExpressRouteCircuitAuthorizationsInner object. + */ + public ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** + * The ExpressRouteCircuitPeeringsInner object to access its operations. + */ + private ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsInner object to access its operations. + * @return the ExpressRouteCircuitPeeringsInner object. + */ + public ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** + * The ExpressRouteCircuitConnectionsInner object to access its operations. + */ + private ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsInner object to access its operations. + * @return the ExpressRouteCircuitConnectionsInner object. + */ + public ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** + * The ExpressRouteCircuitsInner object to access its operations. + */ + private ExpressRouteCircuitsInner expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsInner object to access its operations. + * @return the ExpressRouteCircuitsInner object. + */ + public ExpressRouteCircuitsInner expressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** + * The ExpressRouteServiceProvidersInner object to access its operations. + */ + private ExpressRouteServiceProvidersInner expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersInner object to access its operations. + * @return the ExpressRouteServiceProvidersInner object. + */ + public ExpressRouteServiceProvidersInner expressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** + * The ExpressRouteCrossConnectionsInner object to access its operations. + */ + private ExpressRouteCrossConnectionsInner expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsInner object to access its operations. + * @return the ExpressRouteCrossConnectionsInner object. + */ + public ExpressRouteCrossConnectionsInner expressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** + * The ExpressRouteCrossConnectionPeeringsInner object to access its operations. + */ + private ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsInner object to access its operations. + * @return the ExpressRouteCrossConnectionPeeringsInner object. + */ + public ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** + * The LoadBalancersInner object to access its operations. + */ + private LoadBalancersInner loadBalancers; + + /** + * Gets the LoadBalancersInner object to access its operations. + * @return the LoadBalancersInner object. + */ + public LoadBalancersInner loadBalancers() { + return this.loadBalancers; + } + + /** + * The LoadBalancerBackendAddressPoolsInner object to access its operations. + */ + private LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools; + + /** + * Gets the LoadBalancerBackendAddressPoolsInner object to access its operations. + * @return the LoadBalancerBackendAddressPoolsInner object. + */ + public LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * The LoadBalancerFrontendIPConfigurationsInner object to access its operations. + */ + private LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations; + + /** + * Gets the LoadBalancerFrontendIPConfigurationsInner object to access its operations. + * @return the LoadBalancerFrontendIPConfigurationsInner object. + */ + public LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations() { + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * The InboundNatRulesInner object to access its operations. + */ + private InboundNatRulesInner inboundNatRules; + + /** + * Gets the InboundNatRulesInner object to access its operations. + * @return the InboundNatRulesInner object. + */ + public InboundNatRulesInner inboundNatRules() { + return this.inboundNatRules; + } + + /** + * The LoadBalancerLoadBalancingRulesInner object to access its operations. + */ + private LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules; + + /** + * Gets the LoadBalancerLoadBalancingRulesInner object to access its operations. + * @return the LoadBalancerLoadBalancingRulesInner object. + */ + public LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules() { + return this.loadBalancerLoadBalancingRules; + } + + /** + * The LoadBalancerNetworkInterfacesInner object to access its operations. + */ + private LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces; + + /** + * Gets the LoadBalancerNetworkInterfacesInner object to access its operations. + * @return the LoadBalancerNetworkInterfacesInner object. + */ + public LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces() { + return this.loadBalancerNetworkInterfaces; + } + + /** + * The LoadBalancerProbesInner object to access its operations. + */ + private LoadBalancerProbesInner loadBalancerProbes; + + /** + * Gets the LoadBalancerProbesInner object to access its operations. + * @return the LoadBalancerProbesInner object. + */ + public LoadBalancerProbesInner loadBalancerProbes() { + return this.loadBalancerProbes; + } + + /** + * The NetworkInterfacesInner object to access its operations. + */ + private NetworkInterfacesInner networkInterfaces; + + /** + * Gets the NetworkInterfacesInner object to access its operations. + * @return the NetworkInterfacesInner object. + */ + public NetworkInterfacesInner networkInterfaces() { + return this.networkInterfaces; + } + + /** + * The NetworkInterfaceIPConfigurationsInner object to access its operations. + */ + private NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations; + + /** + * Gets the NetworkInterfaceIPConfigurationsInner object to access its operations. + * @return the NetworkInterfaceIPConfigurationsInner object. + */ + public NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations() { + return this.networkInterfaceIPConfigurations; + } + + /** + * The NetworkInterfaceLoadBalancersInner object to access its operations. + */ + private NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers; + + /** + * Gets the NetworkInterfaceLoadBalancersInner object to access its operations. + * @return the NetworkInterfaceLoadBalancersInner object. + */ + public NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers() { + return this.networkInterfaceLoadBalancers; + } + + /** + * The NetworkSecurityGroupsInner object to access its operations. + */ + private NetworkSecurityGroupsInner networkSecurityGroups; + + /** + * Gets the NetworkSecurityGroupsInner object to access its operations. + * @return the NetworkSecurityGroupsInner object. + */ + public NetworkSecurityGroupsInner networkSecurityGroups() { + return this.networkSecurityGroups; + } + + /** + * The SecurityRulesInner object to access its operations. + */ + private SecurityRulesInner securityRules; + + /** + * Gets the SecurityRulesInner object to access its operations. + * @return the SecurityRulesInner object. + */ + public SecurityRulesInner securityRules() { + return this.securityRules; + } + + /** + * The DefaultSecurityRulesInner object to access its operations. + */ + private DefaultSecurityRulesInner defaultSecurityRules; + + /** + * Gets the DefaultSecurityRulesInner object to access its operations. + * @return the DefaultSecurityRulesInner object. + */ + public DefaultSecurityRulesInner defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * The NetworkWatchersInner object to access its operations. + */ + private NetworkWatchersInner networkWatchers; + + /** + * Gets the NetworkWatchersInner object to access its operations. + * @return the NetworkWatchersInner object. + */ + public NetworkWatchersInner networkWatchers() { + return this.networkWatchers; + } + + /** + * The PacketCapturesInner object to access its operations. + */ + private PacketCapturesInner packetCaptures; + + /** + * Gets the PacketCapturesInner object to access its operations. + * @return the PacketCapturesInner object. + */ + public PacketCapturesInner packetCaptures() { + return this.packetCaptures; + } + + /** + * The ConnectionMonitorsInner object to access its operations. + */ + private ConnectionMonitorsInner connectionMonitors; + + /** + * Gets the ConnectionMonitorsInner object to access its operations. + * @return the ConnectionMonitorsInner object. + */ + public ConnectionMonitorsInner connectionMonitors() { + return this.connectionMonitors; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PublicIPAddressesInner object to access its operations. + */ + private PublicIPAddressesInner publicIPAddresses; + + /** + * Gets the PublicIPAddressesInner object to access its operations. + * @return the PublicIPAddressesInner object. + */ + public PublicIPAddressesInner publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * The PublicIPPrefixesInner object to access its operations. + */ + private PublicIPPrefixesInner publicIPPrefixes; + + /** + * Gets the PublicIPPrefixesInner object to access its operations. + * @return the PublicIPPrefixesInner object. + */ + public PublicIPPrefixesInner publicIPPrefixes() { + return this.publicIPPrefixes; + } + + /** + * The RouteFiltersInner object to access its operations. + */ + private RouteFiltersInner routeFilters; + + /** + * Gets the RouteFiltersInner object to access its operations. + * @return the RouteFiltersInner object. + */ + public RouteFiltersInner routeFilters() { + return this.routeFilters; + } + + /** + * The RouteFilterRulesInner object to access its operations. + */ + private RouteFilterRulesInner routeFilterRules; + + /** + * Gets the RouteFilterRulesInner object to access its operations. + * @return the RouteFilterRulesInner object. + */ + public RouteFilterRulesInner routeFilterRules() { + return this.routeFilterRules; + } + + /** + * The RouteTablesInner object to access its operations. + */ + private RouteTablesInner routeTables; + + /** + * Gets the RouteTablesInner object to access its operations. + * @return the RouteTablesInner object. + */ + public RouteTablesInner routeTables() { + return this.routeTables; + } + + /** + * The RoutesInner object to access its operations. + */ + private RoutesInner routes; + + /** + * Gets the RoutesInner object to access its operations. + * @return the RoutesInner object. + */ + public RoutesInner routes() { + return this.routes; + } + + /** + * The BgpServiceCommunitiesInner object to access its operations. + */ + private BgpServiceCommunitiesInner bgpServiceCommunities; + + /** + * Gets the BgpServiceCommunitiesInner object to access its operations. + * @return the BgpServiceCommunitiesInner object. + */ + public BgpServiceCommunitiesInner bgpServiceCommunities() { + return this.bgpServiceCommunities; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The VirtualNetworksInner object to access its operations. + */ + private VirtualNetworksInner virtualNetworks; + + /** + * Gets the VirtualNetworksInner object to access its operations. + * @return the VirtualNetworksInner object. + */ + public VirtualNetworksInner virtualNetworks() { + return this.virtualNetworks; + } + + /** + * The SubnetsInner object to access its operations. + */ + private SubnetsInner subnets; + + /** + * Gets the SubnetsInner object to access its operations. + * @return the SubnetsInner object. + */ + public SubnetsInner subnets() { + return this.subnets; + } + + /** + * The VirtualNetworkPeeringsInner object to access its operations. + */ + private VirtualNetworkPeeringsInner virtualNetworkPeerings; + + /** + * Gets the VirtualNetworkPeeringsInner object to access its operations. + * @return the VirtualNetworkPeeringsInner object. + */ + public VirtualNetworkPeeringsInner virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * The VirtualNetworkGatewaysInner object to access its operations. + */ + private VirtualNetworkGatewaysInner virtualNetworkGateways; + + /** + * Gets the VirtualNetworkGatewaysInner object to access its operations. + * @return the VirtualNetworkGatewaysInner object. + */ + public VirtualNetworkGatewaysInner virtualNetworkGateways() { + return this.virtualNetworkGateways; + } + + /** + * The VirtualNetworkGatewayConnectionsInner object to access its operations. + */ + private VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections; + + /** + * Gets the VirtualNetworkGatewayConnectionsInner object to access its operations. + * @return the VirtualNetworkGatewayConnectionsInner object. + */ + public VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections() { + return this.virtualNetworkGatewayConnections; + } + + /** + * The LocalNetworkGatewaysInner object to access its operations. + */ + private LocalNetworkGatewaysInner localNetworkGateways; + + /** + * Gets the LocalNetworkGatewaysInner object to access its operations. + * @return the LocalNetworkGatewaysInner object. + */ + public LocalNetworkGatewaysInner localNetworkGateways() { + return this.localNetworkGateways; + } + + /** + * The VirtualWANsInner object to access its operations. + */ + private VirtualWANsInner virtualWANs; + + /** + * Gets the VirtualWANsInner object to access its operations. + * @return the VirtualWANsInner object. + */ + public VirtualWANsInner virtualWANs() { + return this.virtualWANs; + } + + /** + * The VpnSitesInner object to access its operations. + */ + private VpnSitesInner vpnSites; + + /** + * Gets the VpnSitesInner object to access its operations. + * @return the VpnSitesInner object. + */ + public VpnSitesInner vpnSites() { + return this.vpnSites; + } + + /** + * The VpnSitesConfigurationsInner object to access its operations. + */ + private VpnSitesConfigurationsInner vpnSitesConfigurations; + + /** + * Gets the VpnSitesConfigurationsInner object to access its operations. + * @return the VpnSitesConfigurationsInner object. + */ + public VpnSitesConfigurationsInner vpnSitesConfigurations() { + return this.vpnSitesConfigurations; + } + + /** + * The VirtualHubsInner object to access its operations. + */ + private VirtualHubsInner virtualHubs; + + /** + * Gets the VirtualHubsInner object to access its operations. + * @return the VirtualHubsInner object. + */ + public VirtualHubsInner virtualHubs() { + return this.virtualHubs; + } + + /** + * The HubVirtualNetworkConnectionsInner object to access its operations. + */ + private HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsInner object to access its operations. + * @return the HubVirtualNetworkConnectionsInner object. + */ + public HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * The VpnGatewaysInner object to access its operations. + */ + private VpnGatewaysInner vpnGateways; + + /** + * Gets the VpnGatewaysInner object to access its operations. + * @return the VpnGatewaysInner object. + */ + public VpnGatewaysInner vpnGateways() { + return this.vpnGateways; + } + + /** + * The VpnConnectionsInner object to access its operations. + */ + private VpnConnectionsInner vpnConnections; + + /** + * Gets the VpnConnectionsInner object to access its operations. + * @return the VpnConnectionsInner object. + */ + public VpnConnectionsInner vpnConnections() { + return this.vpnConnections; + } + + /** + * The ServiceEndpointPoliciesInner object to access its operations. + */ + private ServiceEndpointPoliciesInner serviceEndpointPolicies; + + /** + * Gets the ServiceEndpointPoliciesInner object to access its operations. + * @return the ServiceEndpointPoliciesInner object. + */ + public ServiceEndpointPoliciesInner serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * The ServiceEndpointPolicyDefinitionsInner object to access its operations. + */ + private ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions; + + /** + * Gets the ServiceEndpointPolicyDefinitionsInner object to access its operations. + * @return the ServiceEndpointPolicyDefinitionsInner object. + */ + public ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NetworkManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureFirewalls = new AzureFirewallsInner(restClient().retrofit(), this); + this.applicationGateways = new ApplicationGatewaysInner(restClient().retrofit(), this); + this.applicationSecurityGroups = new ApplicationSecurityGroupsInner(restClient().retrofit(), this); + this.ddosProtectionPlans = new DdosProtectionPlansInner(restClient().retrofit(), this); + this.availableEndpointServices = new AvailableEndpointServicesInner(restClient().retrofit(), this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsInner(restClient().retrofit(), this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsInner(restClient().retrofit(), this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsInner(restClient().retrofit(), this); + this.expressRouteCircuits = new ExpressRouteCircuitsInner(restClient().retrofit(), this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersInner(restClient().retrofit(), this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsInner(restClient().retrofit(), this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsInner(restClient().retrofit(), this); + this.loadBalancers = new LoadBalancersInner(restClient().retrofit(), this); + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsInner(restClient().retrofit(), this); + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsInner(restClient().retrofit(), this); + this.inboundNatRules = new InboundNatRulesInner(restClient().retrofit(), this); + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesInner(restClient().retrofit(), this); + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesInner(restClient().retrofit(), this); + this.loadBalancerProbes = new LoadBalancerProbesInner(restClient().retrofit(), this); + this.networkInterfaces = new NetworkInterfacesInner(restClient().retrofit(), this); + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsInner(restClient().retrofit(), this); + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersInner(restClient().retrofit(), this); + this.networkSecurityGroups = new NetworkSecurityGroupsInner(restClient().retrofit(), this); + this.securityRules = new SecurityRulesInner(restClient().retrofit(), this); + this.defaultSecurityRules = new DefaultSecurityRulesInner(restClient().retrofit(), this); + this.networkWatchers = new NetworkWatchersInner(restClient().retrofit(), this); + this.packetCaptures = new PacketCapturesInner(restClient().retrofit(), this); + this.connectionMonitors = new ConnectionMonitorsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.publicIPAddresses = new PublicIPAddressesInner(restClient().retrofit(), this); + this.publicIPPrefixes = new PublicIPPrefixesInner(restClient().retrofit(), this); + this.routeFilters = new RouteFiltersInner(restClient().retrofit(), this); + this.routeFilterRules = new RouteFilterRulesInner(restClient().retrofit(), this); + this.routeTables = new RouteTablesInner(restClient().retrofit(), this); + this.routes = new RoutesInner(restClient().retrofit(), this); + this.bgpServiceCommunities = new BgpServiceCommunitiesInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.virtualNetworks = new VirtualNetworksInner(restClient().retrofit(), this); + this.subnets = new SubnetsInner(restClient().retrofit(), this); + this.virtualNetworkPeerings = new VirtualNetworkPeeringsInner(restClient().retrofit(), this); + this.virtualNetworkGateways = new VirtualNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsInner(restClient().retrofit(), this); + this.localNetworkGateways = new LocalNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualWANs = new VirtualWANsInner(restClient().retrofit(), this); + this.vpnSites = new VpnSitesInner(restClient().retrofit(), this); + this.vpnSitesConfigurations = new VpnSitesConfigurationsInner(restClient().retrofit(), this); + this.virtualHubs = new VirtualHubsInner(restClient().retrofit(), this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsInner(restClient().retrofit(), this); + this.vpnGateways = new VpnGatewaysInner(restClient().retrofit(), this); + this.vpnConnections = new VpnConnectionsInner(restClient().retrofit(), this); + this.serviceEndpointPolicies = new ServiceEndpointPoliciesInner(restClient().retrofit(), this); + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NetworkManagementClient", "2018-07-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(NetworkManagementClientService.class); + } + + /** + * The interface defining all the services for NetworkManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkManagementClient checkDnsNameAvailability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + Observable> checkDnsNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("domainNameLabel") String domainNameLabel, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DnsNameAvailabilityResultInner object if successful. + */ + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).toBlocking().single().body(); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkDnsNameAvailabilityAsync(String location, String domainNameLabel, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel), serviceCallback); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (domainNameLabel == null) { + throw new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.checkDnsNameAvailability(location, this.subscriptionId(), domainNameLabel, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManager.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManager.java new file mode 100644 index 0000000000000..7f984235407be --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkManager.java @@ -0,0 +1,711 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.network.v2018_07_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_07_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_07_01.AvailableEndpointServices; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitAuthorizations; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeerings; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitConnections; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCrossConnectionPeerings; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerBackendAddressPools; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerFrontendIPConfigurations; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRules; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerLoadBalancingRules; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerNetworkInterfaces; +import com.microsoft.azure.management.network.v2018_07_01.LoadBalancerProbes; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaces; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceIPConfigurations; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterfaceLoadBalancers; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRules; +import com.microsoft.azure.management.network.v2018_07_01.DefaultSecurityRules; +import com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptures; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionMonitors; +import com.microsoft.azure.management.network.v2018_07_01.Operations; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules; +import com.microsoft.azure.management.network.v2018_07_01.RouteTables; +import com.microsoft.azure.management.network.v2018_07_01.Routes; +import com.microsoft.azure.management.network.v2018_07_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_07_01.Usages; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_07_01.Subnets; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_07_01.VirtualWANs; +import com.microsoft.azure.management.network.v2018_07_01.VpnSites; +import com.microsoft.azure.management.network.v2018_07_01.VpnSitesConfigurations; +import com.microsoft.azure.management.network.v2018_07_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnections; +import com.microsoft.azure.management.network.v2018_07_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnections; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private AzureFirewalls azureFirewalls; + private ApplicationGateways applicationGateways; + private ApplicationSecurityGroups applicationSecurityGroups; + private DdosProtectionPlans ddosProtectionPlans; + private AvailableEndpointServices availableEndpointServices; + private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations; + private ExpressRouteCircuitPeerings expressRouteCircuitPeerings; + private ExpressRouteCircuitConnections expressRouteCircuitConnections; + private ExpressRouteCircuits expressRouteCircuits; + private ExpressRouteServiceProviders expressRouteServiceProviders; + private ExpressRouteCrossConnections expressRouteCrossConnections; + private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings; + private LoadBalancers loadBalancers; + private LoadBalancerBackendAddressPools loadBalancerBackendAddressPools; + private LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations; + private InboundNatRules inboundNatRules; + private LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules; + private LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces; + private LoadBalancerProbes loadBalancerProbes; + private NetworkInterfaces networkInterfaces; + private NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations; + private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers; + private NetworkSecurityGroups networkSecurityGroups; + private SecurityRules securityRules; + private DefaultSecurityRules defaultSecurityRules; + private NetworkWatchers networkWatchers; + private PacketCaptures packetCaptures; + private ConnectionMonitors connectionMonitors; + private Operations operations; + private PublicIPAddresses publicIPAddresses; + private PublicIPPrefixes publicIPPrefixes; + private RouteFilters routeFilters; + private RouteFilterRules routeFilterRules; + private RouteTables routeTables; + private Routes routes; + private BgpServiceCommunities bgpServiceCommunities; + private Usages usages; + private VirtualNetworks virtualNetworks; + private Subnets subnets; + private VirtualNetworkPeerings virtualNetworkPeerings; + private VirtualNetworkGateways virtualNetworkGateways; + private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections; + private LocalNetworkGateways localNetworkGateways; + private VirtualWANs virtualWANs; + private VpnSites vpnSites; + private VpnSitesConfigurations vpnSitesConfigurations; + private VirtualHubs virtualHubs; + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + private VpnGateways vpnGateways; + private VpnConnections vpnConnections; + private ServiceEndpointPolicies serviceEndpointPolicies; + private ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AzureFirewalls. + */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(this); + } + return this.azureFirewalls; + } + + /** + * @return Entry point to manage ApplicationGateways. + */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(this); + } + return this.applicationGateways; + } + + /** + * @return Entry point to manage ApplicationSecurityGroups. + */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = new ApplicationSecurityGroupsImpl(this); + } + return this.applicationSecurityGroups; + } + + /** + * @return Entry point to manage DdosProtectionPlans. + */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(this); + } + return this.ddosProtectionPlans; + } + + /** + * @return Entry point to manage AvailableEndpointServices. + */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = new AvailableEndpointServicesImpl(this); + } + return this.availableEndpointServices; + } + + /** + * @return Entry point to manage ExpressRouteCircuitAuthorizations. + */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsImpl(this); + } + return this.expressRouteCircuitAuthorizations; + } + + /** + * @return Entry point to manage ExpressRouteCircuitPeerings. + */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsImpl(this); + } + return this.expressRouteCircuitPeerings; + } + + /** + * @return Entry point to manage ExpressRouteCircuitConnections. + */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsImpl(this); + } + return this.expressRouteCircuitConnections; + } + + /** + * @return Entry point to manage ExpressRouteCircuits. + */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(this); + } + return this.expressRouteCircuits; + } + + /** + * @return Entry point to manage ExpressRouteServiceProviders. + */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersImpl(this); + } + return this.expressRouteServiceProviders; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnections. + */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsImpl(this); + } + return this.expressRouteCrossConnections; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnectionPeerings. + */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsImpl(this); + } + return this.expressRouteCrossConnectionPeerings; + } + + /** + * @return Entry point to manage LoadBalancers. + */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(this); + } + return this.loadBalancers; + } + + /** + * @return Entry point to manage LoadBalancerBackendAddressPools. + */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsImpl(this); + } + return this.loadBalancerBackendAddressPools; + } + + /** + * @return Entry point to manage LoadBalancerFrontendIPConfigurations. + */ + public LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations() { + if (this.loadBalancerFrontendIPConfigurations == null) { + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsImpl(this); + } + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * @return Entry point to manage InboundNatRules. + */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(this); + } + return this.inboundNatRules; + } + + /** + * @return Entry point to manage LoadBalancerLoadBalancingRules. + */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesImpl(this); + } + return this.loadBalancerLoadBalancingRules; + } + + /** + * @return Entry point to manage LoadBalancerNetworkInterfaces. + */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesImpl(this); + } + return this.loadBalancerNetworkInterfaces; + } + + /** + * @return Entry point to manage LoadBalancerProbes. + */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(this); + } + return this.loadBalancerProbes; + } + + /** + * @return Entry point to manage NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(this); + } + return this.networkInterfaces; + } + + /** + * @return Entry point to manage NetworkInterfaceIPConfigurations. + */ + public NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations() { + if (this.networkInterfaceIPConfigurations == null) { + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsImpl(this); + } + return this.networkInterfaceIPConfigurations; + } + + /** + * @return Entry point to manage NetworkInterfaceLoadBalancers. + */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersImpl(this); + } + return this.networkInterfaceLoadBalancers; + } + + /** + * @return Entry point to manage NetworkSecurityGroups. + */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(this); + } + return this.networkSecurityGroups; + } + + /** + * @return Entry point to manage SecurityRules. + */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(this); + } + return this.securityRules; + } + + /** + * @return Entry point to manage DefaultSecurityRules. + */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(this); + } + return this.defaultSecurityRules; + } + + /** + * @return Entry point to manage NetworkWatchers. + */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(this); + } + return this.networkWatchers; + } + + /** + * @return Entry point to manage PacketCaptures. + */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(this); + } + return this.packetCaptures; + } + + /** + * @return Entry point to manage ConnectionMonitors. + */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(this); + } + return this.connectionMonitors; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PublicIPAddresses. + */ + public PublicIPAddresses publicIPAddresses() { + if (this.publicIPAddresses == null) { + this.publicIPAddresses = new PublicIPAddressesImpl(this); + } + return this.publicIPAddresses; + } + + /** + * @return Entry point to manage PublicIPPrefixes. + */ + public PublicIPPrefixes publicIPPrefixes() { + if (this.publicIPPrefixes == null) { + this.publicIPPrefixes = new PublicIPPrefixesImpl(this); + } + return this.publicIPPrefixes; + } + + /** + * @return Entry point to manage RouteFilters. + */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(this); + } + return this.routeFilters; + } + + /** + * @return Entry point to manage RouteFilterRules. + */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(this); + } + return this.routeFilterRules; + } + + /** + * @return Entry point to manage RouteTables. + */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(this); + } + return this.routeTables; + } + + /** + * @return Entry point to manage Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(this); + } + return this.routes; + } + + /** + * @return Entry point to manage BgpServiceCommunities. + */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(this); + } + return this.bgpServiceCommunities; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage VirtualNetworks. + */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(this); + } + return this.virtualNetworks; + } + + /** + * @return Entry point to manage Subnets. + */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(this); + } + return this.subnets; + } + + /** + * @return Entry point to manage VirtualNetworkPeerings. + */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = new VirtualNetworkPeeringsImpl(this); + } + return this.virtualNetworkPeerings; + } + + /** + * @return Entry point to manage VirtualNetworkGateways. + */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = new VirtualNetworkGatewaysImpl(this); + } + return this.virtualNetworkGateways; + } + + /** + * @return Entry point to manage VirtualNetworkGatewayConnections. + */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsImpl(this); + } + return this.virtualNetworkGatewayConnections; + } + + /** + * @return Entry point to manage LocalNetworkGateways. + */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(this); + } + return this.localNetworkGateways; + } + + /** + * @return Entry point to manage VirtualWANs. + */ + public VirtualWANs virtualWANs() { + if (this.virtualWANs == null) { + this.virtualWANs = new VirtualWANsImpl(this); + } + return this.virtualWANs; + } + + /** + * @return Entry point to manage VpnSites. + */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(this); + } + return this.vpnSites; + } + + /** + * @return Entry point to manage VpnSitesConfigurations. + */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = new VpnSitesConfigurationsImpl(this); + } + return this.vpnSitesConfigurations; + } + + /** + * @return Entry point to manage VirtualHubs. + */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(this); + } + return this.virtualHubs; + } + + /** + * @return Entry point to manage HubVirtualNetworkConnections. + */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsImpl(this); + } + return this.hubVirtualNetworkConnections; + } + + /** + * @return Entry point to manage VpnGateways. + */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(this); + } + return this.vpnGateways; + } + + /** + * @return Entry point to manage VpnConnections. + */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(this); + } + return this.vpnConnections; + } + + /** + * @return Entry point to manage ServiceEndpointPolicies. + */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies = new ServiceEndpointPoliciesImpl(this); + } + return this.serviceEndpointPolicies; + } + + /** + * @return Entry point to manage ServiceEndpointPolicyDefinitions. + */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsImpl(this); + } + return this.serviceEndpointPolicyDefinitions; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NetworkManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..a197ac0527ae2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroup; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.management.network.v2018_07_01.NetworkInterface; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class NetworkSecurityGroupImpl extends GroupableResourceCoreImpl implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + NetworkSecurityGroupImpl(String name, NetworkSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List defaultSecurityRules() { + List lst = new ArrayList(); + if (this.inner().defaultSecurityRules() != null) { + for (SecurityRuleInner inner : this.inner().defaultSecurityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List securityRules() { + List lst = new ArrayList(); + if (this.inner().securityRules() != null) { + for (SecurityRuleInner inner : this.inner().securityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public NetworkSecurityGroupImpl withDefaultSecurityRules(List defaultSecurityRules) { + this.inner().withDefaultSecurityRules(defaultSecurityRules); + return this; + } + + @Override + public NetworkSecurityGroupImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.inner().withSecurityRules(securityRules); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupInner.java new file mode 100644 index 0000000000000..eba25edd8859d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupInner.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * NetworkSecurityGroup resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkSecurityGroupInner extends Resource { + /** + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "properties.securityRules") + private List securityRules; + + /** + * The default security rules of network security group. + */ + @JsonProperty(value = "properties.defaultSecurityRules") + private List defaultSecurityRules; + + /** + * A collection of references to network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of security rules of the network security group. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set a collection of security rules of the network security group. + * + * @param securityRules the securityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Get the default security rules of network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the default security rules of network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get a collection of references to network interfaces. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the network security group resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network security group resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java new file mode 100644 index 0000000000000..fedb17d4baf5c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleDirection; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; + +class NetworkSecurityGroupSecurityRuleImpl extends CreatableUpdatableImpl implements NetworkSecurityGroupSecurityRule, NetworkSecurityGroupSecurityRule.Definition, NetworkSecurityGroupSecurityRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String securityRuleName; + + NetworkSecurityGroupSecurityRuleImpl(String name, NetworkManager manager) { + super(name, new SecurityRuleInner()); + this.manager = manager; + // Set resource name + this.securityRuleName = name; + // + } + + NetworkSecurityGroupSecurityRuleImpl(SecurityRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.securityRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.securityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "securityRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.inner().withAccess(access); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.inner().withDirection(direction); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.inner().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.inner().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.inner().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.inner().withDestinationPortRange(destinationPortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.inner().withDestinationPortRanges(destinationPortRanges); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withPriority(Integer priority) { + this.inner().withPriority(priority); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.inner().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.inner().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.inner().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.inner().withSourcePortRange(sourcePortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.inner().withSourcePortRanges(sourcePortRanges); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java new file mode 100644 index 0000000000000..cda434822ec7e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroupSecurityRuleModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleAccess; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleDirection; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleProtocol; + +class NetworkSecurityGroupSecurityRuleModelImpl extends IndexableRefreshableWrapperImpl implements NetworkSecurityGroupSecurityRuleModel { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String defaultSecurityRuleName; + + NetworkSecurityGroupSecurityRuleModelImpl(SecurityRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.defaultSecurityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "defaultSecurityRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DefaultSecurityRulesInner client = this.manager().inner().defaultSecurityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.defaultSecurityRuleName); + } + + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsImpl.java new file mode 100644 index 0000000000000..ae31d920aa86f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkSecurityGroupsImpl extends GroupableResourcesCoreImpl implements NetworkSecurityGroups { + protected NetworkSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().networkSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(String name) { + return new NetworkSecurityGroupImpl(name, new NetworkSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsInner.java new file mode 100644 index 0000000000000..a47829540fe9a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkSecurityGroupsInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkSecurityGroups. + */ +public class NetworkSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..a04922ee54837 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkWatcher; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; + +class NetworkWatcherImpl extends GroupableResourceCoreImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + NetworkWatcherImpl(String name, NetworkWatcherInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetworkWatcherImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherInner.java new file mode 100644 index 0000000000000..6618f8629621b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatcherInner.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network watcher in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkWatcherInner extends Resource { + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersImpl.java new file mode 100644 index 0000000000000..ef1932581b8ac --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersImpl.java @@ -0,0 +1,300 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_07_01.NetworkWatcher; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Topology; +import com.microsoft.azure.management.network.v2018_07_01.VerificationIPFlowResult; +import com.microsoft.azure.management.network.v2018_07_01.NextHopResult; +import com.microsoft.azure.management.network.v2018_07_01.SecurityGroupViewResult; +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingResult; +import com.microsoft.azure.management.network.v2018_07_01.FlowLogInformation; +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityInformation; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReport; +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersList; +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.management.network.v2018_07_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_07_01.VerificationIPFlowParameters; +import com.microsoft.azure.management.network.v2018_07_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticParameters; + +class NetworkWatchersImpl extends GroupableResourcesCoreImpl implements NetworkWatchers { + protected NetworkWatchersImpl(NetworkManager manager) { + super(manager.inner().networkWatchers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkWatchersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkWatcherImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTopologyAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public Topology call(TopologyInner inner) { + return new TopologyImpl(inner, manager()); + } + }); + } + + @Override + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.verifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public VerificationIPFlowResult call(VerificationIPFlowResultInner inner) { + return new VerificationIPFlowResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNextHopAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NextHopResult call(NextHopResultInner inner) { + return new NextHopResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public SecurityGroupViewResult call(SecurityGroupViewResultInner inner) { + return new SecurityGroupViewResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + NetworkWatchersInner client = this.inner(); + return client.setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getFlowLogStatusAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public ConnectivityInformation call(ConnectivityInformationInner inner) { + return new ConnectivityInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AzureReachabilityReport call(AzureReachabilityReportInner inner) { + return new AzureReachabilityReportImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AvailableProvidersList call(AvailableProvidersListInner inner) { + return new AvailableProvidersListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, manager()); + } + }); + } + + @Override + protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { + return new NetworkWatcherImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkWatcherImpl wrapModel(String name) { + return new NetworkWatcherImpl(name, new NetworkWatcherInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersInner.java new file mode 100644 index 0000000000000..3aedf59c14f1a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersInner.java @@ -0,0 +1,2814 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_07_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_07_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_07_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_07_01.ErrorResponseException; +import com.microsoft.azure.management.network.v2018_07_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2018_07_01.NetworkConfigurationDiagnosticParameters; +import com.microsoft.azure.management.network.v2018_07_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_07_01.QueryTroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_07_01.SecurityGroupViewParameters; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.management.network.v2018_07_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_07_01.VerificationIPFlowParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkWatchers. + */ +public class NetworkWatchersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkWatchersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkWatchersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkWatchersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkWatchers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkWatchersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkWatcherInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getTopology" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology") + Observable> getTopology(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TopologyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers verifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> verifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginVerifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> beginVerifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> getNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> beginGetNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> getVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> beginGetVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> getTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> beginGetTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> getTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> beginGetTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers setFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> setFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginSetFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> beginSetFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> getFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> beginGetFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers checkConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> checkConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginCheckConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> beginCheckConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> getAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> beginGetAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers listAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> listAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginListAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> beginListAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers getNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> getNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.NetworkWatchers beginGetNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> beginGetNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner createOrUpdate(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.createOrUpdate(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().last().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopologyInner object if successful. + */ + public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TopologyInner>() { + @Override + public TopologyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTopologyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTopologyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> verifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.verifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner beginVerifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable> beginVerifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginVerifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginVerifyIPFlowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.getNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable> beginGetNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGetNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNextHopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNextHopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner getVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner beginGetVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable> beginGetVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVMSecurityRulesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVMSecurityRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.getTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGetTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingResultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingResultDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner setFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.setFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginSetFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginSetFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetFlowLogConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetFlowLogConfigurationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner getFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginGetFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetFlowLogStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetFlowLogStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> checkConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.checkConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner beginCheckConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable> beginCheckConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCheckConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCheckConnectivityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCheckConnectivityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.getAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable> beginGetAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAzureReachabilityReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAzureReachabilityReportDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner listAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.listAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner beginListAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable> beginListAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginListAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListAvailableProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListAvailableProvidersDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..a58a800e7322b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NextHopResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.NextHopType; + +class NextHopResultImpl extends WrapperImpl implements NextHopResult { + private final NetworkManager manager; + NextHopResultImpl(NextHopResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public NextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String routeTableId() { + return this.inner().routeTableId(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultInner.java new file mode 100644 index 0000000000000..33e0f8041dfc6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NextHopResultInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.NextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about next hop from the specified VM. + */ +public class NextHopResultInner { + /** + * Next hop type. Possible values include: 'Internet', 'VirtualAppliance', + * 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /** + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The resource identifier for the route table associated with the route + * being returned. If the route being returned does not correspond to any + * user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** + * Get next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @return the nextHopType value + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get next hop IP Address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set next hop IP Address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @return the routeTableId value + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @param routeTableId the routeTableId value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..2e43c111dcfcc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_07_01.OperationPropertiesFormatServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetworkManager manager; + OperationImpl(OperationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..331aecb729a5d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_07_01.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Network REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Specification of the service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get specification of the service. + * + * @return the serviceSpecification value + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set specification of the service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..50b72dae5bd69 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetworkManager manager; + + OperationsImpl(NetworkManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..3b14df3605ecf --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Operations list" }) + @GET("providers/Microsoft.Network/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2018-07-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureInner.java new file mode 100644 index 0000000000000..8953763914ed5 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the create packet capture operation. + */ +@JsonFlatten +public class PacketCaptureInner { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..062fbe1da1056 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PcError; +import com.microsoft.azure.management.network.v2018_07_01.PcStatus; + +class PacketCaptureQueryStatusResultImpl extends WrapperImpl implements PacketCaptureQueryStatusResult { + private final NetworkManager manager; + PacketCaptureQueryStatusResultImpl(PacketCaptureQueryStatusResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime captureStartTime() { + return this.inner().captureStartTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List packetCaptureError() { + return this.inner().packetCaptureError(); + } + + @Override + public PcStatus packetCaptureStatus() { + return this.inner().packetCaptureStatus(); + } + + @Override + public String stopReason() { + return this.inner().stopReason(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 0000000000000..b05353b1afce7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.network.v2018_07_01.PcStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PcError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of packet capture session. + */ +public class PacketCaptureQueryStatusResultInner { + /** + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private DateTime captureStartTime; + + /** + * The status of the packet capture session. Possible values include: + * 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /** + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /** + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** + * Get the name of the packet capture resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the packet capture resource. + * + * @param name the name value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the packet capture resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the packet capture resource. + * + * @param id the id value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the start time of the packet capture session. + * + * @return the captureStartTime value + */ + public DateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(DateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @return the packetCaptureStatus value + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @param packetCaptureStatus the packetCaptureStatus value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the reason the current packet capture session was stopped. + * + * @return the stopReason value + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set the reason the current packet capture session was stopped. + * + * @param stopReason the stopReason value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { + this.stopReason = stopReason; + return this; + } + + /** + * Get list of errors of packet capture session. + * + * @return the packetCaptureError value + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set list of errors of packet capture session. + * + * @param packetCaptureError the packetCaptureError value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { + this.packetCaptureError = packetCaptureError; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..70b560a1205b3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import rx.functions.Func1; + +class PacketCaptureResultImpl extends CreatableUpdatableImpl implements PacketCaptureResult, PacketCaptureResult.Definition, PacketCaptureResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String packetCaptureName; + private PacketCaptureInner createOrUpdateParameter; + + PacketCaptureResultImpl(String name, NetworkManager manager) { + super(name, new PacketCaptureResultInner()); + this.manager = manager; + // Set resource name + this.packetCaptureName = name; + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + PacketCaptureResultImpl(PacketCaptureResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.packetCaptureName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.packetCaptureName = IdParsingUtils.getValueFromIdByName(inner.id(), "packetCaptures"); + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public Integer bytesToCapturePerPacket() { + return this.inner().bytesToCapturePerPacket(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List filters() { + return this.inner().filters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PacketCaptureStorageLocation storageLocation() { + return this.inner().storageLocation(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public Integer timeLimitInSeconds() { + return this.inner().timeLimitInSeconds(); + } + + @Override + public Integer totalBytesPerSession() { + return this.inner().totalBytesPerSession(); + } + + @Override + public PacketCaptureResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public PacketCaptureResultImpl withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.createOrUpdateParameter.withStorageLocation(storageLocation); + return this; + } + + @Override + public PacketCaptureResultImpl withTarget(String target) { + this.createOrUpdateParameter.withTarget(target); + return this; + } + + @Override + public PacketCaptureResultImpl withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.createOrUpdateParameter.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + @Override + public PacketCaptureResultImpl withFilters(List filters) { + this.createOrUpdateParameter.withFilters(filters); + return this; + } + + @Override + public PacketCaptureResultImpl withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.createOrUpdateParameter.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + @Override + public PacketCaptureResultImpl withTotalBytesPerSession(Integer totalBytesPerSession) { + this.createOrUpdateParameter.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultInner.java new file mode 100644 index 0000000000000..2e2eeae8058c0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCaptureResultInner.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about packet capture session. + */ +@JsonFlatten +public class PacketCaptureResultInner { + /** + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * The provisioning state of the packet capture session. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get name of the packet capture session. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get iD of the packet capture operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesImpl.java new file mode 100644 index 0000000000000..fa04d14ffdb07 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptures; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.management.network.v2018_07_01.PacketCaptureResult; + +class PacketCapturesImpl extends WrapperImpl implements PacketCaptures { + private final NetworkManager manager; + + PacketCapturesImpl(NetworkManager manager) { + super(manager.inner().packetCaptures()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public PacketCaptureResultImpl define(String name) { + return wrapModel(name); + } + + private PacketCaptureResultImpl wrapModel(PacketCaptureResultInner inner) { + return new PacketCaptureResultImpl(inner, manager()); + } + + private PacketCaptureResultImpl wrapModel(String name) { + return new PacketCaptureResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + + @Override + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureQueryStatusResult call(PacketCaptureQueryStatusResultInner inner) { + return new PacketCaptureQueryStatusResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + PacketCapturesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java new file mode 100644 index 0000000000000..12a26d57a254a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java @@ -0,0 +1,961 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_07_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in PacketCaptures. + */ +public class PacketCapturesInner { + /** The Retrofit service to perform REST calls. */ + private PacketCapturesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PacketCapturesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PacketCapturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PacketCaptures to be + * used by Retrofit to perform actually REST calls. + */ + interface PacketCapturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures getStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> getStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures beginGetStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> beginGetStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PacketCaptures list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner create(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().last().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.create(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner getStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable> beginGetStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PacketCaptureResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..eaded4fe80914 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl1.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..331885dd1bdfb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..7454d4edb2a4e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Probe; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ProbeProtocol; + +class ProbeImpl extends IndexableRefreshableWrapperImpl implements Probe { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String probeName; + + ProbeImpl(ProbeInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerProbesInner client = this.manager().inner().loadBalancerProbes(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.probeName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer intervalInSeconds() { + return this.inner().intervalInSeconds(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer numberOfProbes() { + return this.inner().numberOfProbes(); + } + + @Override + public int port() { + return this.inner().port(); + } + + @Override + public ProbeProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String requestPath() { + return this.inner().requestPath(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeInner.java new file mode 100644 index 0000000000000..88b9401584bb4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ProbeInner.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ProbeProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancer probe. + */ +@JsonFlatten +public class ProbeInner extends SubResource { + /** + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The protocol of the end point. Possible values are: 'Http', 'Tcp', or + * 'Https'. If 'Tcp' is specified, a received ACK is required for the probe + * to be successful. If 'Http' or 'Https' is specified, a 200 OK response + * from the specifies URI is required for the probe to be successful. + * Possible values include: 'Http', 'Tcp', 'Https'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private ProbeProtocol protocol; + + /** + * The port for communicating the probe. Possible values range from 1 to + * 65535, inclusive. + */ + @JsonProperty(value = "properties.port", required = true) + private int port; + + /** + * The interval, in seconds, for how frequently to probe the endpoint for + * health status. Typically, the interval is slightly less than half the + * allocated timeout period (in seconds) which allows two full probes + * before taking the instance out of rotation. The default value is 15, the + * minimum value is 5. + */ + @JsonProperty(value = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The number of probes where if no response, will result in stopping + * further traffic from being delivered to the endpoint. This values allows + * endpoints to be taken out of rotation faster or slower than the typical + * times used in Azure. + */ + @JsonProperty(value = "properties.numberOfProbes") + private Integer numberOfProbes; + + /** + * The URI used for requesting health status from the VM. Path is required + * if a protocol is set to http. Otherwise, it is not allowed. There is no + * default value. + */ + @JsonProperty(value = "properties.requestPath") + private String requestPath; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the load balancer rules that use this probe. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @return the protocol value + */ + public ProbeProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @param protocol the protocol value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProtocol(ProbeProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @param port the port value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @return the intervalInSeconds value + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @return the numberOfProbes value + */ + public Integer numberOfProbes() { + return this.numberOfProbes; + } + + /** + * Set the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @param numberOfProbes the numberOfProbes value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value + */ + public String requestPath() { + return this.requestPath; + } + + /** + * Set the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @param requestPath the requestPath value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressImpl.java new file mode 100644 index 0000000000000..493c38d3277ea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressImpl.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddress; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import com.microsoft.azure.management.network.v2018_07_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpTag; +import com.microsoft.azure.SubResource; + +class PublicIPAddressImpl extends GroupableResourceCoreImpl implements PublicIPAddress, PublicIPAddress.Definition, PublicIPAddress.Update { + PublicIPAddressImpl(String name, PublicIPAddressInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public PublicIPAddressDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public IPConfiguration ipConfiguration() { + return this.inner().ipConfiguration(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public IPAllocationMethod publicIPAllocationMethod() { + return this.inner().publicIPAllocationMethod(); + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPAddressSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPAddressImpl withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public PublicIPAddressImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public PublicIPAddressImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public PublicIPAddressImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPAddressImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.inner().withPublicIPAllocationMethod(publicIPAllocationMethod); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPPrefix(SubResource publicIPPrefix) { + this.inner().withPublicIPPrefix(publicIPPrefix); + return this; + } + + @Override + public PublicIPAddressImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPAddressImpl withSku(PublicIPAddressSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPAddressImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressInner.java new file mode 100644 index 0000000000000..d0c8056953b99 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressInner.java @@ -0,0 +1,387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import com.microsoft.azure.management.network.v2018_07_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpTag; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP address resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPAddressInner extends Resource { + /** + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIPAddressSku sku; + + /** + * The public IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private IPAllocationMethod publicIPAllocationMethod; + + /** + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "properties.ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IPConfiguration ipConfiguration; + + /** + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "properties.dnsSettings") + private PublicIPAddressDnsSettings dnsSettings; + + /** + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The Public IP Prefix this Public IP Address should be allocated from. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The resource GUID property of the public IP resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the public IP address SKU. + * + * @return the sku value + */ + public PublicIPAddressSku sku() { + return this.sku; + } + + /** + * Set the public IP address SKU. + * + * @param sku the sku value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withSku(PublicIPAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the publicIPAllocationMethod value + */ + public IPAllocationMethod publicIPAllocationMethod() { + return this.publicIPAllocationMethod; + } + + /** + * Set the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param publicIPAllocationMethod the publicIPAllocationMethod value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.publicIPAllocationMethod = publicIPAllocationMethod; + return this; + } + + /** + * Get the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the IP configuration associated with the public IP address. + * + * @return the ipConfiguration value + */ + public IPConfiguration ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Get the FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value + */ + public PublicIPAddressDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the FQDN of the DNS record associated with the public IP address. + * + * @param dnsSettings the dnsSettings value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the list of tags associated with the public IP address. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP address. + * + * @param ipTags the ipTags value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the IP address associated with the public IP address resource. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address associated with the public IP address resource. + * + * @param ipAddress the ipAddress value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the Public IP Prefix this Public IP Address should be allocated from. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the Public IP Prefix this Public IP Address should be allocated from. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get the idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the resource GUID property of the public IP resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesImpl.java new file mode 100644 index 0000000000000..811c6039a466b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesImpl.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddress; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPAddressesImpl extends GroupableResourcesCoreImpl implements PublicIPAddresses { + protected PublicIPAddressesImpl(NetworkManager manager) { + super(manager.inner().publicIPAddresses(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPAddressesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPAddressImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + PublicIPAddressesInner client = this.inner(); + return client.getVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected PublicIPAddressImpl wrapModel(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPAddressImpl wrapModel(String name) { + return new PublicIPAddressImpl(name, new PublicIPAddressInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java new file mode 100644 index 0000000000000..6493cee6e6d2c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java @@ -0,0 +1,2085 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPAddresses. + */ +public class PublicIPAddressesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPAddressesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPAddressesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPAddressesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPAddressesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPAddresses to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPAddressesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + Observable> listVirtualMachineScaleSetPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + Observable> listVirtualMachineScaleSetVMPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses getVirtualMachineScaleSetPublicIPAddress" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}") + Observable> getVirtualMachineScaleSetPublicIPAddress(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpAddressName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpAddressName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpAddressName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The network interface name. + ServiceResponse> * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetPublicIPAddressDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixImpl.java new file mode 100644 index 0000000000000..e6ab423953d91 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefix; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpTag; +import com.microsoft.azure.management.network.v2018_07_01.ReferencedPublicIpAddress; + +class PublicIPPrefixImpl extends GroupableResourceCoreImpl implements PublicIPPrefix, PublicIPPrefix.Definition, PublicIPPrefix.Update { + PublicIPPrefixImpl(String name, PublicIPPrefixInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipPrefix() { + return this.inner().ipPrefix(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public Integer prefixLength() { + return this.inner().prefixLength(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List publicIPAddresses() { + return this.inner().publicIPAddresses(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPPrefixSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPPrefixImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPPrefixImpl withIpPrefix(String ipPrefix) { + this.inner().withIpPrefix(ipPrefix); + return this; + } + + @Override + public PublicIPPrefixImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPPrefixImpl withPrefixLength(Integer prefixLength) { + this.inner().withPrefixLength(prefixLength); + return this; + } + + @Override + public PublicIPPrefixImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddresses(List publicIPAddresses) { + this.inner().withPublicIPAddresses(publicIPAddresses); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPPrefixImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPPrefixImpl withSku(PublicIPPrefixSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPPrefixImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixInner.java new file mode 100644 index 0000000000000..43f6ed8cd6380 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixInner.java @@ -0,0 +1,316 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpTag; +import com.microsoft.azure.management.network.v2018_07_01.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP prefix resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPPrefixInner extends Resource { + /** + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIPPrefixSku sku; + + /** + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The list of tags associated with the public IP prefix. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The Length of the Public IP Prefix. + */ + @JsonProperty(value = "properties.prefixLength") + private Integer prefixLength; + + /** + * The allocated Prefix. + */ + @JsonProperty(value = "properties.ipPrefix") + private String ipPrefix; + + /** + * The list of all referenced PublicIPAddresses. + */ + @JsonProperty(value = "properties.publicIPAddresses") + private List publicIPAddresses; + + /** + * The resource GUID property of the public IP prefix resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the Public IP prefix resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the public IP prefix SKU. + * + * @return the sku value + */ + public PublicIPPrefixSku sku() { + return this.sku; + } + + /** + * Set the public IP prefix SKU. + * + * @param sku the sku value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withSku(PublicIPPrefixSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the list of tags associated with the public IP prefix. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP prefix. + * + * @param ipTags the ipTags value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the Length of the Public IP Prefix. + * + * @return the prefixLength value + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the Length of the Public IP Prefix. + * + * @param prefixLength the prefixLength value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the allocated Prefix. + * + * @return the ipPrefix value + */ + public String ipPrefix() { + return this.ipPrefix; + } + + /** + * Set the allocated Prefix. + * + * @param ipPrefix the ipPrefix value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; + return this; + } + + /** + * Get the list of all referenced PublicIPAddresses. + * + * @return the publicIPAddresses value + */ + public List publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * Set the list of all referenced PublicIPAddresses. + * + * @param publicIPAddresses the publicIPAddresses value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddresses(List publicIPAddresses) { + this.publicIPAddresses = publicIPAddresses; + return this; + } + + /** + * Get the resource GUID property of the public IP prefix resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP prefix resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesImpl.java new file mode 100644 index 0000000000000..31a9e7a49fc6d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefix; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPPrefixesImpl extends GroupableResourcesCoreImpl implements PublicIPPrefixes { + protected PublicIPPrefixesImpl(NetworkManager manager) { + super(manager.inner().publicIPPrefixes(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPPrefixesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPPrefixImpl define(String name) { + return wrapModel(name); + } + + @Override + protected PublicIPPrefixImpl wrapModel(PublicIPPrefixInner inner) { + return new PublicIPPrefixImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPPrefixImpl wrapModel(String name) { + return new PublicIPPrefixImpl(name, new PublicIPPrefixInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java new file mode 100644 index 0000000000000..e13731824c581 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPPrefixes. + */ +public class PublicIPPrefixesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPPrefixesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPPrefixesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPPrefixesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPPrefixesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPPrefixes to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPPrefixesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.PublicIPPrefixes listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpPrefixName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpPrefixName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpPrefixName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpPrefixName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand), serviceCallback); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner createOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterImpl.java new file mode 100644 index 0000000000000..c29567d744541 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilter; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.PatchRouteFilter; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilterRule; +import rx.functions.Func1; + +class RouteFilterImpl extends GroupableResourceCoreImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private PatchRouteFilter updateParameter; + RouteFilterImpl(String name, RouteFilterInner inner, NetworkManager manager) { + super(name, inner, manager); + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public Observable createResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List rules() { + List lst = new ArrayList(); + if (this.inner().rules() != null) { + for (RouteFilterRuleInner inner : this.inner().rules()) { + lst.add( new RouteFilterRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteFilterImpl withPeerings(List peerings) { + if (isInCreateMode()) { + this.inner().withPeerings(peerings); + } else { + this.updateParameter.withPeerings(peerings); + } + return this; + } + + @Override + public RouteFilterImpl withRules(List rules) { + if (isInCreateMode()) { + this.inner().withRules(rules); + } else { + this.updateParameter.withRules(rules); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterInner.java new file mode 100644 index 0000000000000..6ec9dd2212bca --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterInner.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteFilterInner extends Resource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleImpl.java new file mode 100644 index 0000000000000..3cf53acc388ae --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.RouteFilterRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.PatchRouteFilterRule; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.Access; +import rx.functions.Func1; + +class RouteFilterRuleImpl extends CreatableUpdatableImpl implements RouteFilterRule, RouteFilterRule.Definition, RouteFilterRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeFilterName; + private String ruleName; + private PatchRouteFilterRule updateParameter; + + RouteFilterRuleImpl(String name, NetworkManager manager) { + super(name, new RouteFilterRuleInner()); + this.manager = manager; + // Set resource name + this.ruleName = name; + // + this.updateParameter = new PatchRouteFilterRule(); + } + + RouteFilterRuleImpl(RouteFilterRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeFilterName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilters"); + this.ruleName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilterRules"); + // + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.inner()) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.updateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.getAsync(this.resourceGroupName, this.routeFilterName, this.ruleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public List communities() { + return this.inner().communities(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String routeFilterRuleType() { + return this.inner().routeFilterRuleType(); + } + + @Override + public RouteFilterRuleImpl withExistingRouteFilter(String resourceGroupName, String routeFilterName) { + this.resourceGroupName = resourceGroupName; + this.routeFilterName = routeFilterName; + return this; + } + + @Override + public RouteFilterRuleImpl withAccess(Access access) { + this.inner().withAccess(access); + return this; + } + + @Override + public RouteFilterRuleImpl withCommunities(List communities) { + this.inner().withCommunities(communities); + return this; + } + + @Override + public RouteFilterRuleImpl withRouteFilterRuleType(String routeFilterRuleType) { + this.inner().withRouteFilterRuleType(routeFilterRuleType); + return this; + } + + @Override + public RouteFilterRuleImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public RouteFilterRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteFilterRuleImpl withId(String id) { + if (isInCreateMode()) { + this.inner().withId(id); + } else { + this.updateParameter.withId(id); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleInner.java new file mode 100644 index 0000000000000..49f719cc03422 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRuleInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Access; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class RouteFilterRuleInner extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of RouteFilterRuleInner class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public RouteFilterRuleInner() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesImpl.java new file mode 100644 index 0000000000000..b81a195aab57e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilterRule; + +class RouteFilterRulesImpl extends WrapperImpl implements RouteFilterRules { + private final NetworkManager manager; + + RouteFilterRulesImpl(NetworkManager manager) { + super(manager.inner().routeFilterRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteFilterRuleImpl define(String name) { + return wrapModel(name); + } + + private RouteFilterRuleImpl wrapModel(RouteFilterRuleInner inner) { + return new RouteFilterRuleImpl(inner, manager()); + } + + private RouteFilterRuleImpl wrapModel(String name) { + return new RouteFilterRuleImpl(name, this.manager()); + } + + @Override + public Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + RouteFilterRulesInner client = this.inner(); + return client.listByRouteFilterAsync(resourceGroupName, routeFilterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeFilterName, ruleName) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeFilterName, ruleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java new file mode 100644 index 0000000000000..f4ab67eadf3d0 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java @@ -0,0 +1,955 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.PatchRouteFilterRule; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilterRules. + */ +public class RouteFilterRulesInner { + /** The Retrofit service to perform REST calls. */ + private RouteFilterRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFilterRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFilterRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilterRules to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFilterRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules listByRouteFilter" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules") + Observable> listByRouteFilter(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilterRules listByRouteFilterNext" }) + @GET + Observable> listByRouteFilterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().last().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName, String ruleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner createOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner update(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-07-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilter(final String resourceGroupName, final String routeFilterName) { + ServiceResponse> response = listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterWithServiceResponseAsync(resourceGroupName, routeFilterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterWithServiceResponseAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterSinglePageAsync(final String resourceGroupName, final String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByRouteFilter(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilterNext(final String nextPageLink) { + ServiceResponse> response = listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterNextAsync(final String nextPageLink) { + return listByRouteFilterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterNextWithServiceResponseAsync(final String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersImpl.java new file mode 100644 index 0000000000000..39ca4e7cac2e6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_07_01.RouteFilter; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteFiltersImpl extends GroupableResourcesCoreImpl implements RouteFilters { + protected RouteFiltersImpl(NetworkManager manager) { + super(manager.inner().routeFilters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteFiltersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteFilterImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteFilterImpl wrapModel(RouteFilterInner inner) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteFilterImpl wrapModel(String name) { + return new RouteFilterImpl(name, new RouteFilterInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersInner.java new file mode 100644 index 0000000000000..43af383327e59 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFiltersInner.java @@ -0,0 +1,1207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.PatchRouteFilter; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilters. + */ +public class RouteFiltersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteFiltersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFiltersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().last().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner update(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-07-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteImpl.java new file mode 100644 index 0000000000000..1f73202eea61e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Route; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.RouteNextHopType; + +class RouteImpl extends CreatableUpdatableImpl implements Route, Route.Definition, Route.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeTableName; + private String routeName; + + RouteImpl(String name, NetworkManager manager) { + super(name, new RouteInner()); + this.manager = manager; + // Set resource name + this.routeName = name; + // + } + + RouteImpl(RouteInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.routeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); + this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.getAsync(this.resourceGroupName, this.routeTableName, this.routeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public RouteNextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + @Override + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.inner().withNextHopType(nextHopType); + return this; + } + + @Override + public RouteImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public RouteImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public RouteImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.inner().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + @Override + public RouteImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteInner.java new file mode 100644 index 0000000000000..3f8b436065241 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route resource. + */ +@JsonFlatten +public class RouteInner extends SubResource { + /** + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "properties.nextHopType", required = true) + private RouteNextHopType nextHopType; + + /** + * The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + */ + @JsonProperty(value = "properties.nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the destination CIDR to which the route applies. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set + * @return the RouteInner object itself. + */ + public RouteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteInner object itself. + */ + public RouteInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteInner object itself. + */ + public RouteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteInner object itself. + */ + public RouteInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableImpl.java new file mode 100644 index 0000000000000..4f9bb8ff3c676 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.RouteTable; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.Route; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class RouteTableImpl extends GroupableResourceCoreImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + RouteTableImpl(String name, RouteTableInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableBgpRoutePropagation() { + return this.inner().disableBgpRoutePropagation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List routes() { + List lst = new ArrayList(); + if (this.inner().routes() != null) { + for (RouteInner inner : this.inner().routes()) { + lst.add( new RouteImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.inner().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + @Override + public RouteTableImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteTableImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public RouteTableImpl withRoutes(List routes) { + this.inner().withRoutes(routes); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableInner.java new file mode 100644 index 0000000000000..609fc0a426c05 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTableInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route table resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteTableInner extends Resource { + /** + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + */ + @JsonProperty(value = "properties.disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of routes contained within a route table. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set collection of routes contained within a route table. + * + * @param routes the routes value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @return the disableBgpRoutePropagation value + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesImpl.java new file mode 100644 index 0000000000000..698191258cbd6 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.RouteTables; +import com.microsoft.azure.management.network.v2018_07_01.RouteTable; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteTablesImpl extends GroupableResourcesCoreImpl implements RouteTables { + protected RouteTablesImpl(NetworkManager manager) { + super(manager.inner().routeTables(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteTablesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteTablesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteTableImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteTableImpl wrapModel(RouteTableInner inner) { + return new RouteTableImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteTableImpl wrapModel(String name) { + return new RouteTableImpl(name, new RouteTableInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesInner.java new file mode 100644 index 0000000000000..f28d3915ad469 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteTablesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteTables. + */ +public class RouteTablesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteTablesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteTablesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteTablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteTables to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteTablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.RouteTables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().last().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().single().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesImpl.java new file mode 100644 index 0000000000000..e958bab662c01 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.Routes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Route; + +class RoutesImpl extends WrapperImpl implements Routes { + private final NetworkManager manager; + + RoutesImpl(NetworkManager manager) { + super(manager.inner().routes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteImpl define(String name) { + return wrapModel(name); + } + + private RouteImpl wrapModel(RouteInner inner) { + return new RouteImpl(inner, manager()); + } + + private RouteImpl wrapModel(String name) { + return new RouteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String routeTableName) { + RoutesInner client = this.inner(); + return client.listAsync(resourceGroupName, routeTableName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeTableName, routeName) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeTableName, routeName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesInner.java new file mode 100644 index 0000000000000..b6c76bd6c7772 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RoutesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Routes. + */ +public class RoutesInner { + /** The Retrofit service to perform REST calls. */ + private RoutesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoutesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RoutesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Routes to be + * used by Retrofit to perform actually REST calls. + */ + interface RoutesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Routes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName, String routeName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName, String routeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String routeTableName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String routeTableName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, routeTableName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String routeTableName) { + return listWithServiceResponseAsync(resourceGroupName, routeTableName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { + return listSinglePageAsync(resourceGroupName, routeTableName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultImpl.java new file mode 100644 index 0000000000000..36993584fb6a8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.SecurityGroupViewResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.SecurityGroupNetworkInterface; + +class SecurityGroupViewResultImpl extends WrapperImpl implements SecurityGroupViewResult { + private final NetworkManager manager; + SecurityGroupViewResultImpl(SecurityGroupViewResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List networkInterfaces() { + return this.inner().networkInterfaces(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultInner.java new file mode 100644 index 0000000000000..6405622cf739b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityGroupViewResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about security rules applied to the specified VM. + */ +public class SecurityGroupViewResultInner { + /** + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get list of network interfaces on the specified VM. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set list of network interfaces on the specified VM. + * + * @param networkInterfaces the networkInterfaces value to set + * @return the SecurityGroupViewResultInner object itself. + */ + public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRuleInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRuleInner.java new file mode 100644 index 0000000000000..528c5dd39f491 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRuleInner.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRuleDirection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network security rule. + */ +@JsonFlatten +public class SecurityRuleInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', + * and '*'. Possible values include: 'Tcp', 'Udp', '*'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private SecurityRuleProtocol protocol; + + /** + * The source port or range. Integer or range between 0 and 65535. Asterix + * '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. Integer or range between 0 and 65535. + * Asterix '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.destinationPortRange") + private String destinationPortRange; + + /** + * The CIDR or source IP range. Asterix '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "properties.sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "properties.sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The application security group specified as source. + */ + @JsonProperty(value = "properties.sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /** + * The destination address prefix. CIDR or destination IP range. Asterix + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "properties.destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "properties.destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The application security group specified as destination. + */ + @JsonProperty(value = "properties.destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /** + * The source port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /** + * The network traffic is allowed or denied. Possible values are: 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private SecurityRuleAccess access; + + /** + * The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The + * lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outcoming traffic. Possible values are: + * 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "properties.direction", required = true) + private SecurityRuleDirection direction; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @return the protocol value + */ + public SecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @param protocol the protocol value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the CIDR or source IP ranges. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value + */ + public List sourceApplicationSecurityGroups() { + return this.sourceApplicationSecurityGroups; + } + + /** + * Set the application security group specified as source. + * + * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + return this; + } + + /** + * Get the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. CIDR or destination IP ranges. + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value + */ + public List destinationApplicationSecurityGroups() { + return this.destinationApplicationSecurityGroups; + } + + /** + * Set the application security group specified as destination. + * + * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + return this; + } + + /** + * Get the source port ranges. + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @param priority the priority value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesImpl.java new file mode 100644 index 0000000000000..e3693c2bfcd70 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.SecurityRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroupSecurityRule; + +class SecurityRulesImpl extends WrapperImpl implements SecurityRules { + private final NetworkManager manager; + + SecurityRulesImpl(NetworkManager manager) { + super(manager.inner().securityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl define(String name) { + return wrapModel(name); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleImpl(inner, manager()); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(String name) { + return new NetworkSecurityGroupSecurityRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + SecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesInner.java new file mode 100644 index 0000000000000..3744889fbb80e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SecurityRulesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SecurityRules. + */ +public class SecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private SecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface SecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.SecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesImpl.java new file mode 100644 index 0000000000000..6696bb42c0560 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicy; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ServiceEndpointPoliciesImpl extends GroupableResourcesCoreImpl implements ServiceEndpointPolicies { + protected ServiceEndpointPoliciesImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServiceEndpointPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(ServiceEndpointPolicyInner inner) { + return new ServiceEndpointPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(String name) { + return new ServiceEndpointPolicyImpl(name, new ServiceEndpointPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesInner.java new file mode 100644 index 0000000000000..c871849f2c4cb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPoliciesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicies. + */ +public class ServiceEndpointPoliciesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicies listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand), serviceCallback); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..e65a5234f24e2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinition; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; + +class ServiceEndpointPolicyDefinitionImpl extends CreatableUpdatableImpl implements ServiceEndpointPolicyDefinition, ServiceEndpointPolicyDefinition.Definition, ServiceEndpointPolicyDefinition.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String serviceEndpointPolicyName; + private String serviceEndpointPolicyDefinitionName; + + ServiceEndpointPolicyDefinitionImpl(String name, NetworkManager manager) { + super(name, new ServiceEndpointPolicyDefinitionInner()); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = name; + // + } + + ServiceEndpointPolicyDefinitionImpl(ServiceEndpointPolicyDefinitionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceEndpointPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicies"); + this.serviceEndpointPolicyDefinitionName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicyDefinitions"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.getAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String service() { + return this.inner().service(); + } + + @Override + public List serviceResources() { + return this.inner().serviceResources(); + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName) { + this.resourceGroupName = resourceGroupName; + this.serviceEndpointPolicyName = serviceEndpointPolicyName; + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withService(String service) { + this.inner().withService(service); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withServiceResources(List serviceResources) { + this.inner().withServiceResources(serviceResources); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionInner.java new file mode 100644 index 0000000000000..933a7ba9b582b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Service Endpoint policy definitions. + */ +@JsonFlatten +public class ServiceEndpointPolicyDefinitionInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * service endpoint name. + */ + @JsonProperty(value = "properties.service") + private String service; + + /** + * A list of service resources. + */ + @JsonProperty(value = "properties.serviceResources") + private List serviceResources; + + /** + * The provisioning state of the service end point policy definition. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get service endpoint name. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set service endpoint name. + * + * @param service the service value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of service resources. + * + * @return the serviceResources value + */ + public List serviceResources() { + return this.serviceResources; + } + + /** + * Set a list of service resources. + * + * @param serviceResources the serviceResources value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withServiceResources(List serviceResources) { + this.serviceResources = serviceResources; + return this; + } + + /** + * Get the provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java new file mode 100644 index 0000000000000..c5e56395a02cd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinition; + +class ServiceEndpointPolicyDefinitionsImpl extends WrapperImpl implements ServiceEndpointPolicyDefinitions { + private final NetworkManager manager; + + ServiceEndpointPolicyDefinitionsImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicyDefinitions()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl define(String name) { + return wrapModel(name); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(ServiceEndpointPolicyDefinitionInner inner) { + return new ServiceEndpointPolicyDefinitionImpl(inner, manager()); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(String name) { + return new ServiceEndpointPolicyDefinitionImpl(name, this.manager()); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsInner.java new file mode 100644 index 0000000000000..572cf9a1934b8 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyDefinitionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicyDefinitions. + */ +public class ServiceEndpointPolicyDefinitionsInner { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPolicyDefinitionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPolicyDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPolicyDefinitionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPolicyDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicyDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPolicyDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinitions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().last().body(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner get(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().last().body(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().single().body(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyImpl.java new file mode 100644 index 0000000000000..2fa25c6ff9419 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicy; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicyDefinition; + +class ServiceEndpointPolicyImpl extends GroupableResourceCoreImpl implements ServiceEndpointPolicy, ServiceEndpointPolicy.Definition, ServiceEndpointPolicy.Update { + ServiceEndpointPolicyImpl(String name, ServiceEndpointPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List serviceEndpointPolicyDefinitions() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicyDefinitions() != null) { + for (ServiceEndpointPolicyDefinitionInner inner : this.inner().serviceEndpointPolicyDefinitions()) { + lst.add( new ServiceEndpointPolicyDefinitionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ServiceEndpointPolicyImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ServiceEndpointPolicyImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public ServiceEndpointPolicyImpl withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.inner().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyInner.java new file mode 100644 index 0000000000000..76813533f5389 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ServiceEndpointPolicyInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service End point policy resource. + */ +@JsonFlatten +@SkipParentValidation +public class ServiceEndpointPolicyInner extends Resource { + /** + * A collection of service endpoint policy definitions of the service + * endpoint policy. + */ + @JsonProperty(value = "properties.serviceEndpointPolicyDefinitions") + private List serviceEndpointPolicyDefinitions; + + /** + * The resource GUID property of the service endpoint policy resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the service endpoint policy. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of service endpoint policy definitions of the service endpoint policy. + * + * @return the serviceEndpointPolicyDefinitions value + */ + public List serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * Set a collection of service endpoint policy definitions of the service endpoint policy. + * + * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.serviceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + return this; + } + + /** + * Get the resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the service endpoint policy resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetImpl.java new file mode 100644 index 0000000000000..f93063506cafe --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetImpl.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Subnet; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_07_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2018_07_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2018_07_01.RouteTable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPolicy; + +class SubnetImpl extends CreatableUpdatableImpl implements Subnet, Subnet.Definition, Subnet.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String subnetName; + + SubnetImpl(String name, NetworkManager manager) { + super(name, new SubnetInner()); + this.manager = manager; + // Set resource name + this.subnetName = name; + // + } + + SubnetImpl(SubnetInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.subnetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List resourceNavigationLinks() { + return this.inner().resourceNavigationLinks(); + } + + @Override + public RouteTable routeTable() { + RouteTableInner inner = this.inner().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List serviceEndpointPolicies() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicies() != null) { + for (ServiceEndpointPolicyInner inner : this.inner().serviceEndpointPolicies()) { + lst.add( new ServiceEndpointPolicyImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List serviceEndpoints() { + return this.inner().serviceEndpoints(); + } + + @Override + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public SubnetImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public SubnetImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public SubnetImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public SubnetImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public SubnetImpl withResourceNavigationLinks(List resourceNavigationLinks) { + this.inner().withResourceNavigationLinks(resourceNavigationLinks); + return this; + } + + @Override + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.inner().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + @Override + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.inner().withServiceEndpoints(serviceEndpoints); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetInner.java new file mode 100644 index 0000000000000..762a59eb86ad1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetInner.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_07_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.ResourceNavigationLink; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Subnet in a virtual network resource. + */ +@JsonFlatten +public class SubnetInner extends SubResource { + /** + * The address prefix for the subnet. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * The reference of the RouteTable resource. + */ + @JsonProperty(value = "properties.routeTable") + private RouteTableInner routeTable; + + /** + * An array of service endpoints. + */ + @JsonProperty(value = "properties.serviceEndpoints") + private List serviceEndpoints; + + /** + * An array of service endpoint policies. + */ + @JsonProperty(value = "properties.serviceEndpointPolicies") + private List serviceEndpointPolicies; + + /** + * Gets an array of references to the network interface IP configurations + * using subnet. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /** + * Gets an array of references to the external resources using subnet. + */ + @JsonProperty(value = "properties.resourceNavigationLinks") + private List resourceNavigationLinks; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the address prefix for the subnet. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the reference of the RouteTable resource. + * + * @return the routeTable value + */ + public RouteTableInner routeTable() { + return this.routeTable; + } + + /** + * Set the reference of the RouteTable resource. + * + * @param routeTable the routeTable value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withRouteTable(RouteTableInner routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get an array of service endpoints. + * + * @return the serviceEndpoints value + */ + public List serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set an array of service endpoints. + * + * @param serviceEndpoints the serviceEndpoints value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpoints(List serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Get an array of service endpoint policies. + * + * @return the serviceEndpointPolicies value + */ + public List serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * Set an array of service endpoint policies. + * + * @param serviceEndpointPolicies the serviceEndpointPolicies value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.serviceEndpointPolicies = serviceEndpointPolicies; + return this; + } + + /** + * Get gets an array of references to the network interface IP configurations using subnet. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get gets an array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value + */ + public List resourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** + * Set gets an array of references to the external resources using subnet. + * + * @param resourceNavigationLinks the resourceNavigationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withResourceNavigationLinks(List resourceNavigationLinks) { + this.resourceNavigationLinks = resourceNavigationLinks; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsImpl.java new file mode 100644 index 0000000000000..3deaf126b900c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.Subnets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class SubnetsImpl extends WrapperImpl implements Subnets { + private final NetworkManager manager; + + SubnetsImpl(NetworkManager manager) { + super(manager.inner().subnets()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public SubnetImpl define(String name) { + return wrapModel(name); + } + + private SubnetImpl wrapModel(SubnetInner inner) { + return new SubnetImpl(inner, manager()); + } + + private SubnetImpl wrapModel(String name) { + return new SubnetImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + SubnetsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, subnetName) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsInner.java new file mode 100644 index 0000000000000..a4595061f6b3c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/SubnetsInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Subnets. + */ +public class SubnetsInner { + /** The Retrofit service to perform REST calls. */ + private SubnetsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubnetsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SubnetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Subnets to be + * used by Retrofit to perform actually REST calls. + */ + interface SubnetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Subnets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyImpl.java new file mode 100644 index 0000000000000..363288370caac --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Topology; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TopologyResource; + +class TopologyImpl extends WrapperImpl implements Topology { + private final NetworkManager manager; + TopologyImpl(TopologyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime createdDateTime() { + return this.inner().createdDateTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List resources() { + return this.inner().resources(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyInner.java new file mode 100644 index 0000000000000..a82c091490c80 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TopologyInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TopologyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topology of the specified resource group. + */ +public class TopologyInner { + /** + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDateTime; + + /** + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The resources property. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get gUID representing the operation id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value + */ + public DateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the datetime when the topology was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the TopologyInner object itself. + */ + public TopologyInner withResources(List resources) { + this.resources = resources; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultImpl.java new file mode 100644 index 0000000000000..41c375a47690e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingDetails; + +class TroubleshootingResultImpl extends WrapperImpl implements TroubleshootingResult { + private final NetworkManager manager; + TroubleshootingResultImpl(TroubleshootingResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String code() { + return this.inner().code(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List results() { + return this.inner().results(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultInner.java new file mode 100644 index 0000000000000..dc1603b0c7e48 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/TroubleshootingResultInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Troubleshooting information gained from specified resource. + */ +public class TroubleshootingResultInner { + /** + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the start time of the troubleshooting. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the troubleshooting. + * + * @param startTime the startTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the troubleshooting. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the troubleshooting. + * + * @param endTime the endTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the result code of the troubleshooting. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the result code of the troubleshooting. + * + * @param code the code value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withCode(String code) { + this.code = code; + return this; + } + + /** + * Get information from troubleshooting. + * + * @return the results value + */ + public List results() { + return this.results; + } + + /** + * Set information from troubleshooting. + * + * @param results the results value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withResults(List results) { + this.results = results; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..7b360323a8195 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.UsageName; + +class UsageImpl extends WrapperImpl implements Usage { + private final NetworkManager manager; + + UsageImpl(UsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public long currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public long limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..8d4763026d974 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsageInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes network resource usage. + */ +public class UsageInner { + /** + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /** + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /** + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Creates an instance of UsageInner class. + * @param currentValue the current value of the usage. + * @param limit the limit of usage. + * @param name the name of the type of usage. + */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get an enum describing the unit of measurement. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set an enum describing the unit of measurement. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit of usage. + * + * @return the limit value + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit of usage. + * + * @param limit the limit value to set + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name of the type of usage. + * + * @param name the name value to set + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..6457e81a3390b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final NetworkManager manager; + + UsagesImpl(NetworkManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesInner.java new file mode 100644 index 0000000000000..3cdaeb0d801f2 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/UsagesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultImpl.java new file mode 100644 index 0000000000000..521c7c0cd9f3a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VerificationIPFlowResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.Access; + +class VerificationIPFlowResultImpl extends WrapperImpl implements VerificationIPFlowResult { + private final NetworkManager manager; + VerificationIPFlowResultImpl(VerificationIPFlowResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public String ruleName() { + return this.inner().ruleName(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultInner.java new file mode 100644 index 0000000000000..2e369cd7c833a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VerificationIPFlowResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.Access; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of IP flow verification on the target resource. + */ +public class VerificationIPFlowResultInner { + /** + * Indicates whether the traffic is allowed or denied. Possible values + * include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private Access access; + + /** + * Name of the rule. If input is not matched against any security rule, it + * is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * Get indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @param ruleName the ruleName value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..5ff5cf07a3b8c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualHub; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.HubVirtualNetworkConnection; + +class VirtualHubImpl extends GroupableResourceCoreImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + VirtualHubImpl(String name, VirtualHubInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hubVirtualNetworkConnections() { + List lst = new ArrayList(); + if (this.inner().hubVirtualNetworkConnections() != null) { + for (HubVirtualNetworkConnectionInner inner : this.inner().hubVirtualNetworkConnections()) { + lst.add( new HubVirtualNetworkConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public VirtualHubImpl withHubVirtualNetworkConnections(List hubVirtualNetworkConnections) { + this.inner().withHubVirtualNetworkConnections(hubVirtualNetworkConnections); + return this; + } + + @Override + public VirtualHubImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubInner.java new file mode 100644 index 0000000000000..30f3b6cd8d95b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubInner.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualHubInner extends Resource { + /** + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * list of all vnet connections with this VirtualHub. + */ + @JsonProperty(value = "properties.hubVirtualNetworkConnections") + private List hubVirtualNetworkConnections; + + /** + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the VirtualHub belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get list of all vnet connections with this VirtualHub. + * + * @return the hubVirtualNetworkConnections value + */ + public List hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * Set list of all vnet connections with this VirtualHub. + * + * @param hubVirtualNetworkConnections the hubVirtualNetworkConnections value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withHubVirtualNetworkConnections(List hubVirtualNetworkConnections) { + this.hubVirtualNetworkConnections = hubVirtualNetworkConnections; + return this; + } + + /** + * Get address-prefix for this VirtualHub. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set address-prefix for this VirtualHub. + * + * @param addressPrefix the addressPrefix value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsImpl.java new file mode 100644 index 0000000000000..9552abcbf908b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_07_01.VirtualHub; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualHubsImpl extends GroupableResourcesCoreImpl implements VirtualHubs { + protected VirtualHubsImpl(NetworkManager manager) { + super(manager.inner().virtualHubs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualHubsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualHubImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualHubImpl wrapModel(VirtualHubInner inner) { + return new VirtualHubImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualHubImpl wrapModel(String name) { + return new VirtualHubImpl(name, new VirtualHubInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsInner.java new file mode 100644 index 0000000000000..2ff66db945247 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualHubs. + */ +public class VirtualHubsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualHubsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualHubsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualHubName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualHubName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualHubName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..c8e92130e2581 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_07_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_07_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_07_01.IPVersion; +import com.microsoft.azure.management.network.v2018_07_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_07_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; + +class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements VirtualMachineScaleSetNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualMachineScaleSetName; + private String virtualmachineIndex; + private String networkInterfaceName; + private String ipConfigurationName; + + VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(this.resourceGroupName, this.virtualMachineScaleSetName, this.virtualmachineIndex, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..3e43e9e3eb581 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_07_01.LocalNetworkGateway; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateway; + +class VirtualNetworkGatewayConnectionImpl extends GroupableResourceCoreImpl implements VirtualNetworkGatewayConnection, VirtualNetworkGatewayConnection.Definition, VirtualNetworkGatewayConnection.Update { + VirtualNetworkGatewayConnectionImpl(String name, VirtualNetworkGatewayConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public LocalNetworkGateway localNetworkGateway2() { + LocalNetworkGatewayInner inner = this.inner().localNetworkGateway2(); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway1() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway1(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway2() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway2(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.inner().withConnectionType(connectionType); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.inner().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.inner().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.inner().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.inner().withPeer(peer); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.inner().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.inner().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionInner.java new file mode 100644 index 0000000000000..54b45b74f654a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,500 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 0000000000000..66f53d2f15e7a --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionStatus; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionType; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.SubResource; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_07_01.TunnelConnectionHealth; + +class VirtualNetworkGatewayConnectionListEntityImpl extends WrapperImpl implements VirtualNetworkGatewayConnectionListEntity { + private final NetworkManager manager; + + VirtualNetworkGatewayConnectionListEntityImpl(VirtualNetworkGatewayConnectionListEntityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.inner().localNetworkGateway2(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.inner().virtualNetworkGateway1(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.inner().virtualNetworkGateway2(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java new file mode 100644 index 0000000000000..69bdab11ae948 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,501 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2(VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2(VirtualNetworkConnectionGatewayReference localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsImpl.java new file mode 100644 index 0000000000000..e6e4322e801ad --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionSharedKey; +import com.microsoft.azure.management.network.v2018_07_01.ConnectionResetSharedKey; + +class VirtualNetworkGatewayConnectionsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGatewayConnections { + protected VirtualNetworkGatewayConnectionsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGatewayConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnection call(VirtualNetworkGatewayConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength) + .map(new Func1() { + @Override + public ConnectionResetSharedKey call(ConnectionResetSharedKeyInner inner) { + return new ConnectionResetSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(VirtualNetworkGatewayConnectionInner inner) { + return new VirtualNetworkGatewayConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, new VirtualNetworkGatewayConnectionInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsInner.java new file mode 100644 index 0000000000000..eafcbc6b97e0c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayConnectionsInner.java @@ -0,0 +1,1485 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGatewayConnections. + */ +public class VirtualNetworkGatewayConnectionsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewayConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewayConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewayConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGatewayConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewayConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections setSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> setSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections beginSetSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> beginSetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections getSharedKey" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> getSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections resetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> resetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections beginResetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> beginResetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> getSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + Observable> observable = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + return service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..a1e9e7cdc9219 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateway; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_07_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_07_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; + +class VirtualNetworkGatewayImpl extends GroupableResourceCoreImpl implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + VirtualNetworkGatewayImpl(String name, VirtualNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean activeActive() { + return this.inner().activeActive(); + } + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource gatewayDefaultSite() { + return this.inner().gatewayDefaultSite(); + } + + @Override + public VirtualNetworkGatewayType gatewayType() { + return this.inner().gatewayType(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public VpnClientConfiguration vpnClientConfiguration() { + return this.inner().vpnClientConfiguration(); + } + + @Override + public VpnType vpnType() { + return this.inner().vpnType(); + } + + @Override + public VirtualNetworkGatewayImpl withActiveActive(Boolean activeActive) { + this.inner().withActiveActive(activeActive); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.inner().withGatewayDefaultSite(gatewayDefaultSite); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.inner().withGatewayType(gatewayType); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.inner().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.inner().withVpnType(vpnType); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayInner.java new file mode 100644 index 0000000000000..beb58d6a11909 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewayInner.java @@ -0,0 +1,366 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_07_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_07_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayInner extends Resource { + /** + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The type of this virtual network gateway. Possible values are: 'Vpn' and + * 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + */ + @JsonProperty(value = "properties.gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /** + * The type of this virtual network gateway. Possible values are: + * 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', + * 'RouteBased'. + */ + @JsonProperty(value = "properties.vpnType") + private VpnType vpnType; + + /** + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean activeActive; + + /** + * The reference of the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of + * removing existing default site setting. + */ + @JsonProperty(value = "properties.gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /** + * The reference of the VirtualNetworkGatewaySku resource which represents + * the SKU selected for Virtual network gateway. + */ + @JsonProperty(value = "properties.sku") + private VirtualNetworkGatewaySku sku; + + /** + * The reference of the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + */ + @JsonProperty(value = "properties.vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /** + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the VirtualNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get iP configurations for virtual network gateway. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configurations for virtual network gateway. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @return the gatewayType value + */ + public VirtualNetworkGatewayType gatewayType() { + return this.gatewayType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @param gatewayType the gatewayType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.gatewayType = gatewayType; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @return the vpnType value + */ + public VpnType vpnType() { + return this.vpnType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @param vpnType the vpnType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { + this.vpnType = vpnType; + return this; + } + + /** + * Get whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set whether BGP is enabled for this virtual network gateway or not. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get activeActive flag. + * + * @return the activeActive value + */ + public Boolean activeActive() { + return this.activeActive; + } + + /** + * Set activeActive flag. + * + * @param activeActive the activeActive value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActiveActive(Boolean activeActive) { + this.activeActive = activeActive; + return this; + } + + /** + * Get the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @return the gatewayDefaultSite value + */ + public SubResource gatewayDefaultSite() { + return this.gatewayDefaultSite; + } + + /** + * Set the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @param gatewayDefaultSite the gatewayDefaultSite value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.gatewayDefaultSite = gatewayDefaultSite; + return this; + } + + /** + * Get the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @return the sku value + */ + public VirtualNetworkGatewaySku sku() { + return this.sku; + } + + /** + * Set the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @param sku the sku value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value + */ + public VpnClientConfiguration vpnClientConfiguration() { + return this.vpnClientConfiguration; + } + + /** + * Set the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @param vpnClientConfiguration the vpnClientConfiguration value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set virtual network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..03c8d7534debc --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.BgpPeerStatusListResult; +import com.microsoft.azure.management.network.v2018_07_01.GatewayRouteListResult; +import com.microsoft.azure.management.network.v2018_07_01.VpnClientIPsecParameters; +import com.microsoft.azure.management.network.v2018_07_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.management.network.v2018_07_01.VpnDeviceScriptParameters; + +class VirtualNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGateways { + protected VirtualNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { + return new BgpPeerStatusListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(String name) { + return new VirtualNetworkGatewayImpl(name, new VirtualNetworkGatewayInner(), this.manager()); + } + + private VirtualNetworkGatewayConnectionListEntityImpl wrapVirtualNetworkGatewayConnectionListEntityModel(VirtualNetworkGatewayConnectionListEntityInner inner) { + return new VirtualNetworkGatewayConnectionListEntityImpl(inner, manager()); + } + + @Override + public Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConnectionListEntityInner inner) { + return wrapVirtualNetworkGatewayConnectionListEntityModel(inner); + } + }); + } + + @Override + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java new file mode 100644 index 0000000000000..e958c427c91df --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java @@ -0,0 +1,3281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.management.network.v2018_07_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_07_01.VpnDeviceScriptParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGateways. + */ +public class VirtualNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways listConnections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + Observable> listConnections(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> reset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways generatevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGeneratevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> beginGeneratevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGenerateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGetVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> beginGetVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> getBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGetBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> beginGetBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways supportedVpnDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + Observable> supportedVpnDevices(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> getLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGetLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> beginGetLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> getAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGetAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> beginGetAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways setVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> setVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginSetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> beginSetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways getVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> getVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways beginGetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> beginGetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways vpnDeviceConfigurationScript" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + Observable> vpnDeviceConfigurationScript(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VpnDeviceScriptParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkGateways listConnectionsNext" }) + @GET + Observable> listConnectionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnections(final String resourceGroupName, final String virtualNetworkGatewayName) { + ServiceResponse> response = listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsSinglePageAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listConnections(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String gatewayVip = null; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String gatewayVip = null; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGeneratevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGeneratevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGeneratevpnclientpackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGeneratevpnclientpackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGetVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGetVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnProfilePackageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnProfilePackageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String peer = null; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String peer = null; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetBgpPeerStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> supportedVpnDevicesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedVpnDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedVpnDevicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetLearnedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetLearnedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAdvertisedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAdvertisedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner setVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().last().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-07-01"; + Observable> observable = service.setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().single().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginSetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-07-01"; + return service.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginGetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> vpnDeviceConfigurationScriptWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = vpnDeviceConfigurationScriptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse vpnDeviceConfigurationScriptDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnectionsNext(final String nextPageLink) { + ServiceResponse> response = listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsNextAsync(final String nextPageLink) { + return listConnectionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsNextWithServiceResponseAsync(final String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listConnectionsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..5a7ed4232779c --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetwork; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.Subnet; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeering; + +class VirtualNetworkImpl extends GroupableResourceCoreImpl implements VirtualNetwork, VirtualNetwork.Definition, VirtualNetwork.Update { + VirtualNetworkImpl(String name, VirtualNetworkInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public SubResource ddosProtectionPlan() { + return this.inner().ddosProtectionPlan(); + } + + @Override + public DhcpOptions dhcpOptions() { + return this.inner().dhcpOptions(); + } + + @Override + public Boolean enableDdosProtection() { + return this.inner().enableDdosProtection(); + } + + @Override + public Boolean enableVmProtection() { + return this.inner().enableVmProtection(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List virtualNetworkPeerings() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkPeerings() != null) { + for (VirtualNetworkPeeringInner inner : this.inner().virtualNetworkPeerings()) { + lst.add( new VirtualNetworkPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.inner().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + @Override + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.inner().withDhcpOptions(dhcpOptions); + return this; + } + + @Override + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.inner().withEnableDdosProtection(enableDdosProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.inner().withEnableVmProtection(enableVmProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkImpl withSubnets(List subnets) { + this.inner().withSubnets(subnets); + return this; + } + + @Override + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.inner().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkInner.java new file mode 100644 index 0000000000000..0e97e16635e90 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkInner extends Resource { + /** + * The AddressSpace that contains an array of IP address ranges that can be + * used by subnets. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The dhcpOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "properties.dhcpOptions") + private DhcpOptions dhcpOptions; + + /** + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "properties.subnets") + private List subnets; + + /** + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "properties.virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /** + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated + * with the resource. + */ + @JsonProperty(value = "properties.enableDdosProtection") + private Boolean enableDdosProtection; + + /** + * Indicates if VM protection is enabled for all the subnets in the virtual + * network. + */ + @JsonProperty(value = "properties.enableVmProtection") + private Boolean enableVmProtection; + + /** + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "properties.ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @param addressSpace the addressSpace value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @return the dhcpOptions value + */ + public DhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @param dhcpOptions the dhcpOptions value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get a list of subnets in a Virtual Network. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Set a list of subnets in a Virtual Network. + * + * @param subnets the subnets value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get a list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value + */ + public List virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * Set a list of peerings in a Virtual Network. + * + * @param virtualNetworkPeerings the virtualNetworkPeerings value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.virtualNetworkPeerings = virtualNetworkPeerings; + return this; + } + + /** + * Get the resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resourceGuid property of the Virtual Network resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @return the enableDdosProtection value + */ + public Boolean enableDdosProtection() { + return this.enableDdosProtection; + } + + /** + * Set indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @param enableDdosProtection the enableDdosProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @return the enableVmProtection value + */ + public Boolean enableVmProtection() { + return this.enableVmProtection; + } + + /** + * Set indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @param enableVmProtection the enableVmProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { + this.enableVmProtection = enableVmProtection; + return this; + } + + /** + * Get the DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the DDoS protection plan associated with the virtual network. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringImpl.java new file mode 100644 index 0000000000000..bb06095f9370b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeeringState; + +class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String virtualNetworkPeeringName; + + VirtualNetworkPeeringImpl(String name, NetworkManager manager) { + super(name, new VirtualNetworkPeeringInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = name; + // + } + + VirtualNetworkPeeringImpl(VirtualNetworkPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkPeerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowForwardedTraffic() { + return this.inner().allowForwardedTraffic(); + } + + @Override + public Boolean allowGatewayTransit() { + return this.inner().allowGatewayTransit(); + } + + @Override + public Boolean allowVirtualNetworkAccess() { + return this.inner().allowVirtualNetworkAccess(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkPeeringState peeringState() { + return this.inner().peeringState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AddressSpace remoteAddressSpace() { + return this.inner().remoteAddressSpace(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Boolean useRemoteGateways() { + return this.inner().useRemoteGateways(); + } + + @Override + public VirtualNetworkPeeringImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.inner().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.inner().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.inner().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.inner().withPeeringState(peeringState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.inner().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.inner().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.inner().withUseRemoteGateways(useRemoteGateways); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringInner.java new file mode 100644 index 0000000000000..5733e5bfe7d3d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Peerings in a virtual network resource. + */ +@JsonFlatten +public class VirtualNetworkPeeringInner extends SubResource { + /** + * Whether the VMs in the linked virtual network space would be able to + * access all the VMs in local Virtual network space. + */ + @JsonProperty(value = "properties.allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /** + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + */ + @JsonProperty(value = "properties.allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /** + * If gateway links can be used in remote virtual networking to link to + * this virtual network. + */ + @JsonProperty(value = "properties.allowGatewayTransit") + private Boolean allowGatewayTransit; + + /** + * If remote gateways can be used on this virtual network. If the flag is + * set to true, and allowGatewayTransit on remote peering is also true, + * virtual network will use gateways of remote virtual network for transit. + * Only one peering can have this flag set to true. This flag cannot be set + * if virtual network already has a gateway. + */ + @JsonProperty(value = "properties.useRemoteGateways") + private Boolean useRemoteGateways; + + /** + * The reference of the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register + * for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * The reference of the remote virtual network address space. + */ + @JsonProperty(value = "properties.remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /** + * The status of the virtual network peering. Possible values are + * 'Initiated', 'Connected', and 'Disconnected'. Possible values include: + * 'Initiated', 'Connected', 'Disconnected'. + */ + @JsonProperty(value = "properties.peeringState") + private VirtualNetworkPeeringState peeringState; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @return the allowVirtualNetworkAccess value + */ + public Boolean allowVirtualNetworkAccess() { + return this.allowVirtualNetworkAccess; + } + + /** + * Set whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; + return this; + } + + /** + * Get whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @return the allowForwardedTraffic value + */ + public Boolean allowForwardedTraffic() { + return this.allowForwardedTraffic; + } + + /** + * Set whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @param allowForwardedTraffic the allowForwardedTraffic value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.allowForwardedTraffic = allowForwardedTraffic; + return this; + } + + /** + * Get if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @return the allowGatewayTransit value + */ + public Boolean allowGatewayTransit() { + return this.allowGatewayTransit; + } + + /** + * Set if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @param allowGatewayTransit the allowGatewayTransit value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.allowGatewayTransit = allowGatewayTransit; + return this; + } + + /** + * Get if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @return the useRemoteGateways value + */ + public Boolean useRemoteGateways() { + return this.useRemoteGateways; + } + + /** + * Set if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @param useRemoteGateways the useRemoteGateways value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { + this.useRemoteGateways = useRemoteGateways; + return this; + } + + /** + * Get the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the reference of the remote virtual network address space. + * + * @return the remoteAddressSpace value + */ + public AddressSpace remoteAddressSpace() { + return this.remoteAddressSpace; + } + + /** + * Set the reference of the remote virtual network address space. + * + * @param remoteAddressSpace the remoteAddressSpace value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.remoteAddressSpace = remoteAddressSpace; + return this; + } + + /** + * Get the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @return the peeringState value + */ + public VirtualNetworkPeeringState peeringState() { + return this.peeringState; + } + + /** + * Set the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @param peeringState the peeringState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { + this.peeringState = peeringState; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsImpl.java new file mode 100644 index 0000000000000..3f5d6aa6bba3d --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeering; + +class VirtualNetworkPeeringsImpl extends WrapperImpl implements VirtualNetworkPeerings { + private final NetworkManager manager; + + VirtualNetworkPeeringsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkPeeringImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkPeeringImpl wrapModel(VirtualNetworkPeeringInner inner) { + return new VirtualNetworkPeeringImpl(inner, manager()); + } + + private VirtualNetworkPeeringImpl wrapModel(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsInner.java new file mode 100644 index 0000000000000..7ee05ef357525 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkPeerings. + */ +public class VirtualNetworkPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..d390233e94183 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkUsageName; + +class VirtualNetworkUsageImpl extends WrapperImpl implements VirtualNetworkUsage { + private final NetworkManager manager; + + VirtualNetworkUsageImpl(VirtualNetworkUsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public VirtualNetworkUsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageInner.java new file mode 100644 index 0000000000000..93f9ca646bdea --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkUsageInner.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage details for subnet. + */ +public class VirtualNetworkUsageInner { + /** + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /** + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /** + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get indicates number of IPs used from the Subnet. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get subnet identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get indicates the size of the subnet. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name containing common and localized value for usage. + * + * @return the name value + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get usage units. Returns 'Count'. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..cd8df43380b87 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetwork; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.IPAddressAvailabilityResult; +import com.microsoft.azure.management.network.v2018_07_01.VirtualNetworkUsage; + +class VirtualNetworksImpl extends GroupableResourcesCoreImpl implements VirtualNetworks { + protected VirtualNetworksImpl(NetworkManager manager) { + super(manager.inner().virtualNetworks(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworksInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName) + .map(new Func1() { + @Override + public IPAddressAvailabilityResult call(IPAddressAvailabilityResultInner inner) { + return new IPAddressAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkImpl wrapModel(VirtualNetworkInner inner) { + return new VirtualNetworkImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkImpl wrapModel(String name) { + return new VirtualNetworkImpl(name, new VirtualNetworkInner(), this.manager()); + } + + private VirtualNetworkUsageImpl wrapVirtualNetworkUsageModel(VirtualNetworkUsageInner inner) { + return new VirtualNetworkUsageImpl(inner, manager()); + } + + @Override + public Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.listUsageAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkUsage call(VirtualNetworkUsageInner inner) { + return wrapVirtualNetworkUsageModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksInner.java new file mode 100644 index 0000000000000..aa6f9bd286cb7 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworksInner.java @@ -0,0 +1,1765 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworks. + */ +public class VirtualNetworksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks checkIPAddressAvailability" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + Observable> checkIPAddressAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("ipAddress") String ipAddress, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks listUsage" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages") + Observable> listUsage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualNetworks listUsageNext" }) + @GET + Observable> listUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final String ipAddress = null; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single().body(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkIPAddressAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsage(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listUsageSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listUsage(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsageNext(final String nextPageLink) { + ServiceResponse> response = listUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageNextAsync(final String nextPageLink) { + return listUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANImpl.java new file mode 100644 index 0000000000000..c31bc92cb87bb --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANImpl.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualWAN; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; + +class VirtualWANImpl extends GroupableResourceCoreImpl implements VirtualWAN, VirtualWAN.Definition, VirtualWAN.Update { + VirtualWANImpl(String name, VirtualWANInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableVpnEncryption() { + return this.inner().disableVpnEncryption(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List virtualHubs() { + return this.inner().virtualHubs(); + } + + @Override + public List vpnSites() { + return this.inner().vpnSites(); + } + + @Override + public VirtualWANImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.inner().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + @Override + public VirtualWANImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANInner.java new file mode 100644 index 0000000000000..a28eb5d3fee84 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualWAN Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualWANInner extends Resource { + /** + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "properties.disableVpnEncryption") + private Boolean disableVpnEncryption; + + /** + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "properties.virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /** + * The vpnSites property. + */ + @JsonProperty(value = "properties.vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value + */ + public Boolean disableVpnEncryption() { + return this.disableVpnEncryption; + } + + /** + * Set vpn encryption to be disabled or not. + * + * @param disableVpnEncryption the disableVpnEncryption value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.disableVpnEncryption = disableVpnEncryption; + return this; + } + + /** + * Get list of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value + */ + public List virtualHubs() { + return this.virtualHubs; + } + + /** + * Get the vpnSites value. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsImpl.java new file mode 100644 index 0000000000000..4339d599b7b7f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VirtualWANs; +import com.microsoft.azure.management.network.v2018_07_01.VirtualWAN; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualWANsImpl extends GroupableResourcesCoreImpl implements VirtualWANs { + protected VirtualWANsImpl(NetworkManager manager) { + super(manager.inner().virtualWANs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualWANsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualWANsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualWANsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualWANsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualWANsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualWANsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualWANImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualWANImpl wrapModel(VirtualWANInner inner) { + return new VirtualWANImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualWANImpl wrapModel(String name) { + return new VirtualWANImpl(name, new VirtualWANInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java new file mode 100644 index 0000000000000..bcb7f343384b9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualWANs. + */ +public class VirtualWANsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualWANsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWANsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualWANsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualWANsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualWANs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualWANsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VirtualWANs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, virtualWANName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner createOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginCreateOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualWANName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWANName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWANName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWANName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..0c3f4095d7a1f --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VpnClientIPsecParameters; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.DhGroup; +import com.microsoft.azure.management.network.v2018_07_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_07_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_07_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_07_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_07_01.PfsGroup; + +class VpnClientIPsecParametersImpl extends WrapperImpl implements VpnClientIPsecParameters { + private final NetworkManager manager; + VpnClientIPsecParametersImpl(VpnClientIPsecParametersInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DhGroup dhGroup() { + return this.inner().dhGroup(); + } + + @Override + public IkeEncryption ikeEncryption() { + return this.inner().ikeEncryption(); + } + + @Override + public IkeIntegrity ikeIntegrity() { + return this.inner().ikeIntegrity(); + } + + @Override + public IpsecEncryption ipsecEncryption() { + return this.inner().ipsecEncryption(); + } + + @Override + public IpsecIntegrity ipsecIntegrity() { + return this.inner().ipsecIntegrity(); + } + + @Override + public PfsGroup pfsGroup() { + return this.inner().pfsGroup(); + } + + @Override + public int saDataSizeKilobytes() { + return this.inner().saDataSizeKilobytes(); + } + + @Override + public int saLifeTimeSeconds() { + return this.inner().saLifeTimeSeconds(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersInner.java new file mode 100644 index 0000000000000..9c4f1d1f34951 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnClientIPsecParametersInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_07_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_07_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_07_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_07_01.DhGroup; +import com.microsoft.azure.management.network.v2018_07_01.PfsGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + */ +public class VpnClientIPsecParametersInner { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..fc8a180c28d56 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionImpl.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.management.network.v2018_07_01.VpnConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; + +class VpnConnectionImpl extends CreatableUpdatableImpl implements VpnConnection, VpnConnection.Definition, VpnConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String gatewayName; + private String connectionName; + + VpnConnectionImpl(String name, NetworkManager manager) { + super(name, new VpnConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + VpnConnectionImpl(VpnConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.gatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.getAsync(this.resourceGroupName, this.gatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer connectionBandwidthInMbps() { + return this.inner().connectionBandwidthInMbps(); + } + + @Override + public VpnConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVpnSite() { + return this.inner().remoteVpnSite(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VpnConnectionImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + @Override + public VpnConnectionImpl withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.inner().withConnectionStatus(connectionStatus); + return this; + } + + @Override + public VpnConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VpnConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VpnConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VpnConnectionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VpnConnectionImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnConnectionImpl withRemoteVpnSite(SubResource remoteVpnSite) { + this.inner().withRemoteVpnSite(remoteVpnSite); + return this; + } + + @Override + public VpnConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VpnConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VpnConnectionImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionInner.java new file mode 100644 index 0000000000000..e7565940a0474 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionInner.java @@ -0,0 +1,298 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnConnection Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnConnectionInner extends Resource { + /** + * Id of the connected vpn site. + */ + @JsonProperty(value = "properties.remoteVpnSite") + private SubResource remoteVpnSite; + + /** + * routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The connection status. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus") + private VpnConnectionStatus connectionStatus; + + /** + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer connectionBandwidthInMbps; + + /** + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get id of the connected vpn site. + * + * @return the remoteVpnSite value + */ + public SubResource remoteVpnSite() { + return this.remoteVpnSite; + } + + /** + * Set id of the connected vpn site. + * + * @param remoteVpnSite the remoteVpnSite value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { + this.remoteVpnSite = remoteVpnSite; + return this; + } + + /** + * Get routing weight for vpn connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Set the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @param connectionStatus the connectionStatus value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.connectionStatus = connectionStatus; + return this; + } + + /** + * Get ingress bytes transferred. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get egress bytes transferred. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get expected bandwidth in MBPS. + * + * @return the connectionBandwidthInMbps value + */ + public Integer connectionBandwidthInMbps() { + return this.connectionBandwidthInMbps; + } + + /** + * Get sharedKey for the vpn connection. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set sharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsImpl.java new file mode 100644 index 0000000000000..43c81b7df15f9 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnection; + +class VpnConnectionsImpl extends WrapperImpl implements VpnConnections { + private final NetworkManager manager; + + VpnConnectionsImpl(NetworkManager manager) { + super(manager.inner().vpnConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VpnConnectionImpl define(String name) { + return wrapModel(name); + } + + private VpnConnectionImpl wrapModel(VpnConnectionInner inner) { + return new VpnConnectionImpl(inner, manager()); + } + + private VpnConnectionImpl wrapModel(String name) { + return new VpnConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + VpnConnectionsInner client = this.inner(); + return client.listByVpnGatewayAsync(resourceGroupName, gatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, gatewayName, connectionName) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, gatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsInner.java new file mode 100644 index 0000000000000..d5dfb02a89652 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnConnectionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnConnections. + */ +public class VpnConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private VpnConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections listByVpnGateway" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") + Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnConnections listByVpnGatewayNext" }) + @GET + Observable> listByVpnGatewayNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGateway(final String resourceGroupName, final String gatewayName) { + ServiceResponse> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + ServiceResponse> * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGatewayNext(final String nextPageLink) { + ServiceResponse> response = listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewayNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayNextAsync(final String nextPageLink) { + return listByVpnGatewayNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayNextWithServiceResponseAsync(final String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewayNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVpnGatewayNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..7810d1f8a8bd1 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayImpl.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_07_01.Policies; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_07_01.VpnConnection; + +class VpnGatewayImpl extends GroupableResourceCoreImpl implements VpnGateway, VpnGateway.Definition, VpnGateway.Update { + VpnGatewayImpl(String name, VpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (VpnConnectionInner inner : this.inner().connections()) { + lst.add( new VpnConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Policies policies() { + return this.inner().policies(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VpnGatewayImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public VpnGatewayImpl withPolicies(Policies policies) { + this.inner().withPolicies(policies); + return this; + } + + @Override + public VpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayInner.java new file mode 100644 index 0000000000000..70a8549d2ce6b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewayInner.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_07_01.Policies; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * list of all vpn connections to the gateway. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The policies applied to this vpn gateway. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get list of all vpn connections to the gateway. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set list of all vpn connections to the gateway. + * + * @param connections the connections value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the policies applied to this vpn gateway. + * + * @return the policies value + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies applied to this vpn gateway. + * + * @param policies the policies value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysImpl.java new file mode 100644 index 0000000000000..d74ed0881b921 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_07_01.VpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnGatewaysImpl extends GroupableResourcesCoreImpl implements VpnGateways { + protected VpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().vpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnGatewayImpl wrapModel(VpnGatewayInner inner) { + return new VpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnGatewayImpl wrapModel(String name) { + return new VpnGatewayImpl(name, new VpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysInner.java new file mode 100644 index 0000000000000..ccddb6fb56a34 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnGatewaysInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnGateways. + */ +public class VpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().last().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().single().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..acb2d071afd63 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteImpl.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnSite; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; + +class VpnSiteImpl extends GroupableResourceCoreImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + VpnSiteImpl(String name, VpnSiteInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public BgpSettings bgpProperties() { + return this.inner().bgpProperties(); + } + + @Override + public DeviceProperties deviceProperties() { + return this.inner().deviceProperties(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String siteKey() { + return this.inner().siteKey(); + } + + @Override + public SubResource virtualWAN() { + return this.inner().virtualWAN(); + } + + @Override + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.inner().withBgpProperties(bgpProperties); + return this; + } + + @Override + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.inner().withDeviceProperties(deviceProperties); + return this; + } + + @Override + public VpnSiteImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public VpnSiteImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnSiteImpl withSiteKey(String siteKey) { + this.inner().withSiteKey(siteKey); + return this; + } + + @Override + public VpnSiteImpl withVirtualWAN(SubResource virtualWAN) { + this.inner().withVirtualWAN(virtualWAN); + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteInner.java new file mode 100644 index 0000000000000..c9669d5704c1e --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSiteInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_07_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_07_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_07_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_07_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnSite Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnSiteInner extends Resource { + /** + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "properties.virtualWAN") + private SubResource virtualWAN; + + /** + * The device properties. + */ + @JsonProperty(value = "properties.deviceProperties") + private DeviceProperties deviceProperties; + + /** + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "properties.siteKey") + private String siteKey; + + /** + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private BgpSettings bgpProperties; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWAN value + */ + public SubResource virtualWAN() { + return this.virtualWAN; + } + + /** + * Set the VirtualWAN to which the vpnSite belongs. + * + * @param virtualWAN the virtualWAN value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVirtualWAN(SubResource virtualWAN) { + this.virtualWAN = virtualWAN; + return this; + } + + /** + * Get the device properties. + * + * @return the deviceProperties value + */ + public DeviceProperties deviceProperties() { + return this.deviceProperties; + } + + /** + * Set the device properties. + * + * @param deviceProperties the deviceProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { + this.deviceProperties = deviceProperties; + return this; + } + + /** + * Get the ip-address for the vpn-site. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ip-address for the vpn-site. + * + * @param ipAddress the ipAddress value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the key for vpn-site that can be used for connections. + * + * @return the siteKey value + */ + public String siteKey() { + return this.siteKey; + } + + /** + * Set the key for vpn-site that can be used for connections. + * + * @param siteKey the siteKey value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withSiteKey(String siteKey) { + this.siteKey = siteKey; + return this; + } + + /** + * Get the AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges. + * + * @param addressSpace the addressSpace value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the set of bgp properties. + * + * @return the bgpProperties value + */ + public BgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsImpl.java new file mode 100644 index 0000000000000..0a72f43079010 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnSitesConfigurations; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_07_01.GetVpnSitesConfigurationRequest; + +class VpnSitesConfigurationsImpl extends WrapperImpl implements VpnSitesConfigurations { + private final NetworkManager manager; + + VpnSitesConfigurationsImpl(NetworkManager manager) { + super(manager.inner().vpnSitesConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + VpnSitesConfigurationsInner client = this.inner(); + return client.downloadAsync(resourceGroupName, virtualWANName, request).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsInner.java new file mode 100644 index 0000000000000..e778a63e43cd4 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesConfigurationsInner.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.management.network.v2018_07_01.GetVpnSitesConfigurationRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSitesConfigurations. + */ +public class VpnSitesConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private VpnSitesConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSitesConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSitesConfigurations download" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> download(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSitesConfigurations beginDownload" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> beginDownload(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void download(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().last().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-07-01"; + Observable> observable = service.download(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDownload(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().single().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDownloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-07-01"; + return service.beginDownload(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDownloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDownloadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesImpl.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesImpl.java new file mode 100644 index 0000000000000..7d8bbbc9ebdd3 --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_07_01.VpnSites; +import com.microsoft.azure.management.network.v2018_07_01.VpnSite; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnSitesImpl extends GroupableResourcesCoreImpl implements VpnSites { + protected VpnSitesImpl(NetworkManager manager) { + super(manager.inner().vpnSites(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnSitesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnSitesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnSiteImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnSiteImpl wrapModel(VpnSiteInner inner) { + return new VpnSiteImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnSiteImpl wrapModel(String name) { + return new VpnSiteImpl(name, new VpnSiteInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesInner.java new file mode 100644 index 0000000000000..64135dfa5a8cd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VpnSitesInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_07_01.ErrorException; +import com.microsoft.azure.management.network.v2018_07_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSites. + */ +public class VpnSitesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnSitesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSites to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_07_01.VpnSites listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().last().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-07-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-07-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-07-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vpnSiteName) { + deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vpnSiteName) { + return deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vpnSiteName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vpnSiteName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/package-info.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/package-info.java new file mode 100644 index 0000000000000..5cb86e8be3dbd --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_07_01.implementation; diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/package-info.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/package-info.java new file mode 100644 index 0000000000000..67a5989121d7b --- /dev/null +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_07_01; diff --git a/network/resource-manager/v2018_08_01/pom.xml b/network/resource-manager/v2018_08_01/pom.xml new file mode 100644 index 0000000000000..7fc8815f36f9c --- /dev/null +++ b/network/resource-manager/v2018_08_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.network.v2018_08_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Access.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Access.java new file mode 100644 index 0000000000000..8a6b3173dd781 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Access.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Access. + */ +public final class Access extends ExpandableStringEnum { + /** Static value Allow for Access. */ + public static final Access ALLOW = fromString("Allow"); + + /** Static value Deny for Access. */ + public static final Access DENY = fromString("Deny"); + + /** + * Creates or finds a Access from its string representation. + * @param name a name to look for + * @return the corresponding Access + */ + @JsonCreator + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** + * @return known Access values + */ + public static Collection values() { + return values(Access.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AddressSpace.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AddressSpace.java new file mode 100644 index 0000000000000..66af2b10b2651 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AddressSpace.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + */ +public class AddressSpace { + /** + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get a list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set a list of address blocks reserved for this virtual network in CIDR notation. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the AddressSpace object itself. + */ + public AddressSpace withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateway.java new file mode 100644 index 0000000000000..4d03583414bcb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateway.java @@ -0,0 +1,770 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewayInner; + +/** + * Type representing ApplicationGateway. + */ +public interface ApplicationGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authenticationCertificates value. + */ + List authenticationCertificates(); + + /** + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the backendHttpSettingsCollection value. + */ + List backendHttpSettingsCollection(); + + /** + * @return the customErrorConfigurations value. + */ + List customErrorConfigurations(); + + /** + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the frontendPorts value. + */ + List frontendPorts(); + + /** + * @return the gatewayIPConfigurations value. + */ + List gatewayIPConfigurations(); + + /** + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * @return the operationalState value. + */ + ApplicationGatewayOperationalState operationalState(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + ApplicationGatewaySku sku(); + + /** + * @return the sslCertificates value. + */ + List sslCertificates(); + + /** + * @return the sslPolicy value. + */ + ApplicationGatewaySslPolicy sslPolicy(); + + /** + * @return the trustedRootCertificates value. + */ + List trustedRootCertificates(); + + /** + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the ApplicationGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationgateway definition allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @param authenticationCertificates Authentication certificates of the application gateway resource + * @return the next definition stage + */ + WithCreate withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway definition allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next definition stage + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Backend address pool of the application gateway resource + * @return the next definition stage + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway definition allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @return the next definition stage + */ + WithCreate withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway definition allowing to specify CustomErrorConfigurations. + */ + interface WithCustomErrorConfigurations { + /** + * Specifies customErrorConfigurations. + * @param customErrorConfigurations Custom error configurations of the application gateway resource + * @return the next definition stage + */ + WithCreate withCustomErrorConfigurations(List customErrorConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @param enableFips Whether FIPS is enabled on the application gateway resource + * @return the next definition stage + */ + WithCreate withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway definition allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource + * @return the next definition stage + */ + WithCreate withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the applicationgateway definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @return the next definition stage + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + * @param frontendPorts Frontend ports of the application gateway resource + * @return the next definition stage + */ + WithCreate withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway definition allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @param gatewayIPConfigurations Subnets of application the gateway resource + * @return the next definition stage + */ + WithCreate withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @param httpListeners Http listeners of the application gateway resource + * @return the next definition stage + */ + WithCreate withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway definition allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Probes of the application gateway resource + * @return the next definition stage + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the applicationgateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway definition allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @param redirectConfigurations Redirect configurations of the application gateway resource + * @return the next definition stage + */ + WithCreate withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway definition allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @param requestRoutingRules Request routing rules of the application gateway resource + * @return the next definition stage + */ + WithCreate withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU of the application gateway resource + * @return the next definition stage + */ + WithCreate withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway definition allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @param sslCertificates SSL certificates of the application gateway resource + * @return the next definition stage + */ + WithCreate withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway definition allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @param sslPolicy SSL policy of the application gateway resource + * @return the next definition stage + */ + WithCreate withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway definition allowing to specify TrustedRootCertificates. + */ + interface WithTrustedRootCertificates { + /** + * Specifies trustedRootCertificates. + * @param trustedRootCertificates Trusted Root certificates of the application gateway resource + * @return the next definition stage + */ + WithCreate withTrustedRootCertificates(List trustedRootCertificates); + } + + /** + * The stage of the applicationgateway definition allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @param urlPathMaps URL path map of the application gateway resource + * @return the next definition stage + */ + WithCreate withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway definition allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next definition stage + */ + WithCreate withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting where the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthenticationCertificates, DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithBackendHttpSettingsCollection, DefinitionStages.WithCustomErrorConfigurations, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithTrustedRootCertificates, DefinitionStages.WithUrlPathMaps, DefinitionStages.WithWebApplicationFirewallConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a ApplicationGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthenticationCertificates, UpdateStages.WithAutoscaleConfiguration, UpdateStages.WithBackendAddressPools, UpdateStages.WithBackendHttpSettingsCollection, UpdateStages.WithCustomErrorConfigurations, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithTrustedRootCertificates, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { + } + + /** + * Grouping of ApplicationGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationgateway update allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @param authenticationCertificates Authentication certificates of the application gateway resource + * @return the next update stage + */ + Update withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next update stage + */ + Update withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Backend address pool of the application gateway resource + * @return the next update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @return the next update stage + */ + Update withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway update allowing to specify CustomErrorConfigurations. + */ + interface WithCustomErrorConfigurations { + /** + * Specifies customErrorConfigurations. + * @param customErrorConfigurations Custom error configurations of the application gateway resource + * @return the next update stage + */ + Update withCustomErrorConfigurations(List customErrorConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @param enableFips Whether FIPS is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @return the next update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + * @param frontendPorts Frontend ports of the application gateway resource + * @return the next update stage + */ + Update withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway update allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @param gatewayIPConfigurations Subnets of application the gateway resource + * @return the next update stage + */ + Update withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @param httpListeners Http listeners of the application gateway resource + * @return the next update stage + */ + Update withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Probes of the application gateway resource + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the applicationgateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway update allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @param redirectConfigurations Redirect configurations of the application gateway resource + * @return the next update stage + */ + Update withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @param requestRoutingRules Request routing rules of the application gateway resource + * @return the next update stage + */ + Update withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU of the application gateway resource + * @return the next update stage + */ + Update withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway update allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @param sslCertificates SSL certificates of the application gateway resource + * @return the next update stage + */ + Update withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @param sslPolicy SSL policy of the application gateway resource + * @return the next update stage + */ + Update withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway update allowing to specify TrustedRootCertificates. + */ + interface WithTrustedRootCertificates { + /** + * Specifies trustedRootCertificates. + * @param trustedRootCertificates Trusted Root certificates of the application gateway resource + * @return the next update stage + */ + Update withTrustedRootCertificates(List trustedRootCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @param urlPathMaps URL path map of the application gateway resource + * @return the next update stage + */ + Update withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next update stage + */ + Update withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting where the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAuthenticationCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 0000000000000..8d720fc028f3d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authentication certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayAuthenticationCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Provisioning state of the authentication certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the authentication certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the authentication certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the authentication certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAutoscaleConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAutoscaleConfiguration.java new file mode 100644 index 0000000000000..6b9390af16aed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAutoscaleConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale configuration. + */ +public class ApplicationGatewayAutoscaleConfiguration { + /** + * Lower bound on number of Application Gateway instances. + */ + @JsonProperty(value = "minCapacity", required = true) + private int minCapacity; + + /** + * Get lower bound on number of Application Gateway instances. + * + * @return the minCapacity value + */ + public int minCapacity() { + return this.minCapacity; + } + + /** + * Set lower bound on number of Application Gateway instances. + * + * @param minCapacity the minCapacity value to set + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withMinCapacity(int minCapacity) { + this.minCapacity = minCapacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableSslOptions.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 0000000000000..405458540c672 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableSslOptions.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing ApplicationGatewayAvailableSslOptions. + */ +public interface ApplicationGatewayAvailableSslOptions extends HasInner, HasManager { + /** + * @return the availableCipherSuites value. + */ + List availableCipherSuites(); + + /** + * @return the availableProtocols value. + */ + List availableProtocols(); + + /** + * @return the defaultPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the predefinedPolicies value. + */ + List predefinedPolicies(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableWafRuleSetsResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..e2602898d9c3a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayAvailableWafRuleSetsResult. + */ +public interface ApplicationGatewayAvailableWafRuleSetsResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddress.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..2f54e48330c0e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddress.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backend address of an application gateway. + */ +public class ApplicationGatewayBackendAddress { + /** + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get fully qualified domain name (FQDN). + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified domain name (FQDN). + * + * @param fqdn the fqdn value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get iP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set iP address. + * + * @param ipAddress the ipAddress value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddressPool.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 0000000000000..5370d8e2b1adf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Backend Address Pool of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendAddressPool extends SubResource { + /** + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations") + private List backendIPConfigurations; + + /** + * Backend addresses. + */ + @JsonProperty(value = "properties.backendAddresses") + private List backendAddresses; + + /** + * Provisioning state of the backend address pool resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend address pool that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get collection of references to IPs defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Set collection of references to IPs defined in network interfaces. + * + * @param backendIPConfigurations the backendIPConfigurations value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendIPConfigurations(List backendIPConfigurations) { + this.backendIPConfigurations = backendIPConfigurations; + return this; + } + + /** + * Get backend addresses. + * + * @return the backendAddresses value + */ + public List backendAddresses() { + return this.backendAddresses; + } + + /** + * Set backend addresses. + * + * @param backendAddresses the backendAddresses value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendAddresses(List backendAddresses) { + this.backendAddresses = backendAddresses; + return this; + } + + /** + * Get provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend address pool that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend address pool that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealth.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealth.java new file mode 100644 index 0000000000000..883b5fbe21481 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayBackendHealth. + */ +public interface ApplicationGatewayBackendHealth extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthHttpSettings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 0000000000000..ef29415fa9ace --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealthHttp settings. + */ +public class ApplicationGatewayBackendHealthHttpSettings { + /** + * Reference of an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /** + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value + */ + public List servers() { + return this.servers; + } + + /** + * Set list of ApplicationGatewayBackendHealthServer resources. + * + * @param servers the servers value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withServers(List servers) { + this.servers = servers; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthPool.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..57a761fe5e498 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealth pool. + */ +public class ApplicationGatewayBackendHealthPool { + /** + * Reference of an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /** + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get reference of an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set reference of an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendAddressPool(ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServer.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..cf7895556e6b6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway backendhealth http settings. + */ +public class ApplicationGatewayBackendHealthServer { + /** + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Reference of IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIPConfigurationInner ipConfiguration; + + /** + * Health of backend server. Possible values include: 'Unknown', 'Up', + * 'Down', 'Partial', 'Draining'. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /** + * Get iP address or FQDN of backend server. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set iP address or FQDN of backend server. + * + * @param address the address value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get reference of IP configuration of backend server. + * + * @return the ipConfiguration value + */ + public NetworkInterfaceIPConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set reference of IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withIpConfiguration(NetworkInterfaceIPConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @return the health value + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @param health the health value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServerHealth.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..b88781354371e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHealthServerHealth.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayBackendHealthServerHealth. + */ +public final class ApplicationGatewayBackendHealthServerHealth extends ExpandableStringEnum { + /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); + + /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); + + /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); + + /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); + + /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayBackendHealthServerHealth + */ + @JsonCreator + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** + * @return known ApplicationGatewayBackendHealthServerHealth values + */ + public static Collection values() { + return values(ApplicationGatewayBackendHealthServerHealth.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHttpSettings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 0000000000000..879184113352a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,470 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backend address pool settings of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendHttpSettings extends SubResource { + /** + * The destination port on the backend. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * The protocol used to communicate with the backend. Possible values are + * 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /** + * Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "properties.requestTimeout") + private Integer requestTimeout; + + /** + * Probe resource of an application gateway. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Array of references to application gateway trusted root certificates. + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /** + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "properties.connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /** + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendAddress") + private Boolean pickHostNameFromBackendAddress; + + /** + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "properties.affinityCookieName") + private String affinityCookieName; + + /** + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "properties.probeEnabled") + private Boolean probeEnabled; + + /** + * Path which should be used as a prefix for all HTTP requests. Null means + * no path will be prefixed. Default value is null. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend http settings that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the destination port on the backend. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port on the backend. + * + * @param port the port value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @return the cookieBasedAffinity value + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.cookieBasedAffinity; + } + + /** + * Set cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @param cookieBasedAffinity the cookieBasedAffinity value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { + this.cookieBasedAffinity = cookieBasedAffinity; + return this; + } + + /** + * Get request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the requestTimeout value + */ + public Integer requestTimeout() { + return this.requestTimeout; + } + + /** + * Set request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param requestTimeout the requestTimeout value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get probe resource of an application gateway. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set probe resource of an application gateway. + * + * @param probe the probe value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get array of references to application gateway authentication certificates. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set array of references to application gateway authentication certificates. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get array of references to application gateway trusted root certificates. + * + * @return the trustedRootCertificates value + */ + public List trustedRootCertificates() { + return this.trustedRootCertificates; + } + + /** + * Set array of references to application gateway trusted root certificates. + * + * @param trustedRootCertificates the trustedRootCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withTrustedRootCertificates(List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get connection draining of the backend http settings resource. + * + * @return the connectionDraining value + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.connectionDraining; + } + + /** + * Set connection draining of the backend http settings resource. + * + * @param connectionDraining the connectionDraining value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withConnectionDraining(ApplicationGatewayConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + /** + * Get host header to be sent to the backend servers. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host header to be sent to the backend servers. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @return the pickHostNameFromBackendAddress value + */ + public Boolean pickHostNameFromBackendAddress() { + return this.pickHostNameFromBackendAddress; + } + + /** + * Set whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @param pickHostNameFromBackendAddress the pickHostNameFromBackendAddress value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPickHostNameFromBackendAddress(Boolean pickHostNameFromBackendAddress) { + this.pickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + return this; + } + + /** + * Get cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value + */ + public String affinityCookieName() { + return this.affinityCookieName; + } + + /** + * Set cookie name to use for the affinity cookie. + * + * @param affinityCookieName the affinityCookieName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { + this.affinityCookieName = affinityCookieName; + return this; + } + + /** + * Get whether the probe is enabled. Default value is false. + * + * @return the probeEnabled value + */ + public Boolean probeEnabled() { + return this.probeEnabled; + } + + /** + * Set whether the probe is enabled. Default value is false. + * + * @param probeEnabled the probeEnabled value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { + this.probeEnabled = probeEnabled; + return this; + } + + /** + * Get path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @param path the path value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPath(String path) { + this.path = path; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend http settings that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend http settings that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayConnectionDraining.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayConnectionDraining.java new file mode 100644 index 0000000000000..634e4e9194ae0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayConnectionDraining.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection draining allows open connections to a backend server to be active + * for a specified time after the backend server got removed from the + * configuration. + */ +public class ApplicationGatewayConnectionDraining { + /** + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get whether connection draining is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether connection draining is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @return the drainTimeoutInSec value + */ + public int drainTimeoutInSec() { + return this.drainTimeoutInSec; + } + + /** + * Set the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @param drainTimeoutInSec the drainTimeoutInSec value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { + this.drainTimeoutInSec = drainTimeoutInSec; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCookieBasedAffinity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 0000000000000..e4c90ab1d9da4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCookieBasedAffinity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayCookieBasedAffinity. + */ +public final class ApplicationGatewayCookieBasedAffinity extends ExpandableStringEnum { + /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayCookieBasedAffinity + */ + @JsonCreator + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** + * @return known ApplicationGatewayCookieBasedAffinity values + */ + public static Collection values() { + return values(ApplicationGatewayCookieBasedAffinity.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomError.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomError.java new file mode 100644 index 0000000000000..89ea0ecd48cbe --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Customer error of an application gateway. + */ +public class ApplicationGatewayCustomError { + /** + * Status code of the application gateway customer error. Possible values + * include: 'HttpStatus403', 'HttpStatus502'. + */ + @JsonProperty(value = "statusCode") + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /** + * Error page URL of the application gateway customer error. + */ + @JsonProperty(value = "customErrorPageUrl") + private String customErrorPageUrl; + + /** + * Get status code of the application gateway customer error. Possible values include: 'HttpStatus403', 'HttpStatus502'. + * + * @return the statusCode value + */ + public ApplicationGatewayCustomErrorStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set status code of the application gateway customer error. Possible values include: 'HttpStatus403', 'HttpStatus502'. + * + * @param statusCode the statusCode value to set + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withStatusCode(ApplicationGatewayCustomErrorStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get error page URL of the application gateway customer error. + * + * @return the customErrorPageUrl value + */ + public String customErrorPageUrl() { + return this.customErrorPageUrl; + } + + /** + * Set error page URL of the application gateway customer error. + * + * @param customErrorPageUrl the customErrorPageUrl value to set + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withCustomErrorPageUrl(String customErrorPageUrl) { + this.customErrorPageUrl = customErrorPageUrl; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomErrorStatusCode.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomErrorStatusCode.java new file mode 100644 index 0000000000000..9d1ce72424eae --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayCustomErrorStatusCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayCustomErrorStatusCode. + */ +public final class ApplicationGatewayCustomErrorStatusCode extends ExpandableStringEnum { + /** Static value HttpStatus403 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS403 = fromString("HttpStatus403"); + + /** Static value HttpStatus502 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS502 = fromString("HttpStatus502"); + + /** + * Creates or finds a ApplicationGatewayCustomErrorStatusCode from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayCustomErrorStatusCode + */ + @JsonCreator + public static ApplicationGatewayCustomErrorStatusCode fromString(String name) { + return fromString(name, ApplicationGatewayCustomErrorStatusCode.class); + } + + /** + * @return known ApplicationGatewayCustomErrorStatusCode values + */ + public static Collection values() { + return values(ApplicationGatewayCustomErrorStatusCode.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallDisabledRuleGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 0000000000000..4f87d3aeeaafe --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allows to disable rules within a rule group or an entire rule group. + */ +public class ApplicationGatewayFirewallDisabledRuleGroup { + /** + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the name of the rule group that will be disabled. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the rule group that will be disabled. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallExclusion.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallExclusion.java new file mode 100644 index 0000000000000..0ebe65913dfb7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allow to exclude some variable satisfy the condition for the WAF check. + */ +public class ApplicationGatewayFirewallExclusion { + /** + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private String matchVariable; + + /** + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private String selectorMatchOperator; + + /** + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the variable to be excluded. + * + * @return the matchVariable value + */ + public String matchVariable() { + return this.matchVariable; + } + + /** + * Set the variable to be excluded. + * + * @param matchVariable the matchVariable value to set + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withMatchVariable(String matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get when matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. + * + * @return the selectorMatchOperator value + */ + public String selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set when matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelectorMatchOperator(String selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get when matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. + * + * @return the selector value + */ + public String selector() { + return this.selector; + } + + /** + * Set when matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. + * + * @param selector the selector value to set + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelector(String selector) { + this.selector = selector; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallMode.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallMode.java new file mode 100644 index 0000000000000..3625ceb989470 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayFirewallMode. + */ +public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { + /** Static value Detection for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); + + /** Static value Prevention for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayFirewallMode + */ + @JsonCreator + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** + * @return known ApplicationGatewayFirewallMode values + */ + public static Collection values() { + return values(ApplicationGatewayFirewallMode.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRule.java new file mode 100644 index 0000000000000..57eea37ed6668 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRule.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule. + */ +public class ApplicationGatewayFirewallRule { + /** + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /** + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the identifier of the web application firewall rule. + * + * @return the ruleId value + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set the identifier of the web application firewall rule. + * + * @param ruleId the ruleId value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleId(int ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description of the web application firewall rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..5384ff013a20c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule group. + */ +public class ApplicationGatewayFirewallRuleGroup { + /** + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the name of the web application firewall rule group. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the web application firewall rule group. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the description of the web application firewall rule group. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule group. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules of the web application firewall rule group. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules of the web application firewall rule group. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleSet.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 0000000000000..d7acc9f4d64ea --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFirewallRuleSet.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A web application firewall rule set. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayFirewallRuleSet extends Resource { + /** + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleGroups", required = true) + private List ruleGroups; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioning state of the web application firewall rule set. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the web application firewall rule set. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the type of the web application firewall rule set. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the web application firewall rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the rule groups of the web application firewall rule set. + * + * @return the ruleGroups value + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the rule groups of the web application firewall rule set. + * + * @param ruleGroups the ruleGroups value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendIPConfiguration.java new file mode 100644 index 0000000000000..f6aee5aae751a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendIPConfiguration.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendIPConfiguration extends SubResource { + /** + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * PrivateIP allocation method. Possible values include: 'Static', + * 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * Provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend IP configuration that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get privateIPAddress of the network interface IP Configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set privateIPAddress of the network interface IP Configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendPort.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendPort.java new file mode 100644 index 0000000000000..e8f30be91e935 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayFrontendPort.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Frontend port of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendPort extends SubResource { + /** + * Frontend port. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Provisioning state of the frontend port resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend port that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend port. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set frontend port. + * + * @param port the port value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend port that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend port that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayHttpListener.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..96180b92051ef --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayHttpListener.java @@ -0,0 +1,309 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Http listener of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayHttpListener extends SubResource { + /** + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendPort") + private SubResource frontendPort; + + /** + * Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name of HTTP listener. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "properties.sslCertificate") + private SubResource sslCertificate; + + /** + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "properties.requireServerNameIndication") + private Boolean requireServerNameIndication; + + /** + * Provisioning state of the HTTP listener resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Custom error configurations of the HTTP listener. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /** + * Name of the HTTP listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend IP configuration resource of an application gateway. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set frontend IP configuration resource of an application gateway. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get frontend port resource of an application gateway. + * + * @return the frontendPort value + */ + public SubResource frontendPort() { + return this.frontendPort; + } + + /** + * Set frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name of HTTP listener. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host name of HTTP listener. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get sSL certificate resource of an application gateway. + * + * @return the sslCertificate value + */ + public SubResource sslCertificate() { + return this.sslCertificate; + } + + /** + * Set sSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + /** + * Get applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @return the requireServerNameIndication value + */ + public Boolean requireServerNameIndication() { + return this.requireServerNameIndication; + } + + /** + * Set applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @param requireServerNameIndication the requireServerNameIndication value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { + this.requireServerNameIndication = requireServerNameIndication; + return this; + } + + /** + * Get provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get custom error configurations of the HTTP listener. + * + * @return the customErrorConfigurations value + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set custom error configurations of the HTTP listener. + * + * @param customErrorConfigurations the customErrorConfigurations value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withCustomErrorConfigurations(List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get name of the HTTP listener that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the HTTP listener that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayIPConfiguration.java new file mode 100644 index 0000000000000..e4302aac51436 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayIPConfiguration.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + */ +@JsonFlatten +public class ApplicationGatewayIPConfiguration extends SubResource { + /** + * Reference of the subnet resource. A subnet from where application + * gateway gets its private address. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Provisioning state of the application gateway subnet resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the IP configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayOperationalState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayOperationalState.java new file mode 100644 index 0000000000000..4b4d1cc06d701 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayOperationalState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayOperationalState. + */ +public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { + /** Static value Stopped for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); + + /** Static value Starting for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); + + /** Static value Running for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayOperationalState + */ + @JsonCreator + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** + * @return known ApplicationGatewayOperationalState values + */ + public static Collection values() { + return values(ApplicationGatewayOperationalState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayPathRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayPathRule.java new file mode 100644 index 0000000000000..8f4078bf6c144 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayPathRule.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Path rule of URL path map of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayPathRule extends SubResource { + /** + * Path rules of URL path map. + */ + @JsonProperty(value = "properties.paths") + private List paths; + + /** + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Path rule of URL path map resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the path rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get path rules of URL path map. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set path rules of URL path map. + * + * @param paths the paths value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get backend address pool resource of URL path map path rule. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of URL path map path rule. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of URL path map path rule. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of URL path map path rule. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get redirect configuration resource of URL path map path rule. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of URL path map path rule. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the path rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the path rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbe.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbe.java new file mode 100644 index 0000000000000..7cae2b0897f1f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbe.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Probe of the application gateway. + */ +@JsonFlatten +public class ApplicationGatewayProbe extends SubResource { + /** + * The protocol used for the probe. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name to send the probe to. + */ + @JsonProperty(value = "properties.host") + private String host; + + /** + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * The probing interval in seconds. This is the time interval between two + * consecutive probes. Acceptable values are from 1 second to 86400 + * seconds. + */ + @JsonProperty(value = "properties.interval") + private Integer interval; + + /** + * the probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The probe retry count. Backend server is marked down after consecutive + * probe failure count reaches UnhealthyThreshold. Acceptable values are + * from 1 second to 20. + */ + @JsonProperty(value = "properties.unhealthyThreshold") + private Integer unhealthyThreshold; + + /** + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendHttpSettings") + private Boolean pickHostNameFromBackendHttpSettings; + + /** + * Minimum number of servers that are always marked healthy. Default value + * is 0. + */ + @JsonProperty(value = "properties.minServers") + private Integer minServers; + + /** + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "properties.match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the probe that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name to send the probe to. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set host name to send the probe to. + * + * @param host the host value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @param path the path value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @return the interval value + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @param interval the interval value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @return the unhealthyThreshold value + */ + public Integer unhealthyThreshold() { + return this.unhealthyThreshold; + } + + /** + * Set the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @param unhealthyThreshold the unhealthyThreshold value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + /** + * Get whether the host header should be picked from the backend http settings. Default value is false. + * + * @return the pickHostNameFromBackendHttpSettings value + */ + public Boolean pickHostNameFromBackendHttpSettings() { + return this.pickHostNameFromBackendHttpSettings; + } + + /** + * Set whether the host header should be picked from the backend http settings. Default value is false. + * + * @param pickHostNameFromBackendHttpSettings the pickHostNameFromBackendHttpSettings value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostNameFromBackendHttpSettings(Boolean pickHostNameFromBackendHttpSettings) { + this.pickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + return this; + } + + /** + * Get minimum number of servers that are always marked healthy. Default value is 0. + * + * @return the minServers value + */ + public Integer minServers() { + return this.minServers; + } + + /** + * Set minimum number of servers that are always marked healthy. Default value is 0. + * + * @param minServers the minServers value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMinServers(Integer minServers) { + this.minServers = minServers; + return this; + } + + /** + * Get criterion for classifying a healthy probe response. + * + * @return the match value + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set criterion for classifying a healthy probe response. + * + * @param match the match value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the probe that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the probe that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbeHealthResponseMatch.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbeHealthResponseMatch.java new file mode 100644 index 0000000000000..a49c09879ed69 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway probe health response match. + */ +public class ApplicationGatewayProbeHealthResponseMatch { + /** + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /** + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get body that must be contained in the health response. Default value is empty. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set body that must be contained in the health response. Default value is empty. + * + * @param body the body value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { + this.body = body; + return this; + } + + /** + * Get allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @return the statusCodes value + */ + public List statusCodes() { + return this.statusCodes; + } + + /** + * Set allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @param statusCodes the statusCodes value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { + this.statusCodes = statusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProtocol.java new file mode 100644 index 0000000000000..4b0e75e3a8e09 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayProtocol. + */ +public final class ApplicationGatewayProtocol extends ExpandableStringEnum { + /** Static value Http for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTP = fromString("Http"); + + /** Static value Https for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayProtocol + */ + @JsonCreator + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** + * @return known ApplicationGatewayProtocol values + */ + public static Collection values() { + return values(ApplicationGatewayProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 0000000000000..8bef83c6035d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Redirect configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRedirectConfiguration extends SubResource { + /** + * Supported http redirection types - Permanent, Temporary, Found, + * SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', + * 'Temporary'. + */ + @JsonProperty(value = "properties.redirectType") + private ApplicationGatewayRedirectType redirectType; + + /** + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "properties.targetListener") + private SubResource targetListener; + + /** + * Url to redirect the request to. + */ + @JsonProperty(value = "properties.targetUrl") + private String targetUrl; + + /** + * Include path in the redirected url. + */ + @JsonProperty(value = "properties.includePath") + private Boolean includePath; + + /** + * Include query string in the redirected url. + */ + @JsonProperty(value = "properties.includeQueryString") + private Boolean includeQueryString; + + /** + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Name of the redirect configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @return the redirectType value + */ + public ApplicationGatewayRedirectType redirectType() { + return this.redirectType; + } + + /** + * Set supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @param redirectType the redirectType value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRedirectType(ApplicationGatewayRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get reference to a listener to redirect the request to. + * + * @return the targetListener value + */ + public SubResource targetListener() { + return this.targetListener; + } + + /** + * Set reference to a listener to redirect the request to. + * + * @param targetListener the targetListener value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetListener(SubResource targetListener) { + this.targetListener = targetListener; + return this; + } + + /** + * Get url to redirect the request to. + * + * @return the targetUrl value + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set url to redirect the request to. + * + * @param targetUrl the targetUrl value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get include path in the redirected url. + * + * @return the includePath value + */ + public Boolean includePath() { + return this.includePath; + } + + /** + * Set include path in the redirected url. + * + * @param includePath the includePath value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludePath(Boolean includePath) { + this.includePath = includePath; + return this; + } + + /** + * Get include query string in the redirected url. + * + * @return the includeQueryString value + */ + public Boolean includeQueryString() { + return this.includeQueryString; + } + + /** + * Set include query string in the redirected url. + * + * @param includeQueryString the includeQueryString value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludeQueryString(Boolean includeQueryString) { + this.includeQueryString = includeQueryString; + return this; + } + + /** + * Get request routing specifying redirect configuration. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing specifying redirect configuration. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set url path maps specifying default redirect configuration. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get path rules specifying redirect configuration. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rules specifying redirect configuration. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get name of the redirect configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the redirect configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectType.java new file mode 100644 index 0000000000000..7165a27863f3e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRedirectType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRedirectType. + */ +public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { + /** Static value Permanent for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); + + /** Static value Found for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); + + /** Static value SeeOther for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); + + /** Static value Temporary for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRedirectType + */ + @JsonCreator + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** + * @return known ApplicationGatewayRedirectType values + */ + public static Collection values() { + return values(ApplicationGatewayRedirectType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 0000000000000..f509947e0dbfa --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request routing rule of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRequestRoutingRule extends SubResource { + /** + * Rule type. Possible values include: 'Basic', 'PathBasedRouting'. + */ + @JsonProperty(value = "properties.ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /** + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "properties.httpListener") + private SubResource httpListener; + + /** + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "properties.urlPathMap") + private SubResource urlPathMap; + + /** + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Provisioning state of the request routing rule resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the request routing rule that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @return the ruleType value + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.ruleType; + } + + /** + * Set rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @param ruleType the ruleType value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get backend address pool resource of the application gateway. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of the application gateway. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get http listener resource of the application gateway. + * + * @return the httpListener value + */ + public SubResource httpListener() { + return this.httpListener; + } + + /** + * Set http listener resource of the application gateway. + * + * @param httpListener the httpListener value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withHttpListener(SubResource httpListener) { + this.httpListener = httpListener; + return this; + } + + /** + * Get uRL path map resource of the application gateway. + * + * @return the urlPathMap value + */ + public SubResource urlPathMap() { + return this.urlPathMap; + } + + /** + * Set uRL path map resource of the application gateway. + * + * @param urlPathMap the urlPathMap value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withUrlPathMap(SubResource urlPathMap) { + this.urlPathMap = urlPathMap; + return this; + } + + /** + * Get redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of the application gateway. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the request routing rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the request routing rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRuleType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRuleType.java new file mode 100644 index 0000000000000..e1298fa334492 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayRequestRoutingRuleType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRequestRoutingRuleType. + */ +public final class ApplicationGatewayRequestRoutingRuleType extends ExpandableStringEnum { + /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); + + /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRequestRoutingRuleType + */ + @JsonCreator + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** + * @return known ApplicationGatewayRequestRoutingRuleType values + */ + public static Collection values() { + return values(ApplicationGatewayRequestRoutingRuleType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySku.java new file mode 100644 index 0000000000000..7756bad304852 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySku.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of an application gateway. + */ +public class ApplicationGatewaySku { + /** + * Name of an application gateway SKU. Possible values include: + * 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + * 'WAF_Large', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /** + * Tier of an application gateway. Possible values include: 'Standard', + * 'WAF', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /** + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @return the name value + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @param name the name value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @return the tier value + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @param tier the tier value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get capacity (instance count) of an application gateway. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set capacity (instance count) of an application gateway. + * + * @param capacity the capacity value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySkuName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..d37536ba103d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySkuName.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySkuName. + */ +public final class ApplicationGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard_Small for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); + + /** Static value Standard_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); + + /** Static value Standard_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); + + /** Static value WAF_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); + + /** Static value WAF_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); + + /** Static value Standard_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySkuName + */ + @JsonCreator + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** + * @return known ApplicationGatewaySkuName values + */ + public static Collection values() { + return values(ApplicationGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCertificate.java new file mode 100644 index 0000000000000..2f4332843cd3f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCertificate.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * SSL certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewaySslCertificate extends SubResource { + /** + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Password for the pfx file specified in data. Only applicable in PUT + * request. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * Base-64 encoded Public cert data corresponding to pfx specified in data. + * Only applicable in GET request. + */ + @JsonProperty(value = "properties.publicCertData") + private String publicCertData; + + /** + * Provisioning state of the SSL certificate resource Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the SSL certificate that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @param data the data value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get password for the pfx file specified in data. Only applicable in PUT request. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password for the pfx file specified in data. Only applicable in PUT request. + * + * @param password the password value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @param publicCertData the publicCertData value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the SSL certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the SSL certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCipherSuite.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCipherSuite.java new file mode 100644 index 0000000000000..3b81e1ae79464 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslCipherSuite. + */ +public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslCipherSuite + */ + @JsonCreator + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** + * @return known ApplicationGatewaySslCipherSuite values + */ + public static Collection values() { + return values(ApplicationGatewaySslCipherSuite.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicy.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicy.java new file mode 100644 index 0000000000000..d18980bb4792f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway Ssl policy. + */ +public class ApplicationGatewaySslPolicy { + /** + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /** + * Type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /** + * Name of Ssl predefined policy. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /** + * Ssl cipher suites to be enabled in the specified order to application + * gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set ssl protocols to be disabled on application gateway. + * + * @param disabledSslProtocols the disabledSslProtocols value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withDisabledSslProtocols(List disabledSslProtocols) { + this.disabledSslProtocols = disabledSslProtocols; + return this; + } + + /** + * Get type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @return the policyType value + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @param policyType the policyType value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the policyName value + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param policyName the policyName value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order to application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyName.java new file mode 100644 index 0000000000000..1c20f4b5c04d4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyName. + */ +public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { + /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = fromString("AppGwSslPolicy20150501"); + + /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = fromString("AppGwSslPolicy20170401"); + + /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = fromString("AppGwSslPolicy20170401S"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyName + */ + @JsonCreator + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** + * @return known ApplicationGatewaySslPolicyName values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyType.java new file mode 100644 index 0000000000000..a1af8b94a1c4b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPolicyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyType. + */ +public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { + /** Static value Predefined for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); + + /** Static value Custom for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyType + */ + @JsonCreator + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** + * @return known ApplicationGatewaySslPolicyType values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPredefinedPolicy.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 0000000000000..f42a6cad43618 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** + * Type representing ApplicationGatewaySslPredefinedPolicy. + */ +public interface ApplicationGatewaySslPredefinedPolicy extends HasInner, HasManager { + /** + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslProtocol.java new file mode 100644 index 0000000000000..6bbecff206be2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewaySslProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslProtocol. + */ +public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { + /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); + + /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); + + /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslProtocol + */ + @JsonCreator + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** + * @return known ApplicationGatewaySslProtocol values + */ + public static Collection values() { + return values(ApplicationGatewaySslProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTier.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTier.java new file mode 100644 index 0000000000000..1d30bfca8332e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayTier. + */ +public final class ApplicationGatewayTier extends ExpandableStringEnum { + /** Static value Standard for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD = fromString("Standard"); + + /** Static value WAF for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF = fromString("WAF"); + + /** Static value Standard_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayTier + */ + @JsonCreator + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** + * @return known ApplicationGatewayTier values + */ + public static Collection values() { + return values(ApplicationGatewayTier.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTrustedRootCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTrustedRootCertificate.java new file mode 100644 index 0000000000000..0b857a7c57715 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayTrustedRootCertificate.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Trusted Root certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayTrustedRootCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * KeyVault Secret Id for certificate. + */ + @JsonProperty(value = "properties.keyvaultSecretId") + private String keyvaultSecretId; + + /** + * Provisioning state of the trusted root certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the trusted root certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get keyVault Secret Id for certificate. + * + * @return the keyvaultSecretId value + */ + public String keyvaultSecretId() { + return this.keyvaultSecretId; + } + + /** + * Set keyVault Secret Id for certificate. + * + * @param keyvaultSecretId the keyvaultSecretId value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withKeyvaultSecretId(String keyvaultSecretId) { + this.keyvaultSecretId = keyvaultSecretId; + return this; + } + + /** + * Get provisioning state of the trusted root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the trusted root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the trusted root certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the trusted root certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayUrlPathMap.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayUrlPathMap.java new file mode 100644 index 0000000000000..cc8a8a45d05ab --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayUrlPathMap.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + */ +@JsonFlatten +public class ApplicationGatewayUrlPathMap extends SubResource { + /** + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /** + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /** + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /** + * Path rule of URL path map resource. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the URL path map that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value + */ + public SubResource defaultBackendAddressPool() { + return this.defaultBackendAddressPool; + } + + /** + * Set default backend address pool resource of URL path map. + * + * @param defaultBackendAddressPool the defaultBackendAddressPool value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { + this.defaultBackendAddressPool = defaultBackendAddressPool; + return this; + } + + /** + * Get default backend http settings resource of URL path map. + * + * @return the defaultBackendHttpSettings value + */ + public SubResource defaultBackendHttpSettings() { + return this.defaultBackendHttpSettings; + } + + /** + * Set default backend http settings resource of URL path map. + * + * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { + this.defaultBackendHttpSettings = defaultBackendHttpSettings; + return this; + } + + /** + * Get default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value + */ + public SubResource defaultRedirectConfiguration() { + return this.defaultRedirectConfiguration; + } + + /** + * Set default redirect configuration resource of URL path map. + * + * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rule of URL path map resource. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the URL path map that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the URL path map that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayWebApplicationFirewallConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 0000000000000..af4c955eb0885 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway web application firewall configuration. + */ +public class ApplicationGatewayWebApplicationFirewallConfiguration { + /** + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention'. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /** + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /** + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /** + * Maxium request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /** + * Maxium request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /** + * Maxium file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /** + * The exclusion list. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /** + * Get whether the web application firewall is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether the web application firewall is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @return the firewallMode value + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @param firewallMode the firewallMode value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode(ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the disabled rule groups. + * + * @return the disabledRuleGroups value + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set the disabled rule groups. + * + * @param disabledRuleGroups the disabledRuleGroups value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups(List disabledRuleGroups) { + this.disabledRuleGroups = disabledRuleGroups; + return this; + } + + /** + * Get whether allow WAF to check request Body. + * + * @return the requestBodyCheck value + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set whether allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get maxium request body size for WAF. + * + * @return the maxRequestBodySize value + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set maxium request body size for WAF. + * + * @param maxRequestBodySize the maxRequestBodySize value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { + this.maxRequestBodySize = maxRequestBodySize; + return this; + } + + /** + * Get maxium request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set maxium request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySizeInKb(Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get maxium file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set maxium file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * Get the exclusion list. + * + * @return the exclusions value + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusion list. + * + * @param exclusions the exclusions value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateways.java new file mode 100644 index 0000000000000..07844faa7d237 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationGateways.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationGateways. + */ +public interface ApplicationGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableWafRuleSetsAsync(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslOptionsAsync(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslPredefinedPoliciesAsync(); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSslPredefinedPolicyAsync(String predefinedPolicyName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..924b4cc0101d9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroup.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing ApplicationSecurityGroup. + */ +public interface ApplicationSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ApplicationSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a ApplicationSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ApplicationSecurityGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroups.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroups.java new file mode 100644 index 0000000000000..475558a0098d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ApplicationSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationSecurityGroups. + */ +public interface ApplicationSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AssociationType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AssociationType.java new file mode 100644 index 0000000000000..50e9e552fcb61 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AssociationType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AssociationType. + */ +public final class AssociationType extends ExpandableStringEnum { + /** Static value Associated for AssociationType. */ + public static final AssociationType ASSOCIATED = fromString("Associated"); + + /** Static value Contains for AssociationType. */ + public static final AssociationType CONTAINS = fromString("Contains"); + + /** + * Creates or finds a AssociationType from its string representation. + * @param name a name to look for + * @return the corresponding AssociationType + */ + @JsonCreator + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** + * @return known AssociationType values + */ + public static Collection values() { + return values(AssociationType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthenticationMethod.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthenticationMethod.java new file mode 100644 index 0000000000000..b011a1acbd028 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthenticationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationMethod. + */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value EAPTLS for AuthenticationMethod. */ + public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); + + /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ + public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationMethod + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** + * @return known AuthenticationMethod values + */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthorizationUseStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthorizationUseStatus.java new file mode 100644 index 0000000000000..46232ef5507a1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AuthorizationUseStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthorizationUseStatus. + */ +public final class AuthorizationUseStatus extends ExpandableStringEnum { + /** Static value Available for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** Static value InUse for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * @param name a name to look for + * @return the corresponding AuthorizationUseStatus + */ + @JsonCreator + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** + * @return known AuthorizationUseStatus values + */ + public static Collection values() { + return values(AuthorizationUseStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Availability.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Availability.java new file mode 100644 index 0000000000000..dfacf7b719f83 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Availability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Availability of the metric. + */ +public class Availability { + /** + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /** + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /** + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the time grain of the availability. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the time grain of the availability. + * + * @param timeGrain the timeGrain value to set + * @return the Availability object itself. + */ + public Availability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the retention of the availability. + * + * @return the retention value + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention of the availability. + * + * @param retention the retention value to set + * @return the Availability object itself. + */ + public Availability withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get duration of the availability blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the availability blob. + * + * @param blobDuration the blobDuration value to set + * @return the Availability object itself. + */ + public Availability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableDelegations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableDelegations.java new file mode 100644 index 0000000000000..249fbefcafe88 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableDelegations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AvailableDelegationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailableDelegations. + */ +public interface AvailableDelegations extends HasInner { + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableEndpointServices.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableEndpointServices.java new file mode 100644 index 0000000000000..fdee8f29e16af --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableEndpointServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.EndpointServiceResult; + +/** + * Type representing AvailableEndpointServices. + */ +public interface AvailableEndpointServices { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersList.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersList.java new file mode 100644 index 0000000000000..469864618c2b4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersList.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AvailableProvidersListInner; +import java.util.List; + +/** + * Type representing AvailableProvidersList. + */ +public interface AvailableProvidersList extends HasInner, HasManager { + /** + * @return the countries value. + */ + List countries(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..78bd3dfba8aed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCity.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * City or town details. + */ +public class AvailableProvidersListCity { + /** + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the city or town name. + * + * @return the cityName value + */ + public String cityName() { + return this.cityName; + } + + /** + * Set the city or town name. + * + * @param cityName the cityName value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withCityName(String cityName) { + this.cityName = cityName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withProviders(List providers) { + this.providers = providers; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCountry.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCountry.java new file mode 100644 index 0000000000000..06e2f73fa1ba5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListCountry.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Country details. + */ +public class AvailableProvidersListCountry { + /** + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the country name. + * + * @return the countryName value + */ + public String countryName() { + return this.countryName; + } + + /** + * Set the country name. + * + * @param countryName the countryName value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withCountryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available states in the country. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set list of available states in the country. + * + * @param states the states value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListParameters.java new file mode 100644 index 0000000000000..0fbcaeb0956cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Constraints that determine the list of available Internet service providers. + */ +public class AvailableProvidersListParameters { + /** + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /** + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get a list of Azure regions. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set a list of Azure regions. + * + * @param azureLocations the azureLocations value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the country for available providers list. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the country for available providers list. + * + * @param country the country value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state for available providers list. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state for available providers list. + * + * @param state the state value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city or town for available providers list. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city or town for available providers list. + * + * @param city the city value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListState.java new file mode 100644 index 0000000000000..8c24220ae4081 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableProvidersListState.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * State details. + */ +public class AvailableProvidersListState { + /** + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the state name. + * + * @return the stateName value + */ + public String stateName() { + return this.stateName; + } + + /** + * Set the state name. + * + * @param stateName the stateName value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withStateName(String stateName) { + this.stateName = stateName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available cities or towns in the state. + * + * @return the cities value + */ + public List cities() { + return this.cities; + } + + /** + * Set list of available cities or towns in the state. + * + * @param cities the cities value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withCities(List cities) { + this.cities = cities; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableResourceGroupDelegations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableResourceGroupDelegations.java new file mode 100644 index 0000000000000..0521131964504 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AvailableResourceGroupDelegations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.LocationAvailableDelegationModel; + +/** + * Type representing AvailableResourceGroupDelegations. + */ +public interface AvailableResourceGroupDelegations { + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location, final String resourceGroupName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureAsyncOperationResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureAsyncOperationResult.java new file mode 100644 index 0000000000000..48e22ba749d8b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureAsyncOperationResult.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Status of the Azure async operation. Possible values are: 'InProgress', + * 'Succeeded', and 'Failed'. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private NetworkOperationStatus status; + + /** + * The error property. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public NetworkOperationStatus status() { + return this.status; + } + + /** + * Set status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withStatus(NetworkOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewall.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewall.java new file mode 100644 index 0000000000000..a7bb9c2e26bfb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewall.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AzureFirewallInner; + +/** + * Type representing AzureFirewall. + */ +public interface AzureFirewall extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationRuleCollections value. + */ + List applicationRuleCollections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the natRuleCollections value. + */ + List natRuleCollections(); + + /** + * @return the networkRuleCollections value. + */ + List networkRuleCollections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the AzureFirewall definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of AzureFirewall definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AzureFirewall definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the AzureFirewall definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the azurefirewall definition allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall + * @return the next definition stage + */ + WithCreate withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configuration of the Azure Firewall resource + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall definition allowing to specify NatRuleCollections. + */ + interface WithNatRuleCollections { + /** + * Specifies natRuleCollections. + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall + * @return the next definition stage + */ + WithCreate withNatRuleCollections(List natRuleCollections); + } + + /** + * The stage of the azurefirewall definition allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall + * @return the next definition stage + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApplicationRuleCollections, DefinitionStages.WithIpConfigurations, DefinitionStages.WithNatRuleCollections, DefinitionStages.WithNetworkRuleCollections, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a AzureFirewall update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApplicationRuleCollections, UpdateStages.WithIpConfigurations, UpdateStages.WithNatRuleCollections, UpdateStages.WithNetworkRuleCollections, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of AzureFirewall update stages. + */ + interface UpdateStages { + /** + * The stage of the azurefirewall update allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall + * @return the next update stage + */ + Update withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configuration of the Azure Firewall resource + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall update allowing to specify NatRuleCollections. + */ + interface WithNatRuleCollections { + /** + * Specifies natRuleCollections. + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall + * @return the next update stage + */ + Update withNatRuleCollections(List natRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall + * @return the next update stage + */ + Update withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRule.java new file mode 100644 index 0000000000000..6711236132e44 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of an application rule. + */ +public class AzureFirewallApplicationRule { + /** + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /** + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /** + * Get name of the application rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the application rule. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get array of ApplicationRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of ApplicationRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of FQDNs for this rule. + * + * @return the targetFqdns value + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set list of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get list of FQDN Tags for this rule. + * + * @return the fqdnTags value + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set list of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleCollection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 0000000000000..2a0ea78fee660 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Application rule collection resource. + */ +@JsonFlatten +public class AzureFirewallApplicationRuleCollection extends SubResource { + /** + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the application rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the application rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a application rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a application rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocol.java new file mode 100644 index 0000000000000..815b20efeb9e2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocol.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the application rule protocol. + */ +public class AzureFirewallApplicationRuleProtocol { + /** + * Protocol type. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /** + * Port number for the protocol, cannot be greater than 64000. This field + * is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get protocol type. Possible values include: 'Http', 'Https'. + * + * @return the protocolType value + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set protocol type. Possible values include: 'Http', 'Https'. + * + * @param protocolType the protocolType value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType(AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @param port the port value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocolType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 0000000000000..cf3f1973b5c61 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallApplicationRuleProtocolType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallApplicationRuleProtocolType. + */ +public final class AzureFirewallApplicationRuleProtocolType extends ExpandableStringEnum { + /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); + + /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallApplicationRuleProtocolType + */ + @JsonCreator + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** + * @return known AzureFirewallApplicationRuleProtocolType values + */ + public static Collection values() { + return values(AzureFirewallApplicationRuleProtocolType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTag.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTag.java new file mode 100644 index 0000000000000..7a39b60af7ac8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTag.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AzureFirewallFqdnTagInner; + +/** + * Type representing AzureFirewallFqdnTag. + */ +public interface AzureFirewallFqdnTag extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the fqdnTagName value. + */ + String fqdnTagName(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTags.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTags.java new file mode 100644 index 0000000000000..59ea4fde67dff --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallFqdnTags.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AzureFirewallFqdnTagsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewallFqdnTags. + */ +public interface AzureFirewallFqdnTags extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallIPConfiguration.java new file mode 100644 index 0000000000000..7af4fcbcc6027 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallIPConfiguration.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an Azure Firewall. + */ +@JsonFlatten +public class AzureFirewallIPConfiguration extends SubResource { + /** + * The Firewall Internal Load Balancer IP to be used as the next hop in + * User Defined Routes. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Reference of the subnet resource. This resource must be named + * 'AzureFirewallSubnet'. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. This field is a mandatory input if + * subnet is not null. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @param subnet the subnet value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. This field is a mandatory input if subnet is not null. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. This field is a mandatory input if subnet is not null. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCAction.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCAction.java new file mode 100644 index 0000000000000..ff8d7c01209cf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCAction.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AzureFirewall NAT Rule Collection Action. + */ +public class AzureFirewallNatRCAction { + /** + * The type of action. Possible values include: 'Snat', 'Dnat'. + */ + @JsonProperty(value = "type") + private AzureFirewallNatRCActionType type; + + /** + * Get the type of action. Possible values include: 'Snat', 'Dnat'. + * + * @return the type value + */ + public AzureFirewallNatRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Snat', 'Dnat'. + * + * @param type the type value to set + * @return the AzureFirewallNatRCAction object itself. + */ + public AzureFirewallNatRCAction withType(AzureFirewallNatRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCActionType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCActionType.java new file mode 100644 index 0000000000000..9a8a6c0faa332 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRCActionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallNatRCActionType. + */ +public final class AzureFirewallNatRCActionType extends ExpandableStringEnum { + /** Static value Snat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType SNAT = fromString("Snat"); + + /** Static value Dnat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType DNAT = fromString("Dnat"); + + /** + * Creates or finds a AzureFirewallNatRCActionType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallNatRCActionType + */ + @JsonCreator + public static AzureFirewallNatRCActionType fromString(String name) { + return fromString(name, AzureFirewallNatRCActionType.class); + } + + /** + * @return known AzureFirewallNatRCActionType values + */ + public static Collection values() { + return values(AzureFirewallNatRCActionType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRule.java new file mode 100644 index 0000000000000..fe6d3d04955af --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRule.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of a NAT rule. + */ +public class AzureFirewallNatRule { + /** + * Name of the NAT rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses for this rule. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /** + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /** + * Get name of the NAT rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the NAT rule. + * + * @param name the name value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get list of destination IP addresses for this rule. + * + * @return the destinationAddresses value + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set list of destination IP addresses for this rule. + * + * @param destinationAddresses the destinationAddresses value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set list of destination ports. + * + * @param destinationPorts the destinationPorts value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @param protocols the protocols value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the translated address for this NAT rule. + * + * @return the translatedAddress value + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translated port for this NAT rule. + * + * @return the translatedPort value + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRuleCollection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRuleCollection.java new file mode 100644 index 0000000000000..007d4a1d800c2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNatRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * NAT rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNatRuleCollection extends SubResource { + /** + * Priority of the NAT rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a NAT rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallNatRCAction action; + + /** + * Collection of rules used by a NAT rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the NAT rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the NAT rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a NAT rule collection. + * + * @return the action value + */ + public AzureFirewallNatRCAction action() { + return this.action; + } + + /** + * Set the action type of a NAT rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withAction(AzureFirewallNatRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a NAT rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a NAT rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRule.java new file mode 100644 index 0000000000000..4b15914f4c2cb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the network rule. + */ +public class AzureFirewallNetworkRule { + /** + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Get name of the network rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network rule. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of AzureFirewallNetworkRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get list of destination IP addresses. + * + * @return the destinationAddresses value + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set list of destination IP addresses. + * + * @param destinationAddresses the destinationAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set list of destination ports. + * + * @param destinationPorts the destinationPorts value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleCollection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 0000000000000..9f3d74c3fe0d8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNetworkRuleCollection extends SubResource { + /** + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the network rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the network rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a network rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a network rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleProtocol.java new file mode 100644 index 0000000000000..54f3140b6edfb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallNetworkRuleProtocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallNetworkRuleProtocol. + */ +public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { + /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); + + /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); + + /** Static value Any for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); + + /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallNetworkRuleProtocol + */ + @JsonCreator + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** + * @return known AzureFirewallNetworkRuleProtocol values + */ + public static Collection values() { + return values(AzureFirewallNetworkRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCAction.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCAction.java new file mode 100644 index 0000000000000..d7f2e76022038 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCAction.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the AzureFirewallRCAction. + */ +public class AzureFirewallRCAction { + /** + * The type of action. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type of action. Possible values include: 'Allow', 'Deny'. + * + * @return the type value + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Allow', 'Deny'. + * + * @param type the type value to set + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCActionType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCActionType.java new file mode 100644 index 0000000000000..6671387142b72 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewallRCActionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallRCActionType. + */ +public final class AzureFirewallRCActionType extends ExpandableStringEnum { + /** Static value Allow for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); + + /** Static value Deny for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType DENY = fromString("Deny"); + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallRCActionType + */ + @JsonCreator + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** + * @return known AzureFirewallRCActionType values + */ + public static Collection values() { + return values(AzureFirewallRCActionType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewalls.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewalls.java new file mode 100644 index 0000000000000..03fe0b946a8c8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureFirewalls.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AzureFirewallsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewalls. + */ +public interface AzureFirewalls extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReport.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReport.java new file mode 100644 index 0000000000000..47dcec430819f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReport.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AzureReachabilityReportInner; +import java.util.List; + +/** + * Type representing AzureReachabilityReport. + */ +public interface AzureReachabilityReport extends HasInner, HasManager { + /** + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * @return the reachabilityReport value. + */ + List reachabilityReport(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportItem.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportItem.java new file mode 100644 index 0000000000000..4436093e877dd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportItem.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details for a given provider location. + */ +public class AzureReachabilityReportItem { + /** + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /** + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the Internet service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the Internet service provider. + * + * @param provider the provider value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the Azure region. + * + * @return the azureLocation value + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the Azure region. + * + * @param azureLocation the azureLocation value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get list of latency details for each of the time series. + * + * @return the latencies value + */ + public List latencies() { + return this.latencies; + } + + /** + * Set list of latency details for each of the time series. + * + * @param latencies the latencies value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withLatencies(List latencies) { + this.latencies = latencies; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLatencyInfo.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 0000000000000..662fd02b126ca --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details on latency for a time series. + */ +public class AzureReachabilityReportLatencyInfo { + /** + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private DateTime timeStamp; + + /** + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the time stamp. + * + * @return the timeStamp value + */ + public DateTime timeStamp() { + return this.timeStamp; + } + + /** + * Set the time stamp. + * + * @param timeStamp the timeStamp value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimeStamp(DateTime timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + /** + * Get the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @return the score value + */ + public Integer score() { + return this.score; + } + + /** + * Set the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @param score the score value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withScore(Integer score) { + this.score = score; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLocation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLocation.java new file mode 100644 index 0000000000000..69369fe24e0fd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportLocation.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a geographic location. + */ +public class AzureReachabilityReportLocation { + /** + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the name of the country. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the name of the country. + * + * @param country the country value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the name of the state. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the name of the state. + * + * @param state the state value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withState(String state) { + this.state = state; + return this; + } + + /** + * Get the name of the city or town. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the name of the city or town. + * + * @param city the city value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportParameters.java new file mode 100644 index 0000000000000..bc8c2a71b0237 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/AzureReachabilityReportParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Geographic and time constraints for Azure reachability report. + */ +public class AzureReachabilityReportParameters { + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private DateTime endTime; + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set list of Internet service providers. + * + * @param providers the providers value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get optional Azure regions to scope the query to. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set optional Azure regions to scope the query to. + * + * @param azureLocations the azureLocations value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the start time for the Azure reachability report. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the Azure reachability report. + * + * @param startTime the startTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time for the Azure reachability report. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time for the Azure reachability report. + * + * @param endTime the endTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BGPCommunity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BGPCommunity.java new file mode 100644 index 0000000000000..017e6737c3f58 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BGPCommunity.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bgp community information offered in Service Community resources. + */ +public class BGPCommunity { + /** + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /** + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /** + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /** + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /** + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get the region which the service support. e.g. For O365, region is Global. + * + * @return the serviceSupportedRegion value + */ + public String serviceSupportedRegion() { + return this.serviceSupportedRegion; + } + + /** + * Set the region which the service support. e.g. For O365, region is Global. + * + * @param serviceSupportedRegion the serviceSupportedRegion value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceSupportedRegion(String serviceSupportedRegion) { + this.serviceSupportedRegion = serviceSupportedRegion; + return this; + } + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the communityName value + */ + public String communityName() { + return this.communityName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param communityName the communityName value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityName(String communityName) { + this.communityName = communityName; + return this; + } + + /** + * Get the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @return the communityValue value + */ + public String communityValue() { + return this.communityValue; + } + + /** + * Set the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @param communityValue the communityValue value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityValue(String communityValue) { + this.communityValue = communityValue; + return this; + } + + /** + * Get the prefixes that the bgp community contains. + * + * @return the communityPrefixes value + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set the prefixes that the bgp community contains. + * + * @param communityPrefixes the communityPrefixes value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityPrefixes(List communityPrefixes) { + this.communityPrefixes = communityPrefixes; + return this; + } + + /** + * Get customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set customer is authorized to use bgp community or not. + * + * @param isAuthorizedToUse the isAuthorizedToUse value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { + this.isAuthorizedToUse = isAuthorizedToUse; + return this; + } + + /** + * Get the service group of the bgp community contains. + * + * @return the serviceGroup value + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set the service group of the bgp community contains. + * + * @param serviceGroup the serviceGroup value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceGroup(String serviceGroup) { + this.serviceGroup = serviceGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BackendAddressPool.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BackendAddressPool.java new file mode 100644 index 0000000000000..0c778e265aa90 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BackendAddressPool.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing BackendAddressPool. + */ +public interface BackendAddressPool extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendIPConfigurations value. + */ + List backendIPConfigurations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRule value. + */ + SubResource outboundRule(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerState.java new file mode 100644 index 0000000000000..30aaaf606f819 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BgpPeerState. + */ +public final class BgpPeerState extends ExpandableStringEnum { + /** Static value Unknown for BgpPeerState. */ + public static final BgpPeerState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for BgpPeerState. */ + public static final BgpPeerState STOPPED = fromString("Stopped"); + + /** Static value Idle for BgpPeerState. */ + public static final BgpPeerState IDLE = fromString("Idle"); + + /** Static value Connecting for BgpPeerState. */ + public static final BgpPeerState CONNECTING = fromString("Connecting"); + + /** Static value Connected for BgpPeerState. */ + public static final BgpPeerState CONNECTED = fromString("Connected"); + + /** + * Creates or finds a BgpPeerState from its string representation. + * @param name a name to look for + * @return the corresponding BgpPeerState + */ + @JsonCreator + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** + * @return known BgpPeerState values + */ + public static Collection values() { + return values(BgpPeerState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatus.java new file mode 100644 index 0000000000000..0a094bc6cf82c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatus.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP peer status details. + */ +public class BgpPeerStatus { + /** + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /** + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Integer asn; + + /** + * The BGP peer state. Possible values include: 'Unknown', 'Stopped', + * 'Idle', 'Connecting', 'Connected'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /** + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /** + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /** + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /** + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** + * Get the virtual network gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the remote BGP peer. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the autonomous system number of the remote BGP peer. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Get the BGP peer state. Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected'. + * + * @return the state value + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get for how long the peering has been up. + * + * @return the connectedDuration value + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the number of routes learned from this peer. + * + * @return the routesReceived value + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the number of BGP messages sent. + * + * @return the messagesSent value + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the number of BGP messages received. + * + * @return the messagesReceived value + */ + public Long messagesReceived() { + return this.messagesReceived; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatusListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..16d1bf57b3fee --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpPeerStatusListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.BgpPeerStatusListResultInner; +import java.util.List; + +/** + * Type representing BgpPeerStatusListResult. + */ +public interface BgpPeerStatusListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunities.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunities.java new file mode 100644 index 0000000000000..f6167d0c03741 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunities.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.BgpServiceCommunitiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BgpServiceCommunities. + */ +public interface BgpServiceCommunities extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunity.java new file mode 100644 index 0000000000000..c5c0228424e1b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpServiceCommunity.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.BgpServiceCommunityInner; + +/** + * Type representing BgpServiceCommunity. + */ +public interface BgpServiceCommunity extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bgpCommunities value. + */ + List bgpCommunities(); + + /** + * @return the serviceName value. + */ + String serviceName(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpSettings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpSettings.java new file mode 100644 index 0000000000000..684467955f9d9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/BgpSettings.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP settings details. + */ +public class BgpSettings { + /** + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /** + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /** + * Get the BGP speaker's ASN. + * + * @return the asn value + */ + public Long asn() { + return this.asn; + } + + /** + * Set the BGP speaker's ASN. + * + * @param asn the asn value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Get the weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set the weight added to routes learned from this BGP speaker. + * + * @param peerWeight the peerWeight value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withPeerWeight(Integer peerWeight) { + this.peerWeight = peerWeight; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/CircuitConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..b7cb15b119c22 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/CircuitConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CircuitConnectionStatus. + */ +public final class CircuitConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding CircuitConnectionStatus + */ + @JsonCreator + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** + * @return known CircuitConnectionStatus values + */ + public static Collection values() { + return values(CircuitConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorDestination.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorDestination.java new file mode 100644 index 0000000000000..b90f7a44f99c9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorDestination.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the destination of connection monitor. + */ +public class ConnectionMonitorDestination { + /** + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /** + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the destination by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get address of the connection monitor destination (IP or domain name). + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set address of the connection monitor destination (IP or domain name). + * + * @param address the address value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the destination port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorParameters.java new file mode 100644 index 0000000000000..1370540940a56 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the operation to create a connection monitor. + */ +public class ConnectionMonitorParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorQueryResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorQueryResult.java new file mode 100644 index 0000000000000..7eaf69bdd7081 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorQueryResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** + * Type representing ConnectionMonitorQueryResult. + */ +public interface ConnectionMonitorQueryResult extends HasInner, HasManager { + /** + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * @return the states value. + */ + List states(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorResult.java new file mode 100644 index 0000000000000..fb788444ef81d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorResult.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionMonitorResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing ConnectionMonitorResult. + */ +public interface ConnectionMonitorResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoStart value. + */ + Boolean autoStart(); + + /** + * @return the destination value. + */ + ConnectionMonitorDestination destination(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monitoringIntervalInSeconds value. + */ + Integer monitoringIntervalInSeconds(); + + /** + * @return the monitoringStatus value. + */ + String monitoringStatus(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the source value. + */ + ConnectionMonitorSource source(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ConnectionMonitorResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithDestination, DefinitionStages.WithSource, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConnectionMonitorResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConnectionMonitorResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + * @param resourceGroupName The name of the resource group containing Network Watcher + * @param networkWatcherName The name of the Network Watcher resource + * @return the next definition stage + */ + WithDestination withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination the destination parameter value + * @return the next definition stage + */ + WithSource withDestination(ConnectionMonitorDestination destination); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source the source parameter value + * @return the next definition stage + */ + WithCreate withSource(ConnectionMonitorSource source); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart Determines if the connection monitor will start automatically once created + * @return the next definition stage + */ + WithCreate withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next definition stage + */ + WithCreate withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoStart, DefinitionStages.WithLocation, DefinitionStages.WithMonitoringIntervalInSeconds, DefinitionStages.WithTags { + } + } + /** + * The template for a ConnectionMonitorResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoStart, UpdateStages.WithLocation, UpdateStages.WithMonitoringIntervalInSeconds, UpdateStages.WithTags { + } + + /** + * Grouping of ConnectionMonitorResult update stages. + */ + interface UpdateStages { + /** + * The stage of the connectionmonitorresult update allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart Determines if the connection monitor will start automatically once created + * @return the next update stage + */ + Update withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next update stage + */ + Update withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSource.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSource.java new file mode 100644 index 0000000000000..d070aded3f6d5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSource.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the source of connection monitor. + */ +public class ConnectionMonitorSource { + /** + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the source by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the source by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSourceStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSourceStatus.java new file mode 100644 index 0000000000000..facb6d249fd05 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitorSourceStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionMonitorSourceStatus. + */ +public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { + /** Static value Uknown for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus UKNOWN = fromString("Uknown"); + + /** Static value Active for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionMonitorSourceStatus + */ + @JsonCreator + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** + * @return known ConnectionMonitorSourceStatus values + */ + public static Collection values() { + return values(ConnectionMonitorSourceStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitors.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitors.java new file mode 100644 index 0000000000000..b96627e93f1c4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionMonitors.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionMonitorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConnectionMonitors. + */ +public interface ConnectionMonitors extends SupportsCreating, HasInner { + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionResetSharedKey.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionResetSharedKey.java new file mode 100644 index 0000000000000..45152882853c8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionResetSharedKey.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionResetSharedKeyInner; + +/** + * Type representing ConnectionResetSharedKey. + */ +public interface ConnectionResetSharedKey extends HasInner, HasManager { + /** + * @return the keyLength value. + */ + int keyLength(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionSharedKey.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionSharedKey.java new file mode 100644 index 0000000000000..14772df80d73e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionSharedKey.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionSharedKeyInner; + +/** + * Type representing ConnectionSharedKey. + */ +public interface ConnectionSharedKey extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionState.java new file mode 100644 index 0000000000000..7a591c56f05a4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionState. + */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Reachable for ConnectionState. */ + public static final ConnectionState REACHABLE = fromString("Reachable"); + + /** Static value Unreachable for ConnectionState. */ + public static final ConnectionState UNREACHABLE = fromString("Unreachable"); + + /** Static value Unknown for ConnectionState. */ + public static final ConnectionState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionState from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionState + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** + * @return known ConnectionState values + */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStateSnapshot.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStateSnapshot.java new file mode 100644 index 0000000000000..eb8957d2b1e96 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStateSnapshot.java @@ -0,0 +1,270 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection state snapshot. + */ +public class ConnectionStateSnapshot { + /** + * The connection state. Possible values include: 'Reachable', + * 'Unreachable', 'Unknown'. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /** + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Connectivity analysis evaluation state. Possible values include: + * 'NotStarted', 'InProgress', 'Completed'. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /** + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Integer avgLatencyInMs; + + /** + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Integer minLatencyInMs; + + /** + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Integer maxLatencyInMs; + + /** + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Integer probesSent; + + /** + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Integer probesFailed; + + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @return the connectionState value + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @param connectionState the connectionState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the start time of the connection snapshot. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the connection snapshot. + * + * @param startTime the startTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the connection snapshot. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the connection snapshot. + * + * @param endTime the endTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @return the evaluationState value + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @param evaluationState the evaluationState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get average latency in ms. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Integer avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get minimum latency in ms. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Integer minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get maximum latency in ms. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Integer maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the number of sent probes. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Set the number of sent probes. + * + * @param probesSent the probesSent value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Integer probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Set the number of failed probes. + * + * @param probesFailed the probesFailed value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Integer probesFailed) { + this.probesFailed = probesFailed; + return this; + } + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStatus.java new file mode 100644 index 0000000000000..75fe8468d7d40 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionStatus. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Degraded for ConnectionStatus. */ + public static final ConnectionStatus DEGRADED = fromString("Degraded"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionStatus + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * @return known ConnectionStatus values + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityDestination.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityDestination.java new file mode 100644 index 0000000000000..657b6e1ca5de7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityDestination.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define destination of connection. + */ +public class ConnectivityDestination { + /** + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource to which a connection attempt will be made. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource to which a connection attempt will be made. + * + * @param resourceId the resourceId value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the IP address or URI the resource to which a connection attempt will be made. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address or URI the resource to which a connection attempt will be made. + * + * @param address the address value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get port on which check connectivity will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port on which check connectivity will be performed. + * + * @param port the port value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityHop.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityHop.java new file mode 100644 index 0000000000000..ae6a80d5e4b0a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityHop.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a hop between the source and the destination. + */ +public class ConnectivityHop { + /** + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /** + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type of the hop. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the ID of the hop. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the IP address of the hop. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get the ID of the resource corresponding to this hop. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get list of next hop identifiers. + * + * @return the nextHopIds value + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get list of issues. + * + * @return the issues value + */ + public List issues() { + return this.issues; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityInformation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityInformation.java new file mode 100644 index 0000000000000..f0609ab28b23b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityInformation.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectivityInformationInner; +import java.util.List; + +/** + * Type representing ConnectivityInformation. + */ +public interface ConnectivityInformation extends HasInner, HasManager { + /** + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * @return the hops value. + */ + List hops(); + + /** + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * @return the probesSent value. + */ + Integer probesSent(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityIssue.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityIssue.java new file mode 100644 index 0000000000000..58b99d466f6c6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityIssue.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an issue encountered in the process of checking for + * connectivity. + */ +public class ConnectivityIssue { + /** + * The origin of the issue. Possible values include: 'Local', 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /** + * The severity of the issue. Possible values include: 'Error', 'Warning'. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /** + * The type of issue. Possible values include: 'Unknown', 'AgentStopped', + * 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', + * 'UserDefinedRoute', 'PortThrottled', 'Platform'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /** + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** + * Get the origin of the issue. Possible values include: 'Local', 'Inbound', 'Outbound'. + * + * @return the origin value + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity of the issue. Possible values include: 'Error', 'Warning'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type of issue. Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform'. + * + * @return the type value + */ + public IssueType type() { + return this.type; + } + + /** + * Get provides additional context on the issue. + * + * @return the context value + */ + public List> context() { + return this.context; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityParameters.java new file mode 100644 index 0000000000000..29d8d41327426 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivityParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that determine how the connectivity check will be performed. + */ +public class ConnectivityParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /** + * Network protocol. Possible values include: 'Tcp', 'Http', 'Https', + * 'Icmp'. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /** + * The protocolConfiguration property. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withSource(ConnectivitySource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withDestination(ConnectivityDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @return the protocol value + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @param protocol the protocol value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolConfiguration value. + * + * @return the protocolConfiguration value + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set the protocolConfiguration value. + * + * @param protocolConfiguration the protocolConfiguration value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { + this.protocolConfiguration = protocolConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivitySource.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivitySource.java new file mode 100644 index 0000000000000..b1cdf33ac95d2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ConnectivitySource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source of the connection. + */ +public class ConnectivitySource { + /** + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource from which a connectivity check will be initiated. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource from which a connectivity check will be initiated. + * + * @param resourceId the resourceId value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port from which a connectivity check will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port from which a connectivity check will be performed. + * + * @param port the port value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Container.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Container.java new file mode 100644 index 0000000000000..b476f98f06197 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Container.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; + +/** + * Reference to container resource in remote resource provider. + */ +public class Container extends SubResource { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterface.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterface.java new file mode 100644 index 0000000000000..24327d327cad5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterface.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Container network interface child resource. + */ +@JsonFlatten +public class ContainerNetworkInterface extends SubResource { + /** + * Container network interface configuration from which this container + * network interface is created. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfiguration") + private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; + + /** + * Reference to the conatinaer to which this container network interface is + * attached. + */ + @JsonProperty(value = "properties.container") + private Container container; + + /** + * Reference to the ip configuration on this container nic. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get container network interface configuration from which this container network interface is created. + * + * @return the containerNetworkInterfaceConfiguration value + */ + public ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration() { + return this.containerNetworkInterfaceConfiguration; + } + + /** + * Set container network interface configuration from which this container network interface is created. + * + * @param containerNetworkInterfaceConfiguration the containerNetworkInterfaceConfiguration value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withContainerNetworkInterfaceConfiguration(ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration) { + this.containerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; + return this; + } + + /** + * Get reference to the conatinaer to which this container network interface is attached. + * + * @return the container value + */ + public Container container() { + return this.container; + } + + /** + * Set reference to the conatinaer to which this container network interface is attached. + * + * @param container the container value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withContainer(Container container) { + this.container = container; + return this; + } + + /** + * Get reference to the ip configuration on this container nic. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set reference to the ip configuration on this container nic. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withName(String name) { + this.name = name; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..1e98f74e92996 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceConfiguration.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Container network interface configruation child resource. + */ +@JsonFlatten +public class ContainerNetworkInterfaceConfiguration extends SubResource { + /** + * A list of ip configurations of the container network interface + * configuration. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * A list of container network interfaces created from this container + * network interface configuration. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a list of ip configurations of the container network interface configuration. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of ip configurations of the container network interface configuration. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get a list of container network interfaces created from this container network interface configuration. + * + * @return the containerNetworkInterfaces value + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Set a list of container network interfaces created from this container network interface configuration. + * + * @param containerNetworkInterfaces the containerNetworkInterfaces value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.containerNetworkInterfaces = containerNetworkInterfaces; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceIpConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..396c5445a2558 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ContainerNetworkInterfaceIpConfiguration.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The ip configuration for a container network interface. + */ +@JsonFlatten +public class ContainerNetworkInterfaceIpConfiguration { + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ContainerNetworkInterfaceIpConfiguration object itself. + */ + public ContainerNetworkInterfaceIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterfaceIpConfiguration object itself. + */ + public ContainerNetworkInterfaceIpConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlan.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlan.java new file mode 100644 index 0000000000000..896b760cd8628 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlan.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.DdosProtectionPlanInner; + +/** + * Type representing DdosProtectionPlan. + */ +public interface DdosProtectionPlan extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * The entirety of the DdosProtectionPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DdosProtectionPlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DdosProtectionPlan definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DdosProtectionPlan definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a DdosProtectionPlan update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of DdosProtectionPlan update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlans.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlans.java new file mode 100644 index 0000000000000..4db5367cb71dd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DdosProtectionPlans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.DdosProtectionPlansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DdosProtectionPlans. + */ +public interface DdosProtectionPlans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DefaultSecurityRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DefaultSecurityRules.java new file mode 100644 index 0000000000000..87320927d6836 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DefaultSecurityRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.DefaultSecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DefaultSecurityRules. + */ +public interface DefaultSecurityRules extends HasInner { + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Delegation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Delegation.java new file mode 100644 index 0000000000000..1bc1b814f8719 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Delegation.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Details the service to which the subnet is delegated. + */ +@JsonFlatten +public class Delegation extends SubResource { + /** + * The name of the service to whom the subnet should be delegated (e.g. + * Microsoft.Sql/servers). + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Describes the actions permitted to the service upon delegation. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a subnet. This name can + * be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + * + * @param serviceName the serviceName value to set + * @return the Delegation object itself. + */ + public Delegation withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get describes the actions permitted to the service upon delegation. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set describes the actions permitted to the service upon delegation. + * + * @param actions the actions value to set + * @return the Delegation object itself. + */ + public Delegation withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a subnet. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a subnet. This name can be used to access the resource. + * + * @param name the name value to set + * @return the Delegation object itself. + */ + public Delegation withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the Delegation object itself. + */ + public Delegation withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DeviceProperties.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DeviceProperties.java new file mode 100644 index 0000000000000..75af194cc1abe --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DeviceProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of properties of the device. + */ +public class DeviceProperties { + /** + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /** + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /** + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get name of the device Vendor. + * + * @return the deviceVendor value + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set name of the device Vendor. + * + * @param deviceVendor the deviceVendor value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceVendor(String deviceVendor) { + this.deviceVendor = deviceVendor; + return this; + } + + /** + * Get model of the device. + * + * @return the deviceModel value + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set model of the device. + * + * @param deviceModel the deviceModel value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + /** + * Get link speed. + * + * @return the linkSpeedInMbps value + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhGroup.java new file mode 100644 index 0000000000000..102693cbe509e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhGroup.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DhGroup. + */ +public final class DhGroup extends ExpandableStringEnum { + /** Static value None for DhGroup. */ + public static final DhGroup NONE = fromString("None"); + + /** Static value DHGroup1 for DhGroup. */ + public static final DhGroup DHGROUP1 = fromString("DHGroup1"); + + /** Static value DHGroup2 for DhGroup. */ + public static final DhGroup DHGROUP2 = fromString("DHGroup2"); + + /** Static value DHGroup14 for DhGroup. */ + public static final DhGroup DHGROUP14 = fromString("DHGroup14"); + + /** Static value DHGroup2048 for DhGroup. */ + public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); + + /** Static value ECP256 for DhGroup. */ + public static final DhGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for DhGroup. */ + public static final DhGroup ECP384 = fromString("ECP384"); + + /** Static value DHGroup24 for DhGroup. */ + public static final DhGroup DHGROUP24 = fromString("DHGroup24"); + + /** + * Creates or finds a DhGroup from its string representation. + * @param name a name to look for + * @return the corresponding DhGroup + */ + @JsonCreator + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** + * @return known DhGroup values + */ + public static Collection values() { + return values(DhGroup.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhcpOptions.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhcpOptions.java new file mode 100644 index 0000000000000..5b78b0aa2666b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/DhcpOptions.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in + * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + * options. + */ +public class DhcpOptions { + /** + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the list of DNS servers IP addresses. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set + * @return the DhcpOptions object itself. + */ + public DhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Dimension.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Dimension.java new file mode 100644 index 0000000000000..1c6ab4a9160f8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Dimension.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of the metric. + */ +public class Dimension { + /** + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internal name of the dimension. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internal name of the dimension. + * + * @param internalName the internalName value to set + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Direction.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Direction.java new file mode 100644 index 0000000000000..a1fa8ccaba72c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Direction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Direction. + */ +public final class Direction extends ExpandableStringEnum { + /** Static value Inbound for Direction. */ + public static final Direction INBOUND = fromString("Inbound"); + + /** Static value Outbound for Direction. */ + public static final Direction OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Direction from its string representation. + * @param name a name to look for + * @return the corresponding Direction + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** + * @return known Direction values + */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroup.java new file mode 100644 index 0000000000000..3fce8dd13dae9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security group. + */ +public class EffectiveNetworkSecurityGroup { + /** + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /** + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /** + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private Map> tagMap; + + /** + * Get the ID of network security group that is applied. + * + * @return the networkSecurityGroup value + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the ID of network security group that is applied. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get associated resources. + * + * @return the association value + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set associated resources. + * + * @param association the association value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { + this.association = association; + return this; + } + + /** + * Get a collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set a collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Get mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value + */ + public Map> tagMap() { + return this.tagMap; + } + + /** + * Set mapping of tags to list of IP Addresses included within the tag. + * + * @param tagMap the tagMap value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withTagMap(Map> tagMap) { + this.tagMap = tagMap; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupAssociation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 0000000000000..6c1b7294a1123 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The effective network security group association. + */ +public class EffectiveNetworkSecurityGroupAssociation { + /** + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /** + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** + * Get the ID of the subnet if assigned. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the ID of the subnet if assigned. + * + * @param subnet the subnet value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ID of the network interface if assigned. + * + * @return the networkInterface value + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set the ID of the network interface if assigned. + * + * @param networkInterface the networkInterface value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { + this.networkInterface = networkInterface; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..a2ba4b1bb2dd8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** + * Type representing EffectiveNetworkSecurityGroupListResult. + */ +public interface EffectiveNetworkSecurityGroupListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..272800bfaa5ca --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveNetworkSecurityRule.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security rules. + */ +public class EffectiveNetworkSecurityRule { + /** + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /** + * The network protocol this rule applies to. Possible values are: 'Tcp', + * 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /** + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /** + * The source port ranges. Expected values include a single integer between + * 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an + * asterix (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or + * an asterix (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /** + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, + * and the asterix (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), + * System Tags, and the asterix (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /** + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /** + * Whether network traffic is allowed or denied. Possible values are: + * 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /** + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * The direction of the rule. Possible values are: 'Inbound and Outbound'. + * Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get the name of the security rule specified by the user (if created by the user). + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the security rule specified by the user (if created by the user). + * + * @param name the name value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the source address prefix. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the source address prefix. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destination address prefix. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set the expanded source address prefix. + * + * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { + this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + return this; + } + + /** + * Get expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set expanded destination address prefix. + * + * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix(List expandedDestinationAddressPrefix) { + this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + return this; + } + + /** + * Get whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. + * + * @param priority the priority value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRoute.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRoute.java new file mode 100644 index 0000000000000..c947a7937b813 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRoute.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective Route. + */ +public class EffectiveRoute { + /** + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Who created the route. Possible values are: 'Unknown', 'User', + * 'VirtualNetworkGateway', and 'Default'. Possible values include: + * 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /** + * The value of effective route. Possible values are: 'Active' and + * 'Invalid'. Possible values include: 'Active', 'Invalid'. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /** + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /** + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name of the user defined route. This is optional. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the user defined route. This is optional. + * + * @param name the name value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @return the source value + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @param source the source value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @return the state value + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @param state the state value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefixes of the effective routes in CIDR notation. + * + * @param addressPrefix the addressPrefix value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withAddressPrefix(List addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address of the next hop of the effective route. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..5757b1e06d353 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.EffectiveRouteListResultInner; +import java.util.List; + +/** + * Type representing EffectiveRouteListResult. + */ +public interface EffectiveRouteListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteSource.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteSource.java new file mode 100644 index 0000000000000..c62ee9ed57cb5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteSource.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteSource. + */ +public final class EffectiveRouteSource extends ExpandableStringEnum { + /** Static value Unknown for EffectiveRouteSource. */ + public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); + + /** Static value User for EffectiveRouteSource. */ + public static final EffectiveRouteSource USER = fromString("User"); + + /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ + public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value Default for EffectiveRouteSource. */ + public static final EffectiveRouteSource DEFAULT = fromString("Default"); + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteSource + */ + @JsonCreator + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** + * @return known EffectiveRouteSource values + */ + public static Collection values() { + return values(EffectiveRouteSource.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteState.java new file mode 100644 index 0000000000000..5e321c126df18 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveRouteState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteState. + */ +public final class EffectiveRouteState extends ExpandableStringEnum { + /** Static value Active for EffectiveRouteState. */ + public static final EffectiveRouteState ACTIVE = fromString("Active"); + + /** Static value Invalid for EffectiveRouteState. */ + public static final EffectiveRouteState INVALID = fromString("Invalid"); + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteState + */ + @JsonCreator + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** + * @return known EffectiveRouteState values + */ + public static Collection values() { + return values(EffectiveRouteState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveSecurityRuleProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..e7fd2ef175298 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EffectiveSecurityRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveSecurityRuleProtocol. + */ +public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value All for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveSecurityRuleProtocol + */ + @JsonCreator + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** + * @return known EffectiveSecurityRuleProtocol values + */ + public static Collection values() { + return values(EffectiveSecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointService.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointService.java new file mode 100644 index 0000000000000..e5ee12aed8a04 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointService.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identifies the service being brought into the virtual network. + */ +public class EndpointService { + /** + * A unique identifier of the service being referenced by the interface + * endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique identifier of the service being referenced by the interface endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set a unique identifier of the service being referenced by the interface endpoint. + * + * @param id the id value to set + * @return the EndpointService object itself. + */ + public EndpointService withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointServiceResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointServiceResult.java new file mode 100644 index 0000000000000..a4b7c84c7062e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EndpointServiceResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.EndpointServiceResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing EndpointServiceResult. + */ +public interface EndpointServiceResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Error.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Error.java new file mode 100644 index 0000000000000..1e060e1148f1f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Error.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * The innerError property. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public String innerError() { + return this.innerError; + } + + /** + * Set the innerError value. + * + * @param innerError the innerError value to set + * @return the Error object itself. + */ + public Error withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorDetails.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorDetails.java new file mode 100644 index 0000000000000..1ffc32ee1d725 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorDetails.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetails model. + */ +public class ErrorDetails { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorException.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorException.java new file mode 100644 index 0000000000000..da8b8afb033d6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponse.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponse.java new file mode 100644 index 0000000000000..6381c299c11d2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponse { + /** + * Error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponseException.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponseException.java new file mode 100644 index 0000000000000..92ca5cd514fb5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluatedNetworkSecurityGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..bc05ea60bce28 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network security group evaluation. + */ +public class EvaluatedNetworkSecurityGroup { + /** + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /** + * Resource ID of nic or subnet to which network security group is applied. + */ + @JsonProperty(value = "appliedTo") + private String appliedTo; + + /** + * The matchedRule property. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /** + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get network security group ID. + * + * @return the networkSecurityGroupId value + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set network security group ID. + * + * @param networkSecurityGroupId the networkSecurityGroupId value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { + this.networkSecurityGroupId = networkSecurityGroupId; + return this; + } + + /** + * Get resource ID of nic or subnet to which network security group is applied. + * + * @return the appliedTo value + */ + public String appliedTo() { + return this.appliedTo; + } + + /** + * Set resource ID of nic or subnet to which network security group is applied. + * + * @param appliedTo the appliedTo value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withAppliedTo(String appliedTo) { + this.appliedTo = appliedTo; + return this; + } + + /** + * Get the matchedRule value. + * + * @return the matchedRule value + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule value. + * + * @param matchedRule the matchedRule value to set + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { + this.matchedRule = matchedRule; + return this; + } + + /** + * Get list of network security rules evaluation results. + * + * @return the rulesEvaluationResult value + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluationState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluationState.java new file mode 100644 index 0000000000000..13709318853f9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/EvaluationState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EvaluationState. + */ +public final class EvaluationState extends ExpandableStringEnum { + /** Static value NotStarted for EvaluationState. */ + public static final EvaluationState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for EvaluationState. */ + public static final EvaluationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for EvaluationState. */ + public static final EvaluationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a EvaluationState from its string representation. + * @param name a name to look for + * @return the corresponding EvaluationState + */ + @JsonCreator + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** + * @return known EvaluationState values + */ + public static Collection values() { + return values(EvaluationState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuit.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuit.java new file mode 100644 index 0000000000000..4ea693d54d326 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuit.java @@ -0,0 +1,488 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitInner; + +/** + * Type representing ExpressRouteCircuit. + */ +public interface ExpressRouteCircuit extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowClassicOperations value. + */ + Boolean allowClassicOperations(); + + /** + * @return the allowGlobalReach value. + */ + Boolean allowGlobalReach(); + + /** + * @return the authorizations value. + */ + List authorizations(); + + /** + * @return the bandwidthInGbps value. + */ + Double bandwidthInGbps(); + + /** + * @return the circuitProvisioningState value. + */ + String circuitProvisioningState(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRoutePort value. + */ + SubResource expressRoutePort(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProperties value. + */ + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sku value. + */ + ExpressRouteCircuitSku sku(); + + /** + * @return the stag value. + */ + Integer stag(); + + /** + * The entirety of the ExpressRouteCircuit definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuit definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuit definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCircuit definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecircuit definition allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next definition stage + */ + WithCreate withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify AllowGlobalReach. + */ + interface WithAllowGlobalReach { + /** + * Specifies allowGlobalReach. + * @param allowGlobalReach Flag to enable Global Reach on the circuit + * @return the next definition stage + */ + WithCreate withAllowGlobalReach(Boolean allowGlobalReach); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + * @param authorizations The list of authorizations + * @return the next definition stage + */ + WithCreate withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withBandwidthInGbps(Double bandwidthInGbps); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @param circuitProvisioningState The CircuitProvisioningState state of the resource + * @return the next definition stage + */ + WithCreate withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ExpressRoutePort. + */ + interface WithExpressRoutePort { + /** + * Specifies expressRoutePort. + * @param expressRoutePort The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withExpressRoutePort(SubResource expressRoutePort); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + * @param serviceKey The ServiceKey + * @return the next definition stage + */ + WithCreate withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes The ServiceProviderNotes + * @return the next definition stage + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next definition stage + */ + WithCreate withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next definition stage + */ + WithCreate withSku(ExpressRouteCircuitSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowClassicOperations, DefinitionStages.WithAllowGlobalReach, DefinitionStages.WithAuthorizations, DefinitionStages.WithBandwidthInGbps, DefinitionStages.WithCircuitProvisioningState, DefinitionStages.WithExpressRoutePort, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithPeerings, DefinitionStages.WithProvisioningState, DefinitionStages.WithServiceKey, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProperties, DefinitionStages.WithServiceProviderProvisioningState, DefinitionStages.WithSku { + } + } + /** + * The template for a ExpressRouteCircuit update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowClassicOperations, UpdateStages.WithAllowGlobalReach, UpdateStages.WithAuthorizations, UpdateStages.WithBandwidthInGbps, UpdateStages.WithCircuitProvisioningState, UpdateStages.WithExpressRoutePort, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithPeerings, UpdateStages.WithProvisioningState, UpdateStages.WithServiceKey, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProperties, UpdateStages.WithServiceProviderProvisioningState, UpdateStages.WithSku { + } + + /** + * Grouping of ExpressRouteCircuit update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuit update allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next update stage + */ + Update withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify AllowGlobalReach. + */ + interface WithAllowGlobalReach { + /** + * Specifies allowGlobalReach. + * @param allowGlobalReach Flag to enable Global Reach on the circuit + * @return the next update stage + */ + Update withAllowGlobalReach(Boolean allowGlobalReach); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + * @param authorizations The list of authorizations + * @return the next update stage + */ + Update withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource + * @return the next update stage + */ + Update withBandwidthInGbps(Double bandwidthInGbps); + } + + /** + * The stage of the expressroutecircuit update allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @param circuitProvisioningState The CircuitProvisioningState state of the resource + * @return the next update stage + */ + Update withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ExpressRoutePort. + */ + interface WithExpressRoutePort { + /** + * Specifies expressRoutePort. + * @param expressRoutePort The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource + * @return the next update stage + */ + Update withExpressRoutePort(SubResource expressRoutePort); + } + + /** + * The stage of the expressroutecircuit update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + * @param serviceKey The ServiceKey + * @return the next update stage + */ + Update withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes The ServiceProviderNotes + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next update stage + */ + Update withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next update stage + */ + Update withSku(ExpressRouteCircuitSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitArpTable.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitArpTable.java new file mode 100644 index 0000000000000..9167c52a42c1b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitArpTable.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ARP table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitArpTable { + /** + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /** + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /** + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get entry age in minutes. + * + * @return the age value + */ + public Integer age() { + return this.age; + } + + /** + * Set entry age in minutes. + * + * @param age the age value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get interface address. + * + * @return the interfaceProperty value + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set interface address. + * + * @param interfaceProperty the interfaceProperty value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the IP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address. + * + * @param ipAddress the ipAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the MAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address. + * + * @param macAddress the macAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorization.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorization.java new file mode 100644 index 0000000000000..8292641f9258d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCircuitAuthorization. + */ +public interface ExpressRouteCircuitAuthorization extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitAuthorization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitAuthorization definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next definition stage + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithAuthorizationUseStatus, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a ExpressRouteCircuitAuthorization update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next update stage + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorizations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 0000000000000..430a66f6b2aed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitAuthorizations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitAuthorizationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitAuthorizations. + */ +public interface ExpressRouteCircuitAuthorizations extends SupportsCreating, HasInner { + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..4c3a7599f5a1a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnection.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing ExpressRouteCircuitConnection. + */ +public interface ExpressRouteCircuitConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPeering, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitConnection definition. + */ + interface Blank extends WithPeering { + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Peering. + */ + interface WithPeering { + /** + * Specifies resourceGroupName, circuitName, peeringName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @param peeringName The name of the peering + * @return the next definition stage + */ + WithCreate withExistingPeering(String resourceGroupName, String circuitName, String peeringName); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection + * @return the next definition stage + */ + WithCreate withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the peered circuit + * @return the next definition stage + */ + WithCreate withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeerExpressRouteCircuitPeering { + } + } + /** + * The template for a ExpressRouteCircuitConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAuthorizationKey, UpdateStages.WithExpressRouteCircuitPeering, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeerExpressRouteCircuitPeering { + } + + /** + * Grouping of ExpressRouteCircuitConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitconnection update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection + * @return the next update stage + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the peered circuit + * @return the next update stage + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..7caa7949f91cb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitConnections.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitConnections. + */ +public interface ExpressRouteCircuitConnections extends SupportsCreating, HasInner { + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeering.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeering.java new file mode 100644 index 0000000000000..02697af014563 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeering.java @@ -0,0 +1,691 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitPeering. + */ +public interface ExpressRouteCircuitPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteConnection value. + */ + ExpressRouteConnectionId expressRouteConnection(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilter value. + */ + RouteFilter routeFilter(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCircuitPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitPeering definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + * @param resourceGroupName The name of the resource group + * @param circuitName The name of the express route circuit + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next definition stage + */ + WithCreate withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next definition stage + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteConnection. + */ + interface WithExpressRouteConnection { + /** + * Specifies expressRouteConnection. + * @param expressRouteConnection The ExpressRoute connection + * @return the next definition stage + */ + WithCreate withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next definition stage + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next definition stage + */ + WithCreate withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next definition stage + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next definition stage + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAzureASN, DefinitionStages.WithConnections, DefinitionStages.WithExpressRouteConnection, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryAzurePort, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteFilter, DefinitionStages.WithSecondaryAzurePort, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithStats, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCircuitPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureASN, UpdateStages.WithConnections, UpdateStages.WithExpressRouteConnection, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryAzurePort, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithProvisioningState, UpdateStages.WithRouteFilter, UpdateStages.WithSecondaryAzurePort, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithStats, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCircuitPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitpeering update allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next update stage + */ + Update withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ExpressRouteConnection. + */ + interface WithExpressRouteConnection { + /** + * Specifies expressRouteConnection. + * @param expressRouteConnection The ExpressRoute connection + * @return the next update stage + */ + Update withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next update stage + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next update stage + */ + Update withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next update stage + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next update stage + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 0000000000000..d87ac1b7bb380 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ +public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState extends ExpandableStringEnum { + /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = fromString("NotConfigured"); + + /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); + + /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); + + /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = fromString("ValidationNeeded"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..9d9cfbeffc830 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the peering configuration. + */ +public class ExpressRouteCircuitPeeringConfig { + /** + * The reference of AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /** + * The communities of bgp peering. Spepcified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /** + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded'. + */ + @JsonProperty(value = "advertisedPublicPrefixesState") + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /** + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /** + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerASN; + + /** + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** + * Get the reference of AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the reference of AdvertisedPublicPrefixes. + * + * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { + this.advertisedPublicPrefixes = advertisedPublicPrefixes; + return this; + } + + /** + * Get the communities of bgp peering. Spepcified for microsoft peering. + * + * @return the advertisedCommunities value + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set the communities of bgp peering. Spepcified for microsoft peering. + * + * @param advertisedCommunities the advertisedCommunities value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { + this.advertisedCommunities = advertisedCommunities; + return this; + } + + /** + * Get advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @return the advertisedPublicPrefixesState value + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Set advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @param advertisedPublicPrefixesState the advertisedPublicPrefixesState value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixesState(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState) { + this.advertisedPublicPrefixesState = advertisedPublicPrefixesState; + return this; + } + + /** + * Get the legacy mode of the peering. + * + * @return the legacyMode value + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set the legacy mode of the peering. + * + * @param legacyMode the legacyMode value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { + this.legacyMode = legacyMode; + return this; + } + + /** + * Get the CustomerASN of the peering. + * + * @return the customerASN value + */ + public Integer customerASN() { + return this.customerASN; + } + + /** + * Set the CustomerASN of the peering. + * + * @param customerASN the customerASN value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withCustomerASN(Integer customerASN) { + this.customerASN = customerASN; + return this; + } + + /** + * Get the RoutingRegistryName of the configuration. + * + * @return the routingRegistryName value + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set the RoutingRegistryName of the configuration. + * + * @param routingRegistryName the routingRegistryName value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { + this.routingRegistryName = routingRegistryName; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringId.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringId.java new file mode 100644 index 0000000000000..dde02a4da7806 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringId.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoute circuit peering identifier. + */ +public class ExpressRouteCircuitPeeringId { + /** + * The ID of the ExpressRoute circuit peering. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ID of the ExpressRoute circuit peering. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the ExpressRoute circuit peering. + * + * @param id the id value to set + * @return the ExpressRouteCircuitPeeringId object itself. + */ + public ExpressRouteCircuitPeeringId withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringState.java new file mode 100644 index 0000000000000..f944cc4e1cc07 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringState. + */ +public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeerings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeerings.java new file mode 100644 index 0000000000000..eb81cc73fb0d6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitPeerings. + */ +public interface ExpressRouteCircuitPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitReference.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitReference.java new file mode 100644 index 0000000000000..a51594dabfd7a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ExpressRouteCircuitReference model. + */ +public class ExpressRouteCircuitReference { + /** + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get corresponding Express Route Circuit Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set corresponding Express Route Circuit Id. + * + * @param id the id value to set + * @return the ExpressRouteCircuitReference object itself. + */ + public ExpressRouteCircuitReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTable.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 0000000000000..7133afe8e6fee --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTable.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTable { + /** + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /** + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /** + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /** + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /** + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get iP address of a network entity. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Set iP address of a network entity. + * + * @param network the network value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNetwork(String network) { + this.network = network; + return this; + } + + /** + * Get nextHop address. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set nextHop address. + * + * @param nextHop the nextHop value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Get local preference value as set with the set local-preference route-map configuration command. + * + * @return the locPrf value + */ + public String locPrf() { + return this.locPrf; + } + + /** + * Set local preference value as set with the set local-preference route-map configuration command. + * + * @param locPrf the locPrf value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { + this.locPrf = locPrf; + return this; + } + + /** + * Get route Weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + + /** + * Set route Weight. + * + * @param weight the weight value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get autonomous system paths to the destination network. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set autonomous system paths to the destination network. + * + * @param path the path value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTableSummary.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 0000000000000..4618b08c18901 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTableSummary { + /** + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get iP address of the neighbor. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of the neighbor. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get bGP version number spoken to the neighbor. + * + * @return the v value + */ + public Integer v() { + return this.v; + } + + /** + * Set bGP version number spoken to the neighbor. + * + * @param v the v value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { + this.v = v; + return this; + } + + /** + * Get autonomous system number. + * + * @return the as value + */ + public Integer as() { + return this.as; + } + + /** + * Set autonomous system number. + * + * @param as the as value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { + this.as = as; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the statePfxRcd value + */ + public String statePfxRcd() { + return this.statePfxRcd; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param statePfxRcd the statePfxRcd value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { + this.statePfxRcd = statePfxRcd; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitServiceProviderProperties.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 0000000000000..77a7433ce65b0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitServiceProviderProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitServiceProviderProperties { + /** + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /** + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /** + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName. + * + * @return the serviceProviderName value + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName. + * + * @param serviceProviderName the serviceProviderName value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + return this; + } + + /** + * Get the peering location. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the BandwidthInMbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSku.java new file mode 100644 index 0000000000000..7d3e5288b8a65 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSku.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains SKU in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU. Possible values are 'Standard', 'Premium' or + * 'Basic'. Possible values include: 'Standard', 'Premium', 'Basic'. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /** + * The family of the SKU. Possible values are: 'UnlimitedData' and + * 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU. Possible values are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', 'Premium', 'Basic'. + * + * @return the tier value + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU. Possible values are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', 'Premium', 'Basic'. + * + * @param tier the tier value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @return the family value + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @param family the family value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuFamily.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 0000000000000..61554ce701900 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuFamily.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuFamily. + */ +public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { + /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); + + /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuFamily + */ + @JsonCreator + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** + * @return known ExpressRouteCircuitSkuFamily values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuFamily.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuTier.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuTier.java new file mode 100644 index 0000000000000..97a18b844246a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitSkuTier.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuTier. + */ +public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { + /** Static value Standard for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); + + /** Static value Basic for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier BASIC = fromString("Basic"); + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuTier + */ + @JsonCreator + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** + * @return known ExpressRouteCircuitSkuTier values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuTier.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitStats.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitStats.java new file mode 100644 index 0000000000000..7364ad2ba6b3f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitStats.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitStats. + */ +public interface ExpressRouteCircuitStats extends HasInner, HasManager { + /** + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuits.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..3dc7839dbb3d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuits.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuits. + */ +public interface ExpressRouteCircuits extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatsAsync(String resourceGroupName, String circuitName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsArpTableListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsArpTableListResult.java new file mode 100644 index 0000000000000..271345da95e2d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsArpTableListResult. + */ +public interface ExpressRouteCircuitsArpTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 0000000000000..9819b29ba15cf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableListResult. + */ +public interface ExpressRouteCircuitsRoutesTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..8b244f73a0246 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnection.java new file mode 100644 index 0000000000000..48a39eba311d8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnection.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteConnection. + */ +public interface ExpressRouteConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the expressRouteCircuitPeering value. + */ + ExpressRouteCircuitPeeringId expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * The entirety of the ExpressRouteConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteGateway, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithName, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteConnection definition. + */ + interface Blank extends WithExpressRouteGateway { + } + + /** + * The stage of the expressrouteconnection definition allowing to specify ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies resourceGroupName, expressRouteGatewayName. + * @param resourceGroupName The name of the resource group + * @param expressRouteGatewayName The name of the ExpressRoute gateway + * @return the next definition stage + */ + WithExpressRouteCircuitPeering withExistingExpressRouteGateway(String resourceGroupName, String expressRouteGatewayName); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering The ExpressRoute circuit peering + * @return the next definition stage + */ + WithName withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey Authorization key to establish the connection + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight associated to the connection + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithId, DefinitionStages.WithRoutingWeight { + } + } + /** + * The template for a ExpressRouteConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithId, UpdateStages.WithRoutingWeight { + } + + /** + * Grouping of ExpressRouteConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressrouteconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey Authorization key to establish the connection + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressrouteconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressrouteconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight associated to the connection + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionId.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionId.java new file mode 100644 index 0000000000000..3231439a2787c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ID of the ExpressRouteConnection. + */ +public class ExpressRouteConnectionId { + /** + * The ID of the ExpressRouteConnection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the ID of the ExpressRouteConnection. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionList.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionList.java new file mode 100644 index 0000000000000..06dccf663838b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnectionList.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteConnectionListInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteConnectionInner; +import java.util.List; + +/** + * Type representing ExpressRouteConnectionList. + */ +public interface ExpressRouteConnectionList extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnections.java new file mode 100644 index 0000000000000..131d6b10cfff5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteConnections. + */ +public interface ExpressRouteConnections extends SupportsCreating, HasInner { + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String expressRouteGatewayName); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnection.java new file mode 100644 index 0000000000000..e719adac4f016 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnection.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionInner; + +/** + * Type representing ExpressRouteCrossConnection. + */ +public interface ExpressRouteCrossConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bandwidthInMbps value. + */ + Integer bandwidthInMbps(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuit value. + */ + ExpressRouteCircuitReference expressRouteCircuit(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sTag value. + */ + Integer sTag(); + + /** + * The entirety of the ExpressRouteCrossConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next definition stage + */ + WithCreate withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next definition stage + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next definition stage + */ + WithCreate withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes Additional read only notes set by the connectivity provider + * @return the next definition stage + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInMbps, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithPeeringLocation, DefinitionStages.WithPeerings, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProvisioningState { + } + } + /** + * The template for a ExpressRouteCrossConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInMbps, UpdateStages.WithExpressRouteCircuit, UpdateStages.WithPeeringLocation, UpdateStages.WithPeerings, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProvisioningState { + } + + /** + * Grouping of ExpressRouteCrossConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnection update allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next update stage + */ + Update withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next update stage + */ + Update withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next update stage + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes Additional read only notes set by the connectivity provider + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeering.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..a582175307016 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,475 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCrossConnectionPeering. + */ +public interface ExpressRouteCrossConnectionPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCrossConnectionPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCrossConnection, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnectionPeering definition. + */ + interface Blank extends WithExpressRouteCrossConnection { + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify ExpressRouteCrossConnection. + */ + interface WithExpressRouteCrossConnection { + /** + * Specifies resourceGroupName, crossConnectionName. + * @param resourceGroupName The name of the resource group + * @param crossConnectionName The name of the ExpressRouteCrossConnection + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCrossConnectionPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeerings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 0000000000000..157f8f3220db3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnectionPeerings. + */ +public interface ExpressRouteCrossConnectionPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String crossConnectionName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionRoutesTableSummary.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 0000000000000..2d5c440e51eae --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCrossConnectionRoutesTableSummary { + /** + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get iP address of Neighbor router. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of Neighbor router. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get autonomous system number. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Set autonomous system number. + * + * @param asn the asn value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the stateOrPrefixesReceived value + */ + public String stateOrPrefixesReceived() { + return this.stateOrPrefixesReceived; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { + this.stateOrPrefixesReceived = stateOrPrefixesReceived; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnections.java new file mode 100644 index 0000000000000..ea38df2a90025 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnections.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnections. + */ +public interface ExpressRouteCrossConnections extends SupportsCreating, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..8b2e0eccd5e05 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCrossConnectionsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateway.java new file mode 100644 index 0000000000000..0afa143798bd4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateway.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteGatewayInner; + +/** + * Type representing ExpressRouteGateway. + */ +public interface ExpressRouteGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the autoScaleConfiguration value. + */ + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteConnections value. + */ + List expressRouteConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + VirtualHubId virtualHub(); + + /** + * The entirety of the ExpressRouteGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithVirtualHub, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutegateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The Virtual Hub where the ExpressRoute gateway is or will be deployed + * @return the next definition stage +*/ + WithCreate withVirtualHub(VirtualHubId virtualHub); + } + + /** + * The stage of the expressroutegateway definition allowing to specify AutoScaleConfiguration. + */ + interface WithAutoScaleConfiguration { + /** + * Specifies autoScaleConfiguration. + * @param autoScaleConfiguration Configuration for auto scaling + * @return the next definition stage + */ + WithCreate withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAutoScaleConfiguration { + } + } + /** + * The template for a ExpressRouteGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAutoScaleConfiguration { + } + + /** + * Grouping of ExpressRouteGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutegateway update allowing to specify AutoScaleConfiguration. + */ + interface WithAutoScaleConfiguration { + /** + * Specifies autoScaleConfiguration. + * @param autoScaleConfiguration Configuration for auto scaling + * @return the next update stage + */ + Update withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java new file mode 100644 index 0000000000000..40b6b75dd6255 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration for auto scaling. + */ +public class ExpressRouteGatewayPropertiesAutoScaleConfiguration { + /** + * Minimum and maximum number of scale units to deploy. + */ + @JsonProperty(value = "bounds") + private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; + + /** + * Get minimum and maximum number of scale units to deploy. + * + * @return the bounds value + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds() { + return this.bounds; + } + + /** + * Set minimum and maximum number of scale units to deploy. + * + * @param bounds the bounds value to set + * @return the ExpressRouteGatewayPropertiesAutoScaleConfiguration object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration withBounds(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds) { + this.bounds = bounds; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java new file mode 100644 index 0000000000000..85b769894f0dc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Minimum and maximum number of scale units to deploy. + */ +public class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + /** + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "min") + private Integer min; + + /** + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get minimum number of scale units deployed for ExpressRoute gateway. + * + * @return the min value + */ + public Integer min() { + return this.min; + } + + /** + * Set minimum number of scale units deployed for ExpressRoute gateway. + * + * @param min the min value to set + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get maximum number of scale units deployed for ExpressRoute gateway. + * + * @return the max value + */ + public Integer max() { + return this.max; + } + + /** + * Set maximum number of scale units deployed for ExpressRoute gateway. + * + * @param max the max value to set + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMax(Integer max) { + this.max = max; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateways.java new file mode 100644 index 0000000000000..bd80bbf609b23 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteGateways. + */ +public interface ExpressRouteGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLink.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLink.java new file mode 100644 index 0000000000000..14a7399c46b3a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLink.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteLinkInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteLink. + */ +public interface ExpressRouteLink extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the adminState value. + */ + ExpressRouteLinkAdminState adminState(); + + /** + * @return the connectorType value. + */ + ExpressRouteLinkConnectorType connectorType(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the patchPanelId value. + */ + String patchPanelId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rackId value. + */ + String rackId(); + + /** + * @return the routerName value. + */ + String routerName(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkAdminState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkAdminState.java new file mode 100644 index 0000000000000..054dd872ea84e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkAdminState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteLinkAdminState. + */ +public final class ExpressRouteLinkAdminState extends ExpandableStringEnum { + /** Static value Enabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState ENABLED = fromString("Enabled"); + + /** Static value Disabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ExpressRouteLinkAdminState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteLinkAdminState + */ + @JsonCreator + public static ExpressRouteLinkAdminState fromString(String name) { + return fromString(name, ExpressRouteLinkAdminState.class); + } + + /** + * @return known ExpressRouteLinkAdminState values + */ + public static Collection values() { + return values(ExpressRouteLinkAdminState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkConnectorType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkConnectorType.java new file mode 100644 index 0000000000000..9a67c54f709cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinkConnectorType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteLinkConnectorType. + */ +public final class ExpressRouteLinkConnectorType extends ExpandableStringEnum { + /** Static value LC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType LC = fromString("LC"); + + /** Static value SC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType SC = fromString("SC"); + + /** + * Creates or finds a ExpressRouteLinkConnectorType from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteLinkConnectorType + */ + @JsonCreator + public static ExpressRouteLinkConnectorType fromString(String name) { + return fromString(name, ExpressRouteLinkConnectorType.class); + } + + /** + * @return known ExpressRouteLinkConnectorType values + */ + public static Collection values() { + return values(ExpressRouteLinkConnectorType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinks.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinks.java new file mode 100644 index 0000000000000..d8ea441bd7914 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteLinks.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteLinksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteLinks. + */ +public interface ExpressRouteLinks extends HasInner { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String expressRoutePortName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringState.java new file mode 100644 index 0000000000000..53bdf4b48aef4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringState. + */ +public final class ExpressRoutePeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringState + */ + @JsonCreator + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** + * @return known ExpressRoutePeeringState values + */ + public static Collection values() { + return values(ExpressRoutePeeringState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringType.java new file mode 100644 index 0000000000000..07bb9f3137e98 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePeeringType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringType. + */ +public final class ExpressRoutePeeringType extends ExpandableStringEnum { + /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); + + /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); + + /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringType + */ + @JsonCreator + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** + * @return known ExpressRoutePeeringType values + */ + public static Collection values() { + return values(ExpressRoutePeeringType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePort.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePort.java new file mode 100644 index 0000000000000..f2cc5e1c79db7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePort.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteLinkInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRoutePortInner; + +/** + * Type representing ExpressRoutePort. + */ +public interface ExpressRoutePort extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allocationDate value. + */ + String allocationDate(); + + /** + * @return the bandwidthInGbps value. + */ + Integer bandwidthInGbps(); + + /** + * @return the circuits value. + */ + List circuits(); + + /** + * @return the encapsulation value. + */ + ExpressRoutePortsEncapsulation encapsulation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the etherType value. + */ + String etherType(); + + /** + * @return the links value. + */ + List links(); + + /** + * @return the mtu value. + */ + String mtu(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the provisionedBandwidthInGbps value. + */ + Double provisionedBandwidthInGbps(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ExpressRoutePort definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRoutePort definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRoutePort definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRoutePort definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressrouteport definition allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps Bandwidth of procured ports in Gbps + * @return the next definition stage + */ + WithCreate withBandwidthInGbps(Integer bandwidthInGbps); + } + + /** + * The stage of the expressrouteport definition allowing to specify Encapsulation. + */ + interface WithEncapsulation { + /** + * Specifies encapsulation. + * @param encapsulation Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + * @return the next definition stage + */ + WithCreate withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + + /** + * The stage of the expressrouteport definition allowing to specify Links. + */ + interface WithLinks { + /** + * Specifies links. + * @param links The set of physical links of the ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withLinks(List links); + } + + /** + * The stage of the expressrouteport definition allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The name of the peering location that the ExpressRoutePort is mapped to physically + * @return the next definition stage + */ + WithCreate withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressrouteport definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInGbps, DefinitionStages.WithEncapsulation, DefinitionStages.WithLinks, DefinitionStages.WithPeeringLocation, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a ExpressRoutePort update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInGbps, UpdateStages.WithEncapsulation, UpdateStages.WithLinks, UpdateStages.WithPeeringLocation, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of ExpressRoutePort update stages. + */ + interface UpdateStages { + /** + * The stage of the expressrouteport update allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps Bandwidth of procured ports in Gbps + * @return the next update stage + */ + Update withBandwidthInGbps(Integer bandwidthInGbps); + } + + /** + * The stage of the expressrouteport update allowing to specify Encapsulation. + */ + interface WithEncapsulation { + /** + * Specifies encapsulation. + * @param encapsulation Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + * @return the next update stage + */ + Update withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + + /** + * The stage of the expressrouteport update allowing to specify Links. + */ + interface WithLinks { + /** + * Specifies links. + * @param links The set of physical links of the ExpressRoutePort resource + * @return the next update stage + */ + Update withLinks(List links); + } + + /** + * The stage of the expressrouteport update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The name of the peering location that the ExpressRoutePort is mapped to physically + * @return the next update stage + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressrouteport update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the ExpressRoutePort resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePorts.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePorts.java new file mode 100644 index 0000000000000..5897641dc955f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePorts.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRoutePortsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRoutePorts. + */ +public interface ExpressRoutePorts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsEncapsulation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsEncapsulation.java new file mode 100644 index 0000000000000..d78bec83f2933 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsEncapsulation.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePortsEncapsulation. + */ +public final class ExpressRoutePortsEncapsulation extends ExpandableStringEnum { + /** Static value Dot1Q for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation DOT1Q = fromString("Dot1Q"); + + /** Static value QinQ for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation QINQ = fromString("QinQ"); + + /** + * Creates or finds a ExpressRoutePortsEncapsulation from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePortsEncapsulation + */ + @JsonCreator + public static ExpressRoutePortsEncapsulation fromString(String name) { + return fromString(name, ExpressRoutePortsEncapsulation.class); + } + + /** + * @return known ExpressRoutePortsEncapsulation values + */ + public static Collection values() { + return values(ExpressRoutePortsEncapsulation.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocation.java new file mode 100644 index 0000000000000..bd729cd66658e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocation.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRoutePortsLocationInner; + +/** + * Type representing ExpressRoutePortsLocation. + */ +public interface ExpressRoutePortsLocation extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the address value. + */ + String address(); + + /** + * @return the availableBandwidths value. + */ + List availableBandwidths(); + + /** + * @return the contact value. + */ + String contact(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocationBandwidths.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocationBandwidths.java new file mode 100644 index 0000000000000..facfe80501ec3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocationBandwidths.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoutePorts Location Bandwidths. + * Real-time inventory of available ExpressRoute port bandwidths. + */ +public class ExpressRoutePortsLocationBandwidths { + /** + * Bandwidth descriptive name. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /** + * Bandwidth value in Gbps. + */ + @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer valueInGbps; + + /** + * Get bandwidth descriptive name. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Get bandwidth value in Gbps. + * + * @return the valueInGbps value + */ + public Integer valueInGbps() { + return this.valueInGbps; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocations.java new file mode 100644 index 0000000000000..7e7a356edab8e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRoutePortsLocations.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRoutePortsLocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRoutePortsLocations. + */ +public interface ExpressRoutePortsLocations extends SupportsListing, HasInner { + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String locationName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProvider.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProvider.java new file mode 100644 index 0000000000000..87e054174309e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProvider.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteServiceProviderInner; + +/** + * Type representing ExpressRouteServiceProvider. + */ +public interface ExpressRouteServiceProvider extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bandwidthsOffered value. + */ + List bandwidthsOffered(); + + /** + * @return the peeringLocations value. + */ + List peeringLocations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviderBandwidthsOffered.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviderBandwidthsOffered.java new file mode 100644 index 0000000000000..d15caa267f142 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviderBandwidthsOffered.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + */ +public class ExpressRouteServiceProviderBandwidthsOffered { + /** + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /** + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the OfferName. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Set the OfferName. + * + * @param offerName the offerName value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { + this.offerName = offerName; + return this; + } + + /** + * Get the ValueInMbps. + * + * @return the valueInMbps value + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviders.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviders.java new file mode 100644 index 0000000000000..6ac667f203b75 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ExpressRouteServiceProviders.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteServiceProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteServiceProviders. + */ +public interface ExpressRouteServiceProviders extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogInformation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogInformation.java new file mode 100644 index 0000000000000..4e310ab0e8f2f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogInformation.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.FlowLogInformationInner; + +/** + * Type representing FlowLogInformation. + */ +public interface FlowLogInformation extends HasInner, HasManager { + /** + * @return the enabled value. + */ + boolean enabled(); + + /** + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * @return the storageId value. + */ + String storageId(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogStatusParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogStatusParameters.java new file mode 100644 index 0000000000000..2e156ea431720 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FlowLogStatusParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. + */ +public class FlowLogStatusParameters { + /** + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource where getting the flow log and traffic analytics (optional) status. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource where getting the flow log and traffic analytics (optional) status. + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogStatusParameters object itself. + */ + public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FrontendIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FrontendIPConfiguration.java new file mode 100644 index 0000000000000..1261670d0335e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/FrontendIPConfiguration.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing FrontendIPConfiguration. + */ +public interface FrontendIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the zones value. + */ + List zones(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRoute.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRoute.java new file mode 100644 index 0000000000000..535bde0e5ca2d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRoute.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gateway routing details. + */ +public class GatewayRoute { + /** + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /** + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /** + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /** + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /** + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the route's network prefix. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Get the route's next hop. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the peer this route was learned from. + * + * @return the sourcePeer value + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the source this route was learned from. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the route's AS path sequence. + * + * @return the asPath value + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the route's weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRouteListResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRouteListResult.java new file mode 100644 index 0000000000000..7df8005228a6e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GatewayRouteListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.GatewayRouteListResultInner; +import java.util.List; + +/** + * Type representing GatewayRouteListResult. + */ +public interface GatewayRouteListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GetVpnSitesConfigurationRequest.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GetVpnSitesConfigurationRequest.java new file mode 100644 index 0000000000000..8be297a2d7de8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/GetVpnSitesConfigurationRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of Vpn-Sites. + */ +public class GetVpnSitesConfigurationRequest { + /** + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /** + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** + * Get list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Set list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @param vpnSites the vpnSites value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { + this.vpnSites = vpnSites; + return this; + } + + /** + * Get the sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the sas-url to download the configurations for vpn-sites. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPConfiguration.java new file mode 100644 index 0000000000000..5a129fc0f0d92 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HTTP configuration of the connectivity check. + */ +public class HTTPConfiguration { + /** + * HTTP method. Possible values include: 'Get'. + */ + @JsonProperty(value = "method") + private HTTPMethod method; + + /** + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** + * Get hTTP method. Possible values include: 'Get'. + * + * @return the method value + */ + public HTTPMethod method() { + return this.method; + } + + /** + * Set hTTP method. Possible values include: 'Get'. + * + * @param method the method value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withMethod(HTTPMethod method) { + this.method = method; + return this; + } + + /** + * Get list of HTTP headers. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set list of HTTP headers. + * + * @param headers the headers value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get valid status codes. + * + * @return the validStatusCodes value + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set valid status codes. + * + * @param validStatusCodes the validStatusCodes value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withValidStatusCodes(List validStatusCodes) { + this.validStatusCodes = validStatusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPHeader.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPHeader.java new file mode 100644 index 0000000000000..9d111cd3f3a39 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPHeader.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the HTTP header. + */ +public class HTTPHeader { + /** + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value in HTTP header. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name in HTTP header. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name in HTTP header. + * + * @param name the name value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value in HTTP header. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value in HTTP header. + * + * @param value the value value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPMethod.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPMethod.java new file mode 100644 index 0000000000000..373484deff762 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HTTPMethod.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HTTPMethod. + */ +public final class HTTPMethod extends ExpandableStringEnum { + /** Static value Get for HTTPMethod. */ + public static final HTTPMethod GET = fromString("Get"); + + /** + * Creates or finds a HTTPMethod from its string representation. + * @param name a name to look for + * @return the corresponding HTTPMethod + */ + @JsonCreator + public static HTTPMethod fromString(String name) { + return fromString(name, HTTPMethod.class); + } + + /** + * @return known HTTPMethod values + */ + public static Collection values() { + return values(HTTPMethod.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnection.java new file mode 100644 index 0000000000000..1d04213fb979a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnection.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing HubVirtualNetworkConnection. + */ +public interface HubVirtualNetworkConnection extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnectionStatus.java new file mode 100644 index 0000000000000..4400a32efe249 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HubVirtualNetworkConnectionStatus. + */ +public final class HubVirtualNetworkConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubVirtualNetworkConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding HubVirtualNetworkConnectionStatus + */ + @JsonCreator + public static HubVirtualNetworkConnectionStatus fromString(String name) { + return fromString(name, HubVirtualNetworkConnectionStatus.class); + } + + /** + * @return known HubVirtualNetworkConnectionStatus values + */ + public static Collection values() { + return values(HubVirtualNetworkConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnections.java new file mode 100644 index 0000000000000..69f8375bc627b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/HubVirtualNetworkConnections.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.HubVirtualNetworkConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HubVirtualNetworkConnections. + */ +public interface HubVirtualNetworkConnections extends HasInner { + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualHubName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAddressAvailabilityResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAddressAvailabilityResult.java new file mode 100644 index 0000000000000..65726d711cf3f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAddressAvailabilityResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.IPAddressAvailabilityResultInner; +import java.util.List; + +/** + * Type representing IPAddressAvailabilityResult. + */ +public interface IPAddressAvailabilityResult extends HasInner, HasManager { + /** + * @return the available value. + */ + Boolean available(); + + /** + * @return the availableIPAddresses value. + */ + List availableIPAddresses(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAllocationMethod.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAllocationMethod.java new file mode 100644 index 0000000000000..a2d5ee74c612a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPAllocationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPAllocationMethod. + */ +public final class IPAllocationMethod extends ExpandableStringEnum { + /** Static value Static for IPAllocationMethod. */ + public static final IPAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IPAllocationMethod. */ + public static final IPAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IPAllocationMethod from its string representation. + * @param name a name to look for + * @return the corresponding IPAllocationMethod + */ + @JsonCreator + public static IPAllocationMethod fromString(String name) { + return fromString(name, IPAllocationMethod.class); + } + + /** + * @return known IPAllocationMethod values + */ + public static Collection values() { + return values(IPAllocationMethod.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfiguration.java new file mode 100644 index 0000000000000..cd823f1d75c9a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PublicIPAddressInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration. + */ +@JsonFlatten +public class IPConfiguration extends SubResource { + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfigurationProfile.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfigurationProfile.java new file mode 100644 index 0000000000000..ae6727a1b2c26 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPConfigurationProfile.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration profile child resource. + */ +@JsonFlatten +public class IPConfigurationProfile extends SubResource { + /** + * The reference of the subnet resource to create a contatainer network + * interface ip configruation. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the reference of the subnet resource to create a contatainer network interface ip configruation. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource to create a contatainer network interface ip configruation. + * + * @param subnet the subnet value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. This name can be used to access the resource. + * + * @param name the name value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPVersion.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPVersion.java new file mode 100644 index 0000000000000..46a1aa26280c7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IPVersion.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPVersion. + */ +public final class IPVersion extends ExpandableStringEnum { + /** Static value IPv4 for IPVersion. */ + public static final IPVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IPVersion. */ + public static final IPVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IPVersion from its string representation. + * @param name a name to look for + * @return the corresponding IPVersion + */ + @JsonCreator + public static IPVersion fromString(String name) { + return fromString(name, IPVersion.class); + } + + /** + * @return known IPVersion values + */ + public static Collection values() { + return values(IPVersion.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeEncryption.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeEncryption.java new file mode 100644 index 0000000000000..dd6663485cdf4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeEncryption.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeEncryption. + */ +public final class IkeEncryption extends ExpandableStringEnum { + /** Static value DES for IkeEncryption. */ + public static final IkeEncryption DES = fromString("DES"); + + /** Static value DES3 for IkeEncryption. */ + public static final IkeEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IkeEncryption. */ + public static final IkeEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IkeEncryption. */ + public static final IkeEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IkeEncryption. */ + public static final IkeEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES256 for IkeEncryption. */ + public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeEncryption. */ + public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IkeEncryption + */ + @JsonCreator + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** + * @return known IkeEncryption values + */ + public static Collection values() { + return values(IkeEncryption.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeIntegrity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeIntegrity.java new file mode 100644 index 0000000000000..eb48cc4a82c69 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IkeIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeIntegrity. + */ +public final class IkeIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IkeIntegrity. */ + public static final IkeIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IkeIntegrity. */ + public static final IkeIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IkeIntegrity. */ + public static final IkeIntegrity SHA256 = fromString("SHA256"); + + /** Static value SHA384 for IkeIntegrity. */ + public static final IkeIntegrity SHA384 = fromString("SHA384"); + + /** Static value GCMAES256 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IkeIntegrity + */ + @JsonCreator + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** + * @return known IkeIntegrity values + */ + public static Collection values() { + return values(IkeIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatPool.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatPool.java new file mode 100644 index 0000000000000..4a776a13bfb10 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatPool.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT pool of the load balancer. + */ +@JsonFlatten +public class InboundNatPool extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. + * Acceptable values range between 1 and 65534. + */ + @JsonProperty(value = "properties.frontendPortRangeStart", required = true) + private int frontendPortRangeStart; + + /** + * The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable + * values range between 1 and 65535. + */ + @JsonProperty(value = "properties.frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "properties.backendPort", required = true) + private int backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @return the frontendPortRangeStart value + */ + public int frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeStart(int frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @return the frontendPortRangeEnd value + */ + public int frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeEnd(int frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @return the backendPort value + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRule.java new file mode 100644 index 0000000000000..76a0a2090a5d1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRule.java @@ -0,0 +1,398 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing InboundNatRule. + */ +public interface InboundNatRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backendIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the InboundNatRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLoadBalancer, DefinitionStages.WithCreate { + } + + /** + * Grouping of InboundNatRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InboundNatRule definition. + */ + interface Blank extends WithLoadBalancer { + } + + /** + * The stage of the inboundnatrule definition allowing to specify LoadBalancer. + */ + interface WithLoadBalancer { + /** + * Specifies resourceGroupName, loadBalancerName. + * @param resourceGroupName The name of the resource group + * @param loadBalancerName The name of the load balancer + * @return the next definition stage + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + + /** + * The stage of the inboundnatrule definition allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535 + * @return the next definition stage + */ + WithCreate withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @param enableFloatingIP Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint + * @return the next definition stage + */ + WithCreate withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule definition allowing to specify EnableTcpReset. + */ + interface WithEnableTcpReset { + /** + * Specifies enableTcpReset. + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP + * @return the next definition stage + */ + WithCreate withEnableTcpReset(Boolean enableTcpReset); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @param frontendIPConfiguration A reference to frontend IP addresses + * @return the next definition stage + */ + WithCreate withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534 + * @return the next definition stage + */ + WithCreate withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the inboundnatrule definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP + * @return the next definition stage + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Possible values include: 'Udp', 'Tcp', 'All' + * @return the next definition stage + */ + WithCreate withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBackendPort, DefinitionStages.WithEnableFloatingIP, DefinitionStages.WithEnableTcpReset, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfiguration, DefinitionStages.WithFrontendPort, DefinitionStages.WithId, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithName, DefinitionStages.WithProtocol, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a InboundNatRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBackendPort, UpdateStages.WithEnableFloatingIP, UpdateStages.WithEnableTcpReset, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfiguration, UpdateStages.WithFrontendPort, UpdateStages.WithId, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithName, UpdateStages.WithProtocol, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of InboundNatRule update stages. + */ + interface UpdateStages { + /** + * The stage of the inboundnatrule update allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535 + * @return the next update stage + */ + Update withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @param enableFloatingIP Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint + * @return the next update stage + */ + Update withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableTcpReset. + */ + interface WithEnableTcpReset { + /** + * Specifies enableTcpReset. + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP + * @return the next update stage + */ + Update withEnableTcpReset(Boolean enableTcpReset); + } + + /** + * The stage of the inboundnatrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @param frontendIPConfiguration A reference to frontend IP addresses + * @return the next update stage + */ + Update withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534 + * @return the next update stage + */ + Update withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the inboundnatrule update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the inboundnatrule update allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Possible values include: 'Udp', 'Tcp', 'All' + * @return the next update stage + */ + Update withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRules.java new file mode 100644 index 0000000000000..8376615b23f8f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InboundNatRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.InboundNatRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InboundNatRules. + */ +public interface InboundNatRules extends SupportsCreating, HasInner { + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoint.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoint.java new file mode 100644 index 0000000000000..5083d9c1518d9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoint.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.InterfaceEndpointInner; + +/** + * Type representing InterfaceEndpoint. + */ +public interface InterfaceEndpoint extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpointService value. + */ + EndpointService endpointService(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the fqdn value. + */ + String fqdn(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the owner value. + */ + String owner(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * The entirety of the InterfaceEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of InterfaceEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InterfaceEndpoint definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the InterfaceEndpoint definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the interfaceendpoint definition allowing to specify EndpointService. + */ + interface WithEndpointService { + /** + * Specifies endpointService. + * @param endpointService A reference to the service being brought into the virtual network + * @return the next definition stage + */ + WithCreate withEndpointService(EndpointService endpointService); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Fqdn. + */ + interface WithFqdn { + /** + * Specifies fqdn. + * @param fqdn A first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint + * @return the next definition stage + */ + WithCreate withFqdn(String fqdn); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet The ID of the subnet from which the private IP will be allocated + * @return the next definition stage + */ + WithCreate withSubnet(SubnetInner subnet); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEndpointService, DefinitionStages.WithEtag, DefinitionStages.WithFqdn, DefinitionStages.WithSubnet { + } + } + /** + * The template for a InterfaceEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEndpointService, UpdateStages.WithEtag, UpdateStages.WithFqdn, UpdateStages.WithSubnet { + } + + /** + * Grouping of InterfaceEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the interfaceendpoint update allowing to specify EndpointService. + */ + interface WithEndpointService { + /** + * Specifies endpointService. + * @param endpointService A reference to the service being brought into the virtual network + * @return the next update stage + */ + Update withEndpointService(EndpointService endpointService); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Fqdn. + */ + interface WithFqdn { + /** + * Specifies fqdn. + * @param fqdn A first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint + * @return the next update stage + */ + Update withFqdn(String fqdn); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet The ID of the subnet from which the private IP will be allocated + * @return the next update stage + */ + Update withSubnet(SubnetInner subnet); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoints.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoints.java new file mode 100644 index 0000000000000..8be473893f30c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/InterfaceEndpoints.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.InterfaceEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InterfaceEndpoints. + */ +public interface InterfaceEndpoints extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpFlowProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpFlowProtocol.java new file mode 100644 index 0000000000000..30baab1304796 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpFlowProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpFlowProtocol. + */ +public final class IpFlowProtocol extends ExpandableStringEnum { + /** Static value TCP for IpFlowProtocol. */ + public static final IpFlowProtocol TCP = fromString("TCP"); + + /** Static value UDP for IpFlowProtocol. */ + public static final IpFlowProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * @param name a name to look for + * @return the corresponding IpFlowProtocol + */ + @JsonCreator + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** + * @return known IpFlowProtocol values + */ + public static Collection values() { + return values(IpFlowProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpTag.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpTag.java new file mode 100644 index 0000000000000..95658a89aaeba --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpTag.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IpTag associated with the object. + */ +public class IpTag { + /** + * Gets or sets the ipTag type: Example FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /** + * Gets or sets value of the IpTag associated with the public IP. Example + * SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get gets or sets the ipTag type: Example FirstPartyUsage. + * + * @return the ipTagType value + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set gets or sets the ipTag type: Example FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @param tag the tag value to set + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecEncryption.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecEncryption.java new file mode 100644 index 0000000000000..68e789c5694f0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecEncryption.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecEncryption. + */ +public final class IpsecEncryption extends ExpandableStringEnum { + /** Static value None for IpsecEncryption. */ + public static final IpsecEncryption NONE = fromString("None"); + + /** Static value DES for IpsecEncryption. */ + public static final IpsecEncryption DES = fromString("DES"); + + /** Static value DES3 for IpsecEncryption. */ + public static final IpsecEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IpsecEncryption. */ + public static final IpsecEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IpsecEncryption. */ + public static final IpsecEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IpsecEncryption. */ + public static final IpsecEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES128 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IpsecEncryption + */ + @JsonCreator + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** + * @return known IpsecEncryption values + */ + public static Collection values() { + return values(IpsecEncryption.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecIntegrity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecIntegrity.java new file mode 100644 index 0000000000000..fa89f96ce5609 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecIntegrity. + */ +public final class IpsecIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IpsecIntegrity. */ + public static final IpsecIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA256 = fromString("SHA256"); + + /** Static value GCMAES128 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IpsecIntegrity + */ + @JsonCreator + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** + * @return known IpsecIntegrity values + */ + public static Collection values() { + return values(IpsecIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecPolicy.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecPolicy.java new file mode 100644 index 0000000000000..2469eed573d10 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IpsecPolicy.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec Policy configuration for a virtual network gateway connection. + */ +public class IpsecPolicy { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Ipv6ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..d9fd3a0f08f29 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains IPv6 peering config. + */ +public class Ipv6ExpressRouteCircuitPeeringConfig { + /** + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private RouteFilterInner routeFilter; + + /** + * The state of peering. Possible values are: 'Disabled' and 'Enabled'. + * Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IssueType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IssueType.java new file mode 100644 index 0000000000000..3ebcfaf192b27 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/IssueType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IssueType. + */ +public final class IssueType extends ExpandableStringEnum { + /** Static value Unknown for IssueType. */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** Static value AgentStopped for IssueType. */ + public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value GuestFirewall for IssueType. */ + public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); + + /** Static value DnsResolution for IssueType. */ + public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value SocketBind for IssueType. */ + public static final IssueType SOCKET_BIND = fromString("SocketBind"); + + /** Static value NetworkSecurityRule for IssueType. */ + public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); + + /** Static value UserDefinedRoute for IssueType. */ + public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); + + /** Static value PortThrottled for IssueType. */ + public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); + + /** Static value Platform for IssueType. */ + public static final IssueType PLATFORM = fromString("Platform"); + + /** + * Creates or finds a IssueType from its string representation. + * @param name a name to look for + * @return the corresponding IssueType + */ + @JsonCreator + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * @return known IssueType values + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancer.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancer.java new file mode 100644 index 0000000000000..198b407b2d1ae --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancer.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.OutboundRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ProbeInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerInner; + +/** + * Type representing LoadBalancer. + */ +public interface LoadBalancer extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * The entirety of the LoadBalancer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LoadBalancer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LoadBalancer definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LoadBalancer definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the loadbalancer definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Collection of backend address pools used by a load balancer + * @return the next definition stage + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the loadbalancer definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Object representing the frontend IPs to be used for the load balancer + * @return the next definition stage + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer definition allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @param inboundNatPools Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next definition stage + */ + WithCreate withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer definition allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @param inboundNatRules Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next definition stage + */ + WithCreate withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning + * @return the next definition stage + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next definition stage + */ + WithCreate withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Collection of probe objects used in the load balancer + * @return the next definition stage + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the loadbalancer definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next definition stage + */ + WithCreate withSku(LoadBalancerSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithInboundNatPools, DefinitionStages.WithInboundNatRules, DefinitionStages.WithLoadBalancingRules, DefinitionStages.WithOutboundRules, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku { + } + } + /** + * The template for a LoadBalancer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBackendAddressPools, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithInboundNatPools, UpdateStages.WithInboundNatRules, UpdateStages.WithLoadBalancingRules, UpdateStages.WithOutboundRules, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSku { + } + + /** + * Grouping of LoadBalancer update stages. + */ + interface UpdateStages { + /** + * The stage of the loadbalancer update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Collection of backend address pools used by a load balancer + * @return the next update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the loadbalancer update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Object representing the frontend IPs to be used for the load balancer + * @return the next update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @param inboundNatPools Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next update stage + */ + Update withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @param inboundNatRules Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules + * @return the next update stage + */ + Update withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer update allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning + * @return the next update stage + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer update allowing to specify OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next update stage + */ + Update withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Collection of probe objects used in the load balancer + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the loadbalancer update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next update stage + */ + Update withSku(LoadBalancerSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerBackendAddressPools.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerBackendAddressPools.java new file mode 100644 index 0000000000000..af8b639f282ac --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerBackendAddressPools.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerBackendAddressPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerBackendAddressPools. + */ +public interface LoadBalancerBackendAddressPools extends HasInner { + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerFrontendIPConfigurations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerFrontendIPConfigurations.java new file mode 100644 index 0000000000000..4f9351a79e574 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerFrontendIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerFrontendIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerFrontendIPConfigurations. + */ +public interface LoadBalancerFrontendIPConfigurations extends HasInner { + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerLoadBalancingRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerLoadBalancingRules.java new file mode 100644 index 0000000000000..6bc6d12425e41 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerLoadBalancingRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerLoadBalancingRules. + */ +public interface LoadBalancerLoadBalancingRules extends HasInner { + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterface.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterface.java new file mode 100644 index 0000000000000..a7d5ed217c315 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterface.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancerNetworkInterface. + */ +public interface LoadBalancerNetworkInterface extends HasInner, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceEndpoint value. + */ + InterfaceEndpoint interfaceEndpoint(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tapConfigurations value. + */ + List tapConfigurations(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterfaces.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterfaces.java new file mode 100644 index 0000000000000..6fe9ea6a341dd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerNetworkInterfacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerNetworkInterfaces. + */ +public interface LoadBalancerNetworkInterfaces extends HasInner { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerOutboundRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerOutboundRules.java new file mode 100644 index 0000000000000..7b771f7bde92d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerOutboundRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerOutboundRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerOutboundRules. + */ +public interface LoadBalancerOutboundRules extends HasInner { + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerProbes.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerProbes.java new file mode 100644 index 0000000000000..8a8d6810554c6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerProbes.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerProbesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerProbes. + */ +public interface LoadBalancerProbes extends HasInner { + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSku.java new file mode 100644 index 0000000000000..8f632ae3bf53c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a load balancer. + */ +public class LoadBalancerSku { + /** + * Name of a load balancer SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /** + * Get name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSkuName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSkuName.java new file mode 100644 index 0000000000000..088b76c039c98 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancerSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadBalancerSkuName. + */ +public final class LoadBalancerSkuName extends ExpandableStringEnum { + /** Static value Basic for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName BASIC = fromString("Basic"); + + /** Static value Standard for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * @param name a name to look for + * @return the corresponding LoadBalancerSkuName + */ + @JsonCreator + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** + * @return known LoadBalancerSkuName values + */ + public static Collection values() { + return values(LoadBalancerSkuName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancers.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancers.java new file mode 100644 index 0000000000000..437008dc53b40 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancers.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancers. + */ +public interface LoadBalancers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancingRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancingRule.java new file mode 100644 index 0000000000000..021257051ba02 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadBalancingRule.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancingRule. + */ +public interface LoadBalancingRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the disableOutboundSnat value. + */ + Boolean disableOutboundSnat(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + int frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the probe value. + */ + SubResource probe(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadDistribution.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadDistribution.java new file mode 100644 index 0000000000000..b0ca6b8ccba10 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LoadDistribution.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadDistribution. + */ +public final class LoadDistribution extends ExpandableStringEnum { + /** Static value Default for LoadDistribution. */ + public static final LoadDistribution DEFAULT = fromString("Default"); + + /** Static value SourceIP for LoadDistribution. */ + public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); + + /** Static value SourceIPProtocol for LoadDistribution. */ + public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); + + /** + * Creates or finds a LoadDistribution from its string representation. + * @param name a name to look for + * @return the corresponding LoadDistribution + */ + @JsonCreator + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** + * @return known LoadDistribution values + */ + public static Collection values() { + return values(LoadDistribution.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateway.java new file mode 100644 index 0000000000000..a0d3938bcbf1b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateway.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LocalNetworkGatewayInner; + +/** + * Type representing LocalNetworkGateway. + */ +public interface LocalNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayIpAddress value. + */ + String gatewayIpAddress(); + + /** + * @return the localNetworkAddressSpace value. + */ + AddressSpace localNetworkAddressSpace(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the LocalNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LocalNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LocalNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LocalNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the localnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @param gatewayIpAddress IP address of local network gateway + * @return the next definition stage + */ + WithCreate withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @param localNetworkAddressSpace Local network site address space + * @return the next definition stage + */ + WithCreate withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithEtag, DefinitionStages.WithGatewayIpAddress, DefinitionStages.WithLocalNetworkAddressSpace, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a LocalNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithEtag, UpdateStages.WithGatewayIpAddress, UpdateStages.WithLocalNetworkAddressSpace, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of LocalNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the localnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway update allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @param gatewayIpAddress IP address of local network gateway + * @return the next update stage + */ + Update withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway update allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @param localNetworkAddressSpace Local network site address space + * @return the next update stage + */ + Update withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateways.java new file mode 100644 index 0000000000000..3b226a83837c1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocalNetworkGateways.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LocalNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocalNetworkGateways. + */ +public interface LocalNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegation.java new file mode 100644 index 0000000000000..f3026c0ee6539 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegation.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AvailableDelegationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing LocationAvailableDelegation. + */ +public interface LocationAvailableDelegation extends HasInner, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serviceName value. + */ + String serviceName(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegationModel.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegationModel.java new file mode 100644 index 0000000000000..411222a0d8b4f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LocationAvailableDelegationModel.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.AvailableDelegationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing LocationAvailableDelegationModel. + */ +public interface LocationAvailableDelegationModel extends HasInner, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serviceName value. + */ + String serviceName(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LogSpecification.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LogSpecification.java new file mode 100644 index 0000000000000..ece46d6e4b804 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of logging specification. + */ +public class LogSpecification { + /** + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name of the specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the specification. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the specification. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get duration of the blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the blob. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MatchedRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MatchedRule.java new file mode 100644 index 0000000000000..c5de781a86c54 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MatchedRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Matched rule. + */ +public class MatchedRule { + /** + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get name of the matched network security rule. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the matched network security rule. + * + * @param ruleName the ruleName value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @param action the action value to set + * @return the MatchedRule object itself. + */ + public MatchedRule withAction(String action) { + this.action = action; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MetricSpecification.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MetricSpecification.java new file mode 100644 index 0000000000000..62c89b208699a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/MetricSpecification.java @@ -0,0 +1,382 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of metrics specification. + */ +public class MetricSpecification { + /** + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /** + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /** + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /** + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /** + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get units the metric to be displayed in. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set units the metric to be displayed in. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregation type. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get list of availability. + * + * @return the availabilities value + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set list of availability. + * + * @param availabilities the availabilities value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set whether regional MDM account enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set whether gaps would be filled with zeros. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get pattern for the filter of the metric. + * + * @return the metricFilterPattern value + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set pattern for the filter of the metric. + * + * @param metricFilterPattern the metricFilterPattern value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get list of dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set list of dimensions. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get whether the metric is internal. + * + * @return the isInternal value + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set whether the metric is internal. + * + * @param isInternal the isInternal value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the source MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the source MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the source MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resource Id dimension name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 0000000000000..fb857ee64613d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to get network configuration diagnostic. + */ +public class NetworkConfigurationDiagnosticParameters { + /** + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. + * Possible values include: 'Normal', 'Minimum', 'Full'. + */ + @JsonProperty(value = "verbosityLevel") + private VerbosityLevel verbosityLevel; + + /** + * List of network configuration diagnostic profiles. + */ + @JsonProperty(value = "profiles", required = true) + private List profiles; + + /** + * Get the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param targetResourceId the targetResourceId value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full'. + * + * @return the verbosityLevel value + */ + public VerbosityLevel verbosityLevel() { + return this.verbosityLevel; + } + + /** + * Set verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full'. + * + * @param verbosityLevel the verbosityLevel value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withVerbosityLevel(VerbosityLevel verbosityLevel) { + this.verbosityLevel = verbosityLevel; + return this; + } + + /** + * Get list of network configuration diagnostic profiles. + * + * @return the profiles value + */ + public List profiles() { + return this.profiles; + } + + /** + * Set list of network configuration diagnostic profiles. + * + * @param profiles the profiles value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withProfiles(List profiles) { + this.profiles = profiles; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticProfile.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticProfile.java new file mode 100644 index 0000000000000..24e1d6834390c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticProfile.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to compare with network configuration. + */ +public class NetworkConfigurationDiagnosticProfile { + /** + * The direction of the traffic. Accepted values are 'Inbound' and + * 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /** + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /** + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + * Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /** + * Traffice destination port. Accepted values are '*', port (for example, + * 3389) and port range (for example, 80-100). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @param protocol the protocol value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @param source the source value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withSource(String source) { + this.source = source; + return this; + } + + /** + * Get traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value + */ + public String destination() { + return this.destination; + } + + /** + * Set traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @param destination the destination value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @return the destinationPort value + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set traffice destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @param destinationPort the destinationPort value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResponse.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..c51ff06817d8b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** + * Type representing NetworkConfigurationDiagnosticResponse. + */ +public interface NetworkConfigurationDiagnosticResponse extends HasInner, HasManager { + /** + * @return the results value. + */ + List results(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..0988304fa1e53 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + */ +public class NetworkConfigurationDiagnosticResult { + /** + * The profile property. + */ + @JsonProperty(value = "profile") + private NetworkConfigurationDiagnosticProfile profile; + + /** + * The networkSecurityGroupResult property. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the profile value. + * + * @return the profile value + */ + public NetworkConfigurationDiagnosticProfile profile() { + return this.profile; + } + + /** + * Set the profile value. + * + * @param profile the profile value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withProfile(NetworkConfigurationDiagnosticProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get the networkSecurityGroupResult value. + * + * @return the networkSecurityGroupResult value + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult value. + * + * @param networkSecurityGroupResult the networkSecurityGroupResult value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult(NetworkSecurityGroupResult networkSecurityGroupResult) { + this.networkSecurityGroupResult = networkSecurityGroupResult; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterface.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterface.java new file mode 100644 index 0000000000000..c78fce7aebf2a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterface.java @@ -0,0 +1,431 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceTapConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceInner; + +/** + * Type representing NetworkInterface. + */ +public interface NetworkInterface extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * @return the interfaceEndpoint value. + */ + InterfaceEndpoint interfaceEndpoint(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tapConfigurations value. + */ + List tapConfigurations(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + + /** + * The entirety of the NetworkInterface definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterface definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterface definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkInterface definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkinterface definition allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The DNS settings in network interface + * @return the next definition stage + */ + WithCreate withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface definition allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled + * @return the next definition stage + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface definition allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + * @param enableIPForwarding Indicates whether IP forwarding is enabled on this network interface + * @return the next definition stage + */ + WithCreate withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterface definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations A list of IPConfigurations of the network interface + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface definition allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next definition stage + */ + WithCreate withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface definition allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next definition stage + */ + WithCreate withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface definition allowing to specify TapConfigurations. + */ + interface WithTapConfigurations { + /** + * Specifies tapConfigurations. + * @param tapConfigurations A list of TapConfigurations of the network interface + * @return the next definition stage + */ + WithCreate withTapConfigurations(List tapConfigurations); + } + + /** + * The stage of the networkinterface definition allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + * @param virtualMachine The reference of a virtual machine + * @return the next definition stage + */ + WithCreate withVirtualMachine(SubResource virtualMachine); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEnableAcceleratedNetworking, DefinitionStages.WithEnableIPForwarding, DefinitionStages.WithEtag, DefinitionStages.WithIpConfigurations, DefinitionStages.WithMacAddress, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithPrimary, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithTapConfigurations, DefinitionStages.WithVirtualMachine { + } + } + /** + * The template for a NetworkInterface update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEnableAcceleratedNetworking, UpdateStages.WithEnableIPForwarding, UpdateStages.WithEtag, UpdateStages.WithIpConfigurations, UpdateStages.WithMacAddress, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithPrimary, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithTapConfigurations, UpdateStages.WithVirtualMachine { + } + + /** + * Grouping of NetworkInterface update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterface update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The DNS settings in network interface + * @return the next update stage + */ + Update withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface update allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled + * @return the next update stage + */ + Update withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface update allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + * @param enableIPForwarding Indicates whether IP forwarding is enabled on this network interface + * @return the next update stage + */ + Update withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterface update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations A list of IPConfigurations of the network interface + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface update allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next update stage + */ + Update withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface update allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next update stage + */ + Update withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface update allowing to specify TapConfigurations. + */ + interface WithTapConfigurations { + /** + * Specifies tapConfigurations. + * @param tapConfigurations A list of TapConfigurations of the network interface + * @return the next update stage + */ + Update withTapConfigurations(List tapConfigurations); + } + + /** + * The stage of the networkinterface update allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + * @param virtualMachine The reference of a virtual machine + * @return the next update stage + */ + Update withVirtualMachine(SubResource virtualMachine); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceAssociation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceAssociation.java new file mode 100644 index 0000000000000..9a84161342f8c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class NetworkInterfaceAssociation { + /** + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get network interface ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the NetworkInterfaceAssociation object itself. + */ + public NetworkInterfaceAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceDnsSettings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceDnsSettings.java new file mode 100644 index 0000000000000..efe15e39cb00a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceDnsSettings.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS settings of a network interface. + */ +public class NetworkInterfaceDnsSettings { + /** + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers") + private List appliedDnsServers; + + /** + * Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /** + * Fully qualified DNS name supporting internal communications between VMs + * in the same virtual network. + */ + @JsonProperty(value = "internalFqdn") + private String internalFqdn; + + /** + * Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by + * concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix") + private String internalDomainNameSuffix; + + /** + * Get list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @param dnsServers the dnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @return the appliedDnsServers value + */ + public List appliedDnsServers() { + return this.appliedDnsServers; + } + + /** + * Set if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @param appliedDnsServers the appliedDnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withAppliedDnsServers(List appliedDnsServers) { + this.appliedDnsServers = appliedDnsServers; + return this; + } + + /** + * Get relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @return the internalDnsNameLabel value + */ + public String internalDnsNameLabel() { + return this.internalDnsNameLabel; + } + + /** + * Set relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @param internalDnsNameLabel the internalDnsNameLabel value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { + this.internalDnsNameLabel = internalDnsNameLabel; + return this; + } + + /** + * Get fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @return the internalFqdn value + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Set fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @param internalFqdn the internalFqdn value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalFqdn(String internalFqdn) { + this.internalFqdn = internalFqdn; + return this; + } + + /** + * Get even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @return the internalDomainNameSuffix value + */ + public String internalDomainNameSuffix() { + return this.internalDomainNameSuffix; + } + + /** + * Set even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @param internalDomainNameSuffix the internalDomainNameSuffix value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDomainNameSuffix(String internalDomainNameSuffix) { + this.internalDomainNameSuffix = internalDomainNameSuffix; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceIPConfigurations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceIPConfigurations.java new file mode 100644 index 0000000000000..6ebfed3eac80e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceIPConfigurations. + */ +public interface NetworkInterfaceIPConfigurations extends HasInner { + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancer.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancer.java new file mode 100644 index 0000000000000..a62997e3fab98 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LoadBalancerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NetworkInterfaceLoadBalancer. + */ +public interface NetworkInterfaceLoadBalancer extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancers.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancers.java new file mode 100644 index 0000000000000..75ade1293fc24 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceLoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceLoadBalancers. + */ +public interface NetworkInterfaceLoadBalancers extends HasInner { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..2301256bf2835 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkInterfaceNetworkInterfaceIPConfiguration. + */ +public interface NetworkInterfaceNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfiguration.java new file mode 100644 index 0000000000000..29350cb15267a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfiguration.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceTapConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkTapInner; + +/** + * Type representing NetworkInterfaceTapConfiguration. + */ +public interface NetworkInterfaceTapConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkTap value. + */ + VirtualNetworkTap virtualNetworkTap(); + + /** + * The entirety of the NetworkInterfaceTapConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkInterface, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterfaceTapConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterfaceTapConfiguration definition. + */ + interface Blank extends WithNetworkInterface { + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify NetworkInterface. + */ + interface WithNetworkInterface { + /** + * Specifies resourceGroupName, networkInterfaceName. + * @param resourceGroupName The name of the resource group + * @param networkInterfaceName The name of the network interface + * @return the next definition stage + */ + WithCreate withExistingNetworkInterface(String resourceGroupName, String networkInterfaceName); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify VirtualNetworkTap. + */ + interface WithVirtualNetworkTap { + /** + * Specifies virtualNetworkTap. + * @param virtualNetworkTap The reference of the Virtual Network Tap resource + * @return the next definition stage + */ + WithCreate withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithVirtualNetworkTap { + } + } + /** + * The template for a NetworkInterfaceTapConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithVirtualNetworkTap { + } + + /** + * Grouping of NetworkInterfaceTapConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify VirtualNetworkTap. + */ + interface WithVirtualNetworkTap { + /** + * Specifies virtualNetworkTap. + * @param virtualNetworkTap The reference of the Virtual Network Tap resource + * @return the next update stage + */ + Update withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfigurations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfigurations.java new file mode 100644 index 0000000000000..7a118665cfb36 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaceTapConfigurations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceTapConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceTapConfigurations. + */ +public interface NetworkInterfaceTapConfigurations extends SupportsCreating, HasInner { + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaces.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaces.java new file mode 100644 index 0000000000000..370b8471f8603 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkInterfaces.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterface; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +/** + * Type representing NetworkInterfaces. + */ +public interface NetworkInterfaces { + /** + * Begins definition for a new NetworkInterface resource. + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank defineNetworkInterface(String name); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkOperationStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkOperationStatus.java new file mode 100644 index 0000000000000..59a8fc3599c65 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkOperationStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkOperationStatus. + */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkOperationStatus + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** + * @return known NetworkOperationStatus values + */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfile.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfile.java new file mode 100644 index 0000000000000..ac365241468cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfile.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkProfileInner; + +/** + * Type representing NetworkProfile. + */ +public interface NetworkProfile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containerNetworkInterfaceConfigurations value. + */ + List containerNetworkInterfaceConfigurations(); + + /** + * @return the containerNetworkInterfaces value. + */ + List containerNetworkInterfaces(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the NetworkProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkProfile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkProfile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkprofile definition allowing to specify ContainerNetworkInterfaceConfigurations. + */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies containerNetworkInterfaceConfigurations. + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations + * @return the next definition stage + */ + WithCreate withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations); + } + + /** + * The stage of the networkprofile definition allowing to specify ContainerNetworkInterfaces. + */ + interface WithContainerNetworkInterfaces { + /** + * Specifies containerNetworkInterfaces. + * @param containerNetworkInterfaces List of child container network interfaces + * @return the next definition stage + */ + WithCreate withContainerNetworkInterfaces(List containerNetworkInterfaces); + } + + /** + * The stage of the networkprofile definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithContainerNetworkInterfaceConfigurations, DefinitionStages.WithContainerNetworkInterfaces, DefinitionStages.WithEtag { + } + } + /** + * The template for a NetworkProfile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithContainerNetworkInterfaceConfigurations, UpdateStages.WithContainerNetworkInterfaces, UpdateStages.WithEtag { + } + + /** + * Grouping of NetworkProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the networkprofile update allowing to specify ContainerNetworkInterfaceConfigurations. + */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies containerNetworkInterfaceConfigurations. + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations + * @return the next update stage + */ + Update withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations); + } + + /** + * The stage of the networkprofile update allowing to specify ContainerNetworkInterfaces. + */ + interface WithContainerNetworkInterfaces { + /** + * Specifies containerNetworkInterfaces. + * @param containerNetworkInterfaces List of child container network interfaces + * @return the next update stage + */ + Update withContainerNetworkInterfaces(List containerNetworkInterfaces); + } + + /** + * The stage of the networkprofile update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfiles.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfiles.java new file mode 100644 index 0000000000000..9d27a669cc0f4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkProfiles.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkProfiles. + */ +public interface NetworkProfiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..e6cd33dfa69a7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroup.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroup. + */ +public interface NetworkSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the defaultSecurityRules value. + */ + List defaultSecurityRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the securityRules value. + */ + List securityRules(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the NetworkSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networksecuritygroup definition allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next definition stage + */ + WithCreate withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next definition stage + */ + WithCreate withSecurityRules(List securityRules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDefaultSecurityRules, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSecurityRules { + } + } + /** + * The template for a NetworkSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDefaultSecurityRules, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSecurityRules { + } + + /** + * Grouping of NetworkSecurityGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroup update allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next update stage + */ + Update withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup update allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next update stage + */ + Update withSecurityRules(List securityRules); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..4986a5e69c716 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupResult.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded provided traffic query. + */ +public class NetworkSecurityGroupResult { + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /** + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** + * Get the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the securityRuleAccessResult value + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get list of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRule.java new file mode 100644 index 0000000000000..21f35fb1b1748 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRule.java @@ -0,0 +1,590 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroupSecurityRule. + */ +public interface NetworkSecurityGroupSecurityRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * The entirety of the NetworkSecurityGroupSecurityRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithAccess, DefinitionStages.WithDirection, DefinitionStages.WithProtocol, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroupSecurityRule definition. + */ + interface Blank extends WithNetworkSecurityGroup { + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies resourceGroupName, networkSecurityGroupName. + * @param resourceGroupName The name of the resource group + * @param networkSecurityGroupName The name of the network security group + * @return the next definition stage + */ + WithAccess withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithDirection withAccess(SecurityRuleAccess access); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound' + * @return the next definition stage + */ + WithProtocol withDirection(SecurityRuleDirection direction); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + * @return the next definition stage + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used + * @return the next definition stage + */ + WithCreate withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next definition stage + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next definition stage + */ + WithCreate withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next definition stage + */ + WithCreate withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next definition stage + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule + * @return the next definition stage + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @param sourceAddressPrefix The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from + * @return the next definition stage + */ + WithCreate withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next definition stage + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next definition stage + */ + WithCreate withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next definition stage + */ + WithCreate withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next definition stage + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDestinationAddressPrefix, DefinitionStages.WithDestinationAddressPrefixes, DefinitionStages.WithDestinationApplicationSecurityGroups, DefinitionStages.WithDestinationPortRange, DefinitionStages.WithDestinationPortRanges, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPriority, DefinitionStages.WithProvisioningState, DefinitionStages.WithSourceAddressPrefix, DefinitionStages.WithSourceAddressPrefixes, DefinitionStages.WithSourceApplicationSecurityGroups, DefinitionStages.WithSourcePortRange, DefinitionStages.WithSourcePortRanges { + } + } + /** + * The template for a NetworkSecurityGroupSecurityRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDestinationAddressPrefix, UpdateStages.WithDestinationAddressPrefixes, UpdateStages.WithDestinationApplicationSecurityGroups, UpdateStages.WithDestinationPortRange, UpdateStages.WithDestinationPortRanges, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithProvisioningState, UpdateStages.WithSourceAddressPrefix, UpdateStages.WithSourceAddressPrefixes, UpdateStages.WithSourceApplicationSecurityGroups, UpdateStages.WithSourcePortRange, UpdateStages.WithSourcePortRanges { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used + * @return the next update stage + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next update stage + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next update stage + */ + Update withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next update stage + */ + Update withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next update stage + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule + * @return the next update stage + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @param sourceAddressPrefix The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from + * @return the next update stage + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next update stage + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next update stage + */ + Update withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports + * @return the next update stage + */ + Update withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next update stage + */ + Update withSourcePortRanges(List sourcePortRanges); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRuleModel.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRuleModel.java new file mode 100644 index 0000000000000..e9bdd8f7e24b8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroupSecurityRuleModel.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkSecurityGroupSecurityRuleModel. + */ +public interface NetworkSecurityGroupSecurityRuleModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroups.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroups.java new file mode 100644 index 0000000000000..5ea0ffc63ab85 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkSecurityGroups. + */ +public interface NetworkSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityRulesEvaluationResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 0000000000000..c94145e8c2f45 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network security rules evaluation result. + */ +public class NetworkSecurityRulesEvaluationResult { + /** + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /** + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /** + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /** + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /** + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get name of the network security rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network security rule. + * + * @param name the name value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get value indicating whether protocol is matched. + * + * @return the protocolMatched value + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set value indicating whether protocol is matched. + * + * @param protocolMatched the protocolMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { + this.protocolMatched = protocolMatched; + return this; + } + + /** + * Get value indicating whether source is matched. + * + * @return the sourceMatched value + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set value indicating whether source is matched. + * + * @param sourceMatched the sourceMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { + this.sourceMatched = sourceMatched; + return this; + } + + /** + * Get value indicating whether source port is matched. + * + * @return the sourcePortMatched value + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set value indicating whether source port is matched. + * + * @param sourcePortMatched the sourcePortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { + this.sourcePortMatched = sourcePortMatched; + return this; + } + + /** + * Get value indicating whether destination is matched. + * + * @return the destinationMatched value + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set value indicating whether destination is matched. + * + * @param destinationMatched the destinationMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { + this.destinationMatched = destinationMatched; + return this; + } + + /** + * Get value indicating whether destination port is matched. + * + * @return the destinationPortMatched value + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set value indicating whether destination port is matched. + * + * @param destinationPortMatched the destinationPortMatched value to set + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { + this.destinationPortMatched = destinationPortMatched; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatcher.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatcher.java new file mode 100644 index 0000000000000..f4d6edff51324 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatcher.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkWatcherInner; + +/** + * Type representing NetworkWatcher. + */ +public interface NetworkWatcher extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the NetworkWatcher definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkWatcher definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkWatcher definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkWatcher definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkwatcher definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag { + } + } + /** + * The template for a NetworkWatcher update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag { + } + + /** + * Grouping of NetworkWatcher update stages. + */ + interface UpdateStages { + /** + * The stage of the networkwatcher update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatchers.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatchers.java new file mode 100644 index 0000000000000..3b5701bffe36b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NetworkWatchers.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.FlowLogInformationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkWatchersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkWatchers. + */ +public interface NetworkWatchers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopParameters.java new file mode 100644 index 0000000000000..f1df7bd400429 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source and destination endpoint. + */ +public class NextHopParameters { + /** + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIPAddress; + + /** + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the resource identifier of the target resource against which the action is to be performed. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the resource identifier of the target resource against which the action is to be performed. + * + * @param targetResourceId the targetResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the source IP address. + * + * @return the sourceIPAddress value + */ + public String sourceIPAddress() { + return this.sourceIPAddress; + } + + /** + * Set the source IP address. + * + * @param sourceIPAddress the sourceIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withSourceIPAddress(String sourceIPAddress) { + this.sourceIPAddress = sourceIPAddress; + return this; + } + + /** + * Get the destination IP address. + * + * @return the destinationIPAddress value + */ + public String destinationIPAddress() { + return this.destinationIPAddress; + } + + /** + * Set the destination IP address. + * + * @param destinationIPAddress the destinationIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withDestinationIPAddress(String destinationIPAddress) { + this.destinationIPAddress = destinationIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopResult.java new file mode 100644 index 0000000000000..deebb9af13875 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NextHopResultInner; + +/** + * Type representing NextHopResult. + */ +public interface NextHopResult extends HasInner, HasManager { + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * @return the routeTableId value. + */ + String routeTableId(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopType.java new file mode 100644 index 0000000000000..f2de3ccc8a85b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/NextHopType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NextHopType. + */ +public final class NextHopType extends ExpandableStringEnum { + /** Static value Internet for NextHopType. */ + public static final NextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for NextHopType. */ + public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value VirtualNetworkGateway for NextHopType. */ + public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for NextHopType. */ + public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value HyperNetGateway for NextHopType. */ + public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); + + /** Static value None for NextHopType. */ + public static final NextHopType NONE = fromString("None"); + + /** + * Creates or finds a NextHopType from its string representation. + * @param name a name to look for + * @return the corresponding NextHopType + */ + @JsonCreator + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** + * @return known NextHopType values + */ + public static Collection values() { + return values(NextHopType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OfficeTrafficCategory.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OfficeTrafficCategory.java new file mode 100644 index 0000000000000..83220e9ea3b90 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OfficeTrafficCategory.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OfficeTrafficCategory. + */ +public final class OfficeTrafficCategory extends ExpandableStringEnum { + /** Static value Optimize for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE = fromString("Optimize"); + + /** Static value OptimizeAndAllow for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE_AND_ALLOW = fromString("OptimizeAndAllow"); + + /** Static value All for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory ALL = fromString("All"); + + /** Static value None for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory NONE = fromString("None"); + + /** + * Creates or finds a OfficeTrafficCategory from its string representation. + * @param name a name to look for + * @return the corresponding OfficeTrafficCategory + */ + @JsonCreator + public static OfficeTrafficCategory fromString(String name) { + return fromString(name, OfficeTrafficCategory.class); + } + + /** + * @return known OfficeTrafficCategory values + */ + public static Collection values() { + return values(OfficeTrafficCategory.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operation.java new file mode 100644 index 0000000000000..95ba486642ef6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationDisplay.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationDisplay.java new file mode 100644 index 0000000000000..6de5d8d5bbb71 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Network. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Network. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of the operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of the operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationPropertiesFormatServiceSpecification.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 0000000000000..534a6b2ec690a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specification of the service. + */ +public class OperationPropertiesFormatServiceSpecification { + /** + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get operation service specification. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set operation service specification. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get operation log specification. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set operation log specification. + * + * @param logSpecifications the logSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operations.java new file mode 100644 index 0000000000000..50fd529ac85b4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Origin.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Origin.java new file mode 100644 index 0000000000000..b1dbca3257e74 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Origin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Origin. + */ +public final class Origin extends ExpandableStringEnum { + /** Static value Local for Origin. */ + public static final Origin LOCAL = fromString("Local"); + + /** Static value Inbound for Origin. */ + public static final Origin INBOUND = fromString("Inbound"); + + /** Static value Outbound for Origin. */ + public static final Origin OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Origin from its string representation. + * @param name a name to look for + * @return the corresponding Origin + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * @return known Origin values + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OutboundRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OutboundRule.java new file mode 100644 index 0000000000000..4f8cfe2e1970d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/OutboundRule.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.OutboundRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing OutboundRule. + */ +public interface OutboundRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allocatedOutboundPorts value. + */ + Integer allocatedOutboundPorts(); + + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + String protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnGateway.java new file mode 100644 index 0000000000000..fecb58bdfd47d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnGateway.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.P2SVpnGatewayInner; + +/** + * Type representing P2SVpnGateway. + */ +public interface P2SVpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the p2SVpnServerConfiguration value. + */ + SubResource p2SVpnServerConfiguration(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * @return the vpnClientAddressPool value. + */ + AddressSpace vpnClientAddressPool(); + + /** + * @return the vpnClientConnectionHealth value. + */ + VpnClientConnectionHealth vpnClientConnectionHealth(); + + /** + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * The entirety of the P2SVpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of P2SVpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a P2SVpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the P2SVpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the p2svpngateway definition allowing to specify P2SVpnServerConfiguration. + */ + interface WithP2SVpnServerConfiguration { + /** + * Specifies p2SVpnServerConfiguration. + * @param p2SVpnServerConfiguration The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration); + } + + /** + * The stage of the p2svpngateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the p2svpngateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next definition stage + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the p2svpngateway definition allowing to specify VpnClientAddressPool. + */ + interface WithVpnClientAddressPool { + /** + * Specifies vpnClientAddressPool. + * @param vpnClientAddressPool The reference of the address space resource which represents Address space for P2S VpnClient + * @return the next definition stage + */ + WithCreate withVpnClientAddressPool(AddressSpace vpnClientAddressPool); + } + + /** + * The stage of the p2svpngateway definition allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this p2s vpn gateway + * @return the next definition stage + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithP2SVpnServerConfiguration, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub, DefinitionStages.WithVpnClientAddressPool, DefinitionStages.WithVpnGatewayScaleUnit { + } + } + /** + * The template for a P2SVpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithP2SVpnServerConfiguration, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub, UpdateStages.WithVpnClientAddressPool, UpdateStages.WithVpnGatewayScaleUnit { + } + + /** + * Grouping of P2SVpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the p2svpngateway update allowing to specify P2SVpnServerConfiguration. + */ + interface WithP2SVpnServerConfiguration { + /** + * Specifies p2SVpnServerConfiguration. + * @param p2SVpnServerConfiguration The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to + * @return the next update stage + */ + Update withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration); + } + + /** + * The stage of the p2svpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the p2svpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next update stage + */ + Update withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the p2svpngateway update allowing to specify VpnClientAddressPool. + */ + interface WithVpnClientAddressPool { + /** + * Specifies vpnClientAddressPool. + * @param vpnClientAddressPool The reference of the address space resource which represents Address space for P2S VpnClient + * @return the next update stage + */ + Update withVpnClientAddressPool(AddressSpace vpnClientAddressPool); + } + + /** + * The stage of the p2svpngateway update allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this p2s vpn gateway + * @return the next update stage + */ + Update withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnProfileParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnProfileParameters.java new file mode 100644 index 0000000000000..c2641309bc877 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnProfileParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class P2SVpnProfileParameters { + /** + * VPN client Authentication Method. Possible values are: 'EAPTLS' and + * 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the P2SVpnProfileParameters object itself. + */ + public P2SVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusClientRootCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusClientRootCertificate.java new file mode 100644 index 0000000000000..5991eb98bb2fa --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Radius client root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigRadiusClientRootCertificate extends SubResource { + /** + * The Radius client root certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the Radius client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the Radius client root certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Radius client root certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the Radius client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusServerRootCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusServerRootCertificate.java new file mode 100644 index 0000000000000..182642794f505 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigRadiusServerRootCertificate.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Radius Server root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigRadiusServerRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the P2SVpnServerConfiguration Radius Server + * root certificate resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration Radius Server root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRevokedCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..3819e77c2ad2d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigVpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRootCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRootCertificate.java new file mode 100644 index 0000000000000..cb8da1484cbe2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfigVpnClientRootCertificate.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigVpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the P2SVpnServerConfiguration VPN client root + * certificate resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfiguration.java new file mode 100644 index 0000000000000..6345ca2e0808d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2SVpnServerConfiguration.java @@ -0,0 +1,438 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.P2SVpnServerConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing P2SVpnServerConfiguration. + */ +public interface P2SVpnServerConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the p2SVpnGateways value. + */ + List p2SVpnGateways(); + + /** + * @return the p2SVpnServerConfigRadiusClientRootCertificates value. + */ + List p2SVpnServerConfigRadiusClientRootCertificates(); + + /** + * @return the p2SVpnServerConfigRadiusServerRootCertificates value. + */ + List p2SVpnServerConfigRadiusServerRootCertificates(); + + /** + * @return the p2SVpnServerConfigurationPropertiesEtag value. + */ + String p2SVpnServerConfigurationPropertiesEtag(); + + /** + * @return the p2SVpnServerConfigurationPropertiesName value. + */ + String p2SVpnServerConfigurationPropertiesName(); + + /** + * @return the p2SVpnServerConfigVpnClientRevokedCertificates value. + */ + List p2SVpnServerConfigVpnClientRevokedCertificates(); + + /** + * @return the p2SVpnServerConfigVpnClientRootCertificates value. + */ + List p2SVpnServerConfigVpnClientRootCertificates(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the radiusServerAddress value. + */ + String radiusServerAddress(); + + /** + * @return the radiusServerSecret value. + */ + String radiusServerSecret(); + + /** + * @return the vpnClientIpsecPolicies value. + */ + List vpnClientIpsecPolicies(); + + /** + * @return the vpnProtocols value. + */ + List vpnProtocols(); + + /** + * The entirety of the P2SVpnServerConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualWan, DefinitionStages.WithCreate { + } + + /** + * Grouping of P2SVpnServerConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a P2SVpnServerConfiguration definition. + */ + interface Blank extends WithVirtualWan { + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies resourceGroupName, virtualWanName. + * @param resourceGroupName The resource group name of the VirtualWan + * @param virtualWanName The name of the VirtualWan + * @return the next definition stage + */ + WithCreate withExistingVirtualWan(String resourceGroupName, String virtualWanName); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigRadiusClientRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusClientRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusClientRootCertificates. + * @param p2SVpnServerConfigRadiusClientRootCertificates Radius client root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigRadiusServerRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusServerRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusServerRootCertificates. + * @param p2SVpnServerConfigRadiusServerRootCertificates Radius Server root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigurationPropertiesEtag. + */ + interface WithP2SVpnServerConfigurationPropertiesEtag { + /** + * Specifies p2SVpnServerConfigurationPropertiesEtag. + * @param p2SVpnServerConfigurationPropertiesEtag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigurationPropertiesName. + */ + interface WithP2SVpnServerConfigurationPropertiesName { + /** + * Specifies p2SVpnServerConfigurationPropertiesName. + * @param p2SVpnServerConfigurationPropertiesName The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigVpnClientRevokedCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRevokedCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRevokedCertificates. + * @param p2SVpnServerConfigVpnClientRevokedCertificates VPN client revoked certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigVpnClientRootCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRootCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRootCertificates. + * @param p2SVpnServerConfigVpnClientRootCertificates VPN client root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify RadiusServerAddress. + */ + interface WithRadiusServerAddress { + /** + * Specifies radiusServerAddress. + * @param radiusServerAddress The radius server address property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next definition stage + */ + WithCreate withRadiusServerAddress(String radiusServerAddress); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify RadiusServerSecret. + */ + interface WithRadiusServerSecret { + /** + * Specifies radiusServerSecret. + * @param radiusServerSecret The radius secret property of the P2SVpnServerConfiguration resource for for point to site client connection + * @return the next definition stage + */ + WithCreate withRadiusServerSecret(String radiusServerSecret); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VpnClientIpsecPolicies. + */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies vpnClientIpsecPolicies. + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VpnProtocols. + */ + interface WithVpnProtocols { + /** + * Specifies vpnProtocols. + * @param vpnProtocols vpnProtocols for the P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withVpnProtocols(List vpnProtocols); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithP2SVpnServerConfigRadiusClientRootCertificates, DefinitionStages.WithP2SVpnServerConfigRadiusServerRootCertificates, DefinitionStages.WithP2SVpnServerConfigurationPropertiesEtag, DefinitionStages.WithP2SVpnServerConfigurationPropertiesName, DefinitionStages.WithP2SVpnServerConfigVpnClientRevokedCertificates, DefinitionStages.WithP2SVpnServerConfigVpnClientRootCertificates, DefinitionStages.WithRadiusServerAddress, DefinitionStages.WithRadiusServerSecret, DefinitionStages.WithVpnClientIpsecPolicies, DefinitionStages.WithVpnProtocols { + } + } + /** + * The template for a P2SVpnServerConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithP2SVpnServerConfigRadiusClientRootCertificates, UpdateStages.WithP2SVpnServerConfigRadiusServerRootCertificates, UpdateStages.WithP2SVpnServerConfigurationPropertiesEtag, UpdateStages.WithP2SVpnServerConfigurationPropertiesName, UpdateStages.WithP2SVpnServerConfigVpnClientRevokedCertificates, UpdateStages.WithP2SVpnServerConfigVpnClientRootCertificates, UpdateStages.WithRadiusServerAddress, UpdateStages.WithRadiusServerSecret, UpdateStages.WithVpnClientIpsecPolicies, UpdateStages.WithVpnProtocols { + } + + /** + * Grouping of P2SVpnServerConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the p2svpnserverconfiguration update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigRadiusClientRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusClientRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusClientRootCertificates. + * @param p2SVpnServerConfigRadiusClientRootCertificates Radius client root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigRadiusServerRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusServerRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusServerRootCertificates. + * @param p2SVpnServerConfigRadiusServerRootCertificates Radius Server root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigurationPropertiesEtag. + */ + interface WithP2SVpnServerConfigurationPropertiesEtag { + /** + * Specifies p2SVpnServerConfigurationPropertiesEtag. + * @param p2SVpnServerConfigurationPropertiesEtag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigurationPropertiesName. + */ + interface WithP2SVpnServerConfigurationPropertiesName { + /** + * Specifies p2SVpnServerConfigurationPropertiesName. + * @param p2SVpnServerConfigurationPropertiesName The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name + * @return the next update stage + */ + Update withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigVpnClientRevokedCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRevokedCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRevokedCertificates. + * @param p2SVpnServerConfigVpnClientRevokedCertificates VPN client revoked certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigVpnClientRootCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRootCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRootCertificates. + * @param p2SVpnServerConfigVpnClientRootCertificates VPN client root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify RadiusServerAddress. + */ + interface WithRadiusServerAddress { + /** + * Specifies radiusServerAddress. + * @param radiusServerAddress The radius server address property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next update stage + */ + Update withRadiusServerAddress(String radiusServerAddress); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify RadiusServerSecret. + */ + interface WithRadiusServerSecret { + /** + * Specifies radiusServerSecret. + * @param radiusServerSecret The radius secret property of the P2SVpnServerConfiguration resource for for point to site client connection + * @return the next update stage + */ + Update withRadiusServerSecret(String radiusServerSecret); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify VpnClientIpsecPolicies. + */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies vpnClientIpsecPolicies. + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for P2SVpnServerConfiguration + * @return the next update stage + */ + Update withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify VpnProtocols. + */ + interface WithVpnProtocols { + /** + * Specifies vpnProtocols. + * @param vpnProtocols vpnProtocols for the P2SVpnServerConfiguration + * @return the next update stage + */ + Update withVpnProtocols(List vpnProtocols); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnGateways.java new file mode 100644 index 0000000000000..d03cc1e67ac98 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnGateways.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.P2sVpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing P2sVpnGateways. + */ +public interface P2sVpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnServerConfigurations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnServerConfigurations.java new file mode 100644 index 0000000000000..65f1553d0a57a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/P2sVpnServerConfigurations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.P2sVpnServerConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing P2sVpnServerConfigurations. + */ +public interface P2sVpnServerConfigurations extends SupportsCreating, HasInner { + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName); + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureFilter.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureFilter.java new file mode 100644 index 0000000000000..c14dcc70d06e7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureFilter.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + */ +public class PacketCaptureFilter { + /** + * Protocol to be filtered on. Possible values include: 'TCP', 'UDP', + * 'Any'. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIPAddress; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIPAddress; + + /** + * Local port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /** + * Remote port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** + * Get protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @return the protocol value + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @param protocol the protocol value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localIPAddress the localIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localPort the localPort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remotePort the remotePort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureParameters.java new file mode 100644 index 0000000000000..841d2f78c457d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureParameters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the create packet capture operation. + */ +public class PacketCaptureParameters { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureQueryStatusResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureQueryStatusResult.java new file mode 100644 index 0000000000000..3f9f7ec887182 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureQueryStatusResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PacketCaptureQueryStatusResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PacketCaptureQueryStatusResult. + */ +public interface PacketCaptureQueryStatusResult extends HasInner, HasManager { + /** + * @return the captureStartTime value. + */ + DateTime captureStartTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * @return the stopReason value. + */ + String stopReason(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureResult.java new file mode 100644 index 0000000000000..d90114c70be73 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureResult.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PacketCaptureResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing PacketCaptureResult. + */ +public interface PacketCaptureResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the bytesToCapturePerPacket value. + */ + Integer bytesToCapturePerPacket(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the filters value. + */ + List filters(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * @return the totalBytesPerSession value. + */ + Integer totalBytesPerSession(); + + /** + * The entirety of the PacketCaptureResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithStorageLocation, DefinitionStages.WithTarget, DefinitionStages.WithCreate { + } + + /** + * Grouping of PacketCaptureResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PacketCaptureResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the packetcaptureresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + * @param resourceGroupName The name of the resource group + * @param networkWatcherName The name of the network watcher + * @return the next definition stage + */ + WithStorageLocation withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify StorageLocation. + */ + interface WithStorageLocation { + /** + * Specifies storageLocation. + * @param storageLocation the storageLocation parameter value + * @return the next definition stage + */ + WithTarget withStorageLocation(PacketCaptureStorageLocation storageLocation); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Target. + */ + interface WithTarget { + /** + * Specifies target. + * @param target The ID of the targeted resource, only VM is currently supported + * @return the next definition stage + */ + WithCreate withTarget(String target); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next definition stage + */ + WithCreate withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters the filters parameter value + * @return the next definition stage + */ + WithCreate withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next definition stage + */ + WithCreate withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next definition stage + */ + WithCreate withTotalBytesPerSession(Integer totalBytesPerSession); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBytesToCapturePerPacket, DefinitionStages.WithFilters, DefinitionStages.WithTimeLimitInSeconds, DefinitionStages.WithTotalBytesPerSession { + } + } + /** + * The template for a PacketCaptureResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBytesToCapturePerPacket, UpdateStages.WithFilters, UpdateStages.WithTimeLimitInSeconds, UpdateStages.WithTotalBytesPerSession { + } + + /** + * Grouping of PacketCaptureResult update stages. + */ + interface UpdateStages { + /** + * The stage of the packetcaptureresult update allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next update stage + */ + Update withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult update allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters the filters parameter value + * @return the next update stage + */ + Update withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next update stage + */ + Update withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next update stage + */ + Update withTotalBytesPerSession(Integer totalBytesPerSession); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureStorageLocation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureStorageLocation.java new file mode 100644 index 0000000000000..110334ad305aa --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptureStorageLocation.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the storage location for a packet capture session. + */ +public class PacketCaptureStorageLocation { + /** + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /** + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /** + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @param storageId the storageId value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @param filePath the filePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptures.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptures.java new file mode 100644 index 0000000000000..6e0b949e110a3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PacketCaptures.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PacketCapturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PacketCaptures. + */ +public interface PacketCaptures extends SupportsCreating, HasInner { + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilter.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilter.java new file mode 100644 index 0000000000000..18220b4fa3f86 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilter.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitPeeringInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +public class PatchRouteFilter extends SubResource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilterRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilterRule.java new file mode 100644 index 0000000000000..042bf50376d84 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PatchRouteFilterRule.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class PatchRouteFilterRule extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of PatchRouteFilterRule class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public PatchRouteFilterRule() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcError.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcError.java new file mode 100644 index 0000000000000..74769a45be2fb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcError.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcError. + */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates or finds a PcError from its string representation. + * @param name a name to look for + * @return the corresponding PcError + */ + @JsonCreator + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** + * @return known PcError values + */ + public static Collection values() { + return values(PcError.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcProtocol.java new file mode 100644 index 0000000000000..082763b5ae67c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcProtocol. + */ +public final class PcProtocol extends ExpandableStringEnum { + /** Static value TCP for PcProtocol. */ + public static final PcProtocol TCP = fromString("TCP"); + + /** Static value UDP for PcProtocol. */ + public static final PcProtocol UDP = fromString("UDP"); + + /** Static value Any for PcProtocol. */ + public static final PcProtocol ANY = fromString("Any"); + + /** + * Creates or finds a PcProtocol from its string representation. + * @param name a name to look for + * @return the corresponding PcProtocol + */ + @JsonCreator + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** + * @return known PcProtocol values + */ + public static Collection values() { + return values(PcProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcStatus.java new file mode 100644 index 0000000000000..4a2afd19b7c6b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PcStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcStatus. + */ +public final class PcStatus extends ExpandableStringEnum { + /** Static value NotStarted for PcStatus. */ + public static final PcStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PcStatus. */ + public static final PcStatus RUNNING = fromString("Running"); + + /** Static value Stopped for PcStatus. */ + public static final PcStatus STOPPED = fromString("Stopped"); + + /** Static value Error for PcStatus. */ + public static final PcStatus ERROR = fromString("Error"); + + /** Static value Unknown for PcStatus. */ + public static final PcStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PcStatus from its string representation. + * @param name a name to look for + * @return the corresponding PcStatus + */ + @JsonCreator + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** + * @return known PcStatus values + */ + public static Collection values() { + return values(PcStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PfsGroup.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PfsGroup.java new file mode 100644 index 0000000000000..08eafbaac4f45 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PfsGroup.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PfsGroup. + */ +public final class PfsGroup extends ExpandableStringEnum { + /** Static value None for PfsGroup. */ + public static final PfsGroup NONE = fromString("None"); + + /** Static value PFS1 for PfsGroup. */ + public static final PfsGroup PFS1 = fromString("PFS1"); + + /** Static value PFS2 for PfsGroup. */ + public static final PfsGroup PFS2 = fromString("PFS2"); + + /** Static value PFS2048 for PfsGroup. */ + public static final PfsGroup PFS2048 = fromString("PFS2048"); + + /** Static value ECP256 for PfsGroup. */ + public static final PfsGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for PfsGroup. */ + public static final PfsGroup ECP384 = fromString("ECP384"); + + /** Static value PFS24 for PfsGroup. */ + public static final PfsGroup PFS24 = fromString("PFS24"); + + /** Static value PFS14 for PfsGroup. */ + public static final PfsGroup PFS14 = fromString("PFS14"); + + /** Static value PFSMM for PfsGroup. */ + public static final PfsGroup PFSMM = fromString("PFSMM"); + + /** + * Creates or finds a PfsGroup from its string representation. + * @param name a name to look for + * @return the corresponding PfsGroup + */ + @JsonCreator + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** + * @return known PfsGroup values + */ + public static Collection values() { + return values(PfsGroup.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Probe.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Probe.java new file mode 100644 index 0000000000000..763c36ff6a0b5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Probe.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ProbeInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing Probe. + */ +public interface Probe extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the intervalInSeconds value. + */ + Integer intervalInSeconds(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the numberOfProbes value. + */ + Integer numberOfProbes(); + + /** + * @return the port value. + */ + int port(); + + /** + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the requestPath value. + */ + String requestPath(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProbeProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProbeProtocol.java new file mode 100644 index 0000000000000..c54c7e898574b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProbeProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProbeProtocol. + */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value Http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("Http"); + + /** Static value Tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("Tcp"); + + /** Static value Https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ProbeProtocol + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** + * @return known ProbeProtocol values + */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProcessorArchitecture.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProcessorArchitecture.java new file mode 100644 index 0000000000000..f2526f427d62c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProcessorArchitecture.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProcessorArchitecture. + */ +public final class ProcessorArchitecture extends ExpandableStringEnum { + /** Static value Amd64 for ProcessorArchitecture. */ + public static final ProcessorArchitecture AMD64 = fromString("Amd64"); + + /** Static value X86 for ProcessorArchitecture. */ + public static final ProcessorArchitecture X86 = fromString("X86"); + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * @param name a name to look for + * @return the corresponding ProcessorArchitecture + */ + @JsonCreator + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** + * @return known ProcessorArchitecture values + */ + public static Collection values() { + return values(ProcessorArchitecture.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Protocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Protocol.java new file mode 100644 index 0000000000000..613a8ef82719e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Protocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Protocol. + */ +public final class Protocol extends ExpandableStringEnum { + /** Static value Tcp for Protocol. */ + public static final Protocol TCP = fromString("Tcp"); + + /** Static value Http for Protocol. */ + public static final Protocol HTTP = fromString("Http"); + + /** Static value Https for Protocol. */ + public static final Protocol HTTPS = fromString("Https"); + + /** Static value Icmp for Protocol. */ + public static final Protocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a Protocol from its string representation. + * @param name a name to look for + * @return the corresponding Protocol + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * @return known Protocol values + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProtocolConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProtocolConfiguration.java new file mode 100644 index 0000000000000..6924a448c812b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProtocolConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration of the protocol. + */ +public class ProtocolConfiguration { + /** + * The hTTPConfiguration property. + */ + @JsonProperty(value = "HTTPConfiguration") + private HTTPConfiguration hTTPConfiguration; + + /** + * Get the hTTPConfiguration value. + * + * @return the hTTPConfiguration value + */ + public HTTPConfiguration hTTPConfiguration() { + return this.hTTPConfiguration; + } + + /** + * Set the hTTPConfiguration value. + * + * @param hTTPConfiguration the hTTPConfiguration value to set + * @return the ProtocolConfiguration object itself. + */ + public ProtocolConfiguration withHTTPConfiguration(HTTPConfiguration hTTPConfiguration) { + this.hTTPConfiguration = hTTPConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProvisioningState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProvisioningState.java new file mode 100644 index 0000000000000..7262fee9ce1ae --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddress.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddress.java new file mode 100644 index 0000000000000..77b41c177c4a1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddress.java @@ -0,0 +1,423 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PublicIPAddressInner; + +/** + * Type representing PublicIPAddress. + */ +public interface PublicIPAddress extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + PublicIPAddressDnsSettings dnsSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the ipConfiguration value. + */ + IPConfiguration ipConfiguration(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the publicIPAllocationMethod value. + */ + IPAllocationMethod publicIPAllocationMethod(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPAddressSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPAddress definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPAddress definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPAddress definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPAddress definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipaddress definition allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The FQDN of the DNS record associated with the public IP address + * @return the next definition stage + */ + WithCreate withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipaddress definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the public IP address + * @return the next definition stage + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress definition allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address associated with the public IP address resource + * @return the next definition stage + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress definition allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP address + * @return the next definition stage + */ + WithCreate withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @return the next definition stage + */ + WithCreate withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @param publicIPPrefix The Public IP Prefix this Public IP Address should be allocated from + * @return the next definition stage + */ + WithCreate withPublicIPPrefix(SubResource publicIPPrefix); + } + + /** + * The stage of the publicipaddress definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP address SKU + * @return the next definition stage + */ + WithCreate withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEtag, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithIpAddress, DefinitionStages.WithIpTags, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithPublicIPAllocationMethod, DefinitionStages.WithPublicIPPrefix, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPAddress update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEtag, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithIpAddress, UpdateStages.WithIpTags, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithPublicIPAllocationMethod, UpdateStages.WithPublicIPPrefix, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPAddress update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipaddress update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The FQDN of the DNS record associated with the public IP address + * @return the next update stage + */ + Update withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipaddress update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the public IP address + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address associated with the public IP address resource + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP address + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @return the next update stage + */ + Update withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @param publicIPPrefix The Public IP Prefix this Public IP Address should be allocated from + * @return the next update stage + */ + Update withPublicIPPrefix(SubResource publicIPPrefix); + } + + /** + * The stage of the publicipaddress update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP address SKU + * @return the next update stage + */ + Update withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressDnsSettings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressDnsSettings.java new file mode 100644 index 0000000000000..900b492c1bf6f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressDnsSettings.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains FQDN of the DNS record associated with the public IP address. + */ +public class PublicIPAddressDnsSettings { + /** + * Gets or sets the Domain name label.The concatenation of the domain name + * label and the regionalized DNS zone make up the fully qualified domain + * name associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /** + * Gets the FQDN, Fully qualified domain name of the A DNS record + * associated with the public IP. This is the concatenation of the + * domainNameLabel and the regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain + * name that resolves to this public IP address. If the reverseFqdn is + * specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** + * Get gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @return the domainNameLabel value + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @param domainNameLabel the domainNameLabel value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSku.java new file mode 100644 index 0000000000000..34248c3de032e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP address. + */ +public class PublicIPAddressSku { + /** + * Name of a public IP address SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPAddressSkuName name; + + /** + * Get name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public PublicIPAddressSkuName name() { + return this.name; + } + + /** + * Set name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the PublicIPAddressSku object itself. + */ + public PublicIPAddressSku withName(PublicIPAddressSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSkuName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSkuName.java new file mode 100644 index 0000000000000..27cf9d75ba2fb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddressSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicIPAddressSkuName. + */ +public final class PublicIPAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIPAddressSkuName from its string representation. + * @param name a name to look for + * @return the corresponding PublicIPAddressSkuName + */ + @JsonCreator + public static PublicIPAddressSkuName fromString(String name) { + return fromString(name, PublicIPAddressSkuName.class); + } + + /** + * @return known PublicIPAddressSkuName values + */ + public static Collection values() { + return values(PublicIPAddressSkuName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddresses.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddresses.java new file mode 100644 index 0000000000000..4a024f23ee0ed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPAddresses.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PublicIPAddressesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPAddresses. + */ +public interface PublicIPAddresses extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefix.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefix.java new file mode 100644 index 0000000000000..7c542dae9a19f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefix.java @@ -0,0 +1,359 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PublicIPPrefixInner; + +/** + * Type representing PublicIPPrefix. + */ +public interface PublicIPPrefix extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipPrefix value. + */ + String ipPrefix(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the prefixLength value. + */ + Integer prefixLength(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddresses value. + */ + List publicIPAddresses(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPPrefixSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPPrefix definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPPrefix definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPPrefix definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPPrefix definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipprefix definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next definition stage + */ + WithCreate withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP prefix + * @return the next definition stage + */ + WithCreate withIpTags(List ipTags); + } + + /** + * The stage of the publicipprefix definition allowing to specify PrefixLength. + */ + interface WithPrefixLength { + /** + * Specifies prefixLength. + * @param prefixLength The Length of the Public IP Prefix + * @return the next definition stage + */ + WithCreate withPrefixLength(Integer prefixLength); + } + + /** + * The stage of the publicipprefix definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next definition stage + */ + WithCreate withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP prefix SKU + * @return the next definition stage + */ + WithCreate withSku(PublicIPPrefixSku sku); + } + + /** + * The stage of the publicipprefix definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithIpPrefix, DefinitionStages.WithIpTags, DefinitionStages.WithPrefixLength, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddresses, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPPrefix update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithIpPrefix, UpdateStages.WithIpTags, UpdateStages.WithPrefixLength, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddresses, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPPrefix update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipprefix update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipprefix update allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next update stage + */ + Update withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP prefix + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipprefix update allowing to specify PrefixLength. + */ + interface WithPrefixLength { + /** + * Specifies prefixLength. + * @param prefixLength The Length of the Public IP Prefix + * @return the next update stage + */ + Update withPrefixLength(Integer prefixLength); + } + + /** + * The stage of the publicipprefix update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next update stage + */ + Update withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP prefix SKU + * @return the next update stage + */ + Update withSku(PublicIPPrefixSku sku); + } + + /** + * The stage of the publicipprefix update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSku.java new file mode 100644 index 0000000000000..01467c39008de --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP prefix. + */ +public class PublicIPPrefixSku { + /** + * Name of a public IP prefix SKU. Possible values include: 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPPrefixSkuName name; + + /** + * Get name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @return the name value + */ + public PublicIPPrefixSkuName name() { + return this.name; + } + + /** + * Set name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @param name the name value to set + * @return the PublicIPPrefixSku object itself. + */ + public PublicIPPrefixSku withName(PublicIPPrefixSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSkuName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSkuName.java new file mode 100644 index 0000000000000..f8a661fbf8dd0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixSkuName.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicIPPrefixSkuName. + */ +public final class PublicIPPrefixSkuName extends ExpandableStringEnum { + /** Static value Standard for PublicIPPrefixSkuName. */ + public static final PublicIPPrefixSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIPPrefixSkuName from its string representation. + * @param name a name to look for + * @return the corresponding PublicIPPrefixSkuName + */ + @JsonCreator + public static PublicIPPrefixSkuName fromString(String name) { + return fromString(name, PublicIPPrefixSkuName.class); + } + + /** + * @return known PublicIPPrefixSkuName values + */ + public static Collection values() { + return values(PublicIPPrefixSkuName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixes.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixes.java new file mode 100644 index 0000000000000..3b998e53f607e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/PublicIPPrefixes.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.PublicIPPrefixesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPPrefixes. + */ +public interface PublicIPPrefixes extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/QueryTroubleshootingParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/QueryTroubleshootingParameters.java new file mode 100644 index 0000000000000..d2834e3c61b2d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/QueryTroubleshootingParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the resource to query the troubleshooting result. + */ +public class QueryTroubleshootingParameters { + /** + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource ID to query the troubleshooting result. + * + * @param targetResourceId the targetResourceId value to set + * @return the QueryTroubleshootingParameters object itself. + */ + public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ReferencedPublicIpAddress.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ReferencedPublicIpAddress.java new file mode 100644 index 0000000000000..05560d8fbdfc2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ReferencedPublicIpAddress.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ReferencedPublicIpAddress model. + */ +public class ReferencedPublicIpAddress { + /** + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the PublicIPAddress Reference. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the PublicIPAddress Reference. + * + * @param id the id value to set + * @return the ReferencedPublicIpAddress object itself. + */ + public ReferencedPublicIpAddress withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ResourceNavigationLink.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ResourceNavigationLink.java new file mode 100644 index 0000000000000..1d1510a941658 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ResourceNavigationLink.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ResourceNavigationLink resource. + */ +@JsonFlatten +public class ResourceNavigationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ResourceNavigationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ResourceNavigationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RetentionPolicyParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RetentionPolicyParameters.java new file mode 100644 index 0000000000000..2dbc1470e8213 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RetentionPolicyParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the retention policy for flow log. + */ +public class RetentionPolicyParameters { + /** + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get number of days to retain flow log records. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set number of days to retain flow log records. + * + * @param days the days value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get flag to enable/disable retention. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable retention. + * + * @param enabled the enabled value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Route.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Route.java new file mode 100644 index 0000000000000..e2e9885559fa3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Route.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing Route. + */ +public interface Route extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the Route definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteTable, DefinitionStages.WithNextHopType, DefinitionStages.WithCreate { + } + + /** + * Grouping of Route definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Route definition. + */ + interface Blank extends WithRouteTable { + } + + /** + * The stage of the route definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies resourceGroupName, routeTableName. + * @param resourceGroupName The name of the resource group + * @param routeTableName The name of the route table + * @return the next definition stage + */ + WithNextHopType withExistingRouteTable(String resourceGroupName, String routeTableName); + } + + /** + * The stage of the route definition allowing to specify NextHopType. + */ + interface WithNextHopType { + /** + * Specifies nextHopType. + * @param nextHopType The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + * @return the next definition stage + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + + /** + * The stage of the route definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The destination CIDR to which the route applies + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the route definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the route definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the route definition allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance + * @return the next definition stage + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNextHopIpAddress, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a Route update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNextHopIpAddress, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of Route update stages. + */ + interface UpdateStages { + /** + * The stage of the route update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The destination CIDR to which the route applies + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the route update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the route update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the route update allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance + * @return the next update stage + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilter.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilter.java new file mode 100644 index 0000000000000..3b6b7f5cfc765 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilter.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterInner; + +/** + * Type representing RouteFilter. + */ +public interface RouteFilter extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rules value. + */ + List rules(); + + /** + * The entirety of the RouteFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilter definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteFilter definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routefilter definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the routefilter definition allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next definition stage + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithPeerings, DefinitionStages.WithRules { + } + } + /** + * The template for a RouteFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithPeerings, UpdateStages.WithRules { + } + + /** + * Grouping of RouteFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilter update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the routefilter update allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next update stage + */ + Update withRules(List rules); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRule.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRule.java new file mode 100644 index 0000000000000..416f0cfa21069 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRule.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing RouteFilterRule. + */ +public interface RouteFilterRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the communities value. + */ + List communities(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilterRuleType value. + */ + String routeFilterRuleType(); + + /** + * The entirety of the RouteFilterRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteFilter, DefinitionStages.WithAccess, DefinitionStages.WithCommunities, DefinitionStages.WithRouteFilterRuleType, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilterRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilterRule definition. + */ + interface Blank extends WithRouteFilter { + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies resourceGroupName, routeFilterName. + * @param resourceGroupName The name of the resource group + * @param routeFilterName The name of the route filter + * @return the next definition stage + */ + WithAccess withExistingRouteFilter(String resourceGroupName, String routeFilterName); + } + + /** + * The stage of the routefilterrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithCommunities withAccess(Access access); + } + + /** + * The stage of the routefilterrule definition allowing to specify Communities. + */ + interface WithCommunities { + /** + * Specifies communities. + * @param communities The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020'] + * @return the next definition stage + */ + WithRouteFilterRuleType withCommunities(List communities); + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilterRuleType. + */ + interface WithRouteFilterRuleType { + /** + * Specifies routeFilterRuleType. + * @param routeFilterRuleType The rule type of the rule. Valid value is: 'Community' + * @return the next definition stage + */ + WithCreate withRouteFilterRuleType(String routeFilterRuleType); + } + + /** + * The stage of the routefilterrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the routefilterrule definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the routefilterrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a RouteFilterRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId { + } + + /** + * Grouping of RouteFilterRule update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilterrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRules.java new file mode 100644 index 0000000000000..5ba27036e5692 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilterRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFilterRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilterRules. + */ +public interface RouteFilterRules extends SupportsCreating, HasInner { + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilters.java new file mode 100644 index 0000000000000..e848b472a8018 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteFilters.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilters. + */ +public interface RouteFilters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteNextHopType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteNextHopType.java new file mode 100644 index 0000000000000..f0e7df3f7d700 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteNextHopType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RouteNextHopType. + */ +public final class RouteNextHopType extends ExpandableStringEnum { + /** Static value VirtualNetworkGateway for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for RouteNextHopType. */ + public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value Internet for RouteNextHopType. */ + public static final RouteNextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value None for RouteNextHopType. */ + public static final RouteNextHopType NONE = fromString("None"); + + /** + * Creates or finds a RouteNextHopType from its string representation. + * @param name a name to look for + * @return the corresponding RouteNextHopType + */ + @JsonCreator + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** + * @return known RouteNextHopType values + */ + public static Collection values() { + return values(RouteNextHopType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTable.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTable.java new file mode 100644 index 0000000000000..bb26aa47f58ed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTable.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteTableInner; + +/** + * Type representing RouteTable. + */ +public interface RouteTable extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableBgpRoutePropagation value. + */ + Boolean disableBgpRoutePropagation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routes value. + */ + List routes(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the RouteTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteTable definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteTable definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routetable definition allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next definition stage + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the routetable definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable definition allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next definition stage + */ + WithCreate withRoutes(List routes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableBgpRoutePropagation, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithRoutes { + } + } + /** + * The template for a RouteTable update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableBgpRoutePropagation, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithRoutes { + } + + /** + * Grouping of RouteTable update stages. + */ + interface UpdateStages { + /** + * The stage of the routetable update allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next update stage + */ + Update withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the routetable update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable update allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next update stage + */ + Update withRoutes(List routes); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTables.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTables.java new file mode 100644 index 0000000000000..cf86323fa55b4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/RouteTables.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteTablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteTables. + */ +public interface RouteTables extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Routes.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Routes.java new file mode 100644 index 0000000000000..b907554f8f223 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Routes.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RoutesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Routes. + */ +public interface Routes extends SupportsCreating, HasInner { + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String routeTableName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupNetworkInterface.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupNetworkInterface.java new file mode 100644 index 0000000000000..4171dac95340b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupNetworkInterface.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and all its associated security rules. + */ +public class SecurityGroupNetworkInterface { + /** + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The securityRuleAssociations property. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get iD of the network interface. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the network interface. + * + * @param id the id value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withId(String id) { + this.id = id; + return this; + } + + /** + * Get the securityRuleAssociations value. + * + * @return the securityRuleAssociations value + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set the securityRuleAssociations value. + * + * @param securityRuleAssociations the securityRuleAssociations value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withSecurityRuleAssociations(SecurityRuleAssociations securityRuleAssociations) { + this.securityRuleAssociations = securityRuleAssociations; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewParameters.java new file mode 100644 index 0000000000000..9c887e3ba15e5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the VM to check security groups for. + */ +public class SecurityGroupViewParameters { + /** + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get iD of the target VM. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set iD of the target VM. + * + * @param targetResourceId the targetResourceId value to set + * @return the SecurityGroupViewParameters object itself. + */ + public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..f7ce22093e920 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityGroupViewResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityGroupViewResultInner; +import java.util.List; + +/** + * Type representing SecurityGroupViewResult. + */ +public interface SecurityGroupViewResult extends HasInner, HasManager { + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAccess.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAccess.java new file mode 100644 index 0000000000000..dda991a57c37c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAccess.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleAccess. + */ +public final class SecurityRuleAccess extends ExpandableStringEnum { + /** Static value Allow for SecurityRuleAccess. */ + public static final SecurityRuleAccess ALLOW = fromString("Allow"); + + /** Static value Deny for SecurityRuleAccess. */ + public static final SecurityRuleAccess DENY = fromString("Deny"); + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleAccess + */ + @JsonCreator + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** + * @return known SecurityRuleAccess values + */ + public static Collection values() { + return values(SecurityRuleAccess.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAssociations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAssociations.java new file mode 100644 index 0000000000000..b8ec03b040de9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleAssociations.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * All security rules associated with the network interface. + */ +public class SecurityRuleAssociations { + /** + * The networkInterfaceAssociation property. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /** + * The subnetAssociation property. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /** + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /** + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get the networkInterfaceAssociation value. + * + * @return the networkInterfaceAssociation value + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set the networkInterfaceAssociation value. + * + * @param networkInterfaceAssociation the networkInterfaceAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withNetworkInterfaceAssociation(NetworkInterfaceAssociation networkInterfaceAssociation) { + this.networkInterfaceAssociation = networkInterfaceAssociation; + return this; + } + + /** + * Get the subnetAssociation value. + * + * @return the subnetAssociation value + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set the subnetAssociation value. + * + * @param subnetAssociation the subnetAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { + this.subnetAssociation = subnetAssociation; + return this; + } + + /** + * Get collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set collection of default security rules of the network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleDirection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleDirection.java new file mode 100644 index 0000000000000..6208a70af92be --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleDirection.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleDirection. + */ +public final class SecurityRuleDirection extends ExpandableStringEnum { + /** Static value Inbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleDirection + */ + @JsonCreator + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** + * @return known SecurityRuleDirection values + */ + public static Collection values() { + return values(SecurityRuleDirection.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleProtocol.java new file mode 100644 index 0000000000000..3dd6e880b080f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleProtocol. + */ +public final class SecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value * for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ASTERISK = fromString("*"); + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleProtocol + */ + @JsonCreator + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** + * @return known SecurityRuleProtocol values + */ + public static Collection values() { + return values(SecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRules.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRules.java new file mode 100644 index 0000000000000..2ed9dbc7e5280 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SecurityRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SecurityRules. + */ +public interface SecurityRules extends SupportsCreating, HasInner { + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceAssociationLink.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceAssociationLink.java new file mode 100644 index 0000000000000..d3e575654d6b8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceAssociationLink.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ServiceAssociationLink resource. + */ +@JsonFlatten +public class ServiceAssociationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ServiceAssociationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ServiceAssociationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicies.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..a695905fce6e6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicies.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicies. + */ +public interface ServiceEndpointPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicy.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicy.java new file mode 100644 index 0000000000000..d5a4bc807011d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicy.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing ServiceEndpointPolicy. + */ +public interface ServiceEndpointPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the serviceEndpointPolicyDefinitions value. + */ + List serviceEndpointPolicyDefinitions(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the ServiceEndpointPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ServiceEndpointPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the service endpoint policy + * @return the next definition stage + */ + WithCreate withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithServiceEndpointPolicyDefinitions { + } + } + /** + * The template for a ServiceEndpointPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithServiceEndpointPolicyDefinitions { + } + + /** + * Grouping of ServiceEndpointPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicy update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy update allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the service endpoint policy + * @return the next update stage + */ + Update withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinition.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinition.java new file mode 100644 index 0000000000000..82377419cf6f5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing ServiceEndpointPolicyDefinition. + */ +public interface ServiceEndpointPolicyDefinition extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the service value. + */ + String service(); + + /** + * @return the serviceResources value. + */ + List serviceResources(); + + /** + * The entirety of the ServiceEndpointPolicyDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServiceEndpointPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicyDefinition definition. + */ + interface Blank extends WithServiceEndpointPolicy { + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ServiceEndpointPolicy. + */ + interface WithServiceEndpointPolicy { + /** + * Specifies resourceGroupName, serviceEndpointPolicyName. + * @param resourceGroupName The name of the resource group + * @param serviceEndpointPolicyName The name of the service endpoint policy + * @return the next definition stage + */ + WithCreate withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies service. + * @param service service endpoint name + * @return the next definition stage + */ + WithCreate withService(String service); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ServiceResources. + */ + interface WithServiceResources { + /** + * Specifies serviceResources. + * @param serviceResources A list of service resources + * @return the next definition stage + */ + WithCreate withServiceResources(List serviceResources); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithService, DefinitionStages.WithServiceResources { + } + } + /** + * The template for a ServiceEndpointPolicyDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithService, UpdateStages.WithServiceResources { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Service. + */ + interface WithService { + /** + * Specifies service. + * @param service service endpoint name + * @return the next update stage + */ + Update withService(String service); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify ServiceResources. + */ + interface WithServiceResources { + /** + * Specifies serviceResources. + * @param serviceResources A list of service resources + * @return the next update stage + */ + Update withServiceResources(List serviceResources); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinitions.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinitions.java new file mode 100644 index 0000000000000..6cab8d3ff8546 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinitions.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPolicyDefinitionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicyDefinitions. + */ +public interface ServiceEndpointPolicyDefinitions extends SupportsCreating, HasInner { + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPropertiesFormat.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPropertiesFormat.java new file mode 100644 index 0000000000000..298448517bac5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service endpoint properties. + */ +public class ServiceEndpointPropertiesFormat { + /** + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /** + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Get the type of the endpoint service. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set the type of the endpoint service. + * + * @param service the service value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of locations. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set a list of locations. + * + * @param locations the locations value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceProviderProvisioningState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..6cd8d5431ca9f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceProviderProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceProviderProvisioningState. + */ +public final class ServiceProviderProvisioningState extends ExpandableStringEnum { + /** Static value NotProvisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ServiceProviderProvisioningState + */ + @JsonCreator + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** + * @return known ServiceProviderProvisioningState values + */ + public static Collection values() { + return values(ServiceProviderProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Severity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Severity.java new file mode 100644 index 0000000000000..b30da8eaac136 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Severity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Creates or finds a Severity from its string representation. + * @param name a name to look for + * @return the corresponding Severity + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * @return known Severity values + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnet.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnet.java new file mode 100644 index 0000000000000..f84c15281df53 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnet.java @@ -0,0 +1,474 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.RouteTableInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing Subnet. + */ +public interface Subnet extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the addressPrefixes value. + */ + List addressPrefixes(); + + /** + * @return the delegations value. + */ + List delegations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceEndpoints value. + */ + List interfaceEndpoints(); + + /** + * @return the ipConfigurationProfiles value. + */ + List ipConfigurationProfiles(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the purpose value. + */ + String purpose(); + + /** + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * @return the serviceAssociationLinks value. + */ + List serviceAssociationLinks(); + + /** + * @return the serviceEndpointPolicies value. + */ + List serviceEndpointPolicies(); + + /** + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * The entirety of the Subnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of Subnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Subnet definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the subnet definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + * @param resourceGroupName The name of the resource group + * @param virtualNetworkName The name of the virtual network + * @return the next definition stage + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the subnet definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The address prefix for the subnet + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet definition allowing to specify AddressPrefixes. + */ + interface WithAddressPrefixes { + /** + * Specifies addressPrefixes. + * @param addressPrefixes List of address prefixes for the subnet + * @return the next definition stage + */ + WithCreate withAddressPrefixes(List addressPrefixes); + } + + /** + * The stage of the subnet definition allowing to specify Delegations. + */ + interface WithDelegations { + /** + * Specifies delegations. + * @param delegations Gets an array of references to the delegations on the subnet + * @return the next definition stage + */ + WithCreate withDelegations(List delegations); + } + + /** + * The stage of the subnet definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the subnet definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the subnet definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the subnet definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet definition allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next definition stage + */ + WithCreate withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next definition stage + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet definition allowing to specify ServiceAssociationLinks. + */ + interface WithServiceAssociationLinks { + /** + * Specifies serviceAssociationLinks. + * @param serviceAssociationLinks Gets an array of references to services injecting into this subnet + * @return the next definition stage + */ + WithCreate withServiceAssociationLinks(List serviceAssociationLinks); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @param serviceEndpointPolicies An array of service endpoint policies + * @return the next definition stage + */ + WithCreate withServiceEndpointPolicies(List serviceEndpointPolicies); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next definition stage + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithAddressPrefixes, DefinitionStages.WithDelegations, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceNavigationLinks, DefinitionStages.WithRouteTable, DefinitionStages.WithServiceAssociationLinks, DefinitionStages.WithServiceEndpointPolicies, DefinitionStages.WithServiceEndpoints { + } + } + /** + * The template for a Subnet update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAddressPrefixes, UpdateStages.WithDelegations, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithProvisioningState, UpdateStages.WithResourceNavigationLinks, UpdateStages.WithRouteTable, UpdateStages.WithServiceAssociationLinks, UpdateStages.WithServiceEndpointPolicies, UpdateStages.WithServiceEndpoints { + } + + /** + * Grouping of Subnet update stages. + */ + interface UpdateStages { + /** + * The stage of the subnet update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The address prefix for the subnet + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet update allowing to specify AddressPrefixes. + */ + interface WithAddressPrefixes { + /** + * Specifies addressPrefixes. + * @param addressPrefixes List of address prefixes for the subnet + * @return the next update stage + */ + Update withAddressPrefixes(List addressPrefixes); + } + + /** + * The stage of the subnet update allowing to specify Delegations. + */ + interface WithDelegations { + /** + * Specifies delegations. + * @param delegations Gets an array of references to the delegations on the subnet + * @return the next update stage + */ + Update withDelegations(List delegations); + } + + /** + * The stage of the subnet update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the subnet update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the subnet update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the subnet update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet update allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next update stage + */ + Update withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next update stage + */ + Update withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet update allowing to specify ServiceAssociationLinks. + */ + interface WithServiceAssociationLinks { + /** + * Specifies serviceAssociationLinks. + * @param serviceAssociationLinks Gets an array of references to services injecting into this subnet + * @return the next update stage + */ + Update withServiceAssociationLinks(List serviceAssociationLinks); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @param serviceEndpointPolicies An array of service endpoint policies + * @return the next update stage + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next update stage + */ + Update withServiceEndpoints(List serviceEndpoints); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SubnetAssociation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SubnetAssociation.java new file mode 100644 index 0000000000000..80441e10f27ed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/SubnetAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class SubnetAssociation { + /** + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get subnet ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the SubnetAssociation object itself. + */ + public SubnetAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnets.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnets.java new file mode 100644 index 0000000000000..96c9d08696978 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Subnets.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Subnets. + */ +public interface Subnets extends SupportsCreating, HasInner { + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TagsObject.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TagsObject.java new file mode 100644 index 0000000000000..3f510dc21bdd6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TagsObject.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tags object for patch operations. + */ +public class TagsObject { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Topology.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Topology.java new file mode 100644 index 0000000000000..4b34aed3c9c07 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Topology.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.TopologyInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Topology. + */ +public interface Topology extends HasInner, HasManager { + /** + * @return the createdDateTime value. + */ + DateTime createdDateTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the resources value. + */ + List resources(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyAssociation.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyAssociation.java new file mode 100644 index 0000000000000..fcc4b84b89631 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyAssociation.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resources that have an association with the parent resource. + */ +public class TopologyAssociation { + /** + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The association type of the child resource to the parent resource. + * Possible values include: 'Associated', 'Contains'. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get the name of the resource that is associated with the parent resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is associated with the parent resource. + * + * @param name the name value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the resource that is associated with the parent resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource that is associated with the parent resource. + * + * @param resourceId the resourceId value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @return the associationType value + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @param associationType the associationType value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyParameters.java new file mode 100644 index 0000000000000..9972774254e39 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the representation of topology. + */ +public class TopologyParameters { + /** + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /** + * The reference of the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /** + * The reference of the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set the name of the target resource group to perform topology on. + * + * @param targetResourceGroupName the targetResourceGroupName value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { + this.targetResourceGroupName = targetResourceGroupName; + return this; + } + + /** + * Get the reference of the Virtual Network resource. + * + * @return the targetVirtualNetwork value + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the reference of the Virtual Network resource. + * + * @param targetVirtualNetwork the targetVirtualNetwork value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { + this.targetVirtualNetwork = targetVirtualNetwork; + return this; + } + + /** + * Get the reference of the Subnet resource. + * + * @return the targetSubnet value + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the reference of the Subnet resource. + * + * @param targetSubnet the targetSubnet value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetSubnet(SubResource targetSubnet) { + this.targetSubnet = targetSubnet; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyResource.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyResource.java new file mode 100644 index 0000000000000..3aa39c09bfece --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TopologyResource.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network resource topology information for the given resource group. + */ +public class TopologyResource { + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource. + * + * @param name the name value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get iD of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the resource. + * + * @param id the id value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get holds the associations the resource has with other resources in the resource group. + * + * @return the associations value + */ + public List associations() { + return this.associations; + } + + /** + * Set holds the associations the resource has with other resources in the resource group. + * + * @param associations the associations value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withAssociations(List associations) { + this.associations = associations; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsConfigurationProperties.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 0000000000000..026fa27e44bb2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsConfigurationProperties.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsConfigurationProperties { + /** + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion", required = true) + private String workspaceRegion; + + /** + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId", required = true) + private String workspaceResourceId; + + /** + * Get flag to enable/disable traffic analytics. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable traffic analytics. + * + * @param enabled the enabled value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the resource guid of the attached workspace. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the resource guid of the attached workspace. + * + * @param workspaceId the workspaceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the location of the attached workspace. + * + * @return the workspaceRegion value + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set the location of the attached workspace. + * + * @param workspaceRegion the workspaceRegion value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { + this.workspaceRegion = workspaceRegion; + return this; + } + + /** + * Get resource Id of the attached workspace. + * + * @return the workspaceResourceId value + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set resource Id of the attached workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsProperties.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsProperties.java new file mode 100644 index 0000000000000..255185e095246 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TrafficAnalyticsProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsProperties { + /** + * The networkWatcherFlowAnalyticsConfiguration property. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration", required = true) + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get the networkWatcherFlowAnalyticsConfiguration value. + * + * @return the networkWatcherFlowAnalyticsConfiguration value + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set the networkWatcherFlowAnalyticsConfiguration value. + * + * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set + * @return the TrafficAnalyticsProperties object itself. + */ + public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration(TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { + this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TransportProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TransportProtocol.java new file mode 100644 index 0000000000000..fdd675af15d3c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TransportProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TransportProtocol. + */ +public final class TransportProtocol extends ExpandableStringEnum { + /** Static value Udp for TransportProtocol. */ + public static final TransportProtocol UDP = fromString("Udp"); + + /** Static value Tcp for TransportProtocol. */ + public static final TransportProtocol TCP = fromString("Tcp"); + + /** Static value All for TransportProtocol. */ + public static final TransportProtocol ALL = fromString("All"); + + /** + * Creates or finds a TransportProtocol from its string representation. + * @param name a name to look for + * @return the corresponding TransportProtocol + */ + @JsonCreator + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** + * @return known TransportProtocol values + */ + public static Collection values() { + return values(TransportProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingDetails.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingDetails.java new file mode 100644 index 0000000000000..73217059dc54c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingDetails.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information gained from troubleshooting of specified resource. + */ +public class TroubleshootingDetails { + /** + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /** + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id of the get troubleshoot operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the get troubleshoot operation. + * + * @param id the id value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get reason type of failure. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set reason type of failure. + * + * @param reasonType the reasonType value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get a summary of troubleshooting. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set a summary of troubleshooting. + * + * @param summary the summary value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get details on troubleshooting results. + * + * @return the detail value + */ + public String detail() { + return this.detail; + } + + /** + * Set details on troubleshooting results. + * + * @param detail the detail value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withDetail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get list of recommended actions. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set list of recommended actions. + * + * @param recommendedActions the recommendedActions value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingParameters.java new file mode 100644 index 0000000000000..e2a10222af029 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the resource to troubleshoot. + */ +@JsonFlatten +public class TroubleshootingParameters { + /** + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "properties.storagePath", required = true) + private String storagePath; + + /** + * Get the target resource to troubleshoot. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource to troubleshoot. + * + * @param targetResourceId the targetResourceId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the ID for the storage account to save the troubleshoot result. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID for the storage account to save the troubleshoot result. + * + * @param storageId the storageId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the path to the blob to save the troubleshoot result in. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the path to the blob to save the troubleshoot result in. + * + * @param storagePath the storagePath value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingRecommendedActions.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingRecommendedActions.java new file mode 100644 index 0000000000000..c4c2d0200c0f2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingRecommendedActions.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommended actions based on discovered issues. + */ +public class TroubleshootingRecommendedActions { + /** + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /** + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /** + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /** + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get iD of the recommended action. + * + * @return the actionId value + */ + public String actionId() { + return this.actionId; + } + + /** + * Set iD of the recommended action. + * + * @param actionId the actionId value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get description of recommended actions. + * + * @return the actionText value + */ + public String actionText() { + return this.actionText; + } + + /** + * Set description of recommended actions. + * + * @param actionText the actionText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionText(String actionText) { + this.actionText = actionText; + return this; + } + + /** + * Get the uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set the uri linking to a documentation for the recommended troubleshooting actions. + * + * @param actionUri the actionUri value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUri(String actionUri) { + this.actionUri = actionUri; + return this; + } + + /** + * Get the information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set the information from the URI for the recommended troubleshooting actions. + * + * @param actionUriText the actionUriText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { + this.actionUriText = actionUriText; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingResult.java new file mode 100644 index 0000000000000..01de62594afa6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TroubleshootingResult.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.TroubleshootingResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing TroubleshootingResult. + */ +public interface TroubleshootingResult extends HasInner, HasManager { + /** + * @return the code value. + */ + String code(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the results value. + */ + List results(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionHealth.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..4e80ff1628a5f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionHealth.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewayConnection properties. + */ +public class TunnelConnectionHealth { + /** + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /** + * Virtual network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** + * Get tunnel name. + * + * @return the tunnel value + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get virtual network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionStatus.java new file mode 100644 index 0000000000000..eb3d9ab33b69b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/TunnelConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TunnelConnectionStatus. + */ +public final class TunnelConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a TunnelConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding TunnelConnectionStatus + */ + @JsonCreator + public static TunnelConnectionStatus fromString(String name) { + return fromString(name, TunnelConnectionStatus.class); + } + + /** + * @return known TunnelConnectionStatus values + */ + public static Collection values() { + return values(TunnelConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usage.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usage.java new file mode 100644 index 0000000000000..34d0b5da8f804 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + long currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + long limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/UsageName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/UsageName.java new file mode 100644 index 0000000000000..e0f2a4e4085eb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/UsageName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names. + */ +public class UsageName { + /** + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /** + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set a string describing the resource name. + * + * @param value the value value to set + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set a localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usages.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usages.java new file mode 100644 index 0000000000000..35d5e95a8f4f0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerbosityLevel.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerbosityLevel.java new file mode 100644 index 0000000000000..58e8a8d2fc4c7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerbosityLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VerbosityLevel. + */ +public final class VerbosityLevel extends ExpandableStringEnum { + /** Static value Normal for VerbosityLevel. */ + public static final VerbosityLevel NORMAL = fromString("Normal"); + + /** Static value Minimum for VerbosityLevel. */ + public static final VerbosityLevel MINIMUM = fromString("Minimum"); + + /** Static value Full for VerbosityLevel. */ + public static final VerbosityLevel FULL = fromString("Full"); + + /** + * Creates or finds a VerbosityLevel from its string representation. + * @param name a name to look for + * @return the corresponding VerbosityLevel + */ + @JsonCreator + public static VerbosityLevel fromString(String name) { + return fromString(name, VerbosityLevel.class); + } + + /** + * @return known VerbosityLevel values + */ + public static Collection values() { + return values(VerbosityLevel.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowParameters.java new file mode 100644 index 0000000000000..a36c89e5c9d95 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowParameters.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the IP flow to be verified. + */ +public class VerificationIPFlowParameters { + /** + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The direction of the packet represented as a 5-tuple. Possible values + * include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Possible values include: 'TCP', 'UDP'. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /** + * The local port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /** + * The remote port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /** + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIPAddress; + + /** + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of them, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform next-hop on. + * + * @param targetResourceId the targetResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param localPort the localPort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param remotePort the remotePort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Get the local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set the local IP address. Acceptable values are valid IPv4 addresses. + * + * @param localIPAddress the localIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowResult.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowResult.java new file mode 100644 index 0000000000000..141ac5bd86ccc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VerificationIPFlowResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VerificationIPFlowResultInner; + +/** + * Type representing VerificationIPFlowResult. + */ +public interface VerificationIPFlowResult extends HasInner, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the ruleName value. + */ + String ruleName(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHub.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHub.java new file mode 100644 index 0000000000000..ea15cec57f78f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHub.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualHubInner; + +/** + * Type representing VirtualHub. + */ +public interface VirtualHub extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGateway value. + */ + SubResource expressRouteGateway(); + + /** + * @return the p2SVpnGateway value. + */ + SubResource p2SVpnGateway(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the routeTable value. + */ + VirtualHubRouteTable routeTable(); + + /** + * @return the virtualNetworkConnections value. + */ + List virtualNetworkConnections(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * @return the vpnGateway value. + */ + SubResource vpnGateway(); + + /** + * The entirety of the VirtualHub definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualHub definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualHub definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualHub definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualhub definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix Address-prefix for this VirtualHub + * @return the next definition stage + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub definition allowing to specify ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies expressRouteGateway. + * @param expressRouteGateway The expressRouteGateway associated with this VirtualHub + * @return the next definition stage + */ + WithCreate withExpressRouteGateway(SubResource expressRouteGateway); + } + + /** + * The stage of the virtualhub definition allowing to specify P2SVpnGateway. + */ + interface WithP2SVpnGateway { + /** + * Specifies p2SVpnGateway. + * @param p2SVpnGateway The P2SVpnGateway associated with this VirtualHub + * @return the next definition stage + */ + WithCreate withP2SVpnGateway(SubResource p2SVpnGateway); + } + + /** + * The stage of the virtualhub definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The routeTable associated with this virtual hub + * @return the next definition stage + */ + WithCreate withRouteTable(VirtualHubRouteTable routeTable); + } + + /** + * The stage of the virtualhub definition allowing to specify VirtualNetworkConnections. + */ + interface WithVirtualNetworkConnections { + /** + * Specifies virtualNetworkConnections. + * @param virtualNetworkConnections list of all vnet connections with this VirtualHub + * @return the next definition stage + */ + WithCreate withVirtualNetworkConnections(List virtualNetworkConnections); + } + + /** + * The stage of the virtualhub definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the VirtualHub belongs + * @return the next definition stage + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the virtualhub definition allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies vpnGateway. + * @param vpnGateway The VpnGateway associated with this VirtualHub + * @return the next definition stage + */ + WithCreate withVpnGateway(SubResource vpnGateway); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressPrefix, DefinitionStages.WithExpressRouteGateway, DefinitionStages.WithP2SVpnGateway, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteTable, DefinitionStages.WithVirtualNetworkConnections, DefinitionStages.WithVirtualWan, DefinitionStages.WithVpnGateway { + } + } + /** + * The template for a VirtualHub update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressPrefix, UpdateStages.WithExpressRouteGateway, UpdateStages.WithP2SVpnGateway, UpdateStages.WithProvisioningState, UpdateStages.WithRouteTable, UpdateStages.WithVirtualNetworkConnections, UpdateStages.WithVirtualWan, UpdateStages.WithVpnGateway { + } + + /** + * Grouping of VirtualHub update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualhub update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix Address-prefix for this VirtualHub + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub update allowing to specify ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies expressRouteGateway. + * @param expressRouteGateway The expressRouteGateway associated with this VirtualHub + * @return the next update stage + */ + Update withExpressRouteGateway(SubResource expressRouteGateway); + } + + /** + * The stage of the virtualhub update allowing to specify P2SVpnGateway. + */ + interface WithP2SVpnGateway { + /** + * Specifies p2SVpnGateway. + * @param p2SVpnGateway The P2SVpnGateway associated with this VirtualHub + * @return the next update stage + */ + Update withP2SVpnGateway(SubResource p2SVpnGateway); + } + + /** + * The stage of the virtualhub update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The routeTable associated with this virtual hub + * @return the next update stage + */ + Update withRouteTable(VirtualHubRouteTable routeTable); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualNetworkConnections. + */ + interface WithVirtualNetworkConnections { + /** + * Specifies virtualNetworkConnections. + * @param virtualNetworkConnections list of all vnet connections with this VirtualHub + * @return the next update stage + */ + Update withVirtualNetworkConnections(List virtualNetworkConnections); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the VirtualHub belongs + * @return the next update stage + */ + Update withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the virtualhub update allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies vpnGateway. + * @param vpnGateway The VpnGateway associated with this VirtualHub + * @return the next update stage + */ + Update withVpnGateway(SubResource vpnGateway); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubId.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubId.java new file mode 100644 index 0000000000000..28cf8b19c73dc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubId.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Hub identifier. + */ +public class VirtualHubId { + /** + * The resource URI for the Virtual Hub where the ExpressRoute gateway is + * or will be deployed. The Virtual Hub resource and the ExpressRoute + * gateway resource reside in the same subscription. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @param id the id value to set + * @return the VirtualHubId object itself. + */ + public VirtualHubId withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRoute.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRoute.java new file mode 100644 index 0000000000000..5b2a2b04657d0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRoute.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualHub route. + */ +public class VirtualHubRoute { + /** + * list of all addressPrefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * NextHop ip address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get list of all addressPrefixes. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set list of all addressPrefixes. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get nextHop ip address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set nextHop ip address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRouteTable.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRouteTable.java new file mode 100644 index 0000000000000..6562e356706ec --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubRouteTable.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualHub route table. + */ +public class VirtualHubRouteTable { + /** + * list of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get list of all routes. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set list of all routes. + * + * @param routes the routes value to set + * @return the VirtualHubRouteTable object itself. + */ + public VirtualHubRouteTable withRoutes(List routes) { + this.routes = routes; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubs.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubs.java new file mode 100644 index 0000000000000..2a1d4c9f8474d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualHubs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualHubs. + */ +public interface VirtualHubs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..0c982928c1356 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetNetworkInterfaceIPConfiguration. + */ +public interface VirtualMachineScaleSetNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetwork.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetwork.java new file mode 100644 index 0000000000000..7c479cb97672a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetwork.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkInner; + +/** + * Type representing VirtualNetwork. + */ +public interface VirtualNetwork extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the ddosProtectionPlan value. + */ + SubResource ddosProtectionPlan(); + + /** + * @return the dhcpOptions value. + */ + DhcpOptions dhcpOptions(); + + /** + * @return the enableDdosProtection value. + */ + Boolean enableDdosProtection(); + + /** + * @return the enableVmProtection value. + */ + Boolean enableVmProtection(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * @return the virtualNetworkPeerings value. + */ + List virtualNetworkPeerings(); + + /** + * The entirety of the VirtualNetwork definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetwork definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetwork definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetwork definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetwork definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets + * @return the next definition stage + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork definition allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network + * @return the next definition stage + */ + WithCreate withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork definition allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network + * @return the next definition stage + */ + WithCreate withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork definition allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource + * @return the next definition stage + */ + WithCreate withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork definition allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network + * @return the next definition stage + */ + WithCreate withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork definition allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @param subnets A list of subnets in a Virtual Network + * @return the next definition stage + */ + WithCreate withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork definition allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next definition stage + */ + WithCreate withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithDdosProtectionPlan, DefinitionStages.WithDhcpOptions, DefinitionStages.WithEnableDdosProtection, DefinitionStages.WithEnableVmProtection, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSubnets, DefinitionStages.WithVirtualNetworkPeerings { + } + } + /** + * The template for a VirtualNetwork update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithDdosProtectionPlan, UpdateStages.WithDhcpOptions, UpdateStages.WithEnableDdosProtection, UpdateStages.WithEnableVmProtection, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSubnets, UpdateStages.WithVirtualNetworkPeerings { + } + + /** + * Grouping of VirtualNetwork update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetwork update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork update allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network + * @return the next update stage + */ + Update withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork update allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network + * @return the next update stage + */ + Update withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource + * @return the next update stage + */ + Update withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network + * @return the next update stage + */ + Update withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetwork update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork update allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @param subnets A list of subnets in a Virtual Network + * @return the next update stage + */ + Update withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork update allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next update stage + */ + Update withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkConnectionGatewayReference.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 0000000000000..f12520a069b21 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkConnectionGatewayReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + */ +public class VirtualNetworkConnectionGatewayReference { + /** + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @param id the id value to set + * @return the VirtualNetworkConnectionGatewayReference object itself. + */ + public VirtualNetworkConnectionGatewayReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateway.java new file mode 100644 index 0000000000000..7630462b417cc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateway.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewayInner; + +/** + * Type representing VirtualNetworkGateway. + */ +public interface VirtualNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeActive value. + */ + Boolean activeActive(); + + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayDefaultSite value. + */ + SubResource gatewayDefaultSite(); + + /** + * @return the gatewayType value. + */ + VirtualNetworkGatewayType gatewayType(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + VirtualNetworkGatewaySku sku(); + + /** + * @return the vpnClientConfiguration value. + */ + VpnClientConfiguration vpnClientConfiguration(); + + /** + * @return the vpnType value. + */ + VpnType vpnType(); + + /** + * The entirety of the VirtualNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next definition stage + */ + WithCreate withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Virtual network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting + * @return the next definition stage + */ + WithCreate withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next definition stage + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configurations for virtual network gateway + * @return the next definition stage + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway + * @return the next definition stage + */ + WithCreate withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + * @param vpnClientConfiguration The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations + * @return the next definition stage + */ + WithCreate withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next definition stage + */ + WithCreate withVpnType(VpnType vpnType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveActive, DefinitionStages.WithBgpSettings, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithGatewayDefaultSite, DefinitionStages.WithGatewayType, DefinitionStages.WithIpConfigurations, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithVpnClientConfiguration, DefinitionStages.WithVpnType { + } + } + /** + * The template for a VirtualNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveActive, UpdateStages.WithBgpSettings, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithGatewayDefaultSite, UpdateStages.WithGatewayType, UpdateStages.WithIpConfigurations, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithVpnClientConfiguration, UpdateStages.WithVpnType { + } + + /** + * Grouping of VirtualNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgateway update allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next update stage + */ + Update withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Virtual network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting + * @return the next update stage + */ + Update withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next update stage + */ + Update withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configurations for virtual network gateway + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway + * @return the next update stage + */ + Update withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + * @param vpnClientConfiguration The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations + * @return the next update stage + */ + Update withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next update stage + */ + Update withVpnType(VpnType vpnType); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnection.java new file mode 100644 index 0000000000000..7c38dc5da738a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnection.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.LocalNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewayConnectionInner; + +/** + * Type representing VirtualNetworkGatewayConnection. + */ +public interface VirtualNetworkGatewayConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + LocalNetworkGateway localNetworkGateway2(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkGateway virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkGateway virtualNetworkGateway2(); + + /** + * The entirety of the VirtualNetworkGatewayConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithConnectionType, DefinitionStages.WithVirtualNetworkGateway1, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGatewayConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGatewayConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionType. + */ + interface WithConnectionType { + /** + * Specifies connectionType. + * @param connectionType Gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @return the next definition stage +*/ + WithVirtualNetworkGateway1 withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway1. + */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies virtualNetworkGateway1. + * @param virtualNetworkGateway1 The reference to virtual network gateway resource + * @return the next definition stage +*/ + WithCreate withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionProtocol. + */ + interface WithConnectionProtocol { + /** + * Specifies connectionProtocol. + * @param connectionProtocol Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next definition stage + */ + WithCreate withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next definition stage + */ + WithCreate withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next definition stage + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @param localNetworkGateway2 The reference to local network gateway resource + * @return the next definition stage + */ + WithCreate withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @param peer The reference to peerings resource + * @return the next definition stage + */ + WithCreate withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors + * @return the next definition stage + */ + WithCreate withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next definition stage + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithConnectionProtocol, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithExpressRouteGatewayBypass, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocalNetworkGateway2, DefinitionStages.WithPeer, DefinitionStages.WithResourceGuid, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithUsePolicyBasedTrafficSelectors, DefinitionStages.WithVirtualNetworkGateway2 { + } + } + /** + * The template for a VirtualNetworkGatewayConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthorizationKey, UpdateStages.WithConnectionProtocol, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithExpressRouteGatewayBypass, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocalNetworkGateway2, UpdateStages.WithPeer, UpdateStages.WithResourceGuid, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithUsePolicyBasedTrafficSelectors, UpdateStages.WithVirtualNetworkGateway2 { + } + + /** + * Grouping of VirtualNetworkGatewayConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ConnectionProtocol. + */ + interface WithConnectionProtocol { + /** + * Specifies connectionProtocol. + * @param connectionProtocol Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next update stage + */ + Update withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next update stage + */ + Update withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @param localNetworkGateway2 The reference to local network gateway resource + * @return the next update stage + */ + Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @param peer The reference to peerings resource + * @return the next update stage + */ + Update withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors + * @return the next update stage + */ + Update withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next update stage + */ + Update withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionListEntity.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 0000000000000..9af4affa21e58 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionListEntity.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewayConnectionListEntityInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing VirtualNetworkGatewayConnectionListEntity. + */ +public interface VirtualNetworkGatewayConnectionListEntity extends HasInner, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference localNetworkGateway2(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionProtocol.java new file mode 100644 index 0000000000000..f6f101ddd2fa8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionProtocol. + */ +public final class VirtualNetworkGatewayConnectionProtocol extends ExpandableStringEnum { + /** Static value IKEv2 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV2 = fromString("IKEv2"); + + /** Static value IKEv1 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV1 = fromString("IKEv1"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionProtocol + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionProtocol fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionProtocol.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionProtocol values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 0000000000000..b531a3cf0eda0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionStatus. + */ +public final class VirtualNetworkGatewayConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionStatus + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionStatus values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 0000000000000..9c640e51bbe02 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionType. + */ +public final class VirtualNetworkGatewayConnectionType extends ExpandableStringEnum { + /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); + + /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); + + /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionType + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnections.java new file mode 100644 index 0000000000000..c8a7d686158a4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayConnections.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_08_01.implementation.ConnectionSharedKeyInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewayConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkGatewayConnections. + */ +public interface VirtualNetworkGatewayConnections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayIPConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayIPConfiguration.java new file mode 100644 index 0000000000000..caf57018e656b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayIPConfiguration.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration for virtual network gateway. + */ +@JsonFlatten +public class VirtualNetworkGatewayIPConfiguration extends SubResource { + /** + * The private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySku.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySku.java new file mode 100644 index 0000000000000..aaa4d3288f094 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySku.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewaySku details. + */ +public class VirtualNetworkGatewaySku { + /** + * Gateway SKU name. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /** + * Gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /** + * The capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the name value + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param name the name value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the tier value + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param tier the tier value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity. + * + * @param capacity the capacity value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuName.java new file mode 100644 index 0000000000000..8b454367d0e44 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuName. + */ +public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuName + */ + @JsonCreator + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** + * @return known VirtualNetworkGatewaySkuName values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuTier.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 0000000000000..0325fc599f335 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuTier. + */ +public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuTier + */ + @JsonCreator + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** + * @return known VirtualNetworkGatewaySkuTier values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuTier.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayType.java new file mode 100644 index 0000000000000..a08d6fa0d254a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGatewayType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayType. + */ +public final class VirtualNetworkGatewayType extends ExpandableStringEnum { + /** Static value Vpn for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); + + /** Static value ExpressRoute for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayType + */ + @JsonCreator + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** + * @return known VirtualNetworkGatewayType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateways.java new file mode 100644 index 0000000000000..c0a181c9a087e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkGateways.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnClientIPsecParametersInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionListEntity; + +/** + * Type representing VirtualNetworkGateways. + */ +public interface VirtualNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeering.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeering.java new file mode 100644 index 0000000000000..e84dd09953eab --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeering.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing VirtualNetworkPeering. + */ +public interface VirtualNetworkPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peeringState value. + */ + VirtualNetworkPeeringState peeringState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * The entirety of the VirtualNetworkPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkPeering definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + * @param resourceGroupName The name of the resource group + * @param virtualNetworkName The name of the virtual network + * @return the next definition stage + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed + * @return the next definition stage + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this virtual network + * @return the next definition stage + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @param allowVirtualNetworkAccess Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space + * @return the next definition stage + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next definition stage + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next definition stage + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering) + * @return the next definition stage + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway + * @return the next definition stage + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAllowForwardedTraffic, DefinitionStages.WithAllowGatewayTransit, DefinitionStages.WithAllowVirtualNetworkAccess, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeeringState, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteAddressSpace, DefinitionStages.WithRemoteVirtualNetwork, DefinitionStages.WithUseRemoteGateways { + } + } + /** + * The template for a VirtualNetworkPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllowForwardedTraffic, UpdateStages.WithAllowGatewayTransit, UpdateStages.WithAllowVirtualNetworkAccess, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeeringState, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteAddressSpace, UpdateStages.WithRemoteVirtualNetwork, UpdateStages.WithUseRemoteGateways { + } + + /** + * Grouping of VirtualNetworkPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed + * @return the next update stage + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this virtual network + * @return the next update stage + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @param allowVirtualNetworkAccess Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space + * @return the next update stage + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next update stage + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next update stage + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering) + * @return the next update stage + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway + * @return the next update stage + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeeringState.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeeringState.java new file mode 100644 index 0000000000000..c7f59ca77703f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeeringState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkPeeringState. + */ +public final class VirtualNetworkPeeringState extends ExpandableStringEnum { + /** Static value Initiated for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); + + /** Static value Connected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkPeeringState + */ + @JsonCreator + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** + * @return known VirtualNetworkPeeringState values + */ + public static Collection values() { + return values(VirtualNetworkPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeerings.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeerings.java new file mode 100644 index 0000000000000..213f7dedcdfb7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkPeerings. + */ +public interface VirtualNetworkPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTap.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTap.java new file mode 100644 index 0000000000000..a3f62eefddc03 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTap.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkTapInner; + +/** + * Type representing VirtualNetworkTap. + */ +public interface VirtualNetworkTap extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the destinationLoadBalancerFrontEndIPConfiguration value. + */ + FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration(); + + /** + * @return the destinationNetworkInterfaceIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration(); + + /** + * @return the destinationPort value. + */ + Integer destinationPort(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaceTapConfigurations value. + */ + List networkInterfaceTapConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the VirtualNetworkTap definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkTap definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkTap definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkTap definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworktap definition allowing to specify DestinationLoadBalancerFrontEndIPConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIPConfiguration { + /** + * Specifies destinationLoadBalancerFrontEndIPConfiguration. + * @param destinationLoadBalancerFrontEndIPConfiguration The reference to the private IP address on the internal Load Balancer that will receive the tap + * @return the next definition stage + */ + WithCreate withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration); + } + + /** + * The stage of the virtualnetworktap definition allowing to specify DestinationNetworkInterfaceIPConfiguration. + */ + interface WithDestinationNetworkInterfaceIPConfiguration { + /** + * Specifies destinationNetworkInterfaceIPConfiguration. + * @param destinationNetworkInterfaceIPConfiguration The reference to the private IP Address of the collector nic that will receive the tap + * @return the next definition stage + */ + WithCreate withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration); + } + + /** + * The stage of the virtualnetworktap definition allowing to specify DestinationPort. + */ + interface WithDestinationPort { + /** + * Specifies destinationPort. + * @param destinationPort The VXLAN destination port that will receive the tapped traffic + * @return the next definition stage + */ + WithCreate withDestinationPort(Integer destinationPort); + } + + /** + * The stage of the virtualnetworktap definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDestinationLoadBalancerFrontEndIPConfiguration, DefinitionStages.WithDestinationNetworkInterfaceIPConfiguration, DefinitionStages.WithDestinationPort, DefinitionStages.WithEtag { + } + } + /** + * The template for a VirtualNetworkTap update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDestinationLoadBalancerFrontEndIPConfiguration, UpdateStages.WithDestinationNetworkInterfaceIPConfiguration, UpdateStages.WithDestinationPort, UpdateStages.WithEtag { + } + + /** + * Grouping of VirtualNetworkTap update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworktap update allowing to specify DestinationLoadBalancerFrontEndIPConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIPConfiguration { + /** + * Specifies destinationLoadBalancerFrontEndIPConfiguration. + * @param destinationLoadBalancerFrontEndIPConfiguration The reference to the private IP address on the internal Load Balancer that will receive the tap + * @return the next update stage + */ + Update withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration); + } + + /** + * The stage of the virtualnetworktap update allowing to specify DestinationNetworkInterfaceIPConfiguration. + */ + interface WithDestinationNetworkInterfaceIPConfiguration { + /** + * Specifies destinationNetworkInterfaceIPConfiguration. + * @param destinationNetworkInterfaceIPConfiguration The reference to the private IP Address of the collector nic that will receive the tap + * @return the next update stage + */ + Update withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration); + } + + /** + * The stage of the virtualnetworktap update allowing to specify DestinationPort. + */ + interface WithDestinationPort { + /** + * Specifies destinationPort. + * @param destinationPort The VXLAN destination port that will receive the tapped traffic + * @return the next update stage + */ + Update withDestinationPort(Integer destinationPort); + } + + /** + * The stage of the virtualnetworktap update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTaps.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTaps.java new file mode 100644 index 0000000000000..04b6fe129c54e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkTaps.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkTapsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkTaps. + */ +public interface VirtualNetworkTaps extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsage.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsage.java new file mode 100644 index 0000000000000..1d4456e085b6e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworkUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; + +/** + * Type representing VirtualNetworkUsage. + */ +public interface VirtualNetworkUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsageName.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsageName.java new file mode 100644 index 0000000000000..3d190b1e82ca5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworkUsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage strings container. + */ +public class VirtualNetworkUsageName { + /** + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get localized subnet size and usage string. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get subnet size and usage string. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworks.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworks.java new file mode 100644 index 0000000000000..a60d378c96911 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualNetworks.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualNetworksInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkUsage; + +/** + * Type representing VirtualNetworks. + */ +public interface VirtualNetworks extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWAN.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWAN.java new file mode 100644 index 0000000000000..750e172013db4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWAN.java @@ -0,0 +1,289 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.P2SVpnServerConfigurationInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualWANInner; + +/** + * Type representing VirtualWAN. + */ +public interface VirtualWAN extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowBranchToBranchTraffic value. + */ + Boolean allowBranchToBranchTraffic(); + + /** + * @return the allowVnetToVnetTraffic value. + */ + Boolean allowVnetToVnetTraffic(); + + /** + * @return the disableVpnEncryption value. + */ + Boolean disableVpnEncryption(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the office365LocalBreakoutCategory value. + */ + OfficeTrafficCategory office365LocalBreakoutCategory(); + + /** + * @return the p2SVpnServerConfigurations value. + */ + List p2SVpnServerConfigurations(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the securityProviderName value. + */ + String securityProviderName(); + + /** + * @return the virtualHubs value. + */ + List virtualHubs(); + + /** + * @return the vpnSites value. + */ + List vpnSites(); + + /** + * The entirety of the VirtualWAN definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualWAN definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualWAN definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualWAN definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualwan definition allowing to specify AllowBranchToBranchTraffic. + */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies allowBranchToBranchTraffic. + * @param allowBranchToBranchTraffic True if branch to branch traffic is allowed + * @return the next definition stage + */ + WithCreate withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + + /** + * The stage of the virtualwan definition allowing to specify AllowVnetToVnetTraffic. + */ + interface WithAllowVnetToVnetTraffic { + /** + * Specifies allowVnetToVnetTraffic. + * @param allowVnetToVnetTraffic True if Vnet to Vnet traffic is allowed + * @return the next definition stage + */ + WithCreate withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic); + } + + /** + * The stage of the virtualwan definition allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @param disableVpnEncryption Vpn encryption to be disabled or not + * @return the next definition stage + */ + WithCreate withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan definition allowing to specify Office365LocalBreakoutCategory. + */ + interface WithOffice365LocalBreakoutCategory { + /** + * Specifies office365LocalBreakoutCategory. + * @param office365LocalBreakoutCategory The office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + * @return the next definition stage + */ + WithCreate withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory); + } + + /** + * The stage of the virtualwan definition allowing to specify P2SVpnServerConfigurations. + */ + interface WithP2SVpnServerConfigurations { + /** + * Specifies p2SVpnServerConfigurations. + * @param p2SVpnServerConfigurations list of all P2SVpnServerConfigurations associated with the virtual wan + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurations(List p2SVpnServerConfigurations); + } + + /** + * The stage of the virtualwan definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualwan definition allowing to specify SecurityProviderName. + */ + interface WithSecurityProviderName { + /** + * Specifies securityProviderName. + * @param securityProviderName The Security Provider name + * @return the next definition stage + */ + WithCreate withSecurityProviderName(String securityProviderName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowBranchToBranchTraffic, DefinitionStages.WithAllowVnetToVnetTraffic, DefinitionStages.WithDisableVpnEncryption, DefinitionStages.WithOffice365LocalBreakoutCategory, DefinitionStages.WithP2SVpnServerConfigurations, DefinitionStages.WithProvisioningState, DefinitionStages.WithSecurityProviderName { + } + } + /** + * The template for a VirtualWAN update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowBranchToBranchTraffic, UpdateStages.WithAllowVnetToVnetTraffic, UpdateStages.WithDisableVpnEncryption, UpdateStages.WithOffice365LocalBreakoutCategory, UpdateStages.WithP2SVpnServerConfigurations, UpdateStages.WithProvisioningState, UpdateStages.WithSecurityProviderName { + } + + /** + * Grouping of VirtualWAN update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualwan update allowing to specify AllowBranchToBranchTraffic. + */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies allowBranchToBranchTraffic. + * @param allowBranchToBranchTraffic True if branch to branch traffic is allowed + * @return the next update stage + */ + Update withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + + /** + * The stage of the virtualwan update allowing to specify AllowVnetToVnetTraffic. + */ + interface WithAllowVnetToVnetTraffic { + /** + * Specifies allowVnetToVnetTraffic. + * @param allowVnetToVnetTraffic True if Vnet to Vnet traffic is allowed + * @return the next update stage + */ + Update withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic); + } + + /** + * The stage of the virtualwan update allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @param disableVpnEncryption Vpn encryption to be disabled or not + * @return the next update stage + */ + Update withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan update allowing to specify Office365LocalBreakoutCategory. + */ + interface WithOffice365LocalBreakoutCategory { + /** + * Specifies office365LocalBreakoutCategory. + * @param office365LocalBreakoutCategory The office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + * @return the next update stage + */ + Update withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory); + } + + /** + * The stage of the virtualwan update allowing to specify P2SVpnServerConfigurations. + */ + interface WithP2SVpnServerConfigurations { + /** + * Specifies p2SVpnServerConfigurations. + * @param p2SVpnServerConfigurations list of all P2SVpnServerConfigurations associated with the virtual wan + * @return the next update stage + */ + Update withP2SVpnServerConfigurations(List p2SVpnServerConfigurations); + } + + /** + * The stage of the virtualwan update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualwan update allowing to specify SecurityProviderName. + */ + interface WithSecurityProviderName { + /** + * Specifies securityProviderName. + * @param securityProviderName The Security Provider name + * @return the next update stage + */ + Update withSecurityProviderName(String securityProviderName); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProvider.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProvider.java new file mode 100644 index 0000000000000..0ab6f8300b7a1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProvider.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Collection of SecurityProviders. + */ +public class VirtualWanSecurityProvider { + /** + * Name of the security provider. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Url of the security provider. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Name of the security provider. Possible values include: 'External', + * 'Native'. + */ + @JsonProperty(value = "type") + private VirtualWanSecurityProviderType type; + + /** + * Get name of the security provider. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the security provider. + * + * @param name the name value to set + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withName(String name) { + this.name = name; + return this; + } + + /** + * Get url of the security provider. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set url of the security provider. + * + * @param url the url value to set + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get name of the security provider. Possible values include: 'External', 'Native'. + * + * @return the type value + */ + public VirtualWanSecurityProviderType type() { + return this.type; + } + + /** + * Set name of the security provider. Possible values include: 'External', 'Native'. + * + * @param type the type value to set + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withType(VirtualWanSecurityProviderType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProviderType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProviderType.java new file mode 100644 index 0000000000000..516a761f66e9a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWanSecurityProviderType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualWanSecurityProviderType. + */ +public final class VirtualWanSecurityProviderType extends ExpandableStringEnum { + /** Static value External for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType EXTERNAL = fromString("External"); + + /** Static value Native for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType NATIVE = fromString("Native"); + + /** + * Creates or finds a VirtualWanSecurityProviderType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualWanSecurityProviderType + */ + @JsonCreator + public static VirtualWanSecurityProviderType fromString(String name) { + return fromString(name, VirtualWanSecurityProviderType.class); + } + + /** + * @return known VirtualWanSecurityProviderType values + */ + public static Collection values() { + return values(VirtualWanSecurityProviderType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWans.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWans.java new file mode 100644 index 0000000000000..f1ae6d5d6049e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VirtualWans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VirtualWansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualWans. + */ +public interface VirtualWans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConfiguration.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConfiguration.java new file mode 100644 index 0000000000000..4b60e8a7509cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConfiguration.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConfiguration for P2S client. + */ +public class VpnClientConfiguration { + /** + * The reference of the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /** + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /** + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /** + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /** + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /** + * The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /** + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get vpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set vpnClientRootCertificate for virtual network gateway. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRootCertificates(List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get vpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set vpnClientRevokedCertificate for Virtual network gateway. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRevokedCertificates(List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get vpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set vpnClientProtocols for Virtual network gateway. + * + * @param vpnClientProtocols the vpnClientProtocols value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { + this.vpnClientProtocols = vpnClientProtocols; + return this; + } + + /** + * Get vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConnectionHealth.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConnectionHealth.java new file mode 100644 index 0000000000000..42d0d43bf8652 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientConnectionHealth.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConnectionHealth properties. + */ +public class VpnClientConnectionHealth { + /** + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIngressBytesTransferred; + + /** + * Total of the Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEgressBytesTransferred; + + /** + * The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + */ + @JsonProperty(value = "vpnClientConnectionsCount") + private Integer vpnClientConnectionsCount; + + /** + * List of allocated ip addresses to the connected p2s vpn clients. + */ + @JsonProperty(value = "allocatedIpAddresses") + private List allocatedIpAddresses; + + /** + * Get total of the Ingress Bytes Transferred in this P2S Vpn connection. + * + * @return the totalIngressBytesTransferred value + */ + public Long totalIngressBytesTransferred() { + return this.totalIngressBytesTransferred; + } + + /** + * Get total of the Egress Bytes Transferred in this connection. + * + * @return the totalEgressBytesTransferred value + */ + public Long totalEgressBytesTransferred() { + return this.totalEgressBytesTransferred; + } + + /** + * Get the total of p2s vpn clients connected at this time to this P2SVpnGateway. + * + * @return the vpnClientConnectionsCount value + */ + public Integer vpnClientConnectionsCount() { + return this.vpnClientConnectionsCount; + } + + /** + * Set the total of p2s vpn clients connected at this time to this P2SVpnGateway. + * + * @param vpnClientConnectionsCount the vpnClientConnectionsCount value to set + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withVpnClientConnectionsCount(Integer vpnClientConnectionsCount) { + this.vpnClientConnectionsCount = vpnClientConnectionsCount; + return this; + } + + /** + * Get list of allocated ip addresses to the connected p2s vpn clients. + * + * @return the allocatedIpAddresses value + */ + public List allocatedIpAddresses() { + return this.allocatedIpAddresses; + } + + /** + * Set list of allocated ip addresses to the connected p2s vpn clients. + * + * @param allocatedIpAddresses the allocatedIpAddresses value to set + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withAllocatedIpAddresses(List allocatedIpAddresses) { + this.allocatedIpAddresses = allocatedIpAddresses; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientIPsecParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..2dd754950ec3c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientIPsecParameters.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnClientIPsecParametersInner; + +/** + * Type representing VpnClientIPsecParameters. + */ +public interface VpnClientIPsecParameters extends HasInner, HasManager { + /** + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientParameters.java new file mode 100644 index 0000000000000..24af0ffeb3da3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientParameters.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class VpnClientParameters { + /** + * VPN client Processor Architecture. Possible values are: 'AMD64' and + * 'X86'. Possible values include: 'Amd64', 'X86'. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /** + * VPN client Authentication Method. Possible values are: 'EAPTLS' and + * 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external + * radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /** + * A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based + * authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** + * Get vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @return the processorArchitecture value + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @param processorArchitecture the processorArchitecture value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @return the radiusServerAuthCertificate value + */ + public String radiusServerAuthCertificate() { + return this.radiusServerAuthCertificate; + } + + /** + * Set the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { + this.radiusServerAuthCertificate = radiusServerAuthCertificate; + return this; + } + + /** + * Get a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @return the clientRootCertificates value + */ + public List clientRootCertificates() { + return this.clientRootCertificates; + } + + /** + * Set a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @param clientRootCertificates the clientRootCertificates value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { + this.clientRootCertificates = clientRootCertificates; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientProtocol.java new file mode 100644 index 0000000000000..706ef3a5324cf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnClientProtocol. + */ +public final class VpnClientProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnClientProtocol. */ + public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value SSTP for VpnClientProtocol. */ + public static final VpnClientProtocol SSTP = fromString("SSTP"); + + /** Static value OpenVPN for VpnClientProtocol. */ + public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * @param name a name to look for + * @return the corresponding VpnClientProtocol + */ + @JsonCreator + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** + * @return known VpnClientProtocol values + */ + public static Collection values() { + return values(VpnClientProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRevokedCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..b7bc8d208d3c7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRootCertificate.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRootCertificate.java new file mode 100644 index 0000000000000..705a7f47d682d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the VPN client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnection.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnection.java new file mode 100644 index 0000000000000..2f7fcca2ecc6e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnection.java @@ -0,0 +1,467 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing VpnConnection. + */ +public interface VpnConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * The entirety of the VpnConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVpnGateway, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnConnection definition. + */ + interface Blank extends WithVpnGateway { + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies resourceGroupName, gatewayName. + * @param resourceGroupName The resource group name of the VpnGateway + * @param gatewayName The name of the gateway + * @return the next definition stage + */ + WithCreate withExistingVpnGateway(String resourceGroupName, String gatewayName); + } + + /** + * The stage of the vpnconnection definition allowing to specify ConnectionBandwidth. + */ + interface WithConnectionBandwidth { + /** + * Specifies connectionBandwidth. + * @param connectionBandwidth Expected bandwidth in MBPS + * @return the next definition stage + */ + WithCreate withConnectionBandwidth(Integer connectionBandwidth); + } + + /** + * The stage of the vpnconnection definition allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next definition stage + */ + WithCreate withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableInternetSecurity. + */ + interface WithEnableInternetSecurity { + /** + * Specifies enableInternetSecurity. + * @param enableInternetSecurity Enable internet security + * @return the next definition stage + */ + WithCreate withEnableInternetSecurity(Boolean enableInternetSecurity); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableRateLimiting. + */ + interface WithEnableRateLimiting { + /** + * Specifies enableRateLimiting. + * @param enableRateLimiting EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableRateLimiting(Boolean enableRateLimiting); + } + + /** + * The stage of the vpnconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the vpnconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next definition stage + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the vpnconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection definition allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next definition stage + */ + WithCreate withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight routing weight for vpn connection + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnConnectionProtocolType. + */ + interface WithVpnConnectionProtocolType { + /** + * Specifies vpnConnectionProtocolType. + * @param vpnConnectionProtocolType Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next definition stage + */ + WithCreate withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConnectionBandwidth, DefinitionStages.WithConnectionStatus, DefinitionStages.WithEnableBgp, DefinitionStages.WithEnableInternetSecurity, DefinitionStages.WithEnableRateLimiting, DefinitionStages.WithId, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithName, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteVpnSite, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithVpnConnectionProtocolType { + } + } + /** + * The template for a VpnConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConnectionBandwidth, UpdateStages.WithConnectionStatus, UpdateStages.WithEnableBgp, UpdateStages.WithEnableInternetSecurity, UpdateStages.WithEnableRateLimiting, UpdateStages.WithId, UpdateStages.WithIpsecPolicies, UpdateStages.WithName, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteVpnSite, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithVpnConnectionProtocolType { + } + + /** + * Grouping of VpnConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnconnection update allowing to specify ConnectionBandwidth. + */ + interface WithConnectionBandwidth { + /** + * Specifies connectionBandwidth. + * @param connectionBandwidth Expected bandwidth in MBPS + * @return the next update stage + */ + Update withConnectionBandwidth(Integer connectionBandwidth); + } + + /** + * The stage of the vpnconnection update allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next update stage + */ + Update withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableInternetSecurity. + */ + interface WithEnableInternetSecurity { + /** + * Specifies enableInternetSecurity. + * @param enableInternetSecurity Enable internet security + * @return the next update stage + */ + Update withEnableInternetSecurity(Boolean enableInternetSecurity); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableRateLimiting. + */ + interface WithEnableRateLimiting { + /** + * Specifies enableRateLimiting. + * @param enableRateLimiting EnableBgp flag + * @return the next update stage + */ + Update withEnableRateLimiting(Boolean enableRateLimiting); + } + + /** + * The stage of the vpnconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the vpnconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the vpnconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection update allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next update stage + */ + Update withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight routing weight for vpn connection + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection update allowing to specify VpnConnectionProtocolType. + */ + interface WithVpnConnectionProtocolType { + /** + * Specifies vpnConnectionProtocolType. + * @param vpnConnectionProtocolType Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next update stage + */ + Update withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnectionStatus.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnectionStatus.java new file mode 100644 index 0000000000000..b6ce5fb311c95 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnConnectionStatus. + */ +public final class VpnConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VpnConnectionStatus. */ + public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VpnConnectionStatus. */ + public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VpnConnectionStatus + */ + @JsonCreator + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** + * @return known VpnConnectionStatus values + */ + public static Collection values() { + return values(VpnConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnections.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnections.java new file mode 100644 index 0000000000000..160d67504aec6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnConnections. + */ +public interface VpnConnections extends SupportsCreating, HasInner { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnDeviceScriptParameters.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnDeviceScriptParameters.java new file mode 100644 index 0000000000000..0d438f3f105e7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnDeviceScriptParameters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn device configuration script generation parameters. + */ +public class VpnDeviceScriptParameters { + /** + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /** + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /** + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor for the vpn device. + * + * @return the vendor value + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor for the vpn device. + * + * @param vendor the vendor value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the device family for the vpn device. + * + * @return the deviceFamily value + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set the device family for the vpn device. + * + * @param deviceFamily the deviceFamily value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { + this.deviceFamily = deviceFamily; + return this; + } + + /** + * Get the firmware version for the vpn device. + * + * @return the firmwareVersion value + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set the firmware version for the vpn device. + * + * @param firmwareVersion the firmwareVersion value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateway.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateway.java new file mode 100644 index 0000000000000..ae9d10a468ce6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateway.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnConnectionInner; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnGatewayInner; + +/** + * Type representing VpnGateway. + */ +public interface VpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * The entirety of the VpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpngateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections list of all vpn connections to the gateway + * @return the next definition stage + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the vpngateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next definition stage + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the vpngateway definition allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this vpn gateway + * @return the next definition stage + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithConnections, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub, DefinitionStages.WithVpnGatewayScaleUnit { + } + } + /** + * The template for a VpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithConnections, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub, UpdateStages.WithVpnGatewayScaleUnit { + } + + /** + * Grouping of VpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the vpngateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections list of all vpn connections to the gateway + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the vpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next update stage + */ + Update withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the vpngateway update allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this vpn gateway + * @return the next update stage + */ + Update withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGatewayTunnelingProtocol.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGatewayTunnelingProtocol.java new file mode 100644 index 0000000000000..ff915e91e1ef5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGatewayTunnelingProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnGatewayTunnelingProtocol. + */ +public final class VpnGatewayTunnelingProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value OpenVPN for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnGatewayTunnelingProtocol from its string representation. + * @param name a name to look for + * @return the corresponding VpnGatewayTunnelingProtocol + */ + @JsonCreator + public static VpnGatewayTunnelingProtocol fromString(String name) { + return fromString(name, VpnGatewayTunnelingProtocol.class); + } + + /** + * @return known VpnGatewayTunnelingProtocol values + */ + public static Collection values() { + return values(VpnGatewayTunnelingProtocol.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateways.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateways.java new file mode 100644 index 0000000000000..5e64b3293cefd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnGateways. + */ +public interface VpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnProfileResponse.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnProfileResponse.java new file mode 100644 index 0000000000000..0783732eaa9c5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnProfileResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnProfileResponseInner; + +/** + * Type representing VpnProfileResponse. + */ +public interface VpnProfileResponse extends HasInner, HasManager { + /** + * @return the profileUrl value. + */ + String profileUrl(); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSite.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSite.java new file mode 100644 index 0000000000000..198d542422765 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSite.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_08_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnSiteInner; + +/** + * Type representing VpnSite. + */ +public interface VpnSite extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the bgpProperties value. + */ + BgpSettings bgpProperties(); + + /** + * @return the deviceProperties value. + */ + DeviceProperties deviceProperties(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the isSecuritySite value. + */ + Boolean isSecuritySite(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the siteKey value. + */ + String siteKey(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * The entirety of the VpnSite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnSite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnSite definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnSite definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpnsite definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges + * @return the next definition stage + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite definition allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + * @param bgpProperties The set of bgp properties + * @return the next definition stage + */ + WithCreate withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite definition allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @param deviceProperties The device properties + * @return the next definition stage + */ + WithCreate withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite definition allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The ip-address for the vpn-site + * @return the next definition stage + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite definition allowing to specify IsSecuritySite. + */ + interface WithIsSecuritySite { + /** + * Specifies isSecuritySite. + * @param isSecuritySite IsSecuritySite flag + * @return the next definition stage + */ + WithCreate withIsSecuritySite(Boolean isSecuritySite); + } + + /** + * The stage of the vpnsite definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite definition allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @param siteKey The key for vpn-site that can be used for connections + * @return the next definition stage + */ + WithCreate withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the vpnSite belongs + * @return the next definition stage + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithBgpProperties, DefinitionStages.WithDeviceProperties, DefinitionStages.WithIpAddress, DefinitionStages.WithIsSecuritySite, DefinitionStages.WithProvisioningState, DefinitionStages.WithSiteKey, DefinitionStages.WithVirtualWan { + } + } + /** + * The template for a VpnSite update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithBgpProperties, UpdateStages.WithDeviceProperties, UpdateStages.WithIpAddress, UpdateStages.WithIsSecuritySite, UpdateStages.WithProvisioningState, UpdateStages.WithSiteKey, UpdateStages.WithVirtualWan { + } + + /** + * Grouping of VpnSite update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnsite update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite update allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + * @param bgpProperties The set of bgp properties + * @return the next update stage + */ + Update withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite update allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @param deviceProperties The device properties + * @return the next update stage + */ + Update withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The ip-address for the vpn-site + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite update allowing to specify IsSecuritySite. + */ + interface WithIsSecuritySite { + /** + * Specifies isSecuritySite. + * @param isSecuritySite IsSecuritySite flag + * @return the next update stage + */ + Update withIsSecuritySite(Boolean isSecuritySite); + } + + /** + * The stage of the vpnsite update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite update allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @param siteKey The key for vpn-site that can be used for connections + * @return the next update stage + */ + Update withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the vpnSite belongs + * @return the next update stage + */ + Update withVirtualWan(SubResource virtualWan); + } + + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSiteId.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSiteId.java new file mode 100644 index 0000000000000..67bf2fa9aa1ed --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSiteId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnSite Resource. + */ +public class VpnSiteId { + /** + * The resource-uri of the vpn-site for which config is to be fetched. + */ + @JsonProperty(value = "vpnSite", access = JsonProperty.Access.WRITE_ONLY) + private String vpnSite; + + /** + * Get the resource-uri of the vpn-site for which config is to be fetched. + * + * @return the vpnSite value + */ + public String vpnSite() { + return this.vpnSite; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSites.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSites.java new file mode 100644 index 0000000000000..155543392078b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSites.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnSitesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSites. + */ +public interface VpnSites extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSitesConfigurations.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSitesConfigurations.java new file mode 100644 index 0000000000000..97ef851b7c1bc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnSitesConfigurations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.implementation.VpnSitesConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSitesConfigurations. + */ +public interface VpnSitesConfigurations extends HasInner { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request); + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnType.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnType.java new file mode 100644 index 0000000000000..103b8232109e2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/VpnType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnType. + */ +public final class VpnType extends ExpandableStringEnum { + /** Static value PolicyBased for VpnType. */ + public static final VpnType POLICY_BASED = fromString("PolicyBased"); + + /** Static value RouteBased for VpnType. */ + public static final VpnType ROUTE_BASED = fromString("RouteBased"); + + /** + * Creates or finds a VpnType from its string representation. + * @param name a name to look for + * @return the corresponding VpnType + */ + @JsonCreator + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** + * @return known VpnType values + */ + public static Collection values() { + return values(VpnType.class); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 0000000000000..df76d55eae0b1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslProtocol; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class ApplicationGatewayAvailableSslOptionsImpl extends WrapperImpl implements ApplicationGatewayAvailableSslOptions { + private final NetworkManager manager; + ApplicationGatewayAvailableSslOptionsImpl(ApplicationGatewayAvailableSslOptionsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List availableCipherSuites() { + return this.inner().availableCipherSuites(); + } + + @Override + public List availableProtocols() { + return this.inner().availableProtocols(); + } + + @Override + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.inner().defaultPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List predefinedPolicies() { + return this.inner().predefinedPolicies(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java new file mode 100644 index 0000000000000..524f49bd47a20 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayAvailableSslOptionsInner extends Resource { + /** + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "properties.predefinedPolicies") + private List predefinedPolicies; + + /** + * Name of the Ssl predefined policy applied by default to application + * gateway. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "properties.defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /** + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "properties.availableCipherSuites") + private List availableCipherSuites; + + /** + * List of available Ssl protocols. + */ + @JsonProperty(value = "properties.availableProtocols") + private List availableProtocols; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of available Ssl predefined policy. + * + * @return the predefinedPolicies value + */ + public List predefinedPolicies() { + return this.predefinedPolicies; + } + + /** + * Set list of available Ssl predefined policy. + * + * @param predefinedPolicies the predefinedPolicies value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { + this.predefinedPolicies = predefinedPolicies; + return this; + } + + /** + * Get name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the defaultPolicy value + */ + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.defaultPolicy; + } + + /** + * Set name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param defaultPolicy the defaultPolicy value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { + this.defaultPolicy = defaultPolicy; + return this; + } + + /** + * Get list of available Ssl cipher suites. + * + * @return the availableCipherSuites value + */ + public List availableCipherSuites() { + return this.availableCipherSuites; + } + + /** + * Set list of available Ssl cipher suites. + * + * @param availableCipherSuites the availableCipherSuites value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites(List availableCipherSuites) { + this.availableCipherSuites = availableCipherSuites; + return this; + } + + /** + * Get list of available Ssl protocols. + * + * @return the availableProtocols value + */ + public List availableProtocols() { + return this.availableProtocols; + } + + /** + * Set list of available Ssl protocols. + * + * @param availableProtocols the availableProtocols value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols(List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java new file mode 100644 index 0000000000000..e3925804055ee --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFirewallRuleSet; + +class ApplicationGatewayAvailableWafRuleSetsResultImpl extends WrapperImpl implements ApplicationGatewayAvailableWafRuleSetsResult { + private final NetworkManager manager; + ApplicationGatewayAvailableWafRuleSetsResultImpl(ApplicationGatewayAvailableWafRuleSetsResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java new file mode 100644 index 0000000000000..fa33adb8e4bc8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + */ +public class ApplicationGatewayAvailableWafRuleSetsResultInner { + /** + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of application gateway rule sets. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of application gateway rule sets. + * + * @param value the value value to set + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 0000000000000..65f30a3241687 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHealthPool; + +class ApplicationGatewayBackendHealthImpl extends WrapperImpl implements ApplicationGatewayBackendHealth { + private final NetworkManager manager; + ApplicationGatewayBackendHealthImpl(ApplicationGatewayBackendHealthInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthInner.java new file mode 100644 index 0000000000000..e95251e385181 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of ApplicationGatewayBackendHealthPool resources. + */ +public class ApplicationGatewayBackendHealthInner { + /** + * The backendAddressPools property. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get the backendAddressPools value. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools value. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayBackendHealthInner object itself. + */ + public ApplicationGatewayBackendHealthInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayImpl.java new file mode 100644 index 0000000000000..ea0829925763e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayTrustedRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAutoscaleConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayCustomError; + +class ApplicationGatewayImpl extends GroupableResourceCoreImpl implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { + ApplicationGatewayImpl(String name, ApplicationGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List authenticationCertificates() { + return this.inner().authenticationCertificates(); + } + + @Override + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.inner().autoscaleConfiguration(); + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + + @Override + public List backendHttpSettingsCollection() { + return this.inner().backendHttpSettingsCollection(); + } + + @Override + public List customErrorConfigurations() { + return this.inner().customErrorConfigurations(); + } + + @Override + public Boolean enableFips() { + return this.inner().enableFips(); + } + + @Override + public Boolean enableHttp2() { + return this.inner().enableHttp2(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public List frontendPorts() { + return this.inner().frontendPorts(); + } + + @Override + public List gatewayIPConfigurations() { + return this.inner().gatewayIPConfigurations(); + } + + @Override + public List httpListeners() { + return this.inner().httpListeners(); + } + + @Override + public ApplicationGatewayOperationalState operationalState() { + return this.inner().operationalState(); + } + + @Override + public List probes() { + return this.inner().probes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List redirectConfigurations() { + return this.inner().redirectConfigurations(); + } + + @Override + public List requestRoutingRules() { + return this.inner().requestRoutingRules(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public ApplicationGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public List sslCertificates() { + return this.inner().sslCertificates(); + } + + @Override + public ApplicationGatewaySslPolicy sslPolicy() { + return this.inner().sslPolicy(); + } + + @Override + public List trustedRootCertificates() { + return this.inner().trustedRootCertificates(); + } + + @Override + public List urlPathMaps() { + return this.inner().urlPathMaps(); + } + + @Override + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.inner().webApplicationFirewallConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ApplicationGatewayImpl withAuthenticationCertificates(List authenticationCertificates) { + this.inner().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.inner().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.inner().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + @Override + public ApplicationGatewayImpl withCustomErrorConfigurations(List customErrorConfigurations) { + this.inner().withCustomErrorConfigurations(customErrorConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.inner().withEnableFips(enableFips); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.inner().withEnableHttp2(enableHttp2); + return this; + } + + @Override + public ApplicationGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.inner().withFrontendPorts(frontendPorts); + return this; + } + + @Override + public ApplicationGatewayImpl withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.inner().withGatewayIPConfigurations(gatewayIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.inner().withHttpListeners(httpListeners); + return this; + } + + @Override + public ApplicationGatewayImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public ApplicationGatewayImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ApplicationGatewayImpl withRedirectConfigurations(List redirectConfigurations) { + this.inner().withRedirectConfigurations(redirectConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withRequestRoutingRules(List requestRoutingRules) { + this.inner().withRequestRoutingRules(requestRoutingRules); + return this; + } + + @Override + public ApplicationGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.inner().withSslCertificates(sslCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.inner().withSslPolicy(sslPolicy); + return this; + } + + @Override + public ApplicationGatewayImpl withTrustedRootCertificates(List trustedRootCertificates) { + this.inner().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.inner().withUrlPathMaps(urlPathMaps); + return this; + } + + @Override + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.inner().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayInner.java new file mode 100644 index 0000000000000..445ffd5bb924e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewayInner.java @@ -0,0 +1,710 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayTrustedRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAutoscaleConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayCustomError; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Application gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayInner extends Resource { + /** + * SKU of the application gateway resource. + */ + @JsonProperty(value = "properties.sku") + private ApplicationGatewaySku sku; + + /** + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /** + * Operational state of the application gateway resource. Possible values + * include: 'Stopped', 'Starting', 'Running', 'Stopping'. + */ + @JsonProperty(value = "properties.operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /** + * Subnets of application the gateway resource. + */ + @JsonProperty(value = "properties.gatewayIPConfigurations") + private List gatewayIPConfigurations; + + /** + * Authentication certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Trusted Root certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /** + * SSL certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.sslCertificates") + private List sslCertificates; + + /** + * Frontend IP addresses of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Frontend ports of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendPorts") + private List frontendPorts; + + /** + * Probes of the application gateway resource. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Backend address pool of the application gateway resource. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Backend http settings of the application gateway resource. + */ + @JsonProperty(value = "properties.backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Http listeners of the application gateway resource. + */ + @JsonProperty(value = "properties.httpListeners") + private List httpListeners; + + /** + * URL path map of the application gateway resource. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Redirect configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.redirectConfigurations") + private List redirectConfigurations; + + /** + * Web application firewall configuration. + */ + @JsonProperty(value = "properties.webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /** + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableHttp2") + private Boolean enableHttp2; + + /** + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableFips") + private Boolean enableFips; + + /** + * Autoscale Configuration. + */ + @JsonProperty(value = "properties.autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /** + * Resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Provisioning state of the application gateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Custom error configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get sKU of the application gateway resource. + * + * @return the sku value + */ + public ApplicationGatewaySku sku() { + return this.sku; + } + + /** + * Set sKU of the application gateway resource. + * + * @param sku the sku value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get sSL policy of the application gateway resource. + * + * @return the sslPolicy value + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set sSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'. + * + * @return the operationalState value + */ + public ApplicationGatewayOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get subnets of application the gateway resource. + * + * @return the gatewayIPConfigurations value + */ + public List gatewayIPConfigurations() { + return this.gatewayIPConfigurations; + } + + /** + * Set subnets of application the gateway resource. + * + * @param gatewayIPConfigurations the gatewayIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.gatewayIPConfigurations = gatewayIPConfigurations; + return this; + } + + /** + * Get authentication certificates of the application gateway resource. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set authentication certificates of the application gateway resource. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get trusted Root certificates of the application gateway resource. + * + * @return the trustedRootCertificates value + */ + public List trustedRootCertificates() { + return this.trustedRootCertificates; + } + + /** + * Set trusted Root certificates of the application gateway resource. + * + * @param trustedRootCertificates the trustedRootCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withTrustedRootCertificates(List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get sSL certificates of the application gateway resource. + * + * @return the sslCertificates value + */ + public List sslCertificates() { + return this.sslCertificates; + } + + /** + * Set sSL certificates of the application gateway resource. + * + * @param sslCertificates the sslCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslCertificates(List sslCertificates) { + this.sslCertificates = sslCertificates; + return this; + } + + /** + * Get frontend IP addresses of the application gateway resource. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set frontend IP addresses of the application gateway resource. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get frontend ports of the application gateway resource. + * + * @return the frontendPorts value + */ + public List frontendPorts() { + return this.frontendPorts; + } + + /** + * Set frontend ports of the application gateway resource. + * + * @param frontendPorts the frontendPorts value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { + this.frontendPorts = frontendPorts; + return this; + } + + /** + * Get probes of the application gateway resource. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set probes of the application gateway resource. + * + * @param probes the probes value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get backend address pool of the application gateway resource. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set backend address pool of the application gateway resource. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get backend http settings of the application gateway resource. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set backend http settings of the application gateway resource. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get http listeners of the application gateway resource. + * + * @return the httpListeners value + */ + public List httpListeners() { + return this.httpListeners; + } + + /** + * Set http listeners of the application gateway resource. + * + * @param httpListeners the httpListeners value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get uRL path map of the application gateway resource. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set uRL path map of the application gateway resource. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing rules of the application gateway resource. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get redirect configurations of the application gateway resource. + * + * @return the redirectConfigurations value + */ + public List redirectConfigurations() { + return this.redirectConfigurations; + } + + /** + * Set redirect configurations of the application gateway resource. + * + * @param redirectConfigurations the redirectConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRedirectConfigurations(List redirectConfigurations) { + this.redirectConfigurations = redirectConfigurations; + return this; + } + + /** + * Get web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.webApplicationFirewallConfiguration; + } + + /** + * Set web application firewall configuration. + * + * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + return this; + } + + /** + * Get whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value + */ + public Boolean enableHttp2() { + return this.enableHttp2; + } + + /** + * Set whether HTTP2 is enabled on the application gateway resource. + * + * @param enableHttp2 the enableHttp2 value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { + this.enableHttp2 = enableHttp2; + return this; + } + + /** + * Get whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set whether FIPS is enabled on the application gateway resource. + * + * @param enableFips the enableFips value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get autoscale Configuration. + * + * @return the autoscaleConfiguration value + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get resource GUID property of the application gateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set resource GUID property of the application gateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set custom error configurations of the application gateway resource. + * + * @param customErrorConfigurations the customErrorConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withCustomErrorConfigurations(List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting where the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..62cac23211401 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPredefinedPolicy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslProtocol; + +class ApplicationGatewaySslPredefinedPolicyImpl extends WrapperImpl implements ApplicationGatewaySslPredefinedPolicy { + private final NetworkManager manager; + ApplicationGatewaySslPredefinedPolicyImpl(ApplicationGatewaySslPredefinedPolicyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List cipherSuites() { + return this.inner().cipherSuites(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.inner().minProtocolVersion(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java new file mode 100644 index 0000000000000..e2cfa80b5eee9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * An Ssl predefined policy. + */ +@JsonFlatten +public class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /** + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Ssl cipher suites to be enabled in the specified order for application + * gateway. + */ + @JsonProperty(value = "properties.cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "properties.minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get name of the Ssl predefined policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Ssl predefined policy. + * + * @param name the name value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order for application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysImpl.java new file mode 100644 index 0000000000000..b0e93c37d55be --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewaySslPredefinedPolicy; + +class ApplicationGatewaysImpl extends GroupableResourcesCoreImpl implements ApplicationGateways { + protected ApplicationGatewaysImpl(NetworkManager manager) { + super(manager.inner().applicationGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listAll()); + } + + @Override + public Observable listAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAllAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable startAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.startAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.stopAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.backendHealthAsync(resourceGroupName, applicationGatewayName) + .map(new Func1() { + @Override + public ApplicationGatewayBackendHealth call(ApplicationGatewayBackendHealthInner inner) { + return new ApplicationGatewayBackendHealthImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableWafRuleSetsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableWafRuleSetsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResult call(ApplicationGatewayAvailableWafRuleSetsResultInner inner) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, manager()); + } + }); + } + + @Override + protected ApplicationGatewayImpl wrapModel(ApplicationGatewayInner inner) { + return new ApplicationGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationGatewayImpl wrapModel(String name) { + return new ApplicationGatewayImpl(name, new ApplicationGatewayInner(), this.manager()); + } + + @Override + public Observable listAvailableSslOptionsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslOptionsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableSslOptions call(ApplicationGatewayAvailableSslOptionsInner inner) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableSslPredefinedPoliciesAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslPredefinedPoliciesAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + ApplicationGatewaysInner client = this.inner(); + return client.getSslPredefinedPolicyAsync(predefinedPolicyName) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysInner.java new file mode 100644 index 0000000000000..d5fb007b5ce9f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationGatewaysInner.java @@ -0,0 +1,2355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationGateways. + */ +public class ApplicationGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ApplicationGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAll" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + Observable> listAll(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways backendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> backendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways beginBackendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> beginBackendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAvailableWafRuleSets" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + Observable> listAvailableWafRuleSets(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAvailableSslOptions" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + Observable> listAvailableSslOptions(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAvailableSslPredefinedPolicies" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies") + Observable> listAvailableSslPredefinedPolicies(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways getSslPredefinedPolicy" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}") + Observable> getSslPredefinedPolicy(@Path("subscriptionId") String subscriptionId, @Path("predefinedPolicyName") String predefinedPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAllNext" }) + @GET + Observable> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways listAvailableSslPredefinedPoliciesNext" }) + @GET + Observable> listAvailableSslPredefinedPoliciesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAll() { + ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { + return listAllSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String applicationGatewayName) { + startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String applicationGatewayName) { + return startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.start(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String applicationGatewayName) { + beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginStart(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String applicationGatewayName) { + stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String applicationGatewayName) { + return stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.stop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String applicationGatewayName) { + beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginStop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBackendHealthDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object if successful. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableWafRuleSetsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableWafRuleSetsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableWafRuleSetsResultInner>() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable> listAvailableWafRuleSetsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listAvailableWafRuleSets(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableWafRuleSetsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableWafRuleSetsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableSslOptionsInner object if successful. + */ + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableSslOptionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableSslOptionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableSslOptionsInner>() { + @Override + public ApplicationGatewayAvailableSslOptionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable> listAvailableSslOptionsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listAvailableSslOptions(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableSslOptionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableSslOptionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPolicies() { + ServiceResponse> response = listAvailableSslPredefinedPoliciesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesAsync() { + return listAvailableSslPredefinedPoliciesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesWithServiceResponseAsync() { + return listAvailableSslPredefinedPoliciesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listAvailableSslPredefinedPolicies(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewaySslPredefinedPolicyInner object if successful. + */ + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).toBlocking().single().body(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSslPredefinedPolicyAsync(String predefinedPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName), serviceCallback); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).map(new Func1, ApplicationGatewaySslPredefinedPolicyInner>() { + @Override + public ApplicationGatewaySslPredefinedPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable> getSslPredefinedPolicyWithServiceResponseAsync(String predefinedPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (predefinedPolicyName == null) { + throw new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getSslPredefinedPolicy(this.client.subscriptionId(), predefinedPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSslPredefinedPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSslPredefinedPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAllNext(final String nextPageLink) { + ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPoliciesNext(final String nextPageLink) { + ServiceResponse> response = listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAvailableSslPredefinedPoliciesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..1fe2c1c7003f7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; +import rx.Observable; + +class ApplicationSecurityGroupImpl extends GroupableResourceCoreImpl implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + ApplicationSecurityGroupImpl(String name, ApplicationSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupInner.java new file mode 100644 index 0000000000000..fad275a20ae38 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An application security group in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationSecurityGroupInner extends Resource { + /** + * The resource GUID property of the application security group resource. + * It uniquely identifies a resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the application security group resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsImpl.java new file mode 100644 index 0000000000000..b3f685526b5ac --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ApplicationSecurityGroupsImpl extends GroupableResourcesCoreImpl implements ApplicationSecurityGroups { + protected ApplicationSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().applicationSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(ApplicationSecurityGroupInner inner) { + return new ApplicationSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(String name) { + return new ApplicationSecurityGroupImpl(name, new ApplicationSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsInner.java new file mode 100644 index 0000000000000..00dc19f299ec5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ApplicationSecurityGroupsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationSecurityGroups. + */ +public class ApplicationSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationInner.java new file mode 100644 index 0000000000000..032f67f0a3aa8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationInner.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The serviceName of an AvailableDelegation indicates a possible delegation + * for a subnet. + */ +public class AvailableDelegationInner { + /** + * The name of the AvailableDelegation resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique identifier of the AvailableDelegation resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The name of the service and resource. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * Describes the actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the name of the AvailableDelegation resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the AvailableDelegation resource. + * + * @param name the name value to set + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique identifier of the AvailableDelegation resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set a unique identifier of the AvailableDelegation resource. + * + * @param id the id value to set + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type. + * + * @param type the type value to set + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name of the service and resource. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the service and resource. + * + * @param serviceName the serviceName value to set + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get describes the actions permitted to the service upon delegation. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set describes the actions permitted to the service upon delegation. + * + * @param actions the actions value to set + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsImpl.java new file mode 100644 index 0000000000000..99b38eb2684e2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.AvailableDelegations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.LocationAvailableDelegation; + +class AvailableDelegationsImpl extends WrapperImpl implements AvailableDelegations { + private final NetworkManager manager; + + AvailableDelegationsImpl(NetworkManager manager) { + super(manager.inner().availableDelegations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LocationAvailableDelegationImpl wrapModel(AvailableDelegationInner inner) { + return new LocationAvailableDelegationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableDelegationsInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocationAvailableDelegation call(AvailableDelegationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsInner.java new file mode 100644 index 0000000000000..fc2dba820957b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableDelegationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableDelegations. + */ +public class AvailableDelegationsInner { + /** The Retrofit service to perform REST calls. */ + private AvailableDelegationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableDelegationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableDelegationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableDelegationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableDelegations to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableDelegationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableDelegations list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableDelegations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + ServiceResponse> * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesImpl.java new file mode 100644 index 0000000000000..38af40aea1753 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.AvailableEndpointServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.EndpointServiceResult; + +class AvailableEndpointServicesImpl extends WrapperImpl implements AvailableEndpointServices { + private final NetworkManager manager; + + AvailableEndpointServicesImpl(NetworkManager manager) { + super(manager.inner().availableEndpointServices()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private EndpointServiceResultImpl wrapEndpointServiceResultModel(EndpointServiceResultInner inner) { + return new EndpointServiceResultImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableEndpointServicesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EndpointServiceResult call(EndpointServiceResultInner inner) { + return wrapEndpointServiceResultModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesInner.java new file mode 100644 index 0000000000000..cd2da808325eb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableEndpointServicesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableEndpointServices. + */ +public class AvailableEndpointServicesInner { + /** The Retrofit service to perform REST calls. */ + private AvailableEndpointServicesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableEndpointServicesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableEndpointServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableEndpointServices to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableEndpointServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableEndpointServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableEndpointServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..9a05427eb276b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersListCountry; + +class AvailableProvidersListImpl extends WrapperImpl implements AvailableProvidersList { + private final NetworkManager manager; + AvailableProvidersListImpl(AvailableProvidersListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List countries() { + return this.inner().countries(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListInner.java new file mode 100644 index 0000000000000..d22f44727fa2e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableProvidersListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of available countries with details. + */ +public class AvailableProvidersListInner { + /** + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get list of available countries. + * + * @return the countries value + */ + public List countries() { + return this.countries; + } + + /** + * Set list of available countries. + * + * @param countries the countries value to set + * @return the AvailableProvidersListInner object itself. + */ + public AvailableProvidersListInner withCountries(List countries) { + this.countries = countries; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsImpl.java new file mode 100644 index 0000000000000..8771cc5bb353c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.AvailableResourceGroupDelegations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.LocationAvailableDelegationModel; + +class AvailableResourceGroupDelegationsImpl extends WrapperImpl implements AvailableResourceGroupDelegations { + private final NetworkManager manager; + + AvailableResourceGroupDelegationsImpl(NetworkManager manager) { + super(manager.inner().availableResourceGroupDelegations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LocationAvailableDelegationModelImpl wrapLocationAvailableDelegationModelModel(AvailableDelegationInner inner) { + return new LocationAvailableDelegationModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location, final String resourceGroupName) { + AvailableResourceGroupDelegationsInner client = this.inner(); + return client.listAsync(location, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocationAvailableDelegationModel call(AvailableDelegationInner inner) { + return wrapLocationAvailableDelegationModelModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsInner.java new file mode 100644 index 0000000000000..c93e852cd8484 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AvailableResourceGroupDelegationsInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableResourceGroupDelegations. + */ +public class AvailableResourceGroupDelegationsInner { + /** The Retrofit service to perform REST calls. */ + private AvailableResourceGroupDelegationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableResourceGroupDelegationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableResourceGroupDelegationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableResourceGroupDelegationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableResourceGroupDelegations to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableResourceGroupDelegationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableResourceGroupDelegations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations") + Observable> list(@Path("location") String location, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AvailableResourceGroupDelegations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList list(final String location, final String resourceGroupName) { + ServiceResponse> response = listSinglePageAsync(location, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listAsync(final String location, final String resourceGroupName) { + return listWithServiceResponseAsync(location, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location, final String resourceGroupName) { + return listSinglePageAsync(location, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + ServiceResponse> * @param location The location of the domain name. + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location, final String resourceGroupName) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagImpl.java new file mode 100644 index 0000000000000..295f5f781c56f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTag; +import rx.Observable; + +class AzureFirewallFqdnTagImpl extends GroupableResourceCoreImpl implements AzureFirewallFqdnTag { + AzureFirewallFqdnTagImpl(String name, AzureFirewallFqdnTagInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String fqdnTagName() { + return this.inner().fqdnTagName(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagInner.java new file mode 100644 index 0000000000000..1ec7e777fc943 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagInner.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall FQDN Tag Resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallFqdnTagInner extends Resource { + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of this FQDN Tag. + */ + @JsonProperty(value = "properties.fqdnTagName", access = JsonProperty.Access.WRITE_ONLY) + private String fqdnTagName; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of this FQDN Tag. + * + * @return the fqdnTagName value + */ + public String fqdnTagName() { + return this.fqdnTagName; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallFqdnTagInner object itself. + */ + public AzureFirewallFqdnTagInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsImpl.java new file mode 100644 index 0000000000000..0c3fed50ae6a6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTags; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTag; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallFqdnTagsImpl extends GroupableResourcesCoreImpl implements AzureFirewallFqdnTags { + protected AzureFirewallFqdnTagsImpl(NetworkManager manager) { + super(manager.inner().azureFirewallFqdnTags(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallFqdnTagsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + AzureFirewallFqdnTagsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallFqdnTagsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewallFqdnTag call(AzureFirewallFqdnTagInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected AzureFirewallFqdnTagImpl wrapModel(AzureFirewallFqdnTagInner inner) { + return new AzureFirewallFqdnTagImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallFqdnTagImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsInner.java new file mode 100644 index 0000000000000..f7f0230c23ce2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallFqdnTagsInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AzureFirewallFqdnTags. + */ +public class AzureFirewallFqdnTagsInner { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallFqdnTagsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallFqdnTagsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallFqdnTagsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallFqdnTagsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewallFqdnTags to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallFqdnTagsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTags list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTags listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallFqdnTagInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallFqdnTagInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallFqdnTagInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallFqdnTagInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..8ed9ffef58d20 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewall; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallNatRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; + +class AzureFirewallImpl extends GroupableResourceCoreImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + AzureFirewallImpl(String name, AzureFirewallInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationRuleCollections() { + return this.inner().applicationRuleCollections(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public List natRuleCollections() { + return this.inner().natRuleCollections(); + } + + @Override + public List networkRuleCollections() { + return this.inner().networkRuleCollections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureFirewallImpl withApplicationRuleCollections(List applicationRuleCollections) { + this.inner().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public AzureFirewallImpl withNatRuleCollections(List natRuleCollections) { + this.inner().withNatRuleCollections(natRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withNetworkRuleCollections(List networkRuleCollections) { + this.inner().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallInner.java new file mode 100644 index 0000000000000..a469f6c27d3ca --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallInner.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallNatRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallInner extends Resource { + /** + * Collection of application rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.applicationRuleCollections") + private List applicationRuleCollections; + + /** + * Collection of NAT rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.natRuleCollections") + private List natRuleCollections; + + /** + * Collection of network rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.networkRuleCollections") + private List networkRuleCollections; + + /** + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of application rule collections used by Azure Firewall. + * + * @return the applicationRuleCollections value + */ + public List applicationRuleCollections() { + return this.applicationRuleCollections; + } + + /** + * Set collection of application rule collections used by Azure Firewall. + * + * @param applicationRuleCollections the applicationRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withApplicationRuleCollections(List applicationRuleCollections) { + this.applicationRuleCollections = applicationRuleCollections; + return this; + } + + /** + * Get collection of NAT rule collections used by Azure Firewall. + * + * @return the natRuleCollections value + */ + public List natRuleCollections() { + return this.natRuleCollections; + } + + /** + * Set collection of NAT rule collections used by Azure Firewall. + * + * @param natRuleCollections the natRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNatRuleCollections(List natRuleCollections) { + this.natRuleCollections = natRuleCollections; + return this; + } + + /** + * Get collection of network rule collections used by Azure Firewall. + * + * @return the networkRuleCollections value + */ + public List networkRuleCollections() { + return this.networkRuleCollections; + } + + /** + * Set collection of network rule collections used by Azure Firewall. + * + * @param networkRuleCollections the networkRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNetworkRuleCollections(List networkRuleCollections) { + this.networkRuleCollections = networkRuleCollections; + return this; + } + + /** + * Get iP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configuration of the Azure Firewall resource. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsImpl.java new file mode 100644 index 0000000000000..8e22ef200c526 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewall; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallsImpl extends GroupableResourcesCoreImpl implements AzureFirewalls { + protected AzureFirewallsImpl(NetworkManager manager) { + super(manager.inner().azureFirewalls(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AzureFirewallImpl define(String name) { + return wrapModel(name); + } + + @Override + protected AzureFirewallImpl wrapModel(AzureFirewallInner inner) { + return new AzureFirewallImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallImpl wrapModel(String name) { + return new AzureFirewallImpl(name, new AzureFirewallInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsInner.java new file mode 100644 index 0000000000000..5a4611142d3ce --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AzureFirewalls. + */ +public class AzureFirewallsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewalls to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String azureFirewallName) { + deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().last().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String azureFirewallName) { + return deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String azureFirewallName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String azureFirewallName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner beginCreateOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..c3a1e721d2796 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReport; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportItem; + +class AzureReachabilityReportImpl extends WrapperImpl implements AzureReachabilityReport { + private final NetworkManager manager; + AzureReachabilityReportImpl(AzureReachabilityReportInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String aggregationLevel() { + return this.inner().aggregationLevel(); + } + + @Override + public AzureReachabilityReportLocation providerLocation() { + return this.inner().providerLocation(); + } + + @Override + public List reachabilityReport() { + return this.inner().reachabilityReport(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportInner.java new file mode 100644 index 0000000000000..3e109da912482 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureReachabilityReportInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details. + */ +public class AzureReachabilityReportInner { + /** + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @return the aggregationLevel value + */ + public String aggregationLevel() { + return this.aggregationLevel; + } + + /** + * Set the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @param aggregationLevel the aggregationLevel value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { + this.aggregationLevel = aggregationLevel; + return this; + } + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Azure reachability report items. + * + * @return the reachabilityReport value + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set list of Azure reachability report items. + * + * @param reachabilityReport the reachabilityReport value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { + this.reachabilityReport = reachabilityReport; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolImpl.java new file mode 100644 index 0000000000000..75e95bcdf4b94 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.SubResource; + +class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl implements BackendAddressPool { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String backendAddressPoolName; + + BackendAddressPoolImpl(BackendAddressPoolInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.backendAddressPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "backendAddressPools"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerBackendAddressPoolsInner client = this.manager().inner().loadBalancerBackendAddressPools(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.backendAddressPoolName); + } + + + + @Override + public List backendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().backendIPConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().backendIPConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource outboundRule() { + return this.inner().outboundRule(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolInner.java new file mode 100644 index 0000000000000..e111d08f2b97b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BackendAddressPoolInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Pool of backend IP addresses. + */ +@JsonFlatten +public class BackendAddressPoolInner extends SubResource { + /** + * Gets collection of references to IP addresses defined in network + * interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIPConfigurations; + + /** + * Gets load balancing rules that use this backend address pool. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * Gets outbound rules that use this backend address pool. + */ + @JsonProperty(value = "properties.outboundRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundRule; + + /** + * Get provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get gets collection of references to IP addresses defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Get gets load balancing rules that use this backend address pool. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get gets outbound rules that use this backend address pool. + * + * @return the outboundRule value + */ + public SubResource outboundRule() { + return this.outboundRule; + } + + /** + * Get get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultImpl.java new file mode 100644 index 0000000000000..4bdadea838438 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.BgpPeerStatusListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BgpPeerStatus; + +class BgpPeerStatusListResultImpl extends WrapperImpl implements BgpPeerStatusListResult { + private final NetworkManager manager; + BgpPeerStatusListResultImpl(BgpPeerStatusListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultInner.java new file mode 100644 index 0000000000000..c8ee5f4684c38 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpPeerStatusListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list BGP peer status API service call. + */ +public class BgpPeerStatusListResultInner { + /** + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of BGP peers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of BGP peers. + * + * @param value the value value to set + * @return the BgpPeerStatusListResultInner object itself. + */ + public BgpPeerStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesImpl.java new file mode 100644 index 0000000000000..efb61bd2037f9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunity; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class BgpServiceCommunitiesImpl extends GroupableResourcesCoreImpl implements BgpServiceCommunities { + protected BgpServiceCommunitiesImpl(NetworkManager manager) { + super(manager.inner().bgpServiceCommunities(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + BgpServiceCommunitiesInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + BgpServiceCommunitiesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + BgpServiceCommunitiesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BgpServiceCommunity call(BgpServiceCommunityInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(BgpServiceCommunityInner inner) { + return new BgpServiceCommunityImpl(inner.name(), inner, manager()); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesInner.java new file mode 100644 index 0000000000000..c92db8556f8a0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunitiesInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BgpServiceCommunities. + */ +public class BgpServiceCommunitiesInner { + /** The Retrofit service to perform REST calls. */ + private BgpServiceCommunitiesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BgpServiceCommunitiesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(BgpServiceCommunitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BgpServiceCommunities to be + * used by Retrofit to perform actually REST calls. + */ + interface BgpServiceCommunitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunities list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunities listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..0329fcd588eda --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunity; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BGPCommunity; + +class BgpServiceCommunityImpl extends GroupableResourceCoreImpl implements BgpServiceCommunity { + BgpServiceCommunityImpl(String name, BgpServiceCommunityInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bgpCommunities() { + return this.inner().bgpCommunities(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityInner.java new file mode 100644 index 0000000000000..be024c0d73927 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/BgpServiceCommunityInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BGPCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service Community Properties. + */ +@JsonFlatten +@SkipParentValidation +public class BgpServiceCommunityInner extends Resource { + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Get a list of bgp communities. + */ + @JsonProperty(value = "properties.bgpCommunities") + private List bgpCommunities; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param serviceName the serviceName value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get get a list of bgp communities. + * + * @return the bgpCommunities value + */ + public List bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set get a list of bgp communities. + * + * @param bgpCommunities the bgpCommunities value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorInner.java new file mode 100644 index 0000000000000..558d1a0dfa447 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorInner { + /** + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get connection monitor location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set connection monitor location. + * + * @param location the location value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get connection monitor tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set connection monitor tags. + * + * @param tags the tags value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultImpl.java new file mode 100644 index 0000000000000..5793b307d7527 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionStateSnapshot; + +class ConnectionMonitorQueryResultImpl extends WrapperImpl implements ConnectionMonitorQueryResult { + private final NetworkManager manager; + ConnectionMonitorQueryResultImpl(ConnectionMonitorQueryResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorSourceStatus sourceStatus() { + return this.inner().sourceStatus(); + } + + @Override + public List states() { + return this.inner().states(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultInner.java new file mode 100644 index 0000000000000..e43d4a2f94a62 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of connection states snaphots. + */ +public class ConnectionMonitorQueryResultInner { + /** + * Status of connection monitor source. Possible values include: 'Uknown', + * 'Active', 'Inactive'. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /** + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @return the sourceStatus value + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @param sourceStatus the sourceStatus value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get information about connection states. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set information about connection states. + * + * @param states the states value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 0000000000000..25aa264c7db6a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ConnectionMonitorResultImpl extends CreatableUpdatableImpl implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String connectionMonitorName; + private ConnectionMonitorInner createOrUpdateParameter; + + ConnectionMonitorResultImpl(String name, NetworkManager manager) { + super(name, new ConnectionMonitorResultInner()); + this.manager = manager; + // Set resource name + this.connectionMonitorName = name; + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + ConnectionMonitorResultImpl(ConnectionMonitorResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionMonitorName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.connectionMonitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "connectionMonitors"); + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public Boolean autoStart() { + return this.inner().autoStart(); + } + + @Override + public ConnectionMonitorDestination destination() { + return this.inner().destination(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer monitoringIntervalInSeconds() { + return this.inner().monitoringIntervalInSeconds(); + } + + @Override + public String monitoringStatus() { + return this.inner().monitoringStatus(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionMonitorSource source() { + return this.inner().source(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ConnectionMonitorResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createOrUpdateParameter.withDestination(destination); + return this; + } + + @Override + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createOrUpdateParameter.withSource(source); + return this; + } + + @Override + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createOrUpdateParameter.withAutoStart(autoStart); + return this; + } + + @Override + public ConnectionMonitorResultImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createOrUpdateParameter.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + @Override + public ConnectionMonitorResultImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultInner.java new file mode 100644 index 0000000000000..048e853e64867 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorResultInner.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Information about the connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorResultInner extends Resource { + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * The provisioning state of the connection monitor. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "properties.monitoringStatus") + private String monitoringStatus; + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date and time when the connection monitor was started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date and time when the connection monitor was started. + * + * @param startTime the startTime value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the monitoring status of the connection monitor. + * + * @return the monitoringStatus value + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoring status of the connection monitor. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringStatus(String monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 0000000000000..9df32b6a2b54a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitorResult; + +class ConnectionMonitorsImpl extends WrapperImpl implements ConnectionMonitors { + private final NetworkManager manager; + + ConnectionMonitorsImpl(NetworkManager manager) { + super(manager.inner().connectionMonitors()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorResultImpl define(String name) { + return wrapModel(name); + } + + private ConnectionMonitorResultImpl wrapModel(ConnectionMonitorResultInner inner) { + return new ConnectionMonitorResultImpl(inner, manager()); + } + + private ConnectionMonitorResultImpl wrapModel(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorQueryResult call(ConnectionMonitorQueryResultInner inner) { + return new ConnectionMonitorQueryResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + ConnectionMonitorsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java new file mode 100644 index 0000000000000..773ff09eb5c04 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java @@ -0,0 +1,1130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_08_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ConnectionMonitors. + */ +public class ConnectionMonitorsInner { + /** The Retrofit service to perform REST calls. */ + private ConnectionMonitorsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConnectionMonitorsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ConnectionMonitorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConnectionMonitors to be + * used by Retrofit to perform actually REST calls. + */ + interface ConnectionMonitorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors query" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> query(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors beginQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> beginQuery(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner beginCreateOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.start(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner query(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> queryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.query(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginQueryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ConnectionMonitorResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..6226ec8d65401 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionResetSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionResetSharedKeyImpl extends WrapperImpl implements ConnectionResetSharedKey { + private final NetworkManager manager; + ConnectionResetSharedKeyImpl(ConnectionResetSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public int keyLength() { + return this.inner().keyLength(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..c56dccc06710a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionResetSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network connection reset shared key. + */ +public class ConnectionResetSharedKeyInner { + /** + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get the virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value + */ + public int keyLength() { + return this.keyLength; + } + + /** + * Set the virtual network connection reset shared key length, should between 1 and 128. + * + * @param keyLength the keyLength value to set + * @return the ConnectionResetSharedKeyInner object itself. + */ + public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { + this.keyLength = keyLength; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..e4c61b1dbbb03 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectionSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionSharedKeyImpl extends WrapperImpl implements ConnectionSharedKey { + private final NetworkManager manager; + ConnectionSharedKeyImpl(ConnectionSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyInner.java new file mode 100644 index 0000000000000..271aae6574448 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Response for GetConnectionSharedKey API service call. + */ +public class ConnectionSharedKeyInner extends SubResource { + /** + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the virtual network connection shared key value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the virtual network connection shared key value. + * + * @param value the value value to set + * @return the ConnectionSharedKeyInner object itself. + */ + public ConnectionSharedKeyInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationImpl.java new file mode 100644 index 0000000000000..63da2724b7a9f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityHop; + +class ConnectivityInformationImpl extends WrapperImpl implements ConnectivityInformation { + private final NetworkManager manager; + ConnectivityInformationImpl(ConnectivityInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Integer avgLatencyInMs() { + return this.inner().avgLatencyInMs(); + } + + @Override + public ConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public List hops() { + return this.inner().hops(); + } + + @Override + public Integer maxLatencyInMs() { + return this.inner().maxLatencyInMs(); + } + + @Override + public Integer minLatencyInMs() { + return this.inner().minLatencyInMs(); + } + + @Override + public Integer probesFailed() { + return this.inner().probesFailed(); + } + + @Override + public Integer probesSent() { + return this.inner().probesSent(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationInner.java new file mode 100644 index 0000000000000..13e3c6963ed0d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectivityInformationInner.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityHop; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information on the connectivity status. + */ +public class ConnectivityInformationInner { + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * The connection status. Possible values include: 'Unknown', 'Connected', + * 'Disconnected', 'Degraded'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /** + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /** + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /** + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /** + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /** + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded'. + * + * @return the connectionStatus value + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get average latency in milliseconds. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get minimum latency in milliseconds. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get maximum latency in milliseconds. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get total number of probes sent. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 0000000000000..41216acd0843a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlan; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; + +class DdosProtectionPlanImpl extends GroupableResourceCoreImpl implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + DdosProtectionPlanImpl(String name, DdosProtectionPlanInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List virtualNetworks() { + return this.inner().virtualNetworks(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanInner.java new file mode 100644 index 0000000000000..5f8b2eccd7332 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlanInner.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A DDoS protection plan in a resource group. + */ +@JsonFlatten +public class DdosProtectionPlanInner extends Resource { + /** + * The resource GUID property of the DDoS protection plan resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the DDoS protection plan resource. Possible + * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + */ + @JsonProperty(value = "properties.virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworks; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the DDoS protection plan resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + * + * @return the virtualNetworks value + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansImpl.java new file mode 100644 index 0000000000000..1ecc892a72263 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlan; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DdosProtectionPlansImpl extends GroupableResourcesCoreImpl implements DdosProtectionPlans { + protected DdosProtectionPlansImpl(NetworkManager manager) { + super(manager.inner().ddosProtectionPlans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DdosProtectionPlansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DdosProtectionPlanImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(DdosProtectionPlanInner inner) { + return new DdosProtectionPlanImpl(inner.name(), inner, manager()); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(String name) { + return new DdosProtectionPlanImpl(name, new DdosProtectionPlanInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansInner.java new file mode 100644 index 0000000000000..6bc714c0d7a4d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DdosProtectionPlansInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DdosProtectionPlans. + */ +public class DdosProtectionPlansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DdosProtectionPlansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DdosProtectionPlansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DdosProtectionPlansService.class); + this.client = client; + } + + /** + * The interface defining all the services for DdosProtectionPlans to be + * used by Retrofit to perform actually REST calls. + */ + interface DdosProtectionPlansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ddosProtectionPlanName) { + deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().last().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner createOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginCreateOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesImpl.java new file mode 100644 index 0000000000000..02db852414ffd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.DefaultSecurityRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroupSecurityRuleModel; + +class DefaultSecurityRulesImpl extends WrapperImpl implements DefaultSecurityRules { + private final NetworkManager manager; + + DefaultSecurityRulesImpl(NetworkManager manager) { + super(manager.inner().defaultSecurityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkSecurityGroupSecurityRuleModelImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + DefaultSecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + DefaultSecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesInner.java new file mode 100644 index 0000000000000..e79e68a878527 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DefaultSecurityRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DefaultSecurityRules. + */ +public class DefaultSecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private DefaultSecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DefaultSecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DefaultSecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DefaultSecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface DefaultSecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DefaultSecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DefaultSecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("defaultSecurityRuleName") String defaultSecurityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.DefaultSecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName), serviceCallback); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (defaultSecurityRuleName == null) { + throw new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DnsNameAvailabilityResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DnsNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..42114454128c8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/DnsNameAvailabilityResultInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for the CheckDnsNameAvailability API service call. + */ +public class DnsNameAvailabilityResultInner { + /** + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get domain availability (True/False). + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set domain availability (True/False). + * + * @param available the available value to set + * @return the DnsNameAvailabilityResultInner object itself. + */ + public DnsNameAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..0d0604580e0e9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveNetworkSecurityGroup; + +class EffectiveNetworkSecurityGroupListResultImpl extends WrapperImpl implements EffectiveNetworkSecurityGroupListResult { + private final NetworkManager manager; + EffectiveNetworkSecurityGroupListResultImpl(EffectiveNetworkSecurityGroupListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java new file mode 100644 index 0000000000000..927e6f8231d55 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective network security groups API service call. + */ +public class EffectiveNetworkSecurityGroupListResultInner { + /** + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective network security groups. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective network security groups. + * + * @param value the value value to set + * @return the EffectiveNetworkSecurityGroupListResultInner object itself. + */ + public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..0b52238d1e5f9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.EffectiveRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveRoute; + +class EffectiveRouteListResultImpl extends WrapperImpl implements EffectiveRouteListResult { + private final NetworkManager manager; + EffectiveRouteListResultImpl(EffectiveRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultInner.java new file mode 100644 index 0000000000000..68d887fb8ecca --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EffectiveRouteListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective route API service call. + */ +public class EffectiveRouteListResultInner { + /** + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective routes. + * + * @param value the value value to set + * @return the EffectiveRouteListResultInner object itself. + */ + public EffectiveRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..a687b3b5506a1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.EndpointServiceResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EndpointServiceResultImpl extends WrapperImpl implements EndpointServiceResult { + private final NetworkManager manager; + + EndpointServiceResultImpl(EndpointServiceResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultInner.java new file mode 100644 index 0000000000000..e58cfa74f782a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/EndpointServiceResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Endpoint service. + */ +public class EndpointServiceResultInner extends SubResource { + /** + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the endpoint service. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the endpoint service. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..ef1561b6bc73d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.AuthorizationUseStatus; + +class ExpressRouteCircuitAuthorizationImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitAuthorization, ExpressRouteCircuitAuthorization.Definition, ExpressRouteCircuitAuthorization.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String authorizationName; + + ExpressRouteCircuitAuthorizationImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitAuthorizationInner()); + this.manager = manager; + // Set resource name + this.authorizationName = name; + // + } + + ExpressRouteCircuitAuthorizationImpl(ExpressRouteCircuitAuthorizationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.authorizationName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.authorizationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public AuthorizationUseStatus authorizationUseStatus() { + return this.inner().authorizationUseStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.inner().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 0000000000000..6e0c9cfdc86aa --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AuthorizationUseStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authorization in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitAuthorizationInner extends SubResource { + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse'. + */ + @JsonProperty(value = "properties.authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @return the authorizationUseStatus value + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Set authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @param authorizationUseStatus the authorizationUseStatus value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java new file mode 100644 index 0000000000000..bfcead59b009c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorization; + +class ExpressRouteCircuitAuthorizationsImpl extends WrapperImpl implements ExpressRouteCircuitAuthorizations { + private final NetworkManager manager; + + ExpressRouteCircuitAuthorizationsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitAuthorizations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(ExpressRouteCircuitAuthorizationInner inner) { + return new ExpressRouteCircuitAuthorizationImpl(inner, manager()); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, authorizationName) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, authorizationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsInner.java new file mode 100644 index 0000000000000..ff8abb1cd7008 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitAuthorizationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitAuthorizations. + */ +public class ExpressRouteCircuitAuthorizationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitAuthorizationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitAuthorizationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitAuthorizationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitAuthorizations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitAuthorizationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String authorizationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..def9c5321db73 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.CircuitConnectionStatus; + +class ExpressRouteCircuitConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitConnection, ExpressRouteCircuitConnection.Definition, ExpressRouteCircuitConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + private String connectionName; + + ExpressRouteCircuitConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteCircuitConnectionImpl(ExpressRouteCircuitConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "connections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public CircuitConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peerExpressRouteCircuitPeering() { + return this.inner().peerExpressRouteCircuitPeering(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitConnectionImpl withExistingPeering(String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.inner().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..193bdcb6e5adc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionInner.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.CircuitConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@JsonFlatten +public class ExpressRouteCircuitConnectionInner extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /** + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * Express Route Circuit Connection State. Possible values are: 'Connected' + * and 'Disconnected'. Possible values include: 'Connected', 'Connecting', + * 'Disconnected'. + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Provisioning state of the circuit connection resource. Possible values + * are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @return the expressRouteCircuitPeering value + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get express Route Circuit Connection State. Possible values are: 'Connected' and 'Disconnected'. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get provisioning state of the circuit connection resource. Possible values are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..debbcde770bac --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnection; + +class ExpressRouteCircuitConnectionsImpl extends WrapperImpl implements ExpressRouteCircuitConnections { + private final NetworkManager manager; + + ExpressRouteCircuitConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(ExpressRouteCircuitConnectionInner inner) { + return new ExpressRouteCircuitConnectionImpl(inner, manager()); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteCircuitConnection call(ExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsInner.java new file mode 100644 index 0000000000000..b918f2375bd0a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitConnectionsInner.java @@ -0,0 +1,553 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitConnections. + */ +public class ExpressRouteCircuitConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner get(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..96d26373da091 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuit; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_08_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitServiceProviderProperties; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitImpl extends GroupableResourceCoreImpl implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { + ExpressRouteCircuitImpl(String name, ExpressRouteCircuitInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowClassicOperations() { + return this.inner().allowClassicOperations(); + } + + @Override + public Boolean allowGlobalReach() { + return this.inner().allowGlobalReach(); + } + + @Override + public List authorizations() { + List lst = new ArrayList(); + if (this.inner().authorizations() != null) { + for (ExpressRouteCircuitAuthorizationInner inner : this.inner().authorizations()) { + lst.add( new ExpressRouteCircuitAuthorizationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Double bandwidthInGbps() { + return this.inner().bandwidthInGbps(); + } + + @Override + public String circuitProvisioningState() { + return this.inner().circuitProvisioningState(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRoutePort() { + return this.inner().expressRoutePort(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String serviceKey() { + return this.inner().serviceKey(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.inner().serviceProviderProperties(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public ExpressRouteCircuitSku sku() { + return this.inner().sku(); + } + + @Override + public Integer stag() { + return this.inner().stag(); + } + + @Override + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.inner().withAllowClassicOperations(allowClassicOperations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAllowGlobalReach(Boolean allowGlobalReach) { + this.inner().withAllowGlobalReach(allowGlobalReach); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.inner().withAuthorizations(authorizations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withBandwidthInGbps(Double bandwidthInGbps) { + this.inner().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + @Override + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.inner().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withExpressRoutePort(SubResource expressRoutePort) { + this.inner().withExpressRoutePort(expressRoutePort); + return this; + } + + @Override + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCircuitImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.inner().withServiceKey(serviceKey); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.inner().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitInner.java new file mode 100644 index 0000000000000..5c4d9f373cc74 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitInner.java @@ -0,0 +1,454 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_08_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitServiceProviderProperties; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCircuit resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCircuitInner extends Resource { + /** + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /** + * Allow classic operations. + */ + @JsonProperty(value = "properties.allowClassicOperations") + private Boolean allowClassicOperations; + + /** + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.circuitProvisioningState") + private String circuitProvisioningState; + + /** + * The ServiceProviderProvisioningState state of the resource. Possible + * values are 'NotProvisioned', 'Provisioning', 'Provisioned', and + * 'Deprovisioning'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * The list of authorizations. + */ + @JsonProperty(value = "properties.authorizations") + private List authorizations; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The ServiceKey. + */ + @JsonProperty(value = "properties.serviceKey") + private String serviceKey; + + /** + * The ServiceProviderNotes. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * The ServiceProviderProperties. + */ + @JsonProperty(value = "properties.serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /** + * The reference to the ExpressRoutePort resource when the circuit is + * provisioned on an ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.expressRoutePort") + private SubResource expressRoutePort; + + /** + * The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Double bandwidthInGbps; + + /** + * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + */ + @JsonProperty(value = "properties.stag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Flag to enable Global Reach on the circuit. + */ + @JsonProperty(value = "properties.allowGlobalReach") + private Boolean allowGlobalReach; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the SKU. + * + * @return the sku value + */ + public ExpressRouteCircuitSku sku() { + return this.sku; + } + + /** + * Set the SKU. + * + * @param sku the sku value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withSku(ExpressRouteCircuitSku sku) { + this.sku = sku; + return this; + } + + /** + * Get allow classic operations. + * + * @return the allowClassicOperations value + */ + public Boolean allowClassicOperations() { + return this.allowClassicOperations; + } + + /** + * Set allow classic operations. + * + * @param allowClassicOperations the allowClassicOperations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { + this.allowClassicOperations = allowClassicOperations; + return this; + } + + /** + * Get the CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value + */ + public String circuitProvisioningState() { + return this.circuitProvisioningState; + } + + /** + * Set the CircuitProvisioningState state of the resource. + * + * @param circuitProvisioningState the circuitProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { + this.circuitProvisioningState = circuitProvisioningState; + return this; + } + + /** + * Get the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the list of authorizations. + * + * @return the authorizations value + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the list of authorizations. + * + * @param authorizations the authorizations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the ServiceKey. + * + * @return the serviceKey value + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Set the ServiceKey. + * + * @param serviceKey the serviceKey value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + this.serviceKey = serviceKey; + return this; + } + + /** + * Get the ServiceProviderNotes. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the ServiceProviderProperties. + * + * @return the serviceProviderProperties value + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.serviceProviderProperties; + } + + /** + * Set the ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.serviceProviderProperties = serviceProviderProperties; + return this; + } + + /** + * Get the reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + * + * @return the expressRoutePort value + */ + public SubResource expressRoutePort() { + return this.expressRoutePort; + } + + /** + * Set the reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + * + * @param expressRoutePort the expressRoutePort value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withExpressRoutePort(SubResource expressRoutePort) { + this.expressRoutePort = expressRoutePort; + return this; + } + + /** + * Get the bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + * + * @return the bandwidthInGbps value + */ + public Double bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set the bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + * + * @param bandwidthInGbps the bandwidthInGbps value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withBandwidthInGbps(Double bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get the identifier of the circuit traffic. Outer tag for QinQ encapsulation. + * + * @return the stag value + */ + public Integer stag() { + return this.stag; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get flag to enable Global Reach on the circuit. + * + * @return the allowGlobalReach value + */ + public Boolean allowGlobalReach() { + return this.allowGlobalReach; + } + + /** + * Set flag to enable Global Reach on the circuit. + * + * @param allowGlobalReach the allowGlobalReach value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowGlobalReach(Boolean allowGlobalReach) { + this.allowGlobalReach = allowGlobalReach; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringImpl.java new file mode 100644 index 0000000000000..24f23d34368d3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,341 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnectionId; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilter; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + + ExpressRouteCircuitPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCircuitPeeringImpl(ExpressRouteCircuitPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (ExpressRouteCircuitConnectionInner inner : this.inner().connections()) { + lst.add( new ExpressRouteCircuitConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteConnectionId expressRouteConnection() { + return this.inner().expressRouteConnection(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteFilter routeFilter() { + RouteFilterInner inner = this.inner().routeFilter(); + if (inner != null) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.inner().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withAzureASN(Integer azureASN) { + this.inner().withAzureASN(azureASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.inner().withExpressRouteConnection(expressRouteConnection); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.inner().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withRouteFilter(RouteFilterInner routeFilter) { + this.inner().withRouteFilter(routeFilter); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.inner().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.inner().withStats(stats); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringInner.java new file mode 100644 index 0000000000000..c4a13f2daa07a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,565 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnectionId; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN") + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort") + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort") + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets peering stats. + */ + @JsonProperty(value = "properties.stats") + private ExpressRouteCircuitStatsInner stats; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "properties.routeFilter") + private RouteFilterInner routeFilter; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * The ExpressRoute connection. + */ + @JsonProperty(value = "properties.expressRouteConnection") + private ExpressRouteConnectionId expressRouteConnection; + + /** + * The list of circuit connections associated with Azure Private Peering + * for this circuit. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Set the Azure ASN. + * + * @param azureASN the azureASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withAzureASN(Integer azureASN) { + this.azureASN = azureASN; + return this; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Set the primary port. + * + * @param primaryAzurePort the primaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { + this.primaryAzurePort = primaryAzurePort; + return this; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Set the secondary port. + * + * @param secondaryAzurePort the secondaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { + this.secondaryAzurePort = secondaryAzurePort; + return this; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets peering stats. + * + * @return the stats value + */ + public ExpressRouteCircuitStatsInner stats() { + return this.stats; + } + + /** + * Set gets peering stats. + * + * @param stats the stats value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { + this.stats = stats; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get the ExpressRoute connection. + * + * @return the expressRouteConnection value + */ + public ExpressRouteConnectionId expressRouteConnection() { + return this.expressRouteConnection; + } + + /** + * Set the ExpressRoute connection. + * + * @param expressRouteConnection the expressRouteConnection value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.expressRouteConnection = expressRouteConnection; + return this; + } + + /** + * Get the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @param connections the connections value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsImpl.java new file mode 100644 index 0000000000000..c608aa88f6949 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitPeeringsImpl extends WrapperImpl implements ExpressRouteCircuitPeerings { + private final NetworkManager manager; + + ExpressRouteCircuitPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(ExpressRouteCircuitPeeringInner inner) { + return new ExpressRouteCircuitPeeringImpl(inner, manager()); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsInner.java new file mode 100644 index 0000000000000..d9317c71a20d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitPeerings. + */ +public class ExpressRouteCircuitPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..c7f536f928056 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitStats; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ExpressRouteCircuitStatsImpl extends WrapperImpl implements ExpressRouteCircuitStats { + private final NetworkManager manager; + ExpressRouteCircuitStatsImpl(ExpressRouteCircuitStatsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Long primarybytesIn() { + return this.inner().primarybytesIn(); + } + + @Override + public Long primarybytesOut() { + return this.inner().primarybytesOut(); + } + + @Override + public Long secondarybytesIn() { + return this.inner().secondarybytesIn(); + } + + @Override + public Long secondarybytesOut() { + return this.inner().secondarybytesOut(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsInner.java new file mode 100644 index 0000000000000..cd9221556a0bf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains stats associated with the peering. + */ +public class ExpressRouteCircuitStatsInner { + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get gets BytesIn of the peering. + * + * @return the primarybytesIn value + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param primarybytesIn the primarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { + this.primarybytesIn = primarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the primarybytesOut value + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param primarybytesOut the primarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { + this.primarybytesOut = primarybytesOut; + return this; + } + + /** + * Get gets BytesIn of the peering. + * + * @return the secondarybytesIn value + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param secondarybytesIn the secondarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { + this.secondarybytesIn = secondarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the secondarybytesOut value + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param secondarybytesOut the secondarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { + this.secondarybytesOut = secondarybytesOut; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..f66facfe9d3b2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitArpTable; + +class ExpressRouteCircuitsArpTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsArpTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsArpTableListResultImpl(ExpressRouteCircuitsArpTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 0000000000000..6a0aa06fa27b9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsArpTableListResultInner { + /** + * Gets list of the ARP table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get gets list of the ARP table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set gets list of the ARP table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsImpl.java new file mode 100644 index 0000000000000..a464729fe6e55 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuit; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCircuits { + protected ExpressRouteCircuitsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuits(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCircuitsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCircuitImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(ExpressRouteCircuitInner inner) { + return new ExpressRouteCircuitImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(String name) { + return new ExpressRouteCircuitImpl(name, new ExpressRouteCircuitInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResult call(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getStatsAsync(resourceGroupName, circuitName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getPeeringStatsAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsInner.java new file mode 100644 index 0000000000000..482c83a6d9955 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsInner.java @@ -0,0 +1,2021 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuits. + */ +public class ExpressRouteCircuitsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuits to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits getStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats") + Observable> getStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits getPeeringStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + Observable> getPeeringStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getStats(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getPeeringStats(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPeeringStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPeeringStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..b368320092507 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitRoutesTable; + +class ExpressRouteCircuitsRoutesTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableListResultImpl(ExpressRouteCircuitsRoutesTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 0000000000000..02c510552838d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableListResultInner { + /** + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..f8f6144a2a3d6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitRoutesTableSummary; + +class ExpressRouteCircuitsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableSummaryListResultImpl(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..bceb3c1f1130e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionImpl.java new file mode 100644 index 0000000000000..aadda9be919e1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionImpl.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringId; + +class ExpressRouteConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteConnection, ExpressRouteConnection.Definition, ExpressRouteConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String expressRouteGatewayName; + private String connectionName; + + ExpressRouteConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteConnectionImpl(ExpressRouteConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.expressRouteGatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.getAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public ExpressRouteConnectionImpl withExistingExpressRouteGateway(String resourceGroupName, String expressRouteGatewayName) { + this.resourceGroupName = resourceGroupName; + this.expressRouteGatewayName = expressRouteGatewayName; + return this; + } + + @Override + public ExpressRouteConnectionImpl withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionInner.java new file mode 100644 index 0000000000000..b5f92deafb9b1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionInner.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringId; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ExpressRouteConnection resource. + */ +@JsonFlatten +public class ExpressRouteConnectionInner extends SubResource { + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The ExpressRoute circuit peering. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering", required = true) + private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; + + /** + * Authorization key to establish the connection. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The routing weight associated to the connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value + */ + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set the ExpressRoute circuit peering. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get authorization key to establish the connection. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set authorization key to establish the connection. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the routing weight associated to the connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight associated to the connection. + * + * @param routingWeight the routingWeight value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. + * + * @param name the name value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListImpl.java new file mode 100644 index 0000000000000..e2c383e096547 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnectionList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ExpressRouteConnectionListImpl extends WrapperImpl implements ExpressRouteConnectionList { + private final NetworkManager manager; + ExpressRouteConnectionListImpl(ExpressRouteConnectionListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListInner.java new file mode 100644 index 0000000000000..26447d687e0f9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRouteConnection list. + */ +public class ExpressRouteConnectionListInner { + /** + * The list of ExpressRoute connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of ExpressRoute connections. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of ExpressRoute connections. + * + * @param value the value value to set + * @return the ExpressRouteConnectionListInner object itself. + */ + public ExpressRouteConnectionListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsImpl.java new file mode 100644 index 0000000000000..d3c620dd366da --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnectionList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnection; + +class ExpressRouteConnectionsImpl extends WrapperImpl implements ExpressRouteConnections { + private final NetworkManager manager; + + ExpressRouteConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteConnectionImpl wrapModel(ExpressRouteConnectionInner inner) { + return new ExpressRouteConnectionImpl(inner, manager()); + } + + private ExpressRouteConnectionImpl wrapModel(String name) { + return new ExpressRouteConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, expressRouteGatewayName) + .map(new Func1() { + @Override + public ExpressRouteConnectionList call(ExpressRouteConnectionListInner inner) { + return new ExpressRouteConnectionListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, expressRouteGatewayName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteConnection call(ExpressRouteConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java new file mode 100644 index 0000000000000..a7546546c315b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java @@ -0,0 +1,606 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteConnections. + */ +public class ExpressRouteConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteConnectionInner putExpressRouteConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteConnectionInner putExpressRouteConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteConnectionParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteConnectionParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteConnectionParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), putExpressRouteConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteConnectionParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteConnectionParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteConnectionParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), putExpressRouteConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionListInner object if successful. + */ + public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { + return listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionListInner object + */ + public Observable listAsync(String resourceGroupName, String expressRouteGatewayName) { + return listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, ExpressRouteConnectionListInner>() { + @Override + public ExpressRouteConnectionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteConnectionListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 0000000000000..9e25df71aa8cc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_08_01.ServiceProviderProvisioningState; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionImpl extends GroupableResourceCoreImpl implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + ExpressRouteCrossConnectionImpl(String name, ExpressRouteCrossConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer bandwidthInMbps() { + return this.inner().bandwidthInMbps(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.inner().expressRouteCircuit(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCrossConnectionPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCrossConnectionPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public Integer sTag() { + return this.inner().sTag(); + } + + @Override + public ExpressRouteCrossConnectionImpl withBandwidthInMbps(Integer bandwidthInMbps) { + this.inner().withBandwidthInMbps(bandwidthInMbps); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.inner().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionInner.java new file mode 100644 index 0000000000000..1876ad54a57d4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_08_01.ServiceProviderProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCrossConnection resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCrossConnectionInner extends Resource { + /** + * The name of the primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The name of the secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "properties.sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer sTag; + + /** + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "properties.bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "properties.expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /** + * The provisioning state of the circuit in the connectivity provider + * system. Possible values are 'NotProvisioned', 'Provisioning', + * 'Provisioned'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the name of the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the identifier of the circuit traffic. + * + * @return the sTag value + */ + public Integer sTag() { + return this.sTag; + } + + /** + * Get the peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location of the ExpressRoute circuit. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the circuit bandwidth In Mbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Get the ExpressRouteCircuit. + * + * @return the expressRouteCircuit value + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.expressRouteCircuit; + } + + /** + * Set the ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.expressRouteCircuit = expressRouteCircuit; + return this; + } + + /** + * Get the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set additional read only notes set by the connectivity provider. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 0000000000000..421fb4381bab3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.Ipv6ExpressRouteCircuitPeeringConfig; + +class ExpressRouteCrossConnectionPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCrossConnectionPeering, ExpressRouteCrossConnectionPeering.Definition, ExpressRouteCrossConnectionPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String crossConnectionName; + private String peeringName; + + ExpressRouteCrossConnectionPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCrossConnectionPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCrossConnectionPeeringImpl(ExpressRouteCrossConnectionPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.crossConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCrossConnections"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.getAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName) { + this.resourceGroupName = resourceGroupName; + this.crossConnectionName = crossConnectionName; + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringInner.java new file mode 100644 index 0000000000000..2b3c4a017947e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringInner.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_08_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRoute Cross Connection resource. + */ +@JsonFlatten +public class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java new file mode 100644 index 0000000000000..4f1785b173d91 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionPeeringsImpl extends WrapperImpl implements ExpressRouteCrossConnectionPeerings { + private final NetworkManager manager; + + ExpressRouteCrossConnectionPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnectionPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(ExpressRouteCrossConnectionPeeringInner inner) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, manager()); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String crossConnectionName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, crossConnectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, crossConnectionName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, crossConnectionName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java new file mode 100644 index 0000000000000..75e8fef4b006e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnectionPeerings. + */ +public class ExpressRouteCrossConnectionPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnectionPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String crossConnectionName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, crossConnectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String crossConnectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, crossConnectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String crossConnectionName) { + return listWithServiceResponseAsync(resourceGroupName, crossConnectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String crossConnectionName) { + return listSinglePageAsync(resourceGroupName, crossConnectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner get(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner createOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsImpl.java new file mode 100644 index 0000000000000..998673e89f01d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnection; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitsRoutesTableListResult; + +class ExpressRouteCrossConnectionsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCrossConnections { + protected ExpressRouteCrossConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCrossConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(ExpressRouteCrossConnectionInner inner) { + return new ExpressRouteCrossConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionImpl(name, new ExpressRouteCrossConnectionInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult call(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsInner.java new file mode 100644 index 0000000000000..2f0c5e7a19cb2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsInner.java @@ -0,0 +1,1676 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnections. + */ +public class ExpressRouteCrossConnectionsInner implements InnerSupportsGet, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..fe4440335a8a9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionRoutesTableSummary; + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..7eab50bc4b86d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + */ +public class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayImpl.java new file mode 100644 index 0000000000000..daf1a3a854360 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubId; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnection; + +class ExpressRouteGatewayImpl extends GroupableResourceCoreImpl implements ExpressRouteGateway, ExpressRouteGateway.Definition, ExpressRouteGateway.Update { + ExpressRouteGatewayImpl(String name, ExpressRouteGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.inner().autoScaleConfiguration(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List expressRouteConnections() { + List lst = new ArrayList(); + if (this.inner().expressRouteConnections() != null) { + for (ExpressRouteConnectionInner inner : this.inner().expressRouteConnections()) { + lst.add( new ExpressRouteConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public VirtualHubId virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public ExpressRouteGatewayImpl withVirtualHub(VirtualHubId virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public ExpressRouteGatewayImpl withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.inner().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayInner.java new file mode 100644 index 0000000000000..e07bbc24f5609 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewayInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoute gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteGatewayInner extends Resource { + /** + * Configuration for auto scaling. + */ + @JsonProperty(value = "properties.autoScaleConfiguration") + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /** + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + @JsonProperty(value = "properties.expressRouteConnections", access = JsonProperty.Access.WRITE_ONLY) + private List expressRouteConnections; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The Virtual Hub where the ExpressRoute gateway is or will be deployed. + */ + @JsonProperty(value = "properties.virtualHub", required = true) + private VirtualHubId virtualHub; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get configuration for auto scaling. + * + * @return the autoScaleConfiguration value + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.autoScaleConfiguration; + } + + /** + * Set configuration for auto scaling. + * + * @param autoScaleConfiguration the autoScaleConfiguration value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.autoScaleConfiguration = autoScaleConfiguration; + return this; + } + + /** + * Get list of ExpressRoute connections to the ExpressRoute gateway. + * + * @return the expressRouteConnections value + */ + public List expressRouteConnections() { + return this.expressRouteConnections; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @return the virtualHub value + */ + public VirtualHubId virtualHub() { + return this.virtualHub; + } + + /** + * Set the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @param virtualHub the virtualHub value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withVirtualHub(VirtualHubId virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysImpl.java new file mode 100644 index 0000000000000..e8f0eaaf19cd9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteGatewaysImpl extends GroupableResourcesCoreImpl implements ExpressRouteGateways { + protected ExpressRouteGatewaysImpl(NetworkManager manager) { + super(manager.inner().expressRouteGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public ExpressRouteGateway call(ExpressRouteGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteGatewaysInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public ExpressRouteGateway call(ExpressRouteGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteGatewayImpl wrapModel(ExpressRouteGatewayInner inner) { + return new ExpressRouteGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteGatewayImpl wrapModel(String name) { + return new ExpressRouteGatewayImpl(name, new ExpressRouteGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysInner.java new file mode 100644 index 0000000000000..6bf966775bd04 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteGatewaysInner.java @@ -0,0 +1,662 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteGateways. + */ +public class ExpressRouteGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteGatewayInner putExpressRouteGatewayParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteGatewayInner putExpressRouteGatewayParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters), serviceCallback); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteGatewayParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteGatewayParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteGatewayParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), putExpressRouteGatewayParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters), serviceCallback); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteGatewayParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteGatewayParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteGatewayParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), putExpressRouteGatewayParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRouteGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRouteGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRouteGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkImpl.java new file mode 100644 index 0000000000000..f0f79643cbfcf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLink; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinkAdminState; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinkConnectorType; + +class ExpressRouteLinkImpl extends IndexableRefreshableWrapperImpl implements ExpressRouteLink { + private final NetworkManager manager; + private String resourceGroupName; + private String expressRoutePortName; + private String linkName; + + ExpressRouteLinkImpl(ExpressRouteLinkInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.expressRoutePortName = IdParsingUtils.getValueFromIdByName(inner.id(), "ExpressRoutePorts"); + this.linkName = IdParsingUtils.getValueFromIdByName(inner.id(), "links"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteLinksInner client = this.manager().inner().expressRouteLinks(); + return client.getAsync(this.resourceGroupName, this.expressRoutePortName, this.linkName); + } + + + + @Override + public ExpressRouteLinkAdminState adminState() { + return this.inner().adminState(); + } + + @Override + public ExpressRouteLinkConnectorType connectorType() { + return this.inner().connectorType(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String interfaceName() { + return this.inner().interfaceName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String patchPanelId() { + return this.inner().patchPanelId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String rackId() { + return this.inner().rackId(); + } + + @Override + public String routerName() { + return this.inner().routerName(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkInner.java new file mode 100644 index 0000000000000..2ed690aa076c3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinkInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinkConnectorType; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinkAdminState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ExpressRouteLink. + * ExpressRouteLink child resource definition. + */ +@JsonFlatten +public class ExpressRouteLinkInner extends SubResource { + /** + * Name of Azure router associated with physical port. + */ + @JsonProperty(value = "properties.routerName", access = JsonProperty.Access.WRITE_ONLY) + private String routerName; + + /** + * Name of Azure router interface. + */ + @JsonProperty(value = "properties.interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /** + * Mapping between physical port to patch panel port. + */ + @JsonProperty(value = "properties.patchPanelId", access = JsonProperty.Access.WRITE_ONLY) + private String patchPanelId; + + /** + * Mapping of physical patch panel to rack. + */ + @JsonProperty(value = "properties.rackId", access = JsonProperty.Access.WRITE_ONLY) + private String rackId; + + /** + * Physical fiber port type. Possible values include: 'LC', 'SC'. + */ + @JsonProperty(value = "properties.connectorType", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteLinkConnectorType connectorType; + + /** + * Administrative state of the physical port. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.adminState") + private ExpressRouteLinkAdminState adminState; + + /** + * The provisioning state of the ExpressRouteLink resource. Possible values + * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Name of child port resource that is unique among child port resources of + * the parent. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get name of Azure router associated with physical port. + * + * @return the routerName value + */ + public String routerName() { + return this.routerName; + } + + /** + * Get name of Azure router interface. + * + * @return the interfaceName value + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get mapping between physical port to patch panel port. + * + * @return the patchPanelId value + */ + public String patchPanelId() { + return this.patchPanelId; + } + + /** + * Get mapping of physical patch panel to rack. + * + * @return the rackId value + */ + public String rackId() { + return this.rackId; + } + + /** + * Get physical fiber port type. Possible values include: 'LC', 'SC'. + * + * @return the connectorType value + */ + public ExpressRouteLinkConnectorType connectorType() { + return this.connectorType; + } + + /** + * Get administrative state of the physical port. Possible values include: 'Enabled', 'Disabled'. + * + * @return the adminState value + */ + public ExpressRouteLinkAdminState adminState() { + return this.adminState; + } + + /** + * Set administrative state of the physical port. Possible values include: 'Enabled', 'Disabled'. + * + * @param adminState the adminState value to set + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withAdminState(ExpressRouteLinkAdminState adminState) { + this.adminState = adminState; + return this; + } + + /** + * Get the provisioning state of the ExpressRouteLink resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of child port resource that is unique among child port resources of the parent. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of child port resource that is unique among child port resources of the parent. + * + * @param name the name value to set + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksImpl.java new file mode 100644 index 0000000000000..35a05e008566c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinks; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLink; + +class ExpressRouteLinksImpl extends WrapperImpl implements ExpressRouteLinks { + private final NetworkManager manager; + + ExpressRouteLinksImpl(NetworkManager manager) { + super(manager.inner().expressRouteLinks()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ExpressRouteLinkImpl wrapModel(ExpressRouteLinkInner inner) { + return new ExpressRouteLinkImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String expressRoutePortName) { + ExpressRouteLinksInner client = this.inner(); + return client.listAsync(resourceGroupName, expressRoutePortName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteLink call(ExpressRouteLinkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + ExpressRouteLinksInner client = this.inner(); + return client.getAsync(resourceGroupName, expressRoutePortName, linkName) + .map(new Func1() { + @Override + public ExpressRouteLink call(ExpressRouteLinkInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksInner.java new file mode 100644 index 0000000000000..65979fa755aad --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteLinks. + */ +public class ExpressRouteLinksInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteLinksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteLinksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteLinksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteLinksService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteLinks to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteLinksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Path("linkName") String linkName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteLinkInner object if successful. + */ + public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName).toBlocking().single().body(); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String expressRoutePortName, String linkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName), serviceCallback); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteLinkInner object + */ + public Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName).map(new Func1, ExpressRouteLinkInner>() { + @Override + public ExpressRouteLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteLinkInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (linkName == null) { + throw new IllegalArgumentException("Parameter linkName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, linkName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteLinkInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String expressRoutePortName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, expressRoutePortName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String expressRoutePortName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, expressRoutePortName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String expressRoutePortName) { + return listWithServiceResponseAsync(resourceGroupName, expressRoutePortName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String expressRoutePortName) { + return listSinglePageAsync(resourceGroupName, expressRoutePortName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteLinkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortImpl.java new file mode 100644 index 0000000000000..960a494aa1ea7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortImpl.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePort; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsEncapsulation; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLink; + +class ExpressRoutePortImpl extends GroupableResourceCoreImpl implements ExpressRoutePort, ExpressRoutePort.Definition, ExpressRoutePort.Update { + ExpressRoutePortImpl(String name, ExpressRoutePortInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String allocationDate() { + return this.inner().allocationDate(); + } + + @Override + public Integer bandwidthInGbps() { + return this.inner().bandwidthInGbps(); + } + + @Override + public List circuits() { + return this.inner().circuits(); + } + + @Override + public ExpressRoutePortsEncapsulation encapsulation() { + return this.inner().encapsulation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String etherType() { + return this.inner().etherType(); + } + + @Override + public List links() { + List lst = new ArrayList(); + if (this.inner().links() != null) { + for (ExpressRouteLinkInner inner : this.inner().links()) { + lst.add( new ExpressRouteLinkImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String mtu() { + return this.inner().mtu(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public Double provisionedBandwidthInGbps() { + return this.inner().provisionedBandwidthInGbps(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public ExpressRoutePortImpl withBandwidthInGbps(Integer bandwidthInGbps) { + this.inner().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + @Override + public ExpressRoutePortImpl withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.inner().withEncapsulation(encapsulation); + return this; + } + + @Override + public ExpressRoutePortImpl withLinks(List links) { + this.inner().withLinks(links); + return this; + } + + @Override + public ExpressRoutePortImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRoutePortImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortInner.java new file mode 100644 index 0000000000000..fc7f77b45c658 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsEncapsulation; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoute Port. + * ExpressRoutePort resource definition. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRoutePortInner extends Resource { + /** + * The name of the peering location that the ExpressRoutePort is mapped to + * physically. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * Bandwidth of procured ports in Gbps. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Integer bandwidthInGbps; + + /** + * Aggregate Gbps of associated circuit bandwidths. + */ + @JsonProperty(value = "properties.provisionedBandwidthInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Double provisionedBandwidthInGbps; + + /** + * Maximum transmission unit of the physical port pair(s). + */ + @JsonProperty(value = "properties.mtu", access = JsonProperty.Access.WRITE_ONLY) + private String mtu; + + /** + * Encapsulation method on physical ports. Possible values include: + * 'Dot1Q', 'QinQ'. + */ + @JsonProperty(value = "properties.encapsulation") + private ExpressRoutePortsEncapsulation encapsulation; + + /** + * Ethertype of the physical port. + */ + @JsonProperty(value = "properties.etherType", access = JsonProperty.Access.WRITE_ONLY) + private String etherType; + + /** + * Date of the physical port allocation to be used in Letter of + * Authorization. + */ + @JsonProperty(value = "properties.allocationDate", access = JsonProperty.Access.WRITE_ONLY) + private String allocationDate; + + /** + * ExpressRouteLink Sub-Resources. + * The set of physical links of the ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.links") + private List links; + + /** + * Reference the ExpressRoute circuit(s) that are provisioned on this + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.circuits", access = JsonProperty.Access.WRITE_ONLY) + private List circuits; + + /** + * The provisioning state of the ExpressRoutePort resource. Possible values + * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource GUID property of the ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the peering location that the ExpressRoutePort is mapped to physically. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the name of the peering location that the ExpressRoutePort is mapped to physically. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get bandwidth of procured ports in Gbps. + * + * @return the bandwidthInGbps value + */ + public Integer bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set bandwidth of procured ports in Gbps. + * + * @param bandwidthInGbps the bandwidthInGbps value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withBandwidthInGbps(Integer bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get aggregate Gbps of associated circuit bandwidths. + * + * @return the provisionedBandwidthInGbps value + */ + public Double provisionedBandwidthInGbps() { + return this.provisionedBandwidthInGbps; + } + + /** + * Get maximum transmission unit of the physical port pair(s). + * + * @return the mtu value + */ + public String mtu() { + return this.mtu; + } + + /** + * Get encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ'. + * + * @return the encapsulation value + */ + public ExpressRoutePortsEncapsulation encapsulation() { + return this.encapsulation; + } + + /** + * Set encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ'. + * + * @param encapsulation the encapsulation value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.encapsulation = encapsulation; + return this; + } + + /** + * Get ethertype of the physical port. + * + * @return the etherType value + */ + public String etherType() { + return this.etherType; + } + + /** + * Get date of the physical port allocation to be used in Letter of Authorization. + * + * @return the allocationDate value + */ + public String allocationDate() { + return this.allocationDate; + } + + /** + * Get the set of physical links of the ExpressRoutePort resource. + * + * @return the links value + */ + public List links() { + return this.links; + } + + /** + * Set the set of physical links of the ExpressRoutePort resource. + * + * @param links the links value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. + * + * @return the circuits value + */ + public List circuits() { + return this.circuits; + } + + /** + * Get the provisioning state of the ExpressRoutePort resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource GUID property of the ExpressRoutePort resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the ExpressRoutePort resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsImpl.java new file mode 100644 index 0000000000000..4142c4aa8925a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePort; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRoutePortsImpl extends GroupableResourcesCoreImpl implements ExpressRoutePorts { + protected ExpressRoutePortsImpl(NetworkManager manager) { + super(manager.inner().expressRoutePorts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRoutePortsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRoutePortsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePort call(ExpressRoutePortInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRoutePortsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRoutePortsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePort call(ExpressRoutePortInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRoutePortImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRoutePortImpl wrapModel(ExpressRoutePortInner inner) { + return new ExpressRoutePortImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRoutePortImpl wrapModel(String name) { + return new ExpressRoutePortImpl(name, new ExpressRoutePortInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java new file mode 100644 index 0000000000000..ca0d24d20874c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRoutePorts. + */ +public class ExpressRoutePortsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRoutePortsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRoutePortsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRoutePortsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRoutePorts to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRoutePortsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Body ExpressRoutePortInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Body ExpressRoutePortInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRoutePortName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRoutePortName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRoutePortName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRoutePortName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner createOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String expressRoutePortName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).toBlocking().last().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).toBlocking().single().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationImpl.java new file mode 100644 index 0000000000000..262a47c276bc4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocation; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocationBandwidths; + +class ExpressRoutePortsLocationImpl extends GroupableResourceCoreImpl implements ExpressRoutePortsLocation { + ExpressRoutePortsLocationImpl(String name, ExpressRoutePortsLocationInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public String address() { + return this.inner().address(); + } + + @Override + public List availableBandwidths() { + return this.inner().availableBandwidths(); + } + + @Override + public String contact() { + return this.inner().contact(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationInner.java new file mode 100644 index 0000000000000..19ac8139a8ef5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocationBandwidths; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoutePorts Peering Location. + * Definition of the ExpressRoutePorts peering location resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRoutePortsLocationInner extends Resource { + /** + * Address of peering location. + */ + @JsonProperty(value = "properties.address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * Contact details of peering locations. + */ + @JsonProperty(value = "properties.contact", access = JsonProperty.Access.WRITE_ONLY) + private String contact; + + /** + * The inventory of available ExpressRoutePort bandwidths. + */ + @JsonProperty(value = "properties.availableBandwidths") + private List availableBandwidths; + + /** + * The provisioning state of the ExpressRoutePortLocation resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get address of peering location. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get contact details of peering locations. + * + * @return the contact value + */ + public String contact() { + return this.contact; + } + + /** + * Get the inventory of available ExpressRoutePort bandwidths. + * + * @return the availableBandwidths value + */ + public List availableBandwidths() { + return this.availableBandwidths; + } + + /** + * Set the inventory of available ExpressRoutePort bandwidths. + * + * @param availableBandwidths the availableBandwidths value to set + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withAvailableBandwidths(List availableBandwidths) { + this.availableBandwidths = availableBandwidths; + return this; + } + + /** + * Get the provisioning state of the ExpressRoutePortLocation resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsImpl.java new file mode 100644 index 0000000000000..deec1125f02c5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocations; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocation; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRoutePortsLocationsImpl extends GroupableResourcesCoreImpl implements ExpressRoutePortsLocations { + protected ExpressRoutePortsLocationsImpl(NetworkManager manager) { + super(manager.inner().expressRoutePortsLocations(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsLocationsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRoutePortsLocationsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRoutePortsLocationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePortsLocation call(ExpressRoutePortsLocationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String locationName) { + ExpressRoutePortsLocationsInner client = this.inner(); + return client.getAsync(locationName) + .map(new Func1() { + @Override + public ExpressRoutePortsLocation call(ExpressRoutePortsLocationInner inner) { + return new ExpressRoutePortsLocationImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected ExpressRoutePortsLocationImpl wrapModel(ExpressRoutePortsLocationInner inner) { + return new ExpressRoutePortsLocationImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRoutePortsLocationImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsInner.java new file mode 100644 index 0000000000000..03cec5dd271bb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsLocationsInner.java @@ -0,0 +1,367 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRoutePortsLocations. + */ +public class ExpressRoutePortsLocationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRoutePortsLocationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsLocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRoutePortsLocationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRoutePortsLocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRoutePortsLocations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRoutePortsLocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocations list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocations get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortsLocationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortsLocationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortsLocationInner object if successful. + */ + public ExpressRoutePortsLocationInner get(String locationName) { + return getWithServiceResponseAsync(locationName).toBlocking().single().body(); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String locationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName), serviceCallback); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortsLocationInner object + */ + public Observable getAsync(String locationName) { + return getWithServiceResponseAsync(locationName).map(new Func1, ExpressRoutePortsLocationInner>() { + @Override + public ExpressRoutePortsLocationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortsLocationInner object + */ + public Observable> getWithServiceResponseAsync(String locationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(this.client.subscriptionId(), locationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortsLocationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retriving a specific peering location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortsLocationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 0000000000000..2a97df703d107 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProvider; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviderBandwidthsOffered; + +class ExpressRouteServiceProviderImpl extends GroupableResourceCoreImpl implements ExpressRouteServiceProvider { + ExpressRouteServiceProviderImpl(String name, ExpressRouteServiceProviderInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bandwidthsOffered() { + return this.inner().bandwidthsOffered(); + } + + @Override + public List peeringLocations() { + return this.inner().peeringLocations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderInner.java new file mode 100644 index 0000000000000..536331988bcbf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProviderInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviderBandwidthsOffered; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A ExpressRouteResourceProvider object. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteServiceProviderInner extends Resource { + /** + * Get a list of peering locations. + */ + @JsonProperty(value = "properties.peeringLocations") + private List peeringLocations; + + /** + * Gets bandwidths offered. + */ + @JsonProperty(value = "properties.bandwidthsOffered") + private List bandwidthsOffered; + + /** + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get get a list of peering locations. + * + * @return the peeringLocations value + */ + public List peeringLocations() { + return this.peeringLocations; + } + + /** + * Set get a list of peering locations. + * + * @param peeringLocations the peeringLocations value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + return this; + } + + /** + * Get gets bandwidths offered. + * + * @return the bandwidthsOffered value + */ + public List bandwidthsOffered() { + return this.bandwidthsOffered; + } + + /** + * Set gets bandwidths offered. + * + * @param bandwidthsOffered the bandwidthsOffered value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withBandwidthsOffered(List bandwidthsOffered) { + this.bandwidthsOffered = bandwidthsOffered; + return this; + } + + /** + * Get gets the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersImpl.java new file mode 100644 index 0000000000000..03899d8f92269 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProvider; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteServiceProvidersImpl extends GroupableResourcesCoreImpl implements ExpressRouteServiceProviders { + protected ExpressRouteServiceProvidersImpl(NetworkManager manager) { + super(manager.inner().expressRouteServiceProviders(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteServiceProvidersInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRouteServiceProvidersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteServiceProvidersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteServiceProvider call(ExpressRouteServiceProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(ExpressRouteServiceProviderInner inner) { + return new ExpressRouteServiceProviderImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersInner.java new file mode 100644 index 0000000000000..9e879585565e3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteServiceProvidersInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteServiceProviders. + */ +public class ExpressRouteServiceProvidersInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteServiceProvidersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteServiceProvidersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteServiceProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteServiceProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteServiceProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviders list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviders listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationImpl.java new file mode 100644 index 0000000000000..ee6bdf0615735 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.FlowLogInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.TrafficAnalyticsProperties; +import com.microsoft.azure.management.network.v2018_08_01.RetentionPolicyParameters; + +class FlowLogInformationImpl extends WrapperImpl implements FlowLogInformation { + private final NetworkManager manager; + FlowLogInformationImpl(FlowLogInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public boolean enabled() { + return this.inner().enabled(); + } + + @Override + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.inner().flowAnalyticsConfiguration(); + } + + @Override + public RetentionPolicyParameters retentionPolicy() { + return this.inner().retentionPolicy(); + } + + @Override + public String storageId() { + return this.inner().storageId(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationInner.java new file mode 100644 index 0000000000000..749aa6e0248c9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FlowLogInformationInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.RetentionPolicyParameters; +import com.microsoft.azure.management.network.v2018_08_01.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information on the configuration of flow log and traffic analytics + * (optional) . + */ +@JsonFlatten +public class FlowLogInformationInner { + /** + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * The retentionPolicy property. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /** + * The flowAnalyticsConfiguration property. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /** + * Get the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get iD of the storage account which is used to store the flow log. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set iD of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get flag to enable/disable flow logging. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable flow logging. + * + * @param enabled the enabled value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy value. + * + * @return the retentionPolicy value + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy value. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the flowAnalyticsConfiguration value. + * + * @return the flowAnalyticsConfiguration value + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set the flowAnalyticsConfiguration value. + * + * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationImpl.java new file mode 100644 index 0000000000000..2a52a14f66082 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.FrontendIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class FrontendIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements FrontendIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String frontendIPConfigurationName; + + FrontendIPConfigurationImpl(FrontendIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.frontendIPConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "frontendIPConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerFrontendIPConfigurationsInner client = this.manager().inner().loadBalancerFrontendIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.frontendIPConfigurationName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + return this.inner().inboundNatRules(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + return this.inner().outboundRules(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List zones() { + return this.inner().zones(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationInner.java new file mode 100644 index 0000000000000..c8e36275646da --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/FrontendIPConfigurationInner.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP address of the load balancer. + */ +@JsonFlatten +public class FrontendIPConfigurationInner extends SubResource { + /** + * Read only. Inbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /** + * Read only. Inbound pools URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /** + * Read only. Outbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /** + * Gets load balancing rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The Private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the Public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * The reference of the Public IP Prefix resource. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get read only. Inbound rules URIs that use this frontend IP. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get read only. Inbound pools URIs that use this frontend IP. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Get read only. Outbound rules URIs that use this frontend IP. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Get gets load balancing rules URIs that use this frontend IP. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the Public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the Public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the reference of the Public IP Prefix resource. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the reference of the Public IP Prefix resource. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultImpl.java new file mode 100644 index 0000000000000..74fc3fbd4c0d4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.GatewayRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.GatewayRoute; + +class GatewayRouteListResultImpl extends WrapperImpl implements GatewayRouteListResult { + private final NetworkManager manager; + GatewayRouteListResultImpl(GatewayRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultInner.java new file mode 100644 index 0000000000000..247efa5747327 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/GatewayRouteListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of virtual network gateway routes. + */ +public class GatewayRouteListResultInner { + /** + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of gateway routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of gateway routes. + * + * @param value the value value to set + * @return the GatewayRouteListResultInner object itself. + */ + public GatewayRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..e5f1099b2379e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnection; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.SubResource; + +class HubVirtualNetworkConnectionImpl extends IndexableRefreshableWrapperImpl implements HubVirtualNetworkConnection { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualHubName; + private String connectionName; + + HubVirtualNetworkConnectionImpl(HubVirtualNetworkConnectionInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualHubs"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "hubVirtualNetworkConnections"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + HubVirtualNetworkConnectionsInner client = this.manager().inner().hubVirtualNetworkConnections(); + return client.getAsync(this.resourceGroupName, this.virtualHubName, this.connectionName); + } + + + + @Override + public Boolean allowHubToRemoteVnetTransit() { + return this.inner().allowHubToRemoteVnetTransit(); + } + + @Override + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.inner().allowRemoteVnetToUseHubVnetGateways(); + } + + @Override + public Boolean enableInternetSecurity() { + return this.inner().enableInternetSecurity(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionInner.java new file mode 100644 index 0000000000000..2b77718a4606e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * HubVirtualNetworkConnection Resource. + */ +@JsonFlatten +public class HubVirtualNetworkConnectionInner extends SubResource { + /** + * Reference to the remote virtual network. + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "properties.allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /** + * Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "properties.allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /** + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set reference to the remote virtual network. + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get virtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value + */ + public Boolean allowHubToRemoteVnetTransit() { + return this.allowHubToRemoteVnetTransit; + } + + /** + * Set virtualHub to RemoteVnet transit to enabled or not. + * + * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { + this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + return this; + } + + /** + * Get allow RemoteVnet to use Virtual Hub's gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value + */ + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.allowRemoteVnetToUseHubVnetGateways; + } + + /** + * Set allow RemoteVnet to use Virtual Hub's gateways. + * + * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways(Boolean allowRemoteVnetToUseHubVnetGateways) { + this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + return this; + } + + /** + * Get enable internet security. + * + * @return the enableInternetSecurity value + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsImpl.java new file mode 100644 index 0000000000000..80d41083de0b9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnections; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnection; + +class HubVirtualNetworkConnectionsImpl extends WrapperImpl implements HubVirtualNetworkConnections { + private final NetworkManager manager; + + HubVirtualNetworkConnectionsImpl(NetworkManager manager) { + super(manager.inner().hubVirtualNetworkConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private HubVirtualNetworkConnectionImpl wrapModel(HubVirtualNetworkConnectionInner inner) { + return new HubVirtualNetworkConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualHubName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualHubName, connectionName) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsInner.java new file mode 100644 index 0000000000000..844bb736b73c5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/HubVirtualNetworkConnectionsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HubVirtualNetworkConnections. + */ +public class HubVirtualNetworkConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private HubVirtualNetworkConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HubVirtualNetworkConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(HubVirtualNetworkConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HubVirtualNetworkConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface HubVirtualNetworkConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HubVirtualNetworkConnectionInner object if successful. + */ + public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualHubName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).map(new Func1, HubVirtualNetworkConnectionInner>() { + @Override + public HubVirtualNetworkConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualHubName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualHubName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualHubName) { + return listWithServiceResponseAsync(resourceGroupName, virtualHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualHubName) { + return listSinglePageAsync(resourceGroupName, virtualHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + ServiceResponse> * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..7e9a083fbecf5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.IPAddressAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class IPAddressAvailabilityResultImpl extends WrapperImpl implements IPAddressAvailabilityResult { + private final NetworkManager manager; + IPAddressAvailabilityResultImpl(IPAddressAvailabilityResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean available() { + return this.inner().available(); + } + + @Override + public List availableIPAddresses() { + return this.inner().availableIPAddresses(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultInner.java new file mode 100644 index 0000000000000..517f8cb842c86 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IPAddressAvailabilityResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for CheckIPAddressAvailability API service call. + */ +public class IPAddressAvailabilityResultInner { + /** + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIPAddresses; + + /** + * Get private IP address availability. + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set private IP address availability. + * + * @param available the available value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get contains other available private IP addresses if the asked for address is taken. + * + * @return the availableIPAddresses value + */ + public List availableIPAddresses() { + return this.availableIPAddresses; + } + + /** + * Set contains other available private IP addresses if the asked for address is taken. + * + * @param availableIPAddresses the availableIPAddresses value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailableIPAddresses(List availableIPAddresses) { + this.availableIPAddresses = availableIPAddresses; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IdParsingUtils.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ba06d40d99cd0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..ace906a8f11c5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class InboundNatRuleImpl extends CreatableUpdatableImpl implements InboundNatRule, InboundNatRule.Definition, InboundNatRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String inboundNatRuleName; + + InboundNatRuleImpl(String name, NetworkManager manager) { + super(name, new InboundNatRuleInner()); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = name; + // + } + + InboundNatRuleImpl(InboundNatRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.inboundNatRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "inboundNatRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().backendIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public Integer frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public InboundNatRuleImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + @Override + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.inner().withBackendPort(backendPort); + return this; + } + + @Override + public InboundNatRuleImpl withEnableFloatingIP(Boolean enableFloatingIP) { + this.inner().withEnableFloatingIP(enableFloatingIP); + return this; + } + + @Override + public InboundNatRuleImpl withEnableTcpReset(Boolean enableTcpReset) { + this.inner().withEnableTcpReset(enableTcpReset); + return this; + } + + @Override + public InboundNatRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.inner().withFrontendIPConfiguration(frontendIPConfiguration); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.inner().withFrontendPort(frontendPort); + return this; + } + + @Override + public InboundNatRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public InboundNatRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public InboundNatRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleInner.java new file mode 100644 index 0000000000000..ac574285ec932 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRuleInner.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT rule of the load balancer. + */ +@JsonFlatten +public class InboundNatRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP + * configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "properties.backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIPConfigurationInner backendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values range from 1 to + * 65534. + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /** + * The port used for the internal endpoint. Acceptable values range from 1 + * to 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. + * + * @return the backendIPConfiguration value + */ + public NetworkInterfaceIPConfigurationInner backendIPConfiguration() { + return this.backendIPConfiguration; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @return the frontendPort value + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @param frontendPort the frontendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesImpl.java new file mode 100644 index 0000000000000..fcb43d7a9ada7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; + +class InboundNatRulesImpl extends WrapperImpl implements InboundNatRules { + private final NetworkManager manager; + + InboundNatRulesImpl(NetworkManager manager) { + super(manager.inner().inboundNatRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public InboundNatRuleImpl define(String name) { + return wrapModel(name); + } + + private InboundNatRuleImpl wrapModel(InboundNatRuleInner inner) { + return new InboundNatRuleImpl(inner, manager()); + } + + private InboundNatRuleImpl wrapModel(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + InboundNatRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java new file mode 100644 index 0000000000000..591fa5724ca93 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InboundNatRules. + */ +public class InboundNatRulesInner { + /** The Retrofit service to perform REST calls. */ + private InboundNatRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InboundNatRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InboundNatRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for InboundNatRules to be + * used by Retrofit to perform actually REST calls. + */ + interface InboundNatRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InboundNatRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner createOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointImpl.java new file mode 100644 index 0000000000000..47789fdb645a0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoint; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.EndpointService; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterface; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class InterfaceEndpointImpl extends GroupableResourceCoreImpl implements InterfaceEndpoint, InterfaceEndpoint.Definition, InterfaceEndpoint.Update { + InterfaceEndpointImpl(String name, InterfaceEndpointInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public EndpointService endpointService() { + return this.inner().endpointService(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String fqdn() { + return this.inner().fqdn(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String owner() { + return this.inner().owner(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public InterfaceEndpointImpl withEndpointService(EndpointService endpointService) { + this.inner().withEndpointService(endpointService); + return this; + } + + @Override + public InterfaceEndpointImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InterfaceEndpointImpl withFqdn(String fqdn) { + this.inner().withFqdn(fqdn); + return this; + } + + @Override + public InterfaceEndpointImpl withSubnet(SubnetInner subnet) { + this.inner().withSubnet(subnet); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointInner.java new file mode 100644 index 0000000000000..7189fff47ab15 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointInner.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.EndpointService; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Interface endpoint resource. + */ +@JsonFlatten +@SkipParentValidation +public class InterfaceEndpointInner extends Resource { + /** + * A first-party service's FQDN that is mapped to the private IP allocated + * via this interface endpoint. + */ + @JsonProperty(value = "properties.fqdn") + private String fqdn; + + /** + * A reference to the service being brought into the virtual network. + */ + @JsonProperty(value = "properties.endpointService") + private EndpointService endpointService; + + /** + * The ID of the subnet from which the private IP will be allocated. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets an array of references to the network interfaces created for this + * interface endpoint. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A read-only property that identifies who created this interface + * endpoint. + */ + @JsonProperty(value = "properties.owner", access = JsonProperty.Access.WRITE_ONLY) + private String owner; + + /** + * The provisioning state of the interface endpoint. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set a first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint. + * + * @param fqdn the fqdn value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get a reference to the service being brought into the virtual network. + * + * @return the endpointService value + */ + public EndpointService endpointService() { + return this.endpointService; + } + + /** + * Set a reference to the service being brought into the virtual network. + * + * @param endpointService the endpointService value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withEndpointService(EndpointService endpointService) { + this.endpointService = endpointService; + return this; + } + + /** + * Get the ID of the subnet from which the private IP will be allocated. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the ID of the subnet from which the private IP will be allocated. + * + * @param subnet the subnet value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets an array of references to the network interfaces created for this interface endpoint. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a read-only property that identifies who created this interface endpoint. + * + * @return the owner value + */ + public String owner() { + return this.owner; + } + + /** + * Get the provisioning state of the interface endpoint. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsImpl.java new file mode 100644 index 0000000000000..d9c3e0e9133d1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoint; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class InterfaceEndpointsImpl extends GroupableResourcesCoreImpl implements InterfaceEndpoints { + protected InterfaceEndpointsImpl(NetworkManager manager) { + super(manager.inner().interfaceEndpoints(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + InterfaceEndpointsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + InterfaceEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + InterfaceEndpointsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + InterfaceEndpointsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InterfaceEndpoint call(InterfaceEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + InterfaceEndpointsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + InterfaceEndpointsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InterfaceEndpoint call(InterfaceEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public InterfaceEndpointImpl define(String name) { + return wrapModel(name); + } + + @Override + protected InterfaceEndpointImpl wrapModel(InterfaceEndpointInner inner) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } + + @Override + protected InterfaceEndpointImpl wrapModel(String name) { + return new InterfaceEndpointImpl(name, new InterfaceEndpointInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java new file mode 100644 index 0000000000000..5e0e55b76454e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InterfaceEndpoints. + */ +public class InterfaceEndpointsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private InterfaceEndpointsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InterfaceEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InterfaceEndpointsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InterfaceEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for InterfaceEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface InterfaceEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Body InterfaceEndpointInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Body InterfaceEndpointInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/interfaceEndpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String interfaceEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().last().body(); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String interfaceEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String interfaceEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().single().body(); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String interfaceEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().single().body(); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand), serviceCallback); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner createOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters), serviceCallback); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner beginCreateOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters), serviceCallback); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsImpl.java new file mode 100644 index 0000000000000..9ad6c5f75f30b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerBackendAddressPools; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; + +class LoadBalancerBackendAddressPoolsImpl extends WrapperImpl implements LoadBalancerBackendAddressPools { + private final NetworkManager manager; + + LoadBalancerBackendAddressPoolsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerBackendAddressPools()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private BackendAddressPoolImpl wrapModel(BackendAddressPoolInner inner) { + return new BackendAddressPoolImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsInner.java new file mode 100644 index 0000000000000..e8dd19a36aac9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerBackendAddressPoolsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerBackendAddressPools. + */ +public class LoadBalancerBackendAddressPoolsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerBackendAddressPoolsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerBackendAddressPoolsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerBackendAddressPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerBackendAddressPools to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerBackendAddressPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerBackendAddressPools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerBackendAddressPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("backendAddressPoolName") String backendAddressPoolName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerBackendAddressPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackendAddressPoolInner object if successful. + */ + public BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).toBlocking().single().body(); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName), serviceCallback); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).map(new Func1, BackendAddressPoolInner>() { + @Override + public BackendAddressPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (backendAddressPoolName == null) { + throw new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, backendAddressPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java new file mode 100644 index 0000000000000..3c8c7418b74f3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerFrontendIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.FrontendIPConfiguration; + +class LoadBalancerFrontendIPConfigurationsImpl extends WrapperImpl implements LoadBalancerFrontendIPConfigurations { + private final NetworkManager manager; + + LoadBalancerFrontendIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerFrontendIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private FrontendIPConfigurationImpl wrapModel(FrontendIPConfigurationInner inner) { + return new FrontendIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java new file mode 100644 index 0000000000000..0bac1ad6441d7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerFrontendIPConfigurations. + */ +public class LoadBalancerFrontendIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerFrontendIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerFrontendIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerFrontendIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerFrontendIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerFrontendIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerFrontendIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerFrontendIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("frontendIPConfigurationName") String frontendIPConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerFrontendIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FrontendIPConfigurationInner object if successful. + */ + public FrontendIPConfigurationInner get(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).toBlocking().single().body(); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName), serviceCallback); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).map(new Func1, FrontendIPConfigurationInner>() { + @Override + public FrontendIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (frontendIPConfigurationName == null) { + throw new IllegalArgumentException("Parameter frontendIPConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerImpl.java new file mode 100644 index 0000000000000..8c9c404a011e5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancer; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_08_01.OutboundRule; +import com.microsoft.azure.management.network.v2018_08_01.Probe; + +class LoadBalancerImpl extends GroupableResourceCoreImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + LoadBalancerImpl(String name, LoadBalancerInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List outboundRules() { + List lst = new ArrayList(); + if (this.inner().outboundRules() != null) { + for (OutboundRuleInner inner : this.inner().outboundRules()) { + lst.add( new OutboundRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public LoadBalancerImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LoadBalancerImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.inner().withInboundNatPools(inboundNatPools); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.inner().withInboundNatRules(inboundNatRules); + return this; + } + + @Override + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.inner().withLoadBalancingRules(loadBalancingRules); + return this; + } + + @Override + public LoadBalancerImpl withOutboundRules(List outboundRules) { + this.inner().withOutboundRules(outboundRules); + return this; + } + + @Override + public LoadBalancerImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public LoadBalancerImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public LoadBalancerImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerInner.java new file mode 100644 index 0000000000000..f4b278267adc3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerInner.java @@ -0,0 +1,351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatPool; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * LoadBalancer resource. + */ +@JsonFlatten +@SkipParentValidation +public class LoadBalancerInner extends Resource { + /** + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /** + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Object collection representing the load balancing rules Gets the + * provisioning. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /** + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with + * defining an inbound NAT pool. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to + * reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatRules") + private List inboundNatRules; + + /** + * Defines an external port range for inbound NAT to a single backend port + * on NICs associated with a load balancer. Inbound NAT rules are created + * automatically for each NIC associated with the Load Balancer using an + * external port from this range. Defining an Inbound NAT pool on your Load + * Balancer is mutually exclusive with defining inbound Nat rules. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are + * associated with individual virtual machines cannot reference an inbound + * NAT pool. They have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatPools") + private List inboundNatPools; + + /** + * The outbound rules. + */ + @JsonProperty(value = "properties.outboundRules") + private List outboundRules; + + /** + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the load balancer SKU. + * + * @return the sku value + */ + public LoadBalancerSku sku() { + return this.sku; + } + + /** + * Set the load balancer SKU. + * + * @param sku the sku value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withSku(LoadBalancerSku sku) { + this.sku = sku; + return this; + } + + /** + * Get object representing the frontend IPs to be used for the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set object representing the frontend IPs to be used for the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set collection of backend address pools used by a load balancer. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get object collection representing the load balancing rules Gets the provisioning. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set object collection representing the load balancing rules Gets the provisioning. + * + * @param loadBalancingRules the loadBalancingRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get collection of probe objects used in the load balancer. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set collection of probe objects used in the load balancer. + * + * @param probes the probes value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Set collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatRules(List inboundNatRules) { + this.inboundNatRules = inboundNatRules; + return this; + } + + /** + * Get defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Set defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatPools the inboundNatPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + + /** + * Get the outbound rules. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Set the outbound rules. + * + * @param outboundRules the outboundRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withOutboundRules(List outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the resource GUID property of the load balancer resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the load balancer resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesImpl.java new file mode 100644 index 0000000000000..b8c6bf91884a3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerLoadBalancingRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancingRule; + +class LoadBalancerLoadBalancingRulesImpl extends WrapperImpl implements LoadBalancerLoadBalancingRules { + private final NetworkManager manager; + + LoadBalancerLoadBalancingRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerLoadBalancingRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancingRuleImpl wrapModel(LoadBalancingRuleInner inner) { + return new LoadBalancingRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesInner.java new file mode 100644 index 0000000000000..379b5b36d506b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerLoadBalancingRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerLoadBalancingRules. + */ +public class LoadBalancerLoadBalancingRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerLoadBalancingRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerLoadBalancingRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerLoadBalancingRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerLoadBalancingRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerLoadBalancingRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerLoadBalancingRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerLoadBalancingRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("loadBalancingRuleName") String loadBalancingRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerLoadBalancingRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancingRuleInner object if successful. + */ + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).map(new Func1, LoadBalancingRuleInner>() { + @Override + public LoadBalancingRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (loadBalancingRuleName == null) { + throw new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, loadBalancingRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfaceImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfaceImpl.java new file mode 100644 index 0000000000000..3cd546fcc0ce5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfaceImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoint; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroup; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfiguration; +import com.microsoft.azure.SubResource; + +class LoadBalancerNetworkInterfaceImpl extends WrapperImpl implements LoadBalancerNetworkInterface { + private final NetworkManager manager; + + LoadBalancerNetworkInterfaceImpl(NetworkInterfaceInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hostedWorkloads() { + return this.inner().hostedWorkloads(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public InterfaceEndpoint interfaceEndpoint() { + InterfaceEndpointInner inner = this.inner().interfaceEndpoint(); + if (inner != null) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tapConfigurations() { + List lst = new ArrayList(); + if (this.inner().tapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().tapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesImpl.java new file mode 100644 index 0000000000000..076ad8af435c5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterface; + +class LoadBalancerNetworkInterfacesImpl extends WrapperImpl implements LoadBalancerNetworkInterfaces { + private final NetworkManager manager; + + LoadBalancerNetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerNetworkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancerNetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerNetworkInterfacesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesInner.java new file mode 100644 index 0000000000000..f3f197cf029ee --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerNetworkInterfacesInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerNetworkInterfaces. + */ +public class LoadBalancerNetworkInterfacesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerNetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerNetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerNetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerNetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerNetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesImpl.java new file mode 100644 index 0000000000000..348c7be264602 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerOutboundRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.OutboundRule; + +class LoadBalancerOutboundRulesImpl extends WrapperImpl implements LoadBalancerOutboundRules { + private final NetworkManager manager; + + LoadBalancerOutboundRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerOutboundRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private OutboundRuleImpl wrapModel(OutboundRuleInner inner) { + return new OutboundRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerOutboundRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OutboundRule call(OutboundRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + LoadBalancerOutboundRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, outboundRuleName) + .map(new Func1() { + @Override + public OutboundRule call(OutboundRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java new file mode 100644 index 0000000000000..a241fdf83865b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerOutboundRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerOutboundRules. + */ +public class LoadBalancerOutboundRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerOutboundRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerOutboundRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerOutboundRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerOutboundRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerOutboundRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerOutboundRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerOutboundRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerOutboundRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("outboundRuleName") String outboundRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerOutboundRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OutboundRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OutboundRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OutboundRuleInner object if successful. + */ + public OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OutboundRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName).map(new Func1, OutboundRuleInner>() { + @Override + public OutboundRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OutboundRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (outboundRuleName == null) { + throw new IllegalArgumentException("Parameter outboundRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, outboundRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OutboundRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OutboundRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesImpl.java new file mode 100644 index 0000000000000..6794164fa6c79 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerProbes; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Probe; + +class LoadBalancerProbesImpl extends WrapperImpl implements LoadBalancerProbes { + private final NetworkManager manager; + + LoadBalancerProbesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerProbes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ProbeImpl wrapModel(ProbeInner inner) { + return new ProbeImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerProbesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + LoadBalancerProbesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, probeName) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesInner.java new file mode 100644 index 0000000000000..70c3c6c325b6c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancerProbesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerProbes. + */ +public class LoadBalancerProbesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerProbesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerProbesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerProbesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerProbes to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerProbesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerProbes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerProbes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("probeName") String probeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancerProbes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProbeInner object if successful. + */ + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).toBlocking().single().body(); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String probeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName), serviceCallback); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).map(new Func1, ProbeInner>() { + @Override + public ProbeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String probeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (probeName == null) { + throw new IllegalArgumentException("Parameter probeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, loadBalancerName, probeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersImpl.java new file mode 100644 index 0000000000000..42d826570ea0f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancer; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LoadBalancersImpl extends GroupableResourcesCoreImpl implements LoadBalancers { + protected LoadBalancersImpl(NetworkManager manager) { + super(manager.inner().loadBalancers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + LoadBalancersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LoadBalancerImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new LoadBalancerImpl(inner.name(), inner, manager()); + } + + @Override + protected LoadBalancerImpl wrapModel(String name) { + return new LoadBalancerImpl(name, new LoadBalancerInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java new file mode 100644 index 0000000000000..d1f44208a049d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancers. + */ +public class LoadBalancersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private LoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LoadBalancers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 0000000000000..6729c724ba78c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancingRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.LoadDistribution; +import com.microsoft.azure.management.network.v2018_08_01.TransportProtocol; + +class LoadBalancingRuleImpl extends IndexableRefreshableWrapperImpl implements LoadBalancingRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String loadBalancingRuleName; + + LoadBalancingRuleImpl(LoadBalancingRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.loadBalancingRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancingRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerLoadBalancingRulesInner client = this.manager().inner().loadBalancerLoadBalancingRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.loadBalancingRuleName); + } + + + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean disableOutboundSnat() { + return this.inner().disableOutboundSnat(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public int frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public LoadDistribution loadDistribution() { + return this.inner().loadDistribution(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource probe() { + return this.inner().probe(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleInner.java new file mode 100644 index 0000000000000..43981a364669b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleInner.java @@ -0,0 +1,403 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_08_01.LoadDistribution; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancing rule for a load balancer. + */ +@JsonFlatten +public class LoadBalancingRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * The reference of the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The load distribution policy for this rule. Possible values are + * 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: + * 'Default', 'SourceIP', 'SourceIPProtocol'. + */ + @JsonProperty(value = "properties.loadDistribution") + private LoadDistribution loadDistribution; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 0 and + * 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.frontendPort", required = true) + private int frontendPort; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 0 and 65535. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + */ + @JsonProperty(value = "properties.disableOutboundSnat") + private Boolean disableOutboundSnat; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the reference of the load balancer probe used by the load balancing rule. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the reference of the load balancer probe used by the load balancing rule. + * + * @param probe the probe value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @return the loadDistribution value + */ + public LoadDistribution loadDistribution() { + return this.loadDistribution; + } + + /** + * Set the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @param loadDistribution the loadDistribution value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { + this.loadDistribution = loadDistribution; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value + */ + public int frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @param frontendPort the frontendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @param backendPort the backendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @return the disableOutboundSnat value + */ + public Boolean disableOutboundSnat() { + return this.disableOutboundSnat; + } + + /** + * Set configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @param disableOutboundSnat the disableOutboundSnat value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { + this.disableOutboundSnat = disableOutboundSnat; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayImpl.java new file mode 100644 index 0000000000000..435bb8ae52f74 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; + +class LocalNetworkGatewayImpl extends GroupableResourceCoreImpl implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + LocalNetworkGatewayImpl(String name, LocalNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayIpAddress() { + return this.inner().gatewayIpAddress(); + } + + @Override + public AddressSpace localNetworkAddressSpace() { + return this.inner().localNetworkAddressSpace(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public LocalNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.inner().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + @Override + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.inner().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + @Override + public LocalNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayInner.java new file mode 100644 index 0000000000000..5f62ebc56142e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewayInner.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class LocalNetworkGatewayInner extends Resource { + /** + * Local network site address space. + */ + @JsonProperty(value = "properties.localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /** + * IP address of local network gateway. + */ + @JsonProperty(value = "properties.gatewayIpAddress") + private String gatewayIpAddress; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the LocalNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the LocalNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get local network site address space. + * + * @return the localNetworkAddressSpace value + */ + public AddressSpace localNetworkAddressSpace() { + return this.localNetworkAddressSpace; + } + + /** + * Set local network site address space. + * + * @param localNetworkAddressSpace the localNetworkAddressSpace value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.localNetworkAddressSpace = localNetworkAddressSpace; + return this; + } + + /** + * Get iP address of local network gateway. + * + * @return the gatewayIpAddress value + */ + public String gatewayIpAddress() { + return this.gatewayIpAddress; + } + + /** + * Set iP address of local network gateway. + * + * @param gatewayIpAddress the gatewayIpAddress value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { + this.gatewayIpAddress = gatewayIpAddress; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the LocalNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the LocalNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..80511083dae67 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LocalNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements LocalNetworkGateways { + protected LocalNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().localNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocalNetworkGateway call(LocalNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LocalNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(LocalNetworkGatewayInner inner) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(String name) { + return new LocalNetworkGatewayImpl(name, new LocalNetworkGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java new file mode 100644 index 0000000000000..e601fca80bd4f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java @@ -0,0 +1,1048 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocalNetworkGateways. + */ +public class LocalNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private LocalNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocalNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LocalNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocalNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface LocalNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String localNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String localNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationImpl.java new file mode 100644 index 0000000000000..5ad7a76e35f08 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.LocationAvailableDelegation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; + +class LocationAvailableDelegationImpl extends WrapperImpl implements LocationAvailableDelegation { + private final NetworkManager manager; + + LocationAvailableDelegationImpl(AvailableDelegationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationModelImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationModelImpl.java new file mode 100644 index 0000000000000..4450129ce3249 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocationAvailableDelegationModelImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.LocationAvailableDelegationModel; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; + +class LocationAvailableDelegationModelImpl extends WrapperImpl implements LocationAvailableDelegationModel { + private final NetworkManager manager; + + LocationAvailableDelegationModelImpl(AvailableDelegationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..8de82f8473d5f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticResult; + +class NetworkConfigurationDiagnosticResponseImpl extends WrapperImpl implements NetworkConfigurationDiagnosticResponse { + private final NetworkManager manager; + NetworkConfigurationDiagnosticResponseImpl(NetworkConfigurationDiagnosticResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List results() { + return this.inner().results(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 0000000000000..aa4a847c1c4f4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network configuration diagnostic on the target resource. + */ +public class NetworkConfigurationDiagnosticResponseInner { + /** + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get list of network configuration diagnostic results. + * + * @return the results value + */ + public List results() { + return this.results; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationInner.java new file mode 100644 index 0000000000000..7f438cfbc7506 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationInner.java @@ -0,0 +1,395 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IPConfiguration in a network interface. + */ +@JsonFlatten +public class NetworkInterfaceIPConfigurationInner extends SubResource { + /** + * The reference to Virtual Network Taps. + */ + @JsonProperty(value = "properties.virtualNetworkTaps") + private List virtualNetworkTaps; + + /** + * The reference of ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /** + * The reference of LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /** + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Defines how a private IP address is assigned. Possible values are: + * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Available from Api-Version 2016-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IPVersion privateIPAddressVersion; + + /** + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets whether this is a primary customer address on the network + * interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * The provisioning state of the network interface IP configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value + */ + public List virtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** + * Set the reference to Virtual Network Taps. + * + * @param virtualNetworkTaps the virtualNetworkTaps value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withVirtualNetworkTaps(List virtualNetworkTaps) { + this.virtualNetworkTaps = virtualNetworkTaps; + return this; + } + + /** + * Get the reference of ApplicationGatewayBackendAddressPool resource. + * + * @return the applicationGatewayBackendAddressPools value + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the reference of ApplicationGatewayBackendAddressPool resource. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the reference of LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the reference of LoadBalancerBackendAddressPool resource. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get a list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value + */ + public List loadBalancerInboundNatRules() { + return this.loadBalancerInboundNatRules; + } + + /** + * Set a list of references of LoadBalancerInboundNatRules. + * + * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerInboundNatRules(List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the privateIPAddressVersion value + */ + public IPVersion privateIPAddressVersion() { + return this.privateIPAddressVersion; + } + + /** + * Set available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param privateIPAddressVersion the privateIPAddressVersion value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + this.privateIPAddressVersion = privateIPAddressVersion; + return this; + } + + /** + * Get subnet bound to the IP configuration. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set subnet bound to the IP configuration. + * + * @param subnet the subnet value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets whether this is a primary customer address on the network interface. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary customer address on the network interface. + * + * @param primary the primary value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get public IP address bound to the IP configuration. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set public IP address bound to the IP configuration. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get application security groups in which the IP configuration is included. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups in which the IP configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsImpl.java new file mode 100644 index 0000000000000..bfb7c6569fcab --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceNetworkInterfaceIPConfiguration; + +class NetworkInterfaceIPConfigurationsImpl extends WrapperImpl implements NetworkInterfaceIPConfigurations { + private final NetworkManager manager; + + NetworkInterfaceIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceNetworkInterfaceIPConfigurationImpl wrapModel(NetworkInterfaceIPConfigurationInner inner) { + return new NetworkInterfaceNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsInner.java new file mode 100644 index 0000000000000..7c094940d37c2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceIPConfigurations. + */ +public class NetworkInterfaceIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner get(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceImpl.java new file mode 100644 index 0000000000000..6d11e3c6ae8a1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterface; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceDnsSettings; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoint; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfiguration; + +class NetworkInterfaceImpl extends GroupableResourceCoreImpl implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + NetworkInterfaceImpl(String name, NetworkInterfaceInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hostedWorkloads() { + return this.inner().hostedWorkloads(); + } + + @Override + public InterfaceEndpoint interfaceEndpoint() { + InterfaceEndpointInner inner = this.inner().interfaceEndpoint(); + if (inner != null) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List tapConfigurations() { + List lst = new ArrayList(); + if (this.inner().tapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().tapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + + @Override + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.inner().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableIPForwarding(Boolean enableIPForwarding) { + this.inner().withEnableIPForwarding(enableIPForwarding); + return this; + } + + @Override + public NetworkInterfaceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public NetworkInterfaceImpl withMacAddress(String macAddress) { + this.inner().withMacAddress(macAddress); + return this; + } + + @Override + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public NetworkInterfaceImpl withPrimary(Boolean primary) { + this.inner().withPrimary(primary); + return this; + } + + @Override + public NetworkInterfaceImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkInterfaceImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkInterfaceImpl withTapConfigurations(List tapConfigurations) { + this.inner().withTapConfigurations(tapConfigurations); + return this; + } + + @Override + public NetworkInterfaceImpl withVirtualMachine(SubResource virtualMachine) { + this.inner().withVirtualMachine(virtualMachine); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceInner.java new file mode 100644 index 0000000000000..c8cee508cfb90 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceInner.java @@ -0,0 +1,395 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A network interface in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkInterfaceInner extends Resource { + /** + * The reference of a virtual machine. + */ + @JsonProperty(value = "properties.virtualMachine") + private SubResource virtualMachine; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * A reference to the interface endpoint to which the network interface is + * linked. + */ + @JsonProperty(value = "properties.interfaceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private InterfaceEndpointInner interfaceEndpoint; + + /** + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * A list of TapConfigurations of the network interface. + */ + @JsonProperty(value = "properties.tapConfigurations") + private List tapConfigurations; + + /** + * The DNS settings in network interface. + */ + @JsonProperty(value = "properties.dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /** + * The MAC address of the network interface. + */ + @JsonProperty(value = "properties.macAddress") + private String macAddress; + + /** + * Gets whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * If the network interface is accelerated networking enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /** + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + + /** + * A list of references to linked BareMetal resources. + */ + @JsonProperty(value = "properties.hostedWorkloads", access = JsonProperty.Access.WRITE_ONLY) + private List hostedWorkloads; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the reference of a virtual machine. + * + * @return the virtualMachine value + */ + public SubResource virtualMachine() { + return this.virtualMachine; + } + + /** + * Set the reference of a virtual machine. + * + * @param virtualMachine the virtualMachine value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withVirtualMachine(SubResource virtualMachine) { + this.virtualMachine = virtualMachine; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get a reference to the interface endpoint to which the network interface is linked. + * + * @return the interfaceEndpoint value + */ + public InterfaceEndpointInner interfaceEndpoint() { + return this.interfaceEndpoint; + } + + /** + * Get a list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get a list of TapConfigurations of the network interface. + * + * @return the tapConfigurations value + */ + public List tapConfigurations() { + return this.tapConfigurations; + } + + /** + * Set a list of TapConfigurations of the network interface. + * + * @param tapConfigurations the tapConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withTapConfigurations(List tapConfigurations) { + this.tapConfigurations = tapConfigurations; + return this; + } + + /** + * Get the DNS settings in network interface. + * + * @return the dnsSettings value + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the DNS settings in network interface. + * + * @param dnsSettings the dnsSettings value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the MAC address of the network interface. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address of the network interface. + * + * @param macAddress the macAddress value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get gets whether this is a primary network interface on a virtual machine. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary network interface on a virtual machine. + * + * @param primary the primary value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get if the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set if the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + return this; + } + + /** + * Get a list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value + */ + public List hostedWorkloads() { + return this.hostedWorkloads; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network interface resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancerImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancerImpl.java new file mode 100644 index 0000000000000..14e807a5556ad --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancerImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_08_01.OutboundRule; +import com.microsoft.azure.management.network.v2018_08_01.Probe; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerSku; +import java.util.Map; + +class NetworkInterfaceLoadBalancerImpl extends WrapperImpl implements NetworkInterfaceLoadBalancer { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancerImpl(LoadBalancerInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + List lst = new ArrayList(); + if (this.inner().outboundRules() != null) { + for (OutboundRuleInner inner : this.inner().outboundRules()) { + lst.add( new OutboundRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersImpl.java new file mode 100644 index 0000000000000..de9627bfa3ac9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancer; + +class NetworkInterfaceLoadBalancersImpl extends WrapperImpl implements NetworkInterfaceLoadBalancers { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancersImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceLoadBalancers()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceLoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new NetworkInterfaceLoadBalancerImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceLoadBalancersInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceLoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersInner.java new file mode 100644 index 0000000000000..a0d99c6a1102e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceLoadBalancersInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceLoadBalancers. + */ +public class NetworkInterfaceLoadBalancersInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceLoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceLoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceLoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceLoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceLoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..ffbf2f1bcb198 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTap; + +class NetworkInterfaceNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements NetworkInterfaceNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String ipConfigurationName; + + NetworkInterfaceNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceIPConfigurationsInner client = this.manager().inner().networkInterfaceIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List virtualNetworkTaps() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkTaps() != null) { + for (VirtualNetworkTapInner inner : this.inner().virtualNetworkTaps()) { + lst.add( new VirtualNetworkTapImpl(inner.name(), inner, manager())); + } + } + return lst; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationImpl.java new file mode 100644 index 0000000000000..d1b062104a9b9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationImpl.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTap; + +class NetworkInterfaceTapConfigurationImpl extends CreatableUpdatableImpl implements NetworkInterfaceTapConfiguration, NetworkInterfaceTapConfiguration.Definition, NetworkInterfaceTapConfiguration.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String tapConfigurationName; + + NetworkInterfaceTapConfigurationImpl(String name, NetworkManager manager) { + super(name, new NetworkInterfaceTapConfigurationInner()); + this.manager = manager; + // Set resource name + this.tapConfigurationName = name; + // + } + + NetworkInterfaceTapConfigurationImpl(NetworkInterfaceTapConfigurationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tapConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.tapConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "tapConfigurations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VirtualNetworkTap virtualNetworkTap() { + VirtualNetworkTapInner inner = this.inner().virtualNetworkTap(); + if (inner != null) { + return new VirtualNetworkTapImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public NetworkInterfaceTapConfigurationImpl withExistingNetworkInterface(String resourceGroupName, String networkInterfaceName) { + this.resourceGroupName = resourceGroupName; + this.networkInterfaceName = networkInterfaceName; + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.inner().withVirtualNetworkTap(virtualNetworkTap); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationInner.java new file mode 100644 index 0000000000000..64693f1189b0c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationInner.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Tap configuration in a Network Interface. + */ +@JsonFlatten +public class NetworkInterfaceTapConfigurationInner extends SubResource { + /** + * The reference of the Virtual Network Tap resource. + */ + @JsonProperty(value = "properties.virtualNetworkTap") + private VirtualNetworkTapInner virtualNetworkTap; + + /** + * The provisioning state of the network interface tap configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the reference of the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value + */ + public VirtualNetworkTapInner virtualNetworkTap() { + return this.virtualNetworkTap; + } + + /** + * Set the reference of the Virtual Network Tap resource. + * + * @param virtualNetworkTap the virtualNetworkTap value to set + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.virtualNetworkTap = virtualNetworkTap; + return this; + } + + /** + * Get the provisioning state of the network interface tap configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsImpl.java new file mode 100644 index 0000000000000..917d4568ca510 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfiguration; + +class NetworkInterfaceTapConfigurationsImpl extends WrapperImpl implements NetworkInterfaceTapConfigurations { + private final NetworkManager manager; + + NetworkInterfaceTapConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceTapConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceTapConfigurationImpl define(String name) { + return wrapModel(name); + } + + private NetworkInterfaceTapConfigurationImpl wrapModel(NetworkInterfaceTapConfigurationInner inner) { + return new NetworkInterfaceTapConfigurationImpl(inner, manager()); + } + + private NetworkInterfaceTapConfigurationImpl wrapModel(String name) { + return new NetworkInterfaceTapConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceTapConfiguration call(NetworkInterfaceTapConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceTapConfiguration call(NetworkInterfaceTapConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java new file mode 100644 index 0000000000000..60e2ad137632e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceTapConfigurations. + */ +public class NetworkInterfaceTapConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceTapConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceTapConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceTapConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceTapConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceTapConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceTapConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceTapConfigurationInner tapConfigurationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceTapConfigurationInner tapConfigurationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().last().body(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().single().body(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner get(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().single().body(); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner createOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters), serviceCallback); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tapConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter tapConfigurationParameters is required and cannot be null."); + } + Validator.validate(tapConfigurationParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), tapConfigurationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters), serviceCallback); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tapConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter tapConfigurationParameters is required and cannot be null."); + } + Validator.validate(tapConfigurationParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), tapConfigurationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesImpl.java new file mode 100644 index 0000000000000..25d68f0cea436 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterface; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveRouteListResult; +import com.microsoft.azure.management.network.v2018_08_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class NetworkInterfacesImpl extends WrapperImpl implements NetworkInterfaces { + private final NetworkManager manager; + + NetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().networkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceImpl defineNetworkInterface(String name) { + return wrapNetworkInterfaceModel(name); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(String name) { + return new NetworkInterfaceImpl(name, new NetworkInterfaceInner(), this.manager()); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(NetworkInterfaceInner inner) { + return new NetworkInterfaceImpl(inner.name(), inner, manager()); + } + + private VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(NetworkInterfaceIPConfigurationInner inner) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + private Observable getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(String resourceGroupName, String name) { + NetworkInterfacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + private Observable getNetworkInterfaceIPConfigurationInnerUsingNetworkInterfacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(id, "virtualMachineScaleSets"); + String virtualmachineIndex = IdParsingUtils.getValueFromIdByName(id, "virtualMachines"); + String networkInterfaceName = IdParsingUtils.getValueFromIdByName(id, "networkInterfaces"); + String ipConfigurationName = IdParsingUtils.getValueFromIdByName(id, "ipConfigurations"); + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(resourceGroupName, name).map(new Func1 () { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkInterfacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + NetworkInterfacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveRouteListResult call(EffectiveRouteListResultInner inner) { + return new EffectiveRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveNetworkSecurityGroupListResult call(EffectiveNetworkSecurityGroupListResultInner inner) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesInner.java new file mode 100644 index 0000000000000..5f8b98f09cf29 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfacesInner.java @@ -0,0 +1,2966 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaces. + */ +public class NetworkInterfacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces getEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> getEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces beginGetEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> beginGetEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> listEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces beginListEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> beginListEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces") + Observable> listVirtualMachineScaleSetVMNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + Observable> listVirtualMachineScaleSetNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces getVirtualMachineScaleSetNetworkInterface" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}") + Observable> getVirtualMachineScaleSetNetworkInterface(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurations" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> listVirtualMachineScaleSetIpConfigurations(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces getVirtualMachineScaleSetIpConfiguration" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> getVirtualMachineScaleSetIpConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurationsNext" }) + @GET + Observable> listVirtualMachineScaleSetIpConfigurationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetEffectiveRouteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetEffectiveRouteTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListEffectiveNetworkSecurityGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListEffectiveNetworkSecurityGroupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetNetworkInterfaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + ServiceResponse> * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetIpConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurationsNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetIpConfigurationsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManagementClientImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManagementClientImpl.java new file mode 100644 index 0000000000000..71239e02ca48c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,1314 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the NetworkManagementClientImpl class. + */ +public class NetworkManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private NetworkManagementClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NetworkManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NetworkManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ApplicationGatewaysInner object to access its operations. + */ + private ApplicationGatewaysInner applicationGateways; + + /** + * Gets the ApplicationGatewaysInner object to access its operations. + * @return the ApplicationGatewaysInner object. + */ + public ApplicationGatewaysInner applicationGateways() { + return this.applicationGateways; + } + + /** + * The ApplicationSecurityGroupsInner object to access its operations. + */ + private ApplicationSecurityGroupsInner applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsInner object to access its operations. + * @return the ApplicationSecurityGroupsInner object. + */ + public ApplicationSecurityGroupsInner applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * The AvailableDelegationsInner object to access its operations. + */ + private AvailableDelegationsInner availableDelegations; + + /** + * Gets the AvailableDelegationsInner object to access its operations. + * @return the AvailableDelegationsInner object. + */ + public AvailableDelegationsInner availableDelegations() { + return this.availableDelegations; + } + + /** + * The AvailableResourceGroupDelegationsInner object to access its operations. + */ + private AvailableResourceGroupDelegationsInner availableResourceGroupDelegations; + + /** + * Gets the AvailableResourceGroupDelegationsInner object to access its operations. + * @return the AvailableResourceGroupDelegationsInner object. + */ + public AvailableResourceGroupDelegationsInner availableResourceGroupDelegations() { + return this.availableResourceGroupDelegations; + } + + /** + * The AzureFirewallsInner object to access its operations. + */ + private AzureFirewallsInner azureFirewalls; + + /** + * Gets the AzureFirewallsInner object to access its operations. + * @return the AzureFirewallsInner object. + */ + public AzureFirewallsInner azureFirewalls() { + return this.azureFirewalls; + } + + /** + * The AzureFirewallFqdnTagsInner object to access its operations. + */ + private AzureFirewallFqdnTagsInner azureFirewallFqdnTags; + + /** + * Gets the AzureFirewallFqdnTagsInner object to access its operations. + * @return the AzureFirewallFqdnTagsInner object. + */ + public AzureFirewallFqdnTagsInner azureFirewallFqdnTags() { + return this.azureFirewallFqdnTags; + } + + /** + * The DdosProtectionPlansInner object to access its operations. + */ + private DdosProtectionPlansInner ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansInner object to access its operations. + * @return the DdosProtectionPlansInner object. + */ + public DdosProtectionPlansInner ddosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** + * The AvailableEndpointServicesInner object to access its operations. + */ + private AvailableEndpointServicesInner availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesInner object to access its operations. + * @return the AvailableEndpointServicesInner object. + */ + public AvailableEndpointServicesInner availableEndpointServices() { + return this.availableEndpointServices; + } + + /** + * The ExpressRouteCircuitAuthorizationsInner object to access its operations. + */ + private ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsInner object to access its operations. + * @return the ExpressRouteCircuitAuthorizationsInner object. + */ + public ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** + * The ExpressRouteCircuitPeeringsInner object to access its operations. + */ + private ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsInner object to access its operations. + * @return the ExpressRouteCircuitPeeringsInner object. + */ + public ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** + * The ExpressRouteCircuitConnectionsInner object to access its operations. + */ + private ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsInner object to access its operations. + * @return the ExpressRouteCircuitConnectionsInner object. + */ + public ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** + * The ExpressRouteCircuitsInner object to access its operations. + */ + private ExpressRouteCircuitsInner expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsInner object to access its operations. + * @return the ExpressRouteCircuitsInner object. + */ + public ExpressRouteCircuitsInner expressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** + * The ExpressRouteServiceProvidersInner object to access its operations. + */ + private ExpressRouteServiceProvidersInner expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersInner object to access its operations. + * @return the ExpressRouteServiceProvidersInner object. + */ + public ExpressRouteServiceProvidersInner expressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** + * The ExpressRouteCrossConnectionsInner object to access its operations. + */ + private ExpressRouteCrossConnectionsInner expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsInner object to access its operations. + * @return the ExpressRouteCrossConnectionsInner object. + */ + public ExpressRouteCrossConnectionsInner expressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** + * The ExpressRouteCrossConnectionPeeringsInner object to access its operations. + */ + private ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsInner object to access its operations. + * @return the ExpressRouteCrossConnectionPeeringsInner object. + */ + public ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** + * The ExpressRouteGatewaysInner object to access its operations. + */ + private ExpressRouteGatewaysInner expressRouteGateways; + + /** + * Gets the ExpressRouteGatewaysInner object to access its operations. + * @return the ExpressRouteGatewaysInner object. + */ + public ExpressRouteGatewaysInner expressRouteGateways() { + return this.expressRouteGateways; + } + + /** + * The ExpressRouteConnectionsInner object to access its operations. + */ + private ExpressRouteConnectionsInner expressRouteConnections; + + /** + * Gets the ExpressRouteConnectionsInner object to access its operations. + * @return the ExpressRouteConnectionsInner object. + */ + public ExpressRouteConnectionsInner expressRouteConnections() { + return this.expressRouteConnections; + } + + /** + * The ExpressRoutePortsLocationsInner object to access its operations. + */ + private ExpressRoutePortsLocationsInner expressRoutePortsLocations; + + /** + * Gets the ExpressRoutePortsLocationsInner object to access its operations. + * @return the ExpressRoutePortsLocationsInner object. + */ + public ExpressRoutePortsLocationsInner expressRoutePortsLocations() { + return this.expressRoutePortsLocations; + } + + /** + * The ExpressRoutePortsInner object to access its operations. + */ + private ExpressRoutePortsInner expressRoutePorts; + + /** + * Gets the ExpressRoutePortsInner object to access its operations. + * @return the ExpressRoutePortsInner object. + */ + public ExpressRoutePortsInner expressRoutePorts() { + return this.expressRoutePorts; + } + + /** + * The ExpressRouteLinksInner object to access its operations. + */ + private ExpressRouteLinksInner expressRouteLinks; + + /** + * Gets the ExpressRouteLinksInner object to access its operations. + * @return the ExpressRouteLinksInner object. + */ + public ExpressRouteLinksInner expressRouteLinks() { + return this.expressRouteLinks; + } + + /** + * The InterfaceEndpointsInner object to access its operations. + */ + private InterfaceEndpointsInner interfaceEndpoints; + + /** + * Gets the InterfaceEndpointsInner object to access its operations. + * @return the InterfaceEndpointsInner object. + */ + public InterfaceEndpointsInner interfaceEndpoints() { + return this.interfaceEndpoints; + } + + /** + * The LoadBalancersInner object to access its operations. + */ + private LoadBalancersInner loadBalancers; + + /** + * Gets the LoadBalancersInner object to access its operations. + * @return the LoadBalancersInner object. + */ + public LoadBalancersInner loadBalancers() { + return this.loadBalancers; + } + + /** + * The LoadBalancerBackendAddressPoolsInner object to access its operations. + */ + private LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools; + + /** + * Gets the LoadBalancerBackendAddressPoolsInner object to access its operations. + * @return the LoadBalancerBackendAddressPoolsInner object. + */ + public LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * The LoadBalancerFrontendIPConfigurationsInner object to access its operations. + */ + private LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations; + + /** + * Gets the LoadBalancerFrontendIPConfigurationsInner object to access its operations. + * @return the LoadBalancerFrontendIPConfigurationsInner object. + */ + public LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations() { + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * The InboundNatRulesInner object to access its operations. + */ + private InboundNatRulesInner inboundNatRules; + + /** + * Gets the InboundNatRulesInner object to access its operations. + * @return the InboundNatRulesInner object. + */ + public InboundNatRulesInner inboundNatRules() { + return this.inboundNatRules; + } + + /** + * The LoadBalancerLoadBalancingRulesInner object to access its operations. + */ + private LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules; + + /** + * Gets the LoadBalancerLoadBalancingRulesInner object to access its operations. + * @return the LoadBalancerLoadBalancingRulesInner object. + */ + public LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules() { + return this.loadBalancerLoadBalancingRules; + } + + /** + * The LoadBalancerOutboundRulesInner object to access its operations. + */ + private LoadBalancerOutboundRulesInner loadBalancerOutboundRules; + + /** + * Gets the LoadBalancerOutboundRulesInner object to access its operations. + * @return the LoadBalancerOutboundRulesInner object. + */ + public LoadBalancerOutboundRulesInner loadBalancerOutboundRules() { + return this.loadBalancerOutboundRules; + } + + /** + * The LoadBalancerNetworkInterfacesInner object to access its operations. + */ + private LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces; + + /** + * Gets the LoadBalancerNetworkInterfacesInner object to access its operations. + * @return the LoadBalancerNetworkInterfacesInner object. + */ + public LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces() { + return this.loadBalancerNetworkInterfaces; + } + + /** + * The LoadBalancerProbesInner object to access its operations. + */ + private LoadBalancerProbesInner loadBalancerProbes; + + /** + * Gets the LoadBalancerProbesInner object to access its operations. + * @return the LoadBalancerProbesInner object. + */ + public LoadBalancerProbesInner loadBalancerProbes() { + return this.loadBalancerProbes; + } + + /** + * The NetworkInterfacesInner object to access its operations. + */ + private NetworkInterfacesInner networkInterfaces; + + /** + * Gets the NetworkInterfacesInner object to access its operations. + * @return the NetworkInterfacesInner object. + */ + public NetworkInterfacesInner networkInterfaces() { + return this.networkInterfaces; + } + + /** + * The NetworkInterfaceIPConfigurationsInner object to access its operations. + */ + private NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations; + + /** + * Gets the NetworkInterfaceIPConfigurationsInner object to access its operations. + * @return the NetworkInterfaceIPConfigurationsInner object. + */ + public NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations() { + return this.networkInterfaceIPConfigurations; + } + + /** + * The NetworkInterfaceLoadBalancersInner object to access its operations. + */ + private NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers; + + /** + * Gets the NetworkInterfaceLoadBalancersInner object to access its operations. + * @return the NetworkInterfaceLoadBalancersInner object. + */ + public NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers() { + return this.networkInterfaceLoadBalancers; + } + + /** + * The NetworkInterfaceTapConfigurationsInner object to access its operations. + */ + private NetworkInterfaceTapConfigurationsInner networkInterfaceTapConfigurations; + + /** + * Gets the NetworkInterfaceTapConfigurationsInner object to access its operations. + * @return the NetworkInterfaceTapConfigurationsInner object. + */ + public NetworkInterfaceTapConfigurationsInner networkInterfaceTapConfigurations() { + return this.networkInterfaceTapConfigurations; + } + + /** + * The NetworkProfilesInner object to access its operations. + */ + private NetworkProfilesInner networkProfiles; + + /** + * Gets the NetworkProfilesInner object to access its operations. + * @return the NetworkProfilesInner object. + */ + public NetworkProfilesInner networkProfiles() { + return this.networkProfiles; + } + + /** + * The NetworkSecurityGroupsInner object to access its operations. + */ + private NetworkSecurityGroupsInner networkSecurityGroups; + + /** + * Gets the NetworkSecurityGroupsInner object to access its operations. + * @return the NetworkSecurityGroupsInner object. + */ + public NetworkSecurityGroupsInner networkSecurityGroups() { + return this.networkSecurityGroups; + } + + /** + * The SecurityRulesInner object to access its operations. + */ + private SecurityRulesInner securityRules; + + /** + * Gets the SecurityRulesInner object to access its operations. + * @return the SecurityRulesInner object. + */ + public SecurityRulesInner securityRules() { + return this.securityRules; + } + + /** + * The DefaultSecurityRulesInner object to access its operations. + */ + private DefaultSecurityRulesInner defaultSecurityRules; + + /** + * Gets the DefaultSecurityRulesInner object to access its operations. + * @return the DefaultSecurityRulesInner object. + */ + public DefaultSecurityRulesInner defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * The NetworkWatchersInner object to access its operations. + */ + private NetworkWatchersInner networkWatchers; + + /** + * Gets the NetworkWatchersInner object to access its operations. + * @return the NetworkWatchersInner object. + */ + public NetworkWatchersInner networkWatchers() { + return this.networkWatchers; + } + + /** + * The PacketCapturesInner object to access its operations. + */ + private PacketCapturesInner packetCaptures; + + /** + * Gets the PacketCapturesInner object to access its operations. + * @return the PacketCapturesInner object. + */ + public PacketCapturesInner packetCaptures() { + return this.packetCaptures; + } + + /** + * The ConnectionMonitorsInner object to access its operations. + */ + private ConnectionMonitorsInner connectionMonitors; + + /** + * Gets the ConnectionMonitorsInner object to access its operations. + * @return the ConnectionMonitorsInner object. + */ + public ConnectionMonitorsInner connectionMonitors() { + return this.connectionMonitors; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PublicIPAddressesInner object to access its operations. + */ + private PublicIPAddressesInner publicIPAddresses; + + /** + * Gets the PublicIPAddressesInner object to access its operations. + * @return the PublicIPAddressesInner object. + */ + public PublicIPAddressesInner publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * The PublicIPPrefixesInner object to access its operations. + */ + private PublicIPPrefixesInner publicIPPrefixes; + + /** + * Gets the PublicIPPrefixesInner object to access its operations. + * @return the PublicIPPrefixesInner object. + */ + public PublicIPPrefixesInner publicIPPrefixes() { + return this.publicIPPrefixes; + } + + /** + * The RouteFiltersInner object to access its operations. + */ + private RouteFiltersInner routeFilters; + + /** + * Gets the RouteFiltersInner object to access its operations. + * @return the RouteFiltersInner object. + */ + public RouteFiltersInner routeFilters() { + return this.routeFilters; + } + + /** + * The RouteFilterRulesInner object to access its operations. + */ + private RouteFilterRulesInner routeFilterRules; + + /** + * Gets the RouteFilterRulesInner object to access its operations. + * @return the RouteFilterRulesInner object. + */ + public RouteFilterRulesInner routeFilterRules() { + return this.routeFilterRules; + } + + /** + * The RouteTablesInner object to access its operations. + */ + private RouteTablesInner routeTables; + + /** + * Gets the RouteTablesInner object to access its operations. + * @return the RouteTablesInner object. + */ + public RouteTablesInner routeTables() { + return this.routeTables; + } + + /** + * The RoutesInner object to access its operations. + */ + private RoutesInner routes; + + /** + * Gets the RoutesInner object to access its operations. + * @return the RoutesInner object. + */ + public RoutesInner routes() { + return this.routes; + } + + /** + * The BgpServiceCommunitiesInner object to access its operations. + */ + private BgpServiceCommunitiesInner bgpServiceCommunities; + + /** + * Gets the BgpServiceCommunitiesInner object to access its operations. + * @return the BgpServiceCommunitiesInner object. + */ + public BgpServiceCommunitiesInner bgpServiceCommunities() { + return this.bgpServiceCommunities; + } + + /** + * The ServiceEndpointPoliciesInner object to access its operations. + */ + private ServiceEndpointPoliciesInner serviceEndpointPolicies; + + /** + * Gets the ServiceEndpointPoliciesInner object to access its operations. + * @return the ServiceEndpointPoliciesInner object. + */ + public ServiceEndpointPoliciesInner serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * The ServiceEndpointPolicyDefinitionsInner object to access its operations. + */ + private ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions; + + /** + * Gets the ServiceEndpointPolicyDefinitionsInner object to access its operations. + * @return the ServiceEndpointPolicyDefinitionsInner object. + */ + public ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The VirtualNetworksInner object to access its operations. + */ + private VirtualNetworksInner virtualNetworks; + + /** + * Gets the VirtualNetworksInner object to access its operations. + * @return the VirtualNetworksInner object. + */ + public VirtualNetworksInner virtualNetworks() { + return this.virtualNetworks; + } + + /** + * The SubnetsInner object to access its operations. + */ + private SubnetsInner subnets; + + /** + * Gets the SubnetsInner object to access its operations. + * @return the SubnetsInner object. + */ + public SubnetsInner subnets() { + return this.subnets; + } + + /** + * The VirtualNetworkPeeringsInner object to access its operations. + */ + private VirtualNetworkPeeringsInner virtualNetworkPeerings; + + /** + * Gets the VirtualNetworkPeeringsInner object to access its operations. + * @return the VirtualNetworkPeeringsInner object. + */ + public VirtualNetworkPeeringsInner virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * The VirtualNetworkTapsInner object to access its operations. + */ + private VirtualNetworkTapsInner virtualNetworkTaps; + + /** + * Gets the VirtualNetworkTapsInner object to access its operations. + * @return the VirtualNetworkTapsInner object. + */ + public VirtualNetworkTapsInner virtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** + * The VirtualNetworkGatewaysInner object to access its operations. + */ + private VirtualNetworkGatewaysInner virtualNetworkGateways; + + /** + * Gets the VirtualNetworkGatewaysInner object to access its operations. + * @return the VirtualNetworkGatewaysInner object. + */ + public VirtualNetworkGatewaysInner virtualNetworkGateways() { + return this.virtualNetworkGateways; + } + + /** + * The VirtualNetworkGatewayConnectionsInner object to access its operations. + */ + private VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections; + + /** + * Gets the VirtualNetworkGatewayConnectionsInner object to access its operations. + * @return the VirtualNetworkGatewayConnectionsInner object. + */ + public VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections() { + return this.virtualNetworkGatewayConnections; + } + + /** + * The LocalNetworkGatewaysInner object to access its operations. + */ + private LocalNetworkGatewaysInner localNetworkGateways; + + /** + * Gets the LocalNetworkGatewaysInner object to access its operations. + * @return the LocalNetworkGatewaysInner object. + */ + public LocalNetworkGatewaysInner localNetworkGateways() { + return this.localNetworkGateways; + } + + /** + * The VirtualWansInner object to access its operations. + */ + private VirtualWansInner virtualWans; + + /** + * Gets the VirtualWansInner object to access its operations. + * @return the VirtualWansInner object. + */ + public VirtualWansInner virtualWans() { + return this.virtualWans; + } + + /** + * The VpnSitesInner object to access its operations. + */ + private VpnSitesInner vpnSites; + + /** + * Gets the VpnSitesInner object to access its operations. + * @return the VpnSitesInner object. + */ + public VpnSitesInner vpnSites() { + return this.vpnSites; + } + + /** + * The VpnSitesConfigurationsInner object to access its operations. + */ + private VpnSitesConfigurationsInner vpnSitesConfigurations; + + /** + * Gets the VpnSitesConfigurationsInner object to access its operations. + * @return the VpnSitesConfigurationsInner object. + */ + public VpnSitesConfigurationsInner vpnSitesConfigurations() { + return this.vpnSitesConfigurations; + } + + /** + * The VirtualHubsInner object to access its operations. + */ + private VirtualHubsInner virtualHubs; + + /** + * Gets the VirtualHubsInner object to access its operations. + * @return the VirtualHubsInner object. + */ + public VirtualHubsInner virtualHubs() { + return this.virtualHubs; + } + + /** + * The HubVirtualNetworkConnectionsInner object to access its operations. + */ + private HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsInner object to access its operations. + * @return the HubVirtualNetworkConnectionsInner object. + */ + public HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * The VpnGatewaysInner object to access its operations. + */ + private VpnGatewaysInner vpnGateways; + + /** + * Gets the VpnGatewaysInner object to access its operations. + * @return the VpnGatewaysInner object. + */ + public VpnGatewaysInner vpnGateways() { + return this.vpnGateways; + } + + /** + * The VpnConnectionsInner object to access its operations. + */ + private VpnConnectionsInner vpnConnections; + + /** + * Gets the VpnConnectionsInner object to access its operations. + * @return the VpnConnectionsInner object. + */ + public VpnConnectionsInner vpnConnections() { + return this.vpnConnections; + } + + /** + * The P2sVpnServerConfigurationsInner object to access its operations. + */ + private P2sVpnServerConfigurationsInner p2sVpnServerConfigurations; + + /** + * Gets the P2sVpnServerConfigurationsInner object to access its operations. + * @return the P2sVpnServerConfigurationsInner object. + */ + public P2sVpnServerConfigurationsInner p2sVpnServerConfigurations() { + return this.p2sVpnServerConfigurations; + } + + /** + * The P2sVpnGatewaysInner object to access its operations. + */ + private P2sVpnGatewaysInner p2sVpnGateways; + + /** + * Gets the P2sVpnGatewaysInner object to access its operations. + * @return the P2sVpnGatewaysInner object. + */ + public P2sVpnGatewaysInner p2sVpnGateways() { + return this.p2sVpnGateways; + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NetworkManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.applicationGateways = new ApplicationGatewaysInner(restClient().retrofit(), this); + this.applicationSecurityGroups = new ApplicationSecurityGroupsInner(restClient().retrofit(), this); + this.availableDelegations = new AvailableDelegationsInner(restClient().retrofit(), this); + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsInner(restClient().retrofit(), this); + this.azureFirewalls = new AzureFirewallsInner(restClient().retrofit(), this); + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsInner(restClient().retrofit(), this); + this.ddosProtectionPlans = new DdosProtectionPlansInner(restClient().retrofit(), this); + this.availableEndpointServices = new AvailableEndpointServicesInner(restClient().retrofit(), this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsInner(restClient().retrofit(), this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsInner(restClient().retrofit(), this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsInner(restClient().retrofit(), this); + this.expressRouteCircuits = new ExpressRouteCircuitsInner(restClient().retrofit(), this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersInner(restClient().retrofit(), this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsInner(restClient().retrofit(), this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsInner(restClient().retrofit(), this); + this.expressRouteGateways = new ExpressRouteGatewaysInner(restClient().retrofit(), this); + this.expressRouteConnections = new ExpressRouteConnectionsInner(restClient().retrofit(), this); + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsInner(restClient().retrofit(), this); + this.expressRoutePorts = new ExpressRoutePortsInner(restClient().retrofit(), this); + this.expressRouteLinks = new ExpressRouteLinksInner(restClient().retrofit(), this); + this.interfaceEndpoints = new InterfaceEndpointsInner(restClient().retrofit(), this); + this.loadBalancers = new LoadBalancersInner(restClient().retrofit(), this); + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsInner(restClient().retrofit(), this); + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsInner(restClient().retrofit(), this); + this.inboundNatRules = new InboundNatRulesInner(restClient().retrofit(), this); + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesInner(restClient().retrofit(), this); + this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesInner(restClient().retrofit(), this); + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesInner(restClient().retrofit(), this); + this.loadBalancerProbes = new LoadBalancerProbesInner(restClient().retrofit(), this); + this.networkInterfaces = new NetworkInterfacesInner(restClient().retrofit(), this); + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsInner(restClient().retrofit(), this); + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersInner(restClient().retrofit(), this); + this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsInner(restClient().retrofit(), this); + this.networkProfiles = new NetworkProfilesInner(restClient().retrofit(), this); + this.networkSecurityGroups = new NetworkSecurityGroupsInner(restClient().retrofit(), this); + this.securityRules = new SecurityRulesInner(restClient().retrofit(), this); + this.defaultSecurityRules = new DefaultSecurityRulesInner(restClient().retrofit(), this); + this.networkWatchers = new NetworkWatchersInner(restClient().retrofit(), this); + this.packetCaptures = new PacketCapturesInner(restClient().retrofit(), this); + this.connectionMonitors = new ConnectionMonitorsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.publicIPAddresses = new PublicIPAddressesInner(restClient().retrofit(), this); + this.publicIPPrefixes = new PublicIPPrefixesInner(restClient().retrofit(), this); + this.routeFilters = new RouteFiltersInner(restClient().retrofit(), this); + this.routeFilterRules = new RouteFilterRulesInner(restClient().retrofit(), this); + this.routeTables = new RouteTablesInner(restClient().retrofit(), this); + this.routes = new RoutesInner(restClient().retrofit(), this); + this.bgpServiceCommunities = new BgpServiceCommunitiesInner(restClient().retrofit(), this); + this.serviceEndpointPolicies = new ServiceEndpointPoliciesInner(restClient().retrofit(), this); + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.virtualNetworks = new VirtualNetworksInner(restClient().retrofit(), this); + this.subnets = new SubnetsInner(restClient().retrofit(), this); + this.virtualNetworkPeerings = new VirtualNetworkPeeringsInner(restClient().retrofit(), this); + this.virtualNetworkTaps = new VirtualNetworkTapsInner(restClient().retrofit(), this); + this.virtualNetworkGateways = new VirtualNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsInner(restClient().retrofit(), this); + this.localNetworkGateways = new LocalNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualWans = new VirtualWansInner(restClient().retrofit(), this); + this.vpnSites = new VpnSitesInner(restClient().retrofit(), this); + this.vpnSitesConfigurations = new VpnSitesConfigurationsInner(restClient().retrofit(), this); + this.virtualHubs = new VirtualHubsInner(restClient().retrofit(), this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsInner(restClient().retrofit(), this); + this.vpnGateways = new VpnGatewaysInner(restClient().retrofit(), this); + this.vpnConnections = new VpnConnectionsInner(restClient().retrofit(), this); + this.p2sVpnServerConfigurations = new P2sVpnServerConfigurationsInner(restClient().retrofit(), this); + this.p2sVpnGateways = new P2sVpnGatewaysInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NetworkManagementClient", "2018-08-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(NetworkManagementClientService.class); + } + + /** + * The interface defining all the services for NetworkManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkManagementClient checkDnsNameAvailability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + Observable> checkDnsNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("domainNameLabel") String domainNameLabel, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkManagementClient supportedSecurityProviders" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders") + Observable> supportedSecurityProviders(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DnsNameAvailabilityResultInner object if successful. + */ + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).toBlocking().single().body(); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkDnsNameAvailabilityAsync(String location, String domainNameLabel, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel), serviceCallback); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (domainNameLabel == null) { + throw new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.checkDnsNameAvailability(location, this.subscriptionId(), domainNameLabel, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWanSecurityProvidersInner object if successful. + */ + public VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, String virtualWANName) { + return supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which supported security providers are needed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWanSecurityProvidersInner object + */ + public Observable supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName) { + return supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWanSecurityProvidersInner>() { + @Override + public VirtualWanSecurityProvidersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWanSecurityProvidersInner object + */ + public Observable> supportedSecurityProvidersWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.supportedSecurityProviders(this.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedSecurityProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedSecurityProvidersDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManager.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManager.java new file mode 100644 index 0000000000000..967baa653b1be --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManager.java @@ -0,0 +1,891 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_08_01.AvailableDelegations; +import com.microsoft.azure.management.network.v2018_08_01.AvailableResourceGroupDelegations; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_08_01.AzureFirewallFqdnTags; +import com.microsoft.azure.management.network.v2018_08_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_08_01.AvailableEndpointServices; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitAuthorizations; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeerings; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitConnections; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCrossConnectionPeerings; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteGateways; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteConnections; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePortsLocations; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRoutePorts; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteLinks; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoints; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerBackendAddressPools; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerFrontendIPConfigurations; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRules; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerLoadBalancingRules; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerOutboundRules; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerNetworkInterfaces; +import com.microsoft.azure.management.network.v2018_08_01.LoadBalancerProbes; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaces; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceIPConfigurations; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceLoadBalancers; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfigurations; +import com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRules; +import com.microsoft.azure.management.network.v2018_08_01.DefaultSecurityRules; +import com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptures; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionMonitors; +import com.microsoft.azure.management.network.v2018_08_01.Operations; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules; +import com.microsoft.azure.management.network.v2018_08_01.RouteTables; +import com.microsoft.azure.management.network.v2018_08_01.Routes; +import com.microsoft.azure.management.network.v2018_08_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions; +import com.microsoft.azure.management.network.v2018_08_01.Usages; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_08_01.Subnets; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_08_01.VirtualWans; +import com.microsoft.azure.management.network.v2018_08_01.VpnSites; +import com.microsoft.azure.management.network.v2018_08_01.VpnSitesConfigurations; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnections; +import com.microsoft.azure.management.network.v2018_08_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnections; +import com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations; +import com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private ApplicationGateways applicationGateways; + private ApplicationSecurityGroups applicationSecurityGroups; + private AvailableDelegations availableDelegations; + private AvailableResourceGroupDelegations availableResourceGroupDelegations; + private AzureFirewalls azureFirewalls; + private AzureFirewallFqdnTags azureFirewallFqdnTags; + private DdosProtectionPlans ddosProtectionPlans; + private AvailableEndpointServices availableEndpointServices; + private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations; + private ExpressRouteCircuitPeerings expressRouteCircuitPeerings; + private ExpressRouteCircuitConnections expressRouteCircuitConnections; + private ExpressRouteCircuits expressRouteCircuits; + private ExpressRouteServiceProviders expressRouteServiceProviders; + private ExpressRouteCrossConnections expressRouteCrossConnections; + private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings; + private ExpressRouteGateways expressRouteGateways; + private ExpressRouteConnections expressRouteConnections; + private ExpressRoutePortsLocations expressRoutePortsLocations; + private ExpressRoutePorts expressRoutePorts; + private ExpressRouteLinks expressRouteLinks; + private InterfaceEndpoints interfaceEndpoints; + private LoadBalancers loadBalancers; + private LoadBalancerBackendAddressPools loadBalancerBackendAddressPools; + private LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations; + private InboundNatRules inboundNatRules; + private LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules; + private LoadBalancerOutboundRules loadBalancerOutboundRules; + private LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces; + private LoadBalancerProbes loadBalancerProbes; + private NetworkInterfaces networkInterfaces; + private NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations; + private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers; + private NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations; + private NetworkProfiles networkProfiles; + private NetworkSecurityGroups networkSecurityGroups; + private SecurityRules securityRules; + private DefaultSecurityRules defaultSecurityRules; + private NetworkWatchers networkWatchers; + private PacketCaptures packetCaptures; + private ConnectionMonitors connectionMonitors; + private Operations operations; + private PublicIPAddresses publicIPAddresses; + private PublicIPPrefixes publicIPPrefixes; + private RouteFilters routeFilters; + private RouteFilterRules routeFilterRules; + private RouteTables routeTables; + private Routes routes; + private BgpServiceCommunities bgpServiceCommunities; + private ServiceEndpointPolicies serviceEndpointPolicies; + private ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions; + private Usages usages; + private VirtualNetworks virtualNetworks; + private Subnets subnets; + private VirtualNetworkPeerings virtualNetworkPeerings; + private VirtualNetworkTaps virtualNetworkTaps; + private VirtualNetworkGateways virtualNetworkGateways; + private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections; + private LocalNetworkGateways localNetworkGateways; + private VirtualWans virtualWans; + private VpnSites vpnSites; + private VpnSitesConfigurations vpnSitesConfigurations; + private VirtualHubs virtualHubs; + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + private VpnGateways vpnGateways; + private VpnConnections vpnConnections; + private P2sVpnServerConfigurations p2sVpnServerConfigurations; + private P2sVpnGateways p2sVpnGateways; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ApplicationGateways. + */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(this); + } + return this.applicationGateways; + } + + /** + * @return Entry point to manage ApplicationSecurityGroups. + */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = new ApplicationSecurityGroupsImpl(this); + } + return this.applicationSecurityGroups; + } + + /** + * @return Entry point to manage AvailableDelegations. + */ + public AvailableDelegations availableDelegations() { + if (this.availableDelegations == null) { + this.availableDelegations = new AvailableDelegationsImpl(this); + } + return this.availableDelegations; + } + + /** + * @return Entry point to manage AvailableResourceGroupDelegations. + */ + public AvailableResourceGroupDelegations availableResourceGroupDelegations() { + if (this.availableResourceGroupDelegations == null) { + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsImpl(this); + } + return this.availableResourceGroupDelegations; + } + + /** + * @return Entry point to manage AzureFirewalls. + */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(this); + } + return this.azureFirewalls; + } + + /** + * @return Entry point to manage AzureFirewallFqdnTags. + */ + public AzureFirewallFqdnTags azureFirewallFqdnTags() { + if (this.azureFirewallFqdnTags == null) { + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(this); + } + return this.azureFirewallFqdnTags; + } + + /** + * @return Entry point to manage DdosProtectionPlans. + */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(this); + } + return this.ddosProtectionPlans; + } + + /** + * @return Entry point to manage AvailableEndpointServices. + */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = new AvailableEndpointServicesImpl(this); + } + return this.availableEndpointServices; + } + + /** + * @return Entry point to manage ExpressRouteCircuitAuthorizations. + */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsImpl(this); + } + return this.expressRouteCircuitAuthorizations; + } + + /** + * @return Entry point to manage ExpressRouteCircuitPeerings. + */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsImpl(this); + } + return this.expressRouteCircuitPeerings; + } + + /** + * @return Entry point to manage ExpressRouteCircuitConnections. + */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsImpl(this); + } + return this.expressRouteCircuitConnections; + } + + /** + * @return Entry point to manage ExpressRouteCircuits. + */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(this); + } + return this.expressRouteCircuits; + } + + /** + * @return Entry point to manage ExpressRouteServiceProviders. + */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersImpl(this); + } + return this.expressRouteServiceProviders; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnections. + */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsImpl(this); + } + return this.expressRouteCrossConnections; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnectionPeerings. + */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsImpl(this); + } + return this.expressRouteCrossConnectionPeerings; + } + + /** + * @return Entry point to manage ExpressRouteGateways. + */ + public ExpressRouteGateways expressRouteGateways() { + if (this.expressRouteGateways == null) { + this.expressRouteGateways = new ExpressRouteGatewaysImpl(this); + } + return this.expressRouteGateways; + } + + /** + * @return Entry point to manage ExpressRouteConnections. + */ + public ExpressRouteConnections expressRouteConnections() { + if (this.expressRouteConnections == null) { + this.expressRouteConnections = new ExpressRouteConnectionsImpl(this); + } + return this.expressRouteConnections; + } + + /** + * @return Entry point to manage ExpressRoutePortsLocations. + */ + public ExpressRoutePortsLocations expressRoutePortsLocations() { + if (this.expressRoutePortsLocations == null) { + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsImpl(this); + } + return this.expressRoutePortsLocations; + } + + /** + * @return Entry point to manage ExpressRoutePorts. + */ + public ExpressRoutePorts expressRoutePorts() { + if (this.expressRoutePorts == null) { + this.expressRoutePorts = new ExpressRoutePortsImpl(this); + } + return this.expressRoutePorts; + } + + /** + * @return Entry point to manage ExpressRouteLinks. + */ + public ExpressRouteLinks expressRouteLinks() { + if (this.expressRouteLinks == null) { + this.expressRouteLinks = new ExpressRouteLinksImpl(this); + } + return this.expressRouteLinks; + } + + /** + * @return Entry point to manage InterfaceEndpoints. + */ + public InterfaceEndpoints interfaceEndpoints() { + if (this.interfaceEndpoints == null) { + this.interfaceEndpoints = new InterfaceEndpointsImpl(this); + } + return this.interfaceEndpoints; + } + + /** + * @return Entry point to manage LoadBalancers. + */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(this); + } + return this.loadBalancers; + } + + /** + * @return Entry point to manage LoadBalancerBackendAddressPools. + */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsImpl(this); + } + return this.loadBalancerBackendAddressPools; + } + + /** + * @return Entry point to manage LoadBalancerFrontendIPConfigurations. + */ + public LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations() { + if (this.loadBalancerFrontendIPConfigurations == null) { + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsImpl(this); + } + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * @return Entry point to manage InboundNatRules. + */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(this); + } + return this.inboundNatRules; + } + + /** + * @return Entry point to manage LoadBalancerLoadBalancingRules. + */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesImpl(this); + } + return this.loadBalancerLoadBalancingRules; + } + + /** + * @return Entry point to manage LoadBalancerOutboundRules. + */ + public LoadBalancerOutboundRules loadBalancerOutboundRules() { + if (this.loadBalancerOutboundRules == null) { + this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesImpl(this); + } + return this.loadBalancerOutboundRules; + } + + /** + * @return Entry point to manage LoadBalancerNetworkInterfaces. + */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesImpl(this); + } + return this.loadBalancerNetworkInterfaces; + } + + /** + * @return Entry point to manage LoadBalancerProbes. + */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(this); + } + return this.loadBalancerProbes; + } + + /** + * @return Entry point to manage NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(this); + } + return this.networkInterfaces; + } + + /** + * @return Entry point to manage NetworkInterfaceIPConfigurations. + */ + public NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations() { + if (this.networkInterfaceIPConfigurations == null) { + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsImpl(this); + } + return this.networkInterfaceIPConfigurations; + } + + /** + * @return Entry point to manage NetworkInterfaceLoadBalancers. + */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersImpl(this); + } + return this.networkInterfaceLoadBalancers; + } + + /** + * @return Entry point to manage NetworkInterfaceTapConfigurations. + */ + public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() { + if (this.networkInterfaceTapConfigurations == null) { + this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsImpl(this); + } + return this.networkInterfaceTapConfigurations; + } + + /** + * @return Entry point to manage NetworkProfiles. + */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(this); + } + return this.networkProfiles; + } + + /** + * @return Entry point to manage NetworkSecurityGroups. + */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(this); + } + return this.networkSecurityGroups; + } + + /** + * @return Entry point to manage SecurityRules. + */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(this); + } + return this.securityRules; + } + + /** + * @return Entry point to manage DefaultSecurityRules. + */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(this); + } + return this.defaultSecurityRules; + } + + /** + * @return Entry point to manage NetworkWatchers. + */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(this); + } + return this.networkWatchers; + } + + /** + * @return Entry point to manage PacketCaptures. + */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(this); + } + return this.packetCaptures; + } + + /** + * @return Entry point to manage ConnectionMonitors. + */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(this); + } + return this.connectionMonitors; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PublicIPAddresses. + */ + public PublicIPAddresses publicIPAddresses() { + if (this.publicIPAddresses == null) { + this.publicIPAddresses = new PublicIPAddressesImpl(this); + } + return this.publicIPAddresses; + } + + /** + * @return Entry point to manage PublicIPPrefixes. + */ + public PublicIPPrefixes publicIPPrefixes() { + if (this.publicIPPrefixes == null) { + this.publicIPPrefixes = new PublicIPPrefixesImpl(this); + } + return this.publicIPPrefixes; + } + + /** + * @return Entry point to manage RouteFilters. + */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(this); + } + return this.routeFilters; + } + + /** + * @return Entry point to manage RouteFilterRules. + */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(this); + } + return this.routeFilterRules; + } + + /** + * @return Entry point to manage RouteTables. + */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(this); + } + return this.routeTables; + } + + /** + * @return Entry point to manage Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(this); + } + return this.routes; + } + + /** + * @return Entry point to manage BgpServiceCommunities. + */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(this); + } + return this.bgpServiceCommunities; + } + + /** + * @return Entry point to manage ServiceEndpointPolicies. + */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies = new ServiceEndpointPoliciesImpl(this); + } + return this.serviceEndpointPolicies; + } + + /** + * @return Entry point to manage ServiceEndpointPolicyDefinitions. + */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsImpl(this); + } + return this.serviceEndpointPolicyDefinitions; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage VirtualNetworks. + */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(this); + } + return this.virtualNetworks; + } + + /** + * @return Entry point to manage Subnets. + */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(this); + } + return this.subnets; + } + + /** + * @return Entry point to manage VirtualNetworkPeerings. + */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = new VirtualNetworkPeeringsImpl(this); + } + return this.virtualNetworkPeerings; + } + + /** + * @return Entry point to manage VirtualNetworkTaps. + */ + public VirtualNetworkTaps virtualNetworkTaps() { + if (this.virtualNetworkTaps == null) { + this.virtualNetworkTaps = new VirtualNetworkTapsImpl(this); + } + return this.virtualNetworkTaps; + } + + /** + * @return Entry point to manage VirtualNetworkGateways. + */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = new VirtualNetworkGatewaysImpl(this); + } + return this.virtualNetworkGateways; + } + + /** + * @return Entry point to manage VirtualNetworkGatewayConnections. + */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsImpl(this); + } + return this.virtualNetworkGatewayConnections; + } + + /** + * @return Entry point to manage LocalNetworkGateways. + */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(this); + } + return this.localNetworkGateways; + } + + /** + * @return Entry point to manage VirtualWans. + */ + public VirtualWans virtualWans() { + if (this.virtualWans == null) { + this.virtualWans = new VirtualWansImpl(this); + } + return this.virtualWans; + } + + /** + * @return Entry point to manage VpnSites. + */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(this); + } + return this.vpnSites; + } + + /** + * @return Entry point to manage VpnSitesConfigurations. + */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = new VpnSitesConfigurationsImpl(this); + } + return this.vpnSitesConfigurations; + } + + /** + * @return Entry point to manage VirtualHubs. + */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(this); + } + return this.virtualHubs; + } + + /** + * @return Entry point to manage HubVirtualNetworkConnections. + */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsImpl(this); + } + return this.hubVirtualNetworkConnections; + } + + /** + * @return Entry point to manage VpnGateways. + */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(this); + } + return this.vpnGateways; + } + + /** + * @return Entry point to manage VpnConnections. + */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(this); + } + return this.vpnConnections; + } + + /** + * @return Entry point to manage P2sVpnServerConfigurations. + */ + public P2sVpnServerConfigurations p2sVpnServerConfigurations() { + if (this.p2sVpnServerConfigurations == null) { + this.p2sVpnServerConfigurations = new P2sVpnServerConfigurationsImpl(this); + } + return this.p2sVpnServerConfigurations; + } + + /** + * @return Entry point to manage P2sVpnGateways. + */ + public P2sVpnGateways p2sVpnGateways() { + if (this.p2sVpnGateways == null) { + this.p2sVpnGateways = new P2sVpnGatewaysImpl(this); + } + return this.p2sVpnGateways; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NetworkManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..25f96903efe11 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkProfile; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ContainerNetworkInterface; +import com.microsoft.azure.management.network.v2018_08_01.ContainerNetworkInterfaceConfiguration; + +class NetworkProfileImpl extends GroupableResourceCoreImpl implements NetworkProfile, NetworkProfile.Definition, NetworkProfile.Update { + NetworkProfileImpl(String name, NetworkProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containerNetworkInterfaceConfigurations() { + return this.inner().containerNetworkInterfaceConfigurations(); + } + + @Override + public List containerNetworkInterfaces() { + return this.inner().containerNetworkInterfaces(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public NetworkProfileImpl withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations) { + this.inner().withContainerNetworkInterfaceConfigurations(containerNetworkInterfaceConfigurations); + return this; + } + + @Override + public NetworkProfileImpl withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.inner().withContainerNetworkInterfaces(containerNetworkInterfaces); + return this; + } + + @Override + public NetworkProfileImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileInner.java new file mode 100644 index 0000000000000..9b9b9f7411b55 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfileInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ContainerNetworkInterface; +import com.microsoft.azure.management.network.v2018_08_01.ContainerNetworkInterfaceConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network profile resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkProfileInner extends Resource { + /** + * List of child container network interfaces. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /** + * List of chid container network interface configurations. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfigurations") + private List containerNetworkInterfaceConfigurations; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of child container network interfaces. + * + * @return the containerNetworkInterfaces value + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Set list of child container network interfaces. + * + * @param containerNetworkInterfaces the containerNetworkInterfaces value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.containerNetworkInterfaces = containerNetworkInterfaces; + return this; + } + + /** + * Get list of chid container network interface configurations. + * + * @return the containerNetworkInterfaceConfigurations value + */ + public List containerNetworkInterfaceConfigurations() { + return this.containerNetworkInterfaceConfigurations; + } + + /** + * Set list of chid container network interface configurations. + * + * @param containerNetworkInterfaceConfigurations the containerNetworkInterfaceConfigurations value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations) { + this.containerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; + return this; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesImpl.java new file mode 100644 index 0000000000000..92b7265ae90b9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles; +import com.microsoft.azure.management.network.v2018_08_01.NetworkProfile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkProfilesImpl extends GroupableResourcesCoreImpl implements NetworkProfiles { + protected NetworkProfilesImpl(NetworkManager manager) { + super(manager.inner().networkProfiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkProfile call(NetworkProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkProfilesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkProfile call(NetworkProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkProfileImpl wrapModel(NetworkProfileInner inner) { + return new NetworkProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkProfileImpl wrapModel(String name) { + return new NetworkProfileImpl(name, new NetworkProfileInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java new file mode 100644 index 0000000000000..d909fba46db40 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java @@ -0,0 +1,994 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkProfiles. + */ +public class NetworkProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkProfilesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkProfilesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkProfiles to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Body NetworkProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkProfiles listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkProfileName) { + deleteWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().last().body(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkProfileName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().single().body(); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkProfileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkProfileName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand), serviceCallback); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkProfileName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner createOrUpdate(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters), serviceCallback); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkProfileName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().last().body(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkProfileName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags).toBlocking().last().body(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkProfileName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags), serviceCallback); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkProfileName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkProfileName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the network profiles in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..c0194c6a73b0a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroup; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterface; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class NetworkSecurityGroupImpl extends GroupableResourceCoreImpl implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + NetworkSecurityGroupImpl(String name, NetworkSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List defaultSecurityRules() { + List lst = new ArrayList(); + if (this.inner().defaultSecurityRules() != null) { + for (SecurityRuleInner inner : this.inner().defaultSecurityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List securityRules() { + List lst = new ArrayList(); + if (this.inner().securityRules() != null) { + for (SecurityRuleInner inner : this.inner().securityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public NetworkSecurityGroupImpl withDefaultSecurityRules(List defaultSecurityRules) { + this.inner().withDefaultSecurityRules(defaultSecurityRules); + return this; + } + + @Override + public NetworkSecurityGroupImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.inner().withSecurityRules(securityRules); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupInner.java new file mode 100644 index 0000000000000..40140dd5752fe --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupInner.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * NetworkSecurityGroup resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkSecurityGroupInner extends Resource { + /** + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "properties.securityRules") + private List securityRules; + + /** + * The default security rules of network security group. + */ + @JsonProperty(value = "properties.defaultSecurityRules") + private List defaultSecurityRules; + + /** + * A collection of references to network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of security rules of the network security group. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set a collection of security rules of the network security group. + * + * @param securityRules the securityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Get the default security rules of network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the default security rules of network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get a collection of references to network interfaces. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the network security group resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network security group resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java new file mode 100644 index 0000000000000..dd0d092f5b941 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleDirection; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; + +class NetworkSecurityGroupSecurityRuleImpl extends CreatableUpdatableImpl implements NetworkSecurityGroupSecurityRule, NetworkSecurityGroupSecurityRule.Definition, NetworkSecurityGroupSecurityRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String securityRuleName; + + NetworkSecurityGroupSecurityRuleImpl(String name, NetworkManager manager) { + super(name, new SecurityRuleInner()); + this.manager = manager; + // Set resource name + this.securityRuleName = name; + // + } + + NetworkSecurityGroupSecurityRuleImpl(SecurityRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.securityRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.securityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "securityRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.inner().withAccess(access); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.inner().withDirection(direction); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.inner().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.inner().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.inner().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.inner().withDestinationPortRange(destinationPortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.inner().withDestinationPortRanges(destinationPortRanges); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withPriority(Integer priority) { + this.inner().withPriority(priority); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.inner().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.inner().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.inner().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.inner().withSourcePortRange(sourcePortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.inner().withSourcePortRanges(sourcePortRanges); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java new file mode 100644 index 0000000000000..895241b5d9a3c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroupSecurityRuleModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleAccess; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleDirection; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleProtocol; + +class NetworkSecurityGroupSecurityRuleModelImpl extends IndexableRefreshableWrapperImpl implements NetworkSecurityGroupSecurityRuleModel { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String defaultSecurityRuleName; + + NetworkSecurityGroupSecurityRuleModelImpl(SecurityRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.defaultSecurityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "defaultSecurityRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DefaultSecurityRulesInner client = this.manager().inner().defaultSecurityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.defaultSecurityRuleName); + } + + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsImpl.java new file mode 100644 index 0000000000000..7f712da3662a0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkSecurityGroupsImpl extends GroupableResourcesCoreImpl implements NetworkSecurityGroups { + protected NetworkSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().networkSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(String name) { + return new NetworkSecurityGroupImpl(name, new NetworkSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsInner.java new file mode 100644 index 0000000000000..fdc83fa36225b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkSecurityGroupsInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkSecurityGroups. + */ +public class NetworkSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..d4848509c046f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkWatcher; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; + +class NetworkWatcherImpl extends GroupableResourceCoreImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + NetworkWatcherImpl(String name, NetworkWatcherInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetworkWatcherImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherInner.java new file mode 100644 index 0000000000000..8f26e48c2f36f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatcherInner.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network watcher in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkWatcherInner extends Resource { + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersImpl.java new file mode 100644 index 0000000000000..887c498fafd57 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersImpl.java @@ -0,0 +1,300 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_08_01.NetworkWatcher; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Topology; +import com.microsoft.azure.management.network.v2018_08_01.VerificationIPFlowResult; +import com.microsoft.azure.management.network.v2018_08_01.NextHopResult; +import com.microsoft.azure.management.network.v2018_08_01.SecurityGroupViewResult; +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingResult; +import com.microsoft.azure.management.network.v2018_08_01.FlowLogInformation; +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityInformation; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReport; +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersList; +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.management.network.v2018_08_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_08_01.VerificationIPFlowParameters; +import com.microsoft.azure.management.network.v2018_08_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticParameters; + +class NetworkWatchersImpl extends GroupableResourcesCoreImpl implements NetworkWatchers { + protected NetworkWatchersImpl(NetworkManager manager) { + super(manager.inner().networkWatchers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkWatchersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkWatcherImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTopologyAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public Topology call(TopologyInner inner) { + return new TopologyImpl(inner, manager()); + } + }); + } + + @Override + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.verifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public VerificationIPFlowResult call(VerificationIPFlowResultInner inner) { + return new VerificationIPFlowResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNextHopAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NextHopResult call(NextHopResultInner inner) { + return new NextHopResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public SecurityGroupViewResult call(SecurityGroupViewResultInner inner) { + return new SecurityGroupViewResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + NetworkWatchersInner client = this.inner(); + return client.setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getFlowLogStatusAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public ConnectivityInformation call(ConnectivityInformationInner inner) { + return new ConnectivityInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AzureReachabilityReport call(AzureReachabilityReportInner inner) { + return new AzureReachabilityReportImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AvailableProvidersList call(AvailableProvidersListInner inner) { + return new AvailableProvidersListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, manager()); + } + }); + } + + @Override + protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { + return new NetworkWatcherImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkWatcherImpl wrapModel(String name) { + return new NetworkWatcherImpl(name, new NetworkWatcherInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java new file mode 100644 index 0000000000000..1812ce3565d82 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java @@ -0,0 +1,2814 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_08_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_08_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_08_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_08_01.ErrorResponseException; +import com.microsoft.azure.management.network.v2018_08_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2018_08_01.NetworkConfigurationDiagnosticParameters; +import com.microsoft.azure.management.network.v2018_08_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_08_01.QueryTroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_08_01.SecurityGroupViewParameters; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.management.network.v2018_08_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_08_01.VerificationIPFlowParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkWatchers. + */ +public class NetworkWatchersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkWatchersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkWatchersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkWatchersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkWatchers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkWatchersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkWatcherInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getTopology" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology") + Observable> getTopology(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TopologyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers verifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> verifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginVerifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> beginVerifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> getNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> beginGetNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> getVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> beginGetVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> getTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> beginGetTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> getTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> beginGetTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers setFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> setFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginSetFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> beginSetFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> getFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> beginGetFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers checkConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> checkConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginCheckConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> beginCheckConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> getAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> beginGetAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers listAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> listAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginListAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> beginListAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers getNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> getNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.NetworkWatchers beginGetNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> beginGetNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner createOrUpdate(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.createOrUpdate(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().last().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopologyInner object if successful. + */ + public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TopologyInner>() { + @Override + public TopologyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTopologyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTopologyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> verifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.verifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner beginVerifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable> beginVerifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginVerifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginVerifyIPFlowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.getNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable> beginGetNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGetNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNextHopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNextHopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner getVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner beginGetVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable> beginGetVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVMSecurityRulesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVMSecurityRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.getTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGetTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingResultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingResultDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner setFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.setFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginSetFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginSetFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetFlowLogConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetFlowLogConfigurationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner getFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginGetFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetFlowLogStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetFlowLogStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> checkConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.checkConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner beginCheckConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable> beginCheckConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCheckConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCheckConnectivityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCheckConnectivityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.getAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable> beginGetAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAzureReachabilityReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAzureReachabilityReportDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner listAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.listAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner beginListAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable> beginListAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginListAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListAvailableProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListAvailableProvidersDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..c365d87477e94 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NextHopResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.NextHopType; + +class NextHopResultImpl extends WrapperImpl implements NextHopResult { + private final NetworkManager manager; + NextHopResultImpl(NextHopResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public NextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String routeTableId() { + return this.inner().routeTableId(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultInner.java new file mode 100644 index 0000000000000..7045854801b33 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NextHopResultInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.NextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about next hop from the specified VM. + */ +public class NextHopResultInner { + /** + * Next hop type. Possible values include: 'Internet', 'VirtualAppliance', + * 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /** + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The resource identifier for the route table associated with the route + * being returned. If the route being returned does not correspond to any + * user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** + * Get next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @return the nextHopType value + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get next hop IP Address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set next hop IP Address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @return the routeTableId value + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @param routeTableId the routeTableId value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..aa89a6c4e6511 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_08_01.OperationPropertiesFormatServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetworkManager manager; + OperationImpl(OperationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..51202e1525cf9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_08_01.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Network REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Specification of the service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get specification of the service. + * + * @return the serviceSpecification value + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set specification of the service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..4239d5c6301e5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetworkManager manager; + + OperationsImpl(NetworkManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..1ec70c36530f3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Operations list" }) + @GET("providers/Microsoft.Network/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2018-08-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleImpl.java new file mode 100644 index 0000000000000..737eaccce9571 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.OutboundRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; + +class OutboundRuleImpl extends IndexableRefreshableWrapperImpl implements OutboundRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String outboundRuleName; + + OutboundRuleImpl(OutboundRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.outboundRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "outboundRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerOutboundRulesInner client = this.manager().inner().loadBalancerOutboundRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.outboundRuleName); + } + + + + @Override + public Integer allocatedOutboundPorts() { + return this.inner().allocatedOutboundPorts(); + } + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleInner.java new file mode 100644 index 0000000000000..da9e920929de5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/OutboundRuleInner.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Outbound pool of the load balancer. + */ +@JsonFlatten +public class OutboundRuleInner extends SubResource { + /** + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "properties.allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /** + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations", required = true) + private List frontendIPConfigurations; + + /** + * A reference to a pool of DIPs. Outbound traffic is randomly load + * balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool", required = true) + private SubResource backendAddressPool; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', + * 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private String protocol; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * The timeout for the TCP idle connection. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the number of outbound ports to be used for NAT. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the Frontend IP addresses of the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set the Frontend IP addresses of the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set protocol - TCP, UDP or All. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayImpl.java new file mode 100644 index 0000000000000..2a9958f704cba --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientConnectionHealth; + +class P2SVpnGatewayImpl extends GroupableResourceCoreImpl implements P2SVpnGateway, P2SVpnGateway.Definition, P2SVpnGateway.Update { + P2SVpnGatewayImpl(String name, P2SVpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource p2SVpnServerConfiguration() { + return this.inner().p2SVpnServerConfiguration(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public AddressSpace vpnClientAddressPool() { + return this.inner().vpnClientAddressPool(); + } + + @Override + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.inner().vpnClientConnectionHealth(); + } + + @Override + public Integer vpnGatewayScaleUnit() { + return this.inner().vpnGatewayScaleUnit(); + } + + @Override + public P2SVpnGatewayImpl withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { + this.inner().withP2SVpnServerConfiguration(p2SVpnServerConfiguration); + return this; + } + + @Override + public P2SVpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public P2SVpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public P2SVpnGatewayImpl withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.inner().withVpnClientAddressPool(vpnClientAddressPool); + return this; + } + + @Override + public P2SVpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.inner().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayInner.java new file mode 100644 index 0000000000000..2e338f4d02035 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnGatewayInner.java @@ -0,0 +1,215 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * P2SVpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class P2SVpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The scale unit for this p2s vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /** + * The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + */ + @JsonProperty(value = "properties.p2SVpnServerConfiguration") + private SubResource p2SVpnServerConfiguration; + + /** + * The reference of the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "properties.vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /** + * All P2S vpnclients' connection health status. + */ + @JsonProperty(value = "properties.vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY) + private VpnClientConnectionHealth vpnClientConnectionHealth; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the scale unit for this p2s vpn gateway. + * + * @return the vpnGatewayScaleUnit value + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the scale unit for this p2s vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get the P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @return the p2SVpnServerConfiguration value + */ + public SubResource p2SVpnServerConfiguration() { + return this.p2SVpnServerConfiguration; + } + + /** + * Set the P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @param p2SVpnServerConfiguration the p2SVpnServerConfiguration value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { + this.p2SVpnServerConfiguration = p2SVpnServerConfiguration; + return this; + } + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get all P2S vpnclients' connection health status. + * + * @return the vpnClientConnectionHealth value + */ + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.vpnClientConnectionHealth; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationImpl.java new file mode 100644 index 0000000000000..990ae24ba505e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationImpl.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VpnGatewayTunnelingProtocol; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigVpnClientRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigVpnClientRevokedCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigRadiusServerRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigRadiusClientRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.SubResource; + +class P2SVpnServerConfigurationImpl extends CreatableUpdatableImpl implements P2SVpnServerConfiguration, P2SVpnServerConfiguration.Definition, P2SVpnServerConfiguration.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualWanName; + private String p2SVpnServerConfigurationName; + + P2SVpnServerConfigurationImpl(String name, NetworkManager manager) { + super(name, new P2SVpnServerConfigurationInner()); + this.manager = manager; + // Set resource name + this.p2SVpnServerConfigurationName = name; + // + } + + P2SVpnServerConfigurationImpl(P2SVpnServerConfigurationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.p2SVpnServerConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualWanName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualWans"); + this.p2SVpnServerConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "p2sVpnServerConfigurations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.getAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List p2SVpnGateways() { + return this.inner().p2SVpnGateways(); + } + + @Override + public List p2SVpnServerConfigRadiusClientRootCertificates() { + return this.inner().p2SVpnServerConfigRadiusClientRootCertificates(); + } + + @Override + public List p2SVpnServerConfigRadiusServerRootCertificates() { + return this.inner().p2SVpnServerConfigRadiusServerRootCertificates(); + } + + @Override + public String p2SVpnServerConfigurationPropertiesEtag() { + return this.inner().p2SVpnServerConfigurationPropertiesEtag(); + } + + @Override + public String p2SVpnServerConfigurationPropertiesName() { + return this.inner().p2SVpnServerConfigurationPropertiesName(); + } + + @Override + public List p2SVpnServerConfigVpnClientRevokedCertificates() { + return this.inner().p2SVpnServerConfigVpnClientRevokedCertificates(); + } + + @Override + public List p2SVpnServerConfigVpnClientRootCertificates() { + return this.inner().p2SVpnServerConfigVpnClientRootCertificates(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String radiusServerAddress() { + return this.inner().radiusServerAddress(); + } + + @Override + public String radiusServerSecret() { + return this.inner().radiusServerSecret(); + } + + @Override + public List vpnClientIpsecPolicies() { + return this.inner().vpnClientIpsecPolicies(); + } + + @Override + public List vpnProtocols() { + return this.inner().vpnProtocols(); + } + + @Override + public P2SVpnServerConfigurationImpl withExistingVirtualWan(String resourceGroupName, String virtualWanName) { + this.resourceGroupName = resourceGroupName; + this.virtualWanName = virtualWanName; + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates) { + this.inner().withP2SVpnServerConfigRadiusClientRootCertificates(p2SVpnServerConfigRadiusClientRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates) { + this.inner().withP2SVpnServerConfigRadiusServerRootCertificates(p2SVpnServerConfigRadiusServerRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag) { + this.inner().withP2SVpnServerConfigurationPropertiesEtag(p2SVpnServerConfigurationPropertiesEtag); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName) { + this.inner().withP2SVpnServerConfigurationPropertiesName(p2SVpnServerConfigurationPropertiesName); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates) { + this.inner().withP2SVpnServerConfigVpnClientRevokedCertificates(p2SVpnServerConfigVpnClientRevokedCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates) { + this.inner().withP2SVpnServerConfigVpnClientRootCertificates(p2SVpnServerConfigVpnClientRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withRadiusServerAddress(String radiusServerAddress) { + this.inner().withRadiusServerAddress(radiusServerAddress); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withRadiusServerSecret(String radiusServerSecret) { + this.inner().withRadiusServerSecret(radiusServerSecret); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.inner().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withVpnProtocols(List vpnProtocols) { + this.inner().withVpnProtocols(vpnProtocols); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationInner.java new file mode 100644 index 0000000000000..ec0636df6bd08 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2SVpnServerConfigurationInner.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VpnGatewayTunnelingProtocol; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigVpnClientRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigVpnClientRevokedCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigRadiusServerRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfigRadiusClientRootCertificate; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * P2SVpnServerConfiguration Resource. + */ +@JsonFlatten +public class P2SVpnServerConfigurationInner extends SubResource { + /** + * The name of the P2SVpnServerConfiguration that is unique within a + * VirtualWan in a resource group. This name can be used to access the + * resource along with Paren VirtualWan resource name. + */ + @JsonProperty(value = "properties.name") + private String p2SVpnServerConfigurationPropertiesName; + + /** + * vpnProtocols for the P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnProtocols") + private List vpnProtocols; + + /** + * VPN client root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigVpnClientRootCertificates") + private List p2SVpnServerConfigVpnClientRootCertificates; + + /** + * VPN client revoked certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigVpnClientRevokedCertificates") + private List p2SVpnServerConfigVpnClientRevokedCertificates; + + /** + * Radius Server root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigRadiusServerRootCertificates") + private List p2SVpnServerConfigRadiusServerRootCertificates; + + /** + * Radius client root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigRadiusClientRootCertificates") + private List p2SVpnServerConfigRadiusClientRootCertificates; + + /** + * VpnClientIpsecPolicies for P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /** + * The radius server address property of the P2SVpnServerConfiguration + * resource for point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerAddress") + private String radiusServerAddress; + + /** + * The radius secret property of the P2SVpnServerConfiguration resource for + * for point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerSecret") + private String radiusServerSecret; + + /** + * The provisioning state of the P2SVpnServerConfiguration resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The p2SVpnGateways property. + */ + @JsonProperty(value = "properties.p2SVpnGateways", access = JsonProperty.Access.WRITE_ONLY) + private List p2SVpnGateways; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "properties.etag") + private String p2SVpnServerConfigurationPropertiesEtag; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name. + * + * @return the p2SVpnServerConfigurationPropertiesName value + */ + public String p2SVpnServerConfigurationPropertiesName() { + return this.p2SVpnServerConfigurationPropertiesName; + } + + /** + * Set the name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name. + * + * @param p2SVpnServerConfigurationPropertiesName the p2SVpnServerConfigurationPropertiesName value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName) { + this.p2SVpnServerConfigurationPropertiesName = p2SVpnServerConfigurationPropertiesName; + return this; + } + + /** + * Get vpnProtocols for the P2SVpnServerConfiguration. + * + * @return the vpnProtocols value + */ + public List vpnProtocols() { + return this.vpnProtocols; + } + + /** + * Set vpnProtocols for the P2SVpnServerConfiguration. + * + * @param vpnProtocols the vpnProtocols value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withVpnProtocols(List vpnProtocols) { + this.vpnProtocols = vpnProtocols; + return this; + } + + /** + * Get vPN client root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigVpnClientRootCertificates value + */ + public List p2SVpnServerConfigVpnClientRootCertificates() { + return this.p2SVpnServerConfigVpnClientRootCertificates; + } + + /** + * Set vPN client root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigVpnClientRootCertificates the p2SVpnServerConfigVpnClientRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates) { + this.p2SVpnServerConfigVpnClientRootCertificates = p2SVpnServerConfigVpnClientRootCertificates; + return this; + } + + /** + * Get vPN client revoked certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigVpnClientRevokedCertificates value + */ + public List p2SVpnServerConfigVpnClientRevokedCertificates() { + return this.p2SVpnServerConfigVpnClientRevokedCertificates; + } + + /** + * Set vPN client revoked certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigVpnClientRevokedCertificates the p2SVpnServerConfigVpnClientRevokedCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates) { + this.p2SVpnServerConfigVpnClientRevokedCertificates = p2SVpnServerConfigVpnClientRevokedCertificates; + return this; + } + + /** + * Get radius Server root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigRadiusServerRootCertificates value + */ + public List p2SVpnServerConfigRadiusServerRootCertificates() { + return this.p2SVpnServerConfigRadiusServerRootCertificates; + } + + /** + * Set radius Server root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigRadiusServerRootCertificates the p2SVpnServerConfigRadiusServerRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates) { + this.p2SVpnServerConfigRadiusServerRootCertificates = p2SVpnServerConfigRadiusServerRootCertificates; + return this; + } + + /** + * Get radius client root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigRadiusClientRootCertificates value + */ + public List p2SVpnServerConfigRadiusClientRootCertificates() { + return this.p2SVpnServerConfigRadiusClientRootCertificates; + } + + /** + * Set radius client root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigRadiusClientRootCertificates the p2SVpnServerConfigRadiusClientRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates) { + this.p2SVpnServerConfigRadiusClientRootCertificates = p2SVpnServerConfigRadiusClientRootCertificates; + return this; + } + + /** + * Get vpnClientIpsecPolicies for P2SVpnServerConfiguration. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set vpnClientIpsecPolicies for P2SVpnServerConfiguration. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radius server address property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radius server address property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radius secret property of the P2SVpnServerConfiguration resource for for point to site client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radius secret property of the P2SVpnServerConfiguration resource for for point to site client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the p2SVpnGateways value. + * + * @return the p2SVpnGateways value + */ + public List p2SVpnGateways() { + return this.p2SVpnGateways; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the p2SVpnServerConfigurationPropertiesEtag value + */ + public String p2SVpnServerConfigurationPropertiesEtag() { + return this.p2SVpnServerConfigurationPropertiesEtag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param p2SVpnServerConfigurationPropertiesEtag the p2SVpnServerConfigurationPropertiesEtag value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag) { + this.p2SVpnServerConfigurationPropertiesEtag = p2SVpnServerConfigurationPropertiesEtag; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysImpl.java new file mode 100644 index 0000000000000..de6247621e11e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.VpnProfileResponse; + +class P2sVpnGatewaysImpl extends GroupableResourcesCoreImpl implements P2sVpnGateways { + protected P2sVpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().p2sVpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + P2sVpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + P2sVpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + P2sVpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + P2sVpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnGateway call(P2SVpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + P2sVpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + P2sVpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnGateway call(P2SVpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public P2SVpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName) { + P2sVpnGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, gatewayName) + .map(new Func1() { + @Override + public VpnProfileResponse call(VpnProfileResponseInner inner) { + return new VpnProfileResponseImpl(inner, manager()); + } + }); + } + + @Override + protected P2SVpnGatewayImpl wrapModel(P2SVpnGatewayInner inner) { + return new P2SVpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected P2SVpnGatewayImpl wrapModel(String name) { + return new P2SVpnGatewayImpl(name, new P2SVpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java new file mode 100644 index 0000000000000..9909916793529 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java @@ -0,0 +1,1599 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.AuthenticationMethod; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnProfileParameters; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in P2sVpnGateways. + */ +public class P2sVpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private P2sVpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2sVpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public P2sVpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(P2sVpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for P2sVpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface P2sVpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body P2SVpnGatewayInner p2SVpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body P2SVpnGatewayInner p2SVpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject p2SVpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject p2SVpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body P2SVpnProfileParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways beginGenerateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile") + Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body P2SVpnProfileParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).toBlocking().last().body(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (p2SVpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null."); + } + Validator.validate(p2SVpnGatewayParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, p2SVpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).toBlocking().single().body(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (p2SVpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null."); + } + Validator.validate(p2SVpnGatewayParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, p2SVpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner generateVpnProfile(String resourceGroupName, String gatewayName) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final AuthenticationMethod authenticationMethod = null; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(null); + Observable> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner generateVpnProfile(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).toBlocking().last().body(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(authenticationMethod); + Observable> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner beginGenerateVpnProfile(String resourceGroupName, String gatewayName) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final AuthenticationMethod authenticationMethod = null; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(null); + return service.beginGenerateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner beginGenerateVpnProfile(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).toBlocking().single().body(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param authenticationMethod VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(authenticationMethod); + return service.beginGenerateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsImpl.java new file mode 100644 index 0000000000000..53f2605ba3c3e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfiguration; + +class P2sVpnServerConfigurationsImpl extends WrapperImpl implements P2sVpnServerConfigurations { + private final NetworkManager manager; + + P2sVpnServerConfigurationsImpl(NetworkManager manager) { + super(manager.inner().p2sVpnServerConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public P2SVpnServerConfigurationImpl define(String name) { + return wrapModel(name); + } + + private P2SVpnServerConfigurationImpl wrapModel(P2SVpnServerConfigurationInner inner) { + return new P2SVpnServerConfigurationImpl(inner, manager()); + } + + private P2SVpnServerConfigurationImpl wrapModel(String name) { + return new P2SVpnServerConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.listByVirtualWanAsync(resourceGroupName, virtualWanName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnServerConfiguration call(P2SVpnServerConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName) + .map(new Func1() { + @Override + public P2SVpnServerConfiguration call(P2SVpnServerConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java new file mode 100644 index 0000000000000..881f9b16a0ea0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in P2sVpnServerConfigurations. + */ +public class P2sVpnServerConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private P2sVpnServerConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2sVpnServerConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public P2sVpnServerConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(P2sVpnServerConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for P2sVpnServerConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface P2sVpnServerConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Body P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Body P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations listByVirtualWan" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations") + Observable> listByVirtualWan(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.P2sVpnServerConfigurations listByVirtualWanNext" }) + @GET + Observable> listByVirtualWanNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner get(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner createOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).toBlocking().last().body(); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters), serviceCallback); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + if (p2SVpnServerConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationParameters is required and cannot be null."); + } + Validator.validate(p2SVpnServerConfigurationParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, p2SVpnServerConfigurationParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner beginCreateOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).toBlocking().single().body(); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters), serviceCallback); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + if (p2SVpnServerConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationParameters is required and cannot be null."); + } + Validator.validate(p2SVpnServerConfigurationParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, p2SVpnServerConfigurationParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().last().body(); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().single().body(); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnServerConfigurationInner> object if successful. + */ + public PagedList listByVirtualWan(final String resourceGroupName, final String virtualWanName) { + ServiceResponse> response = listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable> listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName) { + return listByVirtualWanWithServiceResponseAsync(resourceGroupName, virtualWanName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable>> listByVirtualWanWithServiceResponseAsync(final String resourceGroupName, final String virtualWanName) { + return listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualWanNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + ServiceResponse> * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnServerConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualWanSinglePageAsync(final String resourceGroupName, final String virtualWanName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByVirtualWan(this.client.subscriptionId(), resourceGroupName, virtualWanName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualWanDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualWanDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnServerConfigurationInner> object if successful. + */ + public PagedList listByVirtualWanNext(final String nextPageLink) { + ServiceResponse> response = listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualWanNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualWanNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable> listByVirtualWanNextAsync(final String nextPageLink) { + return listByVirtualWanNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable>> listByVirtualWanNextWithServiceResponseAsync(final String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualWanNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnServerConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualWanNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVirtualWanNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualWanNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualWanNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureInner.java new file mode 100644 index 0000000000000..af61bf533d761 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the create packet capture operation. + */ +@JsonFlatten +public class PacketCaptureInner { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..a0da6c78f6f11 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PcError; +import com.microsoft.azure.management.network.v2018_08_01.PcStatus; + +class PacketCaptureQueryStatusResultImpl extends WrapperImpl implements PacketCaptureQueryStatusResult { + private final NetworkManager manager; + PacketCaptureQueryStatusResultImpl(PacketCaptureQueryStatusResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime captureStartTime() { + return this.inner().captureStartTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List packetCaptureError() { + return this.inner().packetCaptureError(); + } + + @Override + public PcStatus packetCaptureStatus() { + return this.inner().packetCaptureStatus(); + } + + @Override + public String stopReason() { + return this.inner().stopReason(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 0000000000000..e8eb0c1c0e18d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.network.v2018_08_01.PcStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PcError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of packet capture session. + */ +public class PacketCaptureQueryStatusResultInner { + /** + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private DateTime captureStartTime; + + /** + * The status of the packet capture session. Possible values include: + * 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /** + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /** + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** + * Get the name of the packet capture resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the packet capture resource. + * + * @param name the name value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the packet capture resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the packet capture resource. + * + * @param id the id value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the start time of the packet capture session. + * + * @return the captureStartTime value + */ + public DateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(DateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @return the packetCaptureStatus value + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @param packetCaptureStatus the packetCaptureStatus value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the reason the current packet capture session was stopped. + * + * @return the stopReason value + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set the reason the current packet capture session was stopped. + * + * @param stopReason the stopReason value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { + this.stopReason = stopReason; + return this; + } + + /** + * Get list of errors of packet capture session. + * + * @return the packetCaptureError value + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set list of errors of packet capture session. + * + * @param packetCaptureError the packetCaptureError value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { + this.packetCaptureError = packetCaptureError; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..7e7c988cae0ee --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import rx.functions.Func1; + +class PacketCaptureResultImpl extends CreatableUpdatableImpl implements PacketCaptureResult, PacketCaptureResult.Definition, PacketCaptureResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String packetCaptureName; + private PacketCaptureInner createOrUpdateParameter; + + PacketCaptureResultImpl(String name, NetworkManager manager) { + super(name, new PacketCaptureResultInner()); + this.manager = manager; + // Set resource name + this.packetCaptureName = name; + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + PacketCaptureResultImpl(PacketCaptureResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.packetCaptureName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.packetCaptureName = IdParsingUtils.getValueFromIdByName(inner.id(), "packetCaptures"); + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public Integer bytesToCapturePerPacket() { + return this.inner().bytesToCapturePerPacket(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List filters() { + return this.inner().filters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PacketCaptureStorageLocation storageLocation() { + return this.inner().storageLocation(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public Integer timeLimitInSeconds() { + return this.inner().timeLimitInSeconds(); + } + + @Override + public Integer totalBytesPerSession() { + return this.inner().totalBytesPerSession(); + } + + @Override + public PacketCaptureResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public PacketCaptureResultImpl withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.createOrUpdateParameter.withStorageLocation(storageLocation); + return this; + } + + @Override + public PacketCaptureResultImpl withTarget(String target) { + this.createOrUpdateParameter.withTarget(target); + return this; + } + + @Override + public PacketCaptureResultImpl withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.createOrUpdateParameter.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + @Override + public PacketCaptureResultImpl withFilters(List filters) { + this.createOrUpdateParameter.withFilters(filters); + return this; + } + + @Override + public PacketCaptureResultImpl withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.createOrUpdateParameter.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + @Override + public PacketCaptureResultImpl withTotalBytesPerSession(Integer totalBytesPerSession) { + this.createOrUpdateParameter.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultInner.java new file mode 100644 index 0000000000000..45039cce0b64b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCaptureResultInner.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about packet capture session. + */ +@JsonFlatten +public class PacketCaptureResultInner { + /** + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * The provisioning state of the packet capture session. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get name of the packet capture session. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get iD of the packet capture operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesImpl.java new file mode 100644 index 0000000000000..2e431efaa4706 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptures; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.management.network.v2018_08_01.PacketCaptureResult; + +class PacketCapturesImpl extends WrapperImpl implements PacketCaptures { + private final NetworkManager manager; + + PacketCapturesImpl(NetworkManager manager) { + super(manager.inner().packetCaptures()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public PacketCaptureResultImpl define(String name) { + return wrapModel(name); + } + + private PacketCaptureResultImpl wrapModel(PacketCaptureResultInner inner) { + return new PacketCaptureResultImpl(inner, manager()); + } + + private PacketCaptureResultImpl wrapModel(String name) { + return new PacketCaptureResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + + @Override + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureQueryStatusResult call(PacketCaptureQueryStatusResultInner inner) { + return new PacketCaptureQueryStatusResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + PacketCapturesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesInner.java new file mode 100644 index 0000000000000..4aae8fad7120a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PacketCapturesInner.java @@ -0,0 +1,961 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_08_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in PacketCaptures. + */ +public class PacketCapturesInner { + /** The Retrofit service to perform REST calls. */ + private PacketCapturesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PacketCapturesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PacketCapturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PacketCaptures to be + * used by Retrofit to perform actually REST calls. + */ + interface PacketCapturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures getStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> getStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures beginGetStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> beginGetStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PacketCaptures list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner create(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().last().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.create(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner getStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable> beginGetStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PacketCaptureResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..5f22eca13d79c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl1.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..72d7a27340bfb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..e79294ea79bf4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Probe; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ProbeProtocol; + +class ProbeImpl extends IndexableRefreshableWrapperImpl implements Probe { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String probeName; + + ProbeImpl(ProbeInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerProbesInner client = this.manager().inner().loadBalancerProbes(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.probeName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer intervalInSeconds() { + return this.inner().intervalInSeconds(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer numberOfProbes() { + return this.inner().numberOfProbes(); + } + + @Override + public int port() { + return this.inner().port(); + } + + @Override + public ProbeProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String requestPath() { + return this.inner().requestPath(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeInner.java new file mode 100644 index 0000000000000..04c19e646b66f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ProbeInner.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.ProbeProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancer probe. + */ +@JsonFlatten +public class ProbeInner extends SubResource { + /** + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The protocol of the end point. Possible values are: 'Http', 'Tcp', or + * 'Https'. If 'Tcp' is specified, a received ACK is required for the probe + * to be successful. If 'Http' or 'Https' is specified, a 200 OK response + * from the specifies URI is required for the probe to be successful. + * Possible values include: 'Http', 'Tcp', 'Https'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private ProbeProtocol protocol; + + /** + * The port for communicating the probe. Possible values range from 1 to + * 65535, inclusive. + */ + @JsonProperty(value = "properties.port", required = true) + private int port; + + /** + * The interval, in seconds, for how frequently to probe the endpoint for + * health status. Typically, the interval is slightly less than half the + * allocated timeout period (in seconds) which allows two full probes + * before taking the instance out of rotation. The default value is 15, the + * minimum value is 5. + */ + @JsonProperty(value = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The number of probes where if no response, will result in stopping + * further traffic from being delivered to the endpoint. This values allows + * endpoints to be taken out of rotation faster or slower than the typical + * times used in Azure. + */ + @JsonProperty(value = "properties.numberOfProbes") + private Integer numberOfProbes; + + /** + * The URI used for requesting health status from the VM. Path is required + * if a protocol is set to http. Otherwise, it is not allowed. There is no + * default value. + */ + @JsonProperty(value = "properties.requestPath") + private String requestPath; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the load balancer rules that use this probe. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @return the protocol value + */ + public ProbeProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @param protocol the protocol value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProtocol(ProbeProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @param port the port value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @return the intervalInSeconds value + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @return the numberOfProbes value + */ + public Integer numberOfProbes() { + return this.numberOfProbes; + } + + /** + * Set the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @param numberOfProbes the numberOfProbes value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value + */ + public String requestPath() { + return this.requestPath; + } + + /** + * Set the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @param requestPath the requestPath value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressImpl.java new file mode 100644 index 0000000000000..db003d268cc62 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressImpl.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddress; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import com.microsoft.azure.management.network.v2018_08_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpTag; +import com.microsoft.azure.SubResource; + +class PublicIPAddressImpl extends GroupableResourceCoreImpl implements PublicIPAddress, PublicIPAddress.Definition, PublicIPAddress.Update { + PublicIPAddressImpl(String name, PublicIPAddressInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public PublicIPAddressDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public IPConfiguration ipConfiguration() { + return this.inner().ipConfiguration(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public IPAllocationMethod publicIPAllocationMethod() { + return this.inner().publicIPAllocationMethod(); + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPAddressSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPAddressImpl withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public PublicIPAddressImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public PublicIPAddressImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public PublicIPAddressImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPAddressImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.inner().withPublicIPAllocationMethod(publicIPAllocationMethod); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPPrefix(SubResource publicIPPrefix) { + this.inner().withPublicIPPrefix(publicIPPrefix); + return this; + } + + @Override + public PublicIPAddressImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPAddressImpl withSku(PublicIPAddressSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPAddressImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressInner.java new file mode 100644 index 0000000000000..0a33c3f1ce63d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressInner.java @@ -0,0 +1,387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import com.microsoft.azure.management.network.v2018_08_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpTag; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP address resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPAddressInner extends Resource { + /** + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIPAddressSku sku; + + /** + * The public IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private IPAllocationMethod publicIPAllocationMethod; + + /** + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "properties.ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IPConfiguration ipConfiguration; + + /** + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "properties.dnsSettings") + private PublicIPAddressDnsSettings dnsSettings; + + /** + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The Public IP Prefix this Public IP Address should be allocated from. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The resource GUID property of the public IP resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the public IP address SKU. + * + * @return the sku value + */ + public PublicIPAddressSku sku() { + return this.sku; + } + + /** + * Set the public IP address SKU. + * + * @param sku the sku value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withSku(PublicIPAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the publicIPAllocationMethod value + */ + public IPAllocationMethod publicIPAllocationMethod() { + return this.publicIPAllocationMethod; + } + + /** + * Set the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param publicIPAllocationMethod the publicIPAllocationMethod value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.publicIPAllocationMethod = publicIPAllocationMethod; + return this; + } + + /** + * Get the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the IP configuration associated with the public IP address. + * + * @return the ipConfiguration value + */ + public IPConfiguration ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Get the FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value + */ + public PublicIPAddressDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the FQDN of the DNS record associated with the public IP address. + * + * @param dnsSettings the dnsSettings value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the list of tags associated with the public IP address. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP address. + * + * @param ipTags the ipTags value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the IP address associated with the public IP address resource. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address associated with the public IP address resource. + * + * @param ipAddress the ipAddress value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the Public IP Prefix this Public IP Address should be allocated from. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the Public IP Prefix this Public IP Address should be allocated from. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get the idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the resource GUID property of the public IP resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesImpl.java new file mode 100644 index 0000000000000..bc720cdac4bbe --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesImpl.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddress; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPAddressesImpl extends GroupableResourcesCoreImpl implements PublicIPAddresses { + protected PublicIPAddressesImpl(NetworkManager manager) { + super(manager.inner().publicIPAddresses(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPAddressesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPAddressImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + PublicIPAddressesInner client = this.inner(); + return client.getVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected PublicIPAddressImpl wrapModel(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPAddressImpl wrapModel(String name) { + return new PublicIPAddressImpl(name, new PublicIPAddressInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesInner.java new file mode 100644 index 0000000000000..4c52c4b4447cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPAddressesInner.java @@ -0,0 +1,2085 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPAddresses. + */ +public class PublicIPAddressesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPAddressesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPAddressesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPAddressesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPAddressesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPAddresses to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPAddressesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + Observable> listVirtualMachineScaleSetPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + Observable> listVirtualMachineScaleSetVMPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses getVirtualMachineScaleSetPublicIPAddress" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}") + Observable> getVirtualMachineScaleSetPublicIPAddress(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpAddressName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpAddressName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpAddressName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The network interface name. + ServiceResponse> * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetPublicIPAddressDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixImpl.java new file mode 100644 index 0000000000000..6884b2f59bdd3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefix; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpTag; +import com.microsoft.azure.management.network.v2018_08_01.ReferencedPublicIpAddress; + +class PublicIPPrefixImpl extends GroupableResourceCoreImpl implements PublicIPPrefix, PublicIPPrefix.Definition, PublicIPPrefix.Update { + PublicIPPrefixImpl(String name, PublicIPPrefixInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipPrefix() { + return this.inner().ipPrefix(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public Integer prefixLength() { + return this.inner().prefixLength(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List publicIPAddresses() { + return this.inner().publicIPAddresses(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPPrefixSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPPrefixImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPPrefixImpl withIpPrefix(String ipPrefix) { + this.inner().withIpPrefix(ipPrefix); + return this; + } + + @Override + public PublicIPPrefixImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPPrefixImpl withPrefixLength(Integer prefixLength) { + this.inner().withPrefixLength(prefixLength); + return this; + } + + @Override + public PublicIPPrefixImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddresses(List publicIPAddresses) { + this.inner().withPublicIPAddresses(publicIPAddresses); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPPrefixImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPPrefixImpl withSku(PublicIPPrefixSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPPrefixImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixInner.java new file mode 100644 index 0000000000000..2d4a7b752e9b8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixInner.java @@ -0,0 +1,316 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpTag; +import com.microsoft.azure.management.network.v2018_08_01.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP prefix resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPPrefixInner extends Resource { + /** + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIPPrefixSku sku; + + /** + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The list of tags associated with the public IP prefix. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The Length of the Public IP Prefix. + */ + @JsonProperty(value = "properties.prefixLength") + private Integer prefixLength; + + /** + * The allocated Prefix. + */ + @JsonProperty(value = "properties.ipPrefix") + private String ipPrefix; + + /** + * The list of all referenced PublicIPAddresses. + */ + @JsonProperty(value = "properties.publicIPAddresses") + private List publicIPAddresses; + + /** + * The resource GUID property of the public IP prefix resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the Public IP prefix resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the public IP prefix SKU. + * + * @return the sku value + */ + public PublicIPPrefixSku sku() { + return this.sku; + } + + /** + * Set the public IP prefix SKU. + * + * @param sku the sku value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withSku(PublicIPPrefixSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the list of tags associated with the public IP prefix. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP prefix. + * + * @param ipTags the ipTags value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the Length of the Public IP Prefix. + * + * @return the prefixLength value + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the Length of the Public IP Prefix. + * + * @param prefixLength the prefixLength value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the allocated Prefix. + * + * @return the ipPrefix value + */ + public String ipPrefix() { + return this.ipPrefix; + } + + /** + * Set the allocated Prefix. + * + * @param ipPrefix the ipPrefix value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; + return this; + } + + /** + * Get the list of all referenced PublicIPAddresses. + * + * @return the publicIPAddresses value + */ + public List publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * Set the list of all referenced PublicIPAddresses. + * + * @param publicIPAddresses the publicIPAddresses value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddresses(List publicIPAddresses) { + this.publicIPAddresses = publicIPAddresses; + return this; + } + + /** + * Get the resource GUID property of the public IP prefix resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP prefix resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesImpl.java new file mode 100644 index 0000000000000..5765087e874ce --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefix; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPPrefixesImpl extends GroupableResourcesCoreImpl implements PublicIPPrefixes { + protected PublicIPPrefixesImpl(NetworkManager manager) { + super(manager.inner().publicIPPrefixes(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPPrefixesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPPrefixImpl define(String name) { + return wrapModel(name); + } + + @Override + protected PublicIPPrefixImpl wrapModel(PublicIPPrefixInner inner) { + return new PublicIPPrefixImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPPrefixImpl wrapModel(String name) { + return new PublicIPPrefixImpl(name, new PublicIPPrefixInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesInner.java new file mode 100644 index 0000000000000..810da0bb83744 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/PublicIPPrefixesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPPrefixes. + */ +public class PublicIPPrefixesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPPrefixesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPPrefixesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPPrefixesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPPrefixesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPPrefixes to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPPrefixesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.PublicIPPrefixes listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpPrefixName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpPrefixName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpPrefixName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpPrefixName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand), serviceCallback); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIPPrefx. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner createOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterImpl.java new file mode 100644 index 0000000000000..ef65ab64743ad --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilter; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.PatchRouteFilter; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilterRule; +import rx.functions.Func1; + +class RouteFilterImpl extends GroupableResourceCoreImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private PatchRouteFilter updateParameter; + RouteFilterImpl(String name, RouteFilterInner inner, NetworkManager manager) { + super(name, inner, manager); + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public Observable createResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List rules() { + List lst = new ArrayList(); + if (this.inner().rules() != null) { + for (RouteFilterRuleInner inner : this.inner().rules()) { + lst.add( new RouteFilterRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteFilterImpl withPeerings(List peerings) { + if (isInCreateMode()) { + this.inner().withPeerings(peerings); + } else { + this.updateParameter.withPeerings(peerings); + } + return this; + } + + @Override + public RouteFilterImpl withRules(List rules) { + if (isInCreateMode()) { + this.inner().withRules(rules); + } else { + this.updateParameter.withRules(rules); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterInner.java new file mode 100644 index 0000000000000..106eaa6cf202a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterInner.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteFilterInner extends Resource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleImpl.java new file mode 100644 index 0000000000000..310453dcc7a29 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.RouteFilterRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.PatchRouteFilterRule; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.Access; +import rx.functions.Func1; + +class RouteFilterRuleImpl extends CreatableUpdatableImpl implements RouteFilterRule, RouteFilterRule.Definition, RouteFilterRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeFilterName; + private String ruleName; + private PatchRouteFilterRule updateParameter; + + RouteFilterRuleImpl(String name, NetworkManager manager) { + super(name, new RouteFilterRuleInner()); + this.manager = manager; + // Set resource name + this.ruleName = name; + // + this.updateParameter = new PatchRouteFilterRule(); + } + + RouteFilterRuleImpl(RouteFilterRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeFilterName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilters"); + this.ruleName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilterRules"); + // + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.inner()) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.updateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.getAsync(this.resourceGroupName, this.routeFilterName, this.ruleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public List communities() { + return this.inner().communities(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String routeFilterRuleType() { + return this.inner().routeFilterRuleType(); + } + + @Override + public RouteFilterRuleImpl withExistingRouteFilter(String resourceGroupName, String routeFilterName) { + this.resourceGroupName = resourceGroupName; + this.routeFilterName = routeFilterName; + return this; + } + + @Override + public RouteFilterRuleImpl withAccess(Access access) { + this.inner().withAccess(access); + return this; + } + + @Override + public RouteFilterRuleImpl withCommunities(List communities) { + this.inner().withCommunities(communities); + return this; + } + + @Override + public RouteFilterRuleImpl withRouteFilterRuleType(String routeFilterRuleType) { + this.inner().withRouteFilterRuleType(routeFilterRuleType); + return this; + } + + @Override + public RouteFilterRuleImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public RouteFilterRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteFilterRuleImpl withId(String id) { + if (isInCreateMode()) { + this.inner().withId(id); + } else { + this.updateParameter.withId(id); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleInner.java new file mode 100644 index 0000000000000..64722ee40e0eb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRuleInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Access; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class RouteFilterRuleInner extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of RouteFilterRuleInner class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public RouteFilterRuleInner() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesImpl.java new file mode 100644 index 0000000000000..5a4cebcf6d1c9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilterRule; + +class RouteFilterRulesImpl extends WrapperImpl implements RouteFilterRules { + private final NetworkManager manager; + + RouteFilterRulesImpl(NetworkManager manager) { + super(manager.inner().routeFilterRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteFilterRuleImpl define(String name) { + return wrapModel(name); + } + + private RouteFilterRuleImpl wrapModel(RouteFilterRuleInner inner) { + return new RouteFilterRuleImpl(inner, manager()); + } + + private RouteFilterRuleImpl wrapModel(String name) { + return new RouteFilterRuleImpl(name, this.manager()); + } + + @Override + public Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + RouteFilterRulesInner client = this.inner(); + return client.listByRouteFilterAsync(resourceGroupName, routeFilterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeFilterName, ruleName) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeFilterName, ruleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesInner.java new file mode 100644 index 0000000000000..566b88598a4df --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFilterRulesInner.java @@ -0,0 +1,955 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.PatchRouteFilterRule; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilterRules. + */ +public class RouteFilterRulesInner { + /** The Retrofit service to perform REST calls. */ + private RouteFilterRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFilterRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFilterRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilterRules to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFilterRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules listByRouteFilter" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules") + Observable> listByRouteFilter(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilterRules listByRouteFilterNext" }) + @GET + Observable> listByRouteFilterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().last().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName, String ruleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner createOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner update(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-08-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilter(final String resourceGroupName, final String routeFilterName) { + ServiceResponse> response = listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterWithServiceResponseAsync(resourceGroupName, routeFilterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterWithServiceResponseAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterSinglePageAsync(final String resourceGroupName, final String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByRouteFilter(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilterNext(final String nextPageLink) { + ServiceResponse> response = listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterNextAsync(final String nextPageLink) { + return listByRouteFilterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterNextWithServiceResponseAsync(final String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersImpl.java new file mode 100644 index 0000000000000..768a9b13af03c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_08_01.RouteFilter; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteFiltersImpl extends GroupableResourcesCoreImpl implements RouteFilters { + protected RouteFiltersImpl(NetworkManager manager) { + super(manager.inner().routeFilters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteFiltersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteFilterImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteFilterImpl wrapModel(RouteFilterInner inner) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteFilterImpl wrapModel(String name) { + return new RouteFilterImpl(name, new RouteFilterInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersInner.java new file mode 100644 index 0000000000000..f118f884688bc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteFiltersInner.java @@ -0,0 +1,1207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.PatchRouteFilter; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilters. + */ +public class RouteFiltersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteFiltersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFiltersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().last().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner update(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-08-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteImpl.java new file mode 100644 index 0000000000000..3a9fc6dd17154 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Route; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.RouteNextHopType; + +class RouteImpl extends CreatableUpdatableImpl implements Route, Route.Definition, Route.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeTableName; + private String routeName; + + RouteImpl(String name, NetworkManager manager) { + super(name, new RouteInner()); + this.manager = manager; + // Set resource name + this.routeName = name; + // + } + + RouteImpl(RouteInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.routeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); + this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.getAsync(this.resourceGroupName, this.routeTableName, this.routeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public RouteNextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + @Override + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.inner().withNextHopType(nextHopType); + return this; + } + + @Override + public RouteImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public RouteImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public RouteImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.inner().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + @Override + public RouteImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteInner.java new file mode 100644 index 0000000000000..b4f9dfe1406d3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route resource. + */ +@JsonFlatten +public class RouteInner extends SubResource { + /** + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "properties.nextHopType", required = true) + private RouteNextHopType nextHopType; + + /** + * The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + */ + @JsonProperty(value = "properties.nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the destination CIDR to which the route applies. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set + * @return the RouteInner object itself. + */ + public RouteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteInner object itself. + */ + public RouteInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteInner object itself. + */ + public RouteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteInner object itself. + */ + public RouteInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableImpl.java new file mode 100644 index 0000000000000..4538f90020d6e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.RouteTable; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.Route; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class RouteTableImpl extends GroupableResourceCoreImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + RouteTableImpl(String name, RouteTableInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableBgpRoutePropagation() { + return this.inner().disableBgpRoutePropagation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List routes() { + List lst = new ArrayList(); + if (this.inner().routes() != null) { + for (RouteInner inner : this.inner().routes()) { + lst.add( new RouteImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.inner().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + @Override + public RouteTableImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteTableImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public RouteTableImpl withRoutes(List routes) { + this.inner().withRoutes(routes); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableInner.java new file mode 100644 index 0000000000000..0f84ecded4931 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTableInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route table resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteTableInner extends Resource { + /** + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + */ + @JsonProperty(value = "properties.disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of routes contained within a route table. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set collection of routes contained within a route table. + * + * @param routes the routes value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @return the disableBgpRoutePropagation value + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesImpl.java new file mode 100644 index 0000000000000..cc99e6aef0431 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.RouteTables; +import com.microsoft.azure.management.network.v2018_08_01.RouteTable; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteTablesImpl extends GroupableResourcesCoreImpl implements RouteTables { + protected RouteTablesImpl(NetworkManager manager) { + super(manager.inner().routeTables(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteTablesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteTablesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteTableImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteTableImpl wrapModel(RouteTableInner inner) { + return new RouteTableImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteTableImpl wrapModel(String name) { + return new RouteTableImpl(name, new RouteTableInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesInner.java new file mode 100644 index 0000000000000..2dbaa26912876 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RouteTablesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteTables. + */ +public class RouteTablesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteTablesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteTablesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteTablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteTables to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteTablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.RouteTables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().last().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().single().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesImpl.java new file mode 100644 index 0000000000000..5aa1fc9dfd606 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.Routes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Route; + +class RoutesImpl extends WrapperImpl implements Routes { + private final NetworkManager manager; + + RoutesImpl(NetworkManager manager) { + super(manager.inner().routes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteImpl define(String name) { + return wrapModel(name); + } + + private RouteImpl wrapModel(RouteInner inner) { + return new RouteImpl(inner, manager()); + } + + private RouteImpl wrapModel(String name) { + return new RouteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String routeTableName) { + RoutesInner client = this.inner(); + return client.listAsync(resourceGroupName, routeTableName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeTableName, routeName) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeTableName, routeName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesInner.java new file mode 100644 index 0000000000000..7f36990ee304d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/RoutesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Routes. + */ +public class RoutesInner { + /** The Retrofit service to perform REST calls. */ + private RoutesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoutesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RoutesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Routes to be + * used by Retrofit to perform actually REST calls. + */ + interface RoutesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Routes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName, String routeName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName, String routeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String routeTableName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String routeTableName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, routeTableName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String routeTableName) { + return listWithServiceResponseAsync(resourceGroupName, routeTableName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { + return listSinglePageAsync(resourceGroupName, routeTableName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultImpl.java new file mode 100644 index 0000000000000..949fb85673525 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.SecurityGroupViewResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.SecurityGroupNetworkInterface; + +class SecurityGroupViewResultImpl extends WrapperImpl implements SecurityGroupViewResult { + private final NetworkManager manager; + SecurityGroupViewResultImpl(SecurityGroupViewResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List networkInterfaces() { + return this.inner().networkInterfaces(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultInner.java new file mode 100644 index 0000000000000..011e9cdf2886b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityGroupViewResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about security rules applied to the specified VM. + */ +public class SecurityGroupViewResultInner { + /** + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get list of network interfaces on the specified VM. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set list of network interfaces on the specified VM. + * + * @param networkInterfaces the networkInterfaces value to set + * @return the SecurityGroupViewResultInner object itself. + */ + public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRuleInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRuleInner.java new file mode 100644 index 0000000000000..3076ca031b38a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRuleInner.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRuleDirection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network security rule. + */ +@JsonFlatten +public class SecurityRuleInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', + * and '*'. Possible values include: 'Tcp', 'Udp', '*'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private SecurityRuleProtocol protocol; + + /** + * The source port or range. Integer or range between 0 and 65535. Asterix + * '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. Integer or range between 0 and 65535. + * Asterix '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.destinationPortRange") + private String destinationPortRange; + + /** + * The CIDR or source IP range. Asterix '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "properties.sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "properties.sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The application security group specified as source. + */ + @JsonProperty(value = "properties.sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /** + * The destination address prefix. CIDR or destination IP range. Asterix + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "properties.destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "properties.destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The application security group specified as destination. + */ + @JsonProperty(value = "properties.destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /** + * The source port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /** + * The network traffic is allowed or denied. Possible values are: 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private SecurityRuleAccess access; + + /** + * The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The + * lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outcoming traffic. Possible values are: + * 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "properties.direction", required = true) + private SecurityRuleDirection direction; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @return the protocol value + */ + public SecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @param protocol the protocol value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the CIDR or source IP ranges. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value + */ + public List sourceApplicationSecurityGroups() { + return this.sourceApplicationSecurityGroups; + } + + /** + * Set the application security group specified as source. + * + * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + return this; + } + + /** + * Get the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. CIDR or destination IP ranges. + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value + */ + public List destinationApplicationSecurityGroups() { + return this.destinationApplicationSecurityGroups; + } + + /** + * Set the application security group specified as destination. + * + * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + return this; + } + + /** + * Get the source port ranges. + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @param priority the priority value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesImpl.java new file mode 100644 index 0000000000000..4f6a480f5b35a --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.SecurityRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroupSecurityRule; + +class SecurityRulesImpl extends WrapperImpl implements SecurityRules { + private final NetworkManager manager; + + SecurityRulesImpl(NetworkManager manager) { + super(manager.inner().securityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl define(String name) { + return wrapModel(name); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleImpl(inner, manager()); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(String name) { + return new NetworkSecurityGroupSecurityRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + SecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesInner.java new file mode 100644 index 0000000000000..085d6361faf05 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SecurityRulesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SecurityRules. + */ +public class SecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private SecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface SecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.SecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesImpl.java new file mode 100644 index 0000000000000..0607dbf013053 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicy; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ServiceEndpointPoliciesImpl extends GroupableResourcesCoreImpl implements ServiceEndpointPolicies { + protected ServiceEndpointPoliciesImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServiceEndpointPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(ServiceEndpointPolicyInner inner) { + return new ServiceEndpointPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(String name) { + return new ServiceEndpointPolicyImpl(name, new ServiceEndpointPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java new file mode 100644 index 0000000000000..4ba43e2fc2ecc --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicies. + */ +public class ServiceEndpointPoliciesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicies listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand), serviceCallback); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..f68444d1c0057 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinition; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; + +class ServiceEndpointPolicyDefinitionImpl extends CreatableUpdatableImpl implements ServiceEndpointPolicyDefinition, ServiceEndpointPolicyDefinition.Definition, ServiceEndpointPolicyDefinition.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String serviceEndpointPolicyName; + private String serviceEndpointPolicyDefinitionName; + + ServiceEndpointPolicyDefinitionImpl(String name, NetworkManager manager) { + super(name, new ServiceEndpointPolicyDefinitionInner()); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = name; + // + } + + ServiceEndpointPolicyDefinitionImpl(ServiceEndpointPolicyDefinitionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceEndpointPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicies"); + this.serviceEndpointPolicyDefinitionName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicyDefinitions"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.getAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String service() { + return this.inner().service(); + } + + @Override + public List serviceResources() { + return this.inner().serviceResources(); + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName) { + this.resourceGroupName = resourceGroupName; + this.serviceEndpointPolicyName = serviceEndpointPolicyName; + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withService(String service) { + this.inner().withService(service); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withServiceResources(List serviceResources) { + this.inner().withServiceResources(serviceResources); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionInner.java new file mode 100644 index 0000000000000..01df4e1e9ff28 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Service Endpoint policy definitions. + */ +@JsonFlatten +public class ServiceEndpointPolicyDefinitionInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * service endpoint name. + */ + @JsonProperty(value = "properties.service") + private String service; + + /** + * A list of service resources. + */ + @JsonProperty(value = "properties.serviceResources") + private List serviceResources; + + /** + * The provisioning state of the service end point policy definition. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get service endpoint name. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set service endpoint name. + * + * @param service the service value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of service resources. + * + * @return the serviceResources value + */ + public List serviceResources() { + return this.serviceResources; + } + + /** + * Set a list of service resources. + * + * @param serviceResources the serviceResources value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withServiceResources(List serviceResources) { + this.serviceResources = serviceResources; + return this; + } + + /** + * Get the provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java new file mode 100644 index 0000000000000..c8087aa46831c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinition; + +class ServiceEndpointPolicyDefinitionsImpl extends WrapperImpl implements ServiceEndpointPolicyDefinitions { + private final NetworkManager manager; + + ServiceEndpointPolicyDefinitionsImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicyDefinitions()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl define(String name) { + return wrapModel(name); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(ServiceEndpointPolicyDefinitionInner inner) { + return new ServiceEndpointPolicyDefinitionImpl(inner, manager()); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(String name) { + return new ServiceEndpointPolicyDefinitionImpl(name, this.manager()); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java new file mode 100644 index 0000000000000..87c6123c6cff9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicyDefinitions. + */ +public class ServiceEndpointPolicyDefinitionsInner { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPolicyDefinitionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPolicyDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPolicyDefinitionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPolicyDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicyDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPolicyDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinitions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().last().body(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner get(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().last().body(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().single().body(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyImpl.java new file mode 100644 index 0000000000000..f8eb253d608a8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicy; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicyDefinition; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class ServiceEndpointPolicyImpl extends GroupableResourceCoreImpl implements ServiceEndpointPolicy, ServiceEndpointPolicy.Definition, ServiceEndpointPolicy.Update { + ServiceEndpointPolicyImpl(String name, ServiceEndpointPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List serviceEndpointPolicyDefinitions() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicyDefinitions() != null) { + for (ServiceEndpointPolicyDefinitionInner inner : this.inner().serviceEndpointPolicyDefinitions()) { + lst.add( new ServiceEndpointPolicyDefinitionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ServiceEndpointPolicyImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyImpl withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.inner().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyInner.java new file mode 100644 index 0000000000000..5683415e43222 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service End point policy resource. + */ +@JsonFlatten +@SkipParentValidation +public class ServiceEndpointPolicyInner extends Resource { + /** + * A collection of service endpoint policy definitions of the service + * endpoint policy. + */ + @JsonProperty(value = "properties.serviceEndpointPolicyDefinitions") + private List serviceEndpointPolicyDefinitions; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the service endpoint policy resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the service endpoint policy. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of service endpoint policy definitions of the service endpoint policy. + * + * @return the serviceEndpointPolicyDefinitions value + */ + public List serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * Set a collection of service endpoint policy definitions of the service endpoint policy. + * + * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.serviceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetImpl.java new file mode 100644 index 0000000000000..5b3a9db8fd411 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetImpl.java @@ -0,0 +1,276 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Subnet; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_08_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.IPConfigurationProfile; +import com.microsoft.azure.management.network.v2018_08_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2018_08_01.ServiceAssociationLink; +import com.microsoft.azure.management.network.v2018_08_01.Delegation; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.InterfaceEndpoint; +import com.microsoft.azure.management.network.v2018_08_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2018_08_01.RouteTable; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPolicy; + +class SubnetImpl extends CreatableUpdatableImpl implements Subnet, Subnet.Definition, Subnet.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String subnetName; + + SubnetImpl(String name, NetworkManager manager) { + super(name, new SubnetInner()); + this.manager = manager; + // Set resource name + this.subnetName = name; + // + } + + SubnetImpl(SubnetInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.subnetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public List addressPrefixes() { + return this.inner().addressPrefixes(); + } + + @Override + public List delegations() { + return this.inner().delegations(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List interfaceEndpoints() { + List lst = new ArrayList(); + if (this.inner().interfaceEndpoints() != null) { + for (InterfaceEndpointInner inner : this.inner().interfaceEndpoints()) { + lst.add( new InterfaceEndpointImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List ipConfigurationProfiles() { + return this.inner().ipConfigurationProfiles(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String purpose() { + return this.inner().purpose(); + } + + @Override + public List resourceNavigationLinks() { + return this.inner().resourceNavigationLinks(); + } + + @Override + public RouteTable routeTable() { + RouteTableInner inner = this.inner().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List serviceAssociationLinks() { + return this.inner().serviceAssociationLinks(); + } + + @Override + public List serviceEndpointPolicies() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicies() != null) { + for (ServiceEndpointPolicyInner inner : this.inner().serviceEndpointPolicies()) { + lst.add( new ServiceEndpointPolicyImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List serviceEndpoints() { + return this.inner().serviceEndpoints(); + } + + @Override + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public SubnetImpl withAddressPrefixes(List addressPrefixes) { + this.inner().withAddressPrefixes(addressPrefixes); + return this; + } + + @Override + public SubnetImpl withDelegations(List delegations) { + this.inner().withDelegations(delegations); + return this; + } + + @Override + public SubnetImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public SubnetImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public SubnetImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public SubnetImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public SubnetImpl withResourceNavigationLinks(List resourceNavigationLinks) { + this.inner().withResourceNavigationLinks(resourceNavigationLinks); + return this; + } + + @Override + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public SubnetImpl withServiceAssociationLinks(List serviceAssociationLinks) { + this.inner().withServiceAssociationLinks(serviceAssociationLinks); + return this; + } + + @Override + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.inner().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + @Override + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.inner().withServiceEndpoints(serviceEndpoints); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetInner.java new file mode 100644 index 0000000000000..fcb2cc55fea8e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetInner.java @@ -0,0 +1,402 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_08_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.IPConfigurationProfile; +import com.microsoft.azure.management.network.v2018_08_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2018_08_01.ServiceAssociationLink; +import com.microsoft.azure.management.network.v2018_08_01.Delegation; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Subnet in a virtual network resource. + */ +@JsonFlatten +public class SubnetInner extends SubResource { + /** + * The address prefix for the subnet. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * List of address prefixes for the subnet. + */ + @JsonProperty(value = "properties.addressPrefixes") + private List addressPrefixes; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * The reference of the RouteTable resource. + */ + @JsonProperty(value = "properties.routeTable") + private RouteTableInner routeTable; + + /** + * An array of service endpoints. + */ + @JsonProperty(value = "properties.serviceEndpoints") + private List serviceEndpoints; + + /** + * An array of service endpoint policies. + */ + @JsonProperty(value = "properties.serviceEndpointPolicies") + private List serviceEndpointPolicies; + + /** + * An array of references to interface endpoints. + */ + @JsonProperty(value = "properties.interfaceEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List interfaceEndpoints; + + /** + * Gets an array of references to the network interface IP configurations + * using subnet. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /** + * Array of IP configuration profiles which reference this subnet. + */ + @JsonProperty(value = "properties.ipConfigurationProfiles", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurationProfiles; + + /** + * Gets an array of references to the external resources using subnet. + */ + @JsonProperty(value = "properties.resourceNavigationLinks") + private List resourceNavigationLinks; + + /** + * Gets an array of references to services injecting into this subnet. + */ + @JsonProperty(value = "properties.serviceAssociationLinks") + private List serviceAssociationLinks; + + /** + * Gets an array of references to the delegations on the subnet. + */ + @JsonProperty(value = "properties.delegations") + private List delegations; + + /** + * A read-only string identifying the intention of use for this subnet + * based on delegations and other user-defined properties. + */ + @JsonProperty(value = "properties.purpose", access = JsonProperty.Access.WRITE_ONLY) + private String purpose; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the address prefix for the subnet. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get list of address prefixes for the subnet. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set list of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the reference of the RouteTable resource. + * + * @return the routeTable value + */ + public RouteTableInner routeTable() { + return this.routeTable; + } + + /** + * Set the reference of the RouteTable resource. + * + * @param routeTable the routeTable value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withRouteTable(RouteTableInner routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get an array of service endpoints. + * + * @return the serviceEndpoints value + */ + public List serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set an array of service endpoints. + * + * @param serviceEndpoints the serviceEndpoints value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpoints(List serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Get an array of service endpoint policies. + * + * @return the serviceEndpointPolicies value + */ + public List serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * Set an array of service endpoint policies. + * + * @param serviceEndpointPolicies the serviceEndpointPolicies value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.serviceEndpointPolicies = serviceEndpointPolicies; + return this; + } + + /** + * Get an array of references to interface endpoints. + * + * @return the interfaceEndpoints value + */ + public List interfaceEndpoints() { + return this.interfaceEndpoints; + } + + /** + * Get gets an array of references to the network interface IP configurations using subnet. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value + */ + public List ipConfigurationProfiles() { + return this.ipConfigurationProfiles; + } + + /** + * Get gets an array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value + */ + public List resourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** + * Set gets an array of references to the external resources using subnet. + * + * @param resourceNavigationLinks the resourceNavigationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withResourceNavigationLinks(List resourceNavigationLinks) { + this.resourceNavigationLinks = resourceNavigationLinks; + return this; + } + + /** + * Get gets an array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value + */ + public List serviceAssociationLinks() { + return this.serviceAssociationLinks; + } + + /** + * Set gets an array of references to services injecting into this subnet. + * + * @param serviceAssociationLinks the serviceAssociationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceAssociationLinks(List serviceAssociationLinks) { + this.serviceAssociationLinks = serviceAssociationLinks; + return this; + } + + /** + * Get gets an array of references to the delegations on the subnet. + * + * @return the delegations value + */ + public List delegations() { + return this.delegations; + } + + /** + * Set gets an array of references to the delegations on the subnet. + * + * @param delegations the delegations value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withDelegations(List delegations) { + this.delegations = delegations; + return this; + } + + /** + * Get a read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. + * + * @return the purpose value + */ + public String purpose() { + return this.purpose; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsImpl.java new file mode 100644 index 0000000000000..a2cd7f9aaccc3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.Subnets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; + +class SubnetsImpl extends WrapperImpl implements Subnets { + private final NetworkManager manager; + + SubnetsImpl(NetworkManager manager) { + super(manager.inner().subnets()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public SubnetImpl define(String name) { + return wrapModel(name); + } + + private SubnetImpl wrapModel(SubnetInner inner) { + return new SubnetImpl(inner, manager()); + } + + private SubnetImpl wrapModel(String name) { + return new SubnetImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + SubnetsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, subnetName) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsInner.java new file mode 100644 index 0000000000000..2b72f00ce691f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/SubnetsInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Subnets. + */ +public class SubnetsInner { + /** The Retrofit service to perform REST calls. */ + private SubnetsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubnetsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SubnetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Subnets to be + * used by Retrofit to perform actually REST calls. + */ + interface SubnetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Subnets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyImpl.java new file mode 100644 index 0000000000000..7f139557c6cdb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Topology; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TopologyResource; + +class TopologyImpl extends WrapperImpl implements Topology { + private final NetworkManager manager; + TopologyImpl(TopologyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime createdDateTime() { + return this.inner().createdDateTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List resources() { + return this.inner().resources(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyInner.java new file mode 100644 index 0000000000000..c3e86159d86cd --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TopologyInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TopologyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topology of the specified resource group. + */ +public class TopologyInner { + /** + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDateTime; + + /** + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The resources property. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get gUID representing the operation id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value + */ + public DateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the datetime when the topology was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the TopologyInner object itself. + */ + public TopologyInner withResources(List resources) { + this.resources = resources; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultImpl.java new file mode 100644 index 0000000000000..1ac185ab057d4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingDetails; + +class TroubleshootingResultImpl extends WrapperImpl implements TroubleshootingResult { + private final NetworkManager manager; + TroubleshootingResultImpl(TroubleshootingResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String code() { + return this.inner().code(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List results() { + return this.inner().results(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultInner.java new file mode 100644 index 0000000000000..db6e3de1b403d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/TroubleshootingResultInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Troubleshooting information gained from specified resource. + */ +public class TroubleshootingResultInner { + /** + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the start time of the troubleshooting. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the troubleshooting. + * + * @param startTime the startTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the troubleshooting. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the troubleshooting. + * + * @param endTime the endTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the result code of the troubleshooting. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the result code of the troubleshooting. + * + * @param code the code value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withCode(String code) { + this.code = code; + return this; + } + + /** + * Get information from troubleshooting. + * + * @return the results value + */ + public List results() { + return this.results; + } + + /** + * Set information from troubleshooting. + * + * @param results the results value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withResults(List results) { + this.results = results; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..2d4df17a4fb1c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.UsageName; + +class UsageImpl extends WrapperImpl implements Usage { + private final NetworkManager manager; + + UsageImpl(UsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public long currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public long limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..87cd149b27839 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsageInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes network resource usage. + */ +public class UsageInner { + /** + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /** + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /** + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Creates an instance of UsageInner class. + * @param currentValue the current value of the usage. + * @param limit the limit of usage. + * @param name the name of the type of usage. + */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get an enum describing the unit of measurement. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set an enum describing the unit of measurement. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit of usage. + * + * @return the limit value + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit of usage. + * + * @param limit the limit value to set + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name of the type of usage. + * + * @param name the name value to set + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..c5b2a1be3bf55 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final NetworkManager manager; + + UsagesImpl(NetworkManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesInner.java new file mode 100644 index 0000000000000..b2b272c0df49d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/UsagesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultImpl.java new file mode 100644 index 0000000000000..e4b15686db6f5 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VerificationIPFlowResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.Access; + +class VerificationIPFlowResultImpl extends WrapperImpl implements VerificationIPFlowResult { + private final NetworkManager manager; + VerificationIPFlowResultImpl(VerificationIPFlowResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public String ruleName() { + return this.inner().ruleName(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultInner.java new file mode 100644 index 0000000000000..0ed40f9abd258 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VerificationIPFlowResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.Access; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of IP flow verification on the target resource. + */ +public class VerificationIPFlowResultInner { + /** + * Indicates whether the traffic is allowed or denied. Possible values + * include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private Access access; + + /** + * Name of the rule. If input is not matched against any security rule, it + * is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * Get indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @param ruleName the ruleName value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..5b1c2c34c0aa7 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHub; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubRouteTable; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.HubVirtualNetworkConnection; + +class VirtualHubImpl extends GroupableResourceCoreImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + VirtualHubImpl(String name, VirtualHubInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteGateway() { + return this.inner().expressRouteGateway(); + } + + @Override + public SubResource p2SVpnGateway() { + return this.inner().p2SVpnGateway(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public VirtualHubRouteTable routeTable() { + return this.inner().routeTable(); + } + + @Override + public List virtualNetworkConnections() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkConnections() != null) { + for (HubVirtualNetworkConnectionInner inner : this.inner().virtualNetworkConnections()) { + lst.add( new HubVirtualNetworkConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public SubResource vpnGateway() { + return this.inner().vpnGateway(); + } + + @Override + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public VirtualHubImpl withExpressRouteGateway(SubResource expressRouteGateway) { + this.inner().withExpressRouteGateway(expressRouteGateway); + return this; + } + + @Override + public VirtualHubImpl withP2SVpnGateway(SubResource p2SVpnGateway) { + this.inner().withP2SVpnGateway(p2SVpnGateway); + return this; + } + + @Override + public VirtualHubImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualHubImpl withRouteTable(VirtualHubRouteTable routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public VirtualHubImpl withVirtualNetworkConnections(List virtualNetworkConnections) { + this.inner().withVirtualNetworkConnections(virtualNetworkConnections); + return this; + } + + @Override + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + + @Override + public VirtualHubImpl withVpnGateway(SubResource vpnGateway) { + this.inner().withVpnGateway(vpnGateway); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubInner.java new file mode 100644 index 0000000000000..cea7d1b9b3a38 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubInner.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubRouteTable; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualHubInner extends Resource { + /** + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * The VpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.vpnGateway") + private SubResource vpnGateway; + + /** + * The P2SVpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.p2SVpnGateway") + private SubResource p2SVpnGateway; + + /** + * The expressRouteGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.expressRouteGateway") + private SubResource expressRouteGateway; + + /** + * list of all vnet connections with this VirtualHub. + */ + @JsonProperty(value = "properties.virtualNetworkConnections") + private List virtualNetworkConnections; + + /** + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The routeTable associated with this virtual hub. + */ + @JsonProperty(value = "properties.routeTable") + private VirtualHubRouteTable routeTable; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the VirtualHub belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the VpnGateway associated with this VirtualHub. + * + * @return the vpnGateway value + */ + public SubResource vpnGateway() { + return this.vpnGateway; + } + + /** + * Set the VpnGateway associated with this VirtualHub. + * + * @param vpnGateway the vpnGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVpnGateway(SubResource vpnGateway) { + this.vpnGateway = vpnGateway; + return this; + } + + /** + * Get the P2SVpnGateway associated with this VirtualHub. + * + * @return the p2SVpnGateway value + */ + public SubResource p2SVpnGateway() { + return this.p2SVpnGateway; + } + + /** + * Set the P2SVpnGateway associated with this VirtualHub. + * + * @param p2SVpnGateway the p2SVpnGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withP2SVpnGateway(SubResource p2SVpnGateway) { + this.p2SVpnGateway = p2SVpnGateway; + return this; + } + + /** + * Get the expressRouteGateway associated with this VirtualHub. + * + * @return the expressRouteGateway value + */ + public SubResource expressRouteGateway() { + return this.expressRouteGateway; + } + + /** + * Set the expressRouteGateway associated with this VirtualHub. + * + * @param expressRouteGateway the expressRouteGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withExpressRouteGateway(SubResource expressRouteGateway) { + this.expressRouteGateway = expressRouteGateway; + return this; + } + + /** + * Get list of all vnet connections with this VirtualHub. + * + * @return the virtualNetworkConnections value + */ + public List virtualNetworkConnections() { + return this.virtualNetworkConnections; + } + + /** + * Set list of all vnet connections with this VirtualHub. + * + * @param virtualNetworkConnections the virtualNetworkConnections value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualNetworkConnections(List virtualNetworkConnections) { + this.virtualNetworkConnections = virtualNetworkConnections; + return this; + } + + /** + * Get address-prefix for this VirtualHub. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set address-prefix for this VirtualHub. + * + * @param addressPrefix the addressPrefix value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the routeTable associated with this virtual hub. + * + * @return the routeTable value + */ + public VirtualHubRouteTable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable associated with this virtual hub. + * + * @param routeTable the routeTable value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withRouteTable(VirtualHubRouteTable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsImpl.java new file mode 100644 index 0000000000000..9d656c03e6789 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_08_01.VirtualHub; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualHubsImpl extends GroupableResourcesCoreImpl implements VirtualHubs { + protected VirtualHubsImpl(NetworkManager manager) { + super(manager.inner().virtualHubs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualHubsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualHubImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualHubImpl wrapModel(VirtualHubInner inner) { + return new VirtualHubImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualHubImpl wrapModel(String name) { + return new VirtualHubImpl(name, new VirtualHubInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsInner.java new file mode 100644 index 0000000000000..7b6db2eb77820 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualHubs. + */ +public class VirtualHubsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualHubsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualHubsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualHubName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualHubName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualHubName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..f93ef98fd1118 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_08_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_08_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_08_01.IPVersion; +import com.microsoft.azure.management.network.v2018_08_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_08_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTap; + +class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements VirtualMachineScaleSetNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualMachineScaleSetName; + private String virtualmachineIndex; + private String networkInterfaceName; + private String ipConfigurationName; + + VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(this.resourceGroupName, this.virtualMachineScaleSetName, this.virtualmachineIndex, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List virtualNetworkTaps() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkTaps() != null) { + for (VirtualNetworkTapInner inner : this.inner().virtualNetworkTaps()) { + lst.add( new VirtualNetworkTapImpl(inner.name(), inner, manager())); + } + } + return lst; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..a9e7a4bbdc20f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_08_01.LocalNetworkGateway; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateway; + +class VirtualNetworkGatewayConnectionImpl extends GroupableResourceCoreImpl implements VirtualNetworkGatewayConnection, VirtualNetworkGatewayConnection.Definition, VirtualNetworkGatewayConnection.Update { + VirtualNetworkGatewayConnectionImpl(String name, VirtualNetworkGatewayConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.inner().connectionProtocol(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public LocalNetworkGateway localNetworkGateway2() { + LocalNetworkGatewayInner inner = this.inner().localNetworkGateway2(); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway1() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway1(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway2() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway2(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.inner().withConnectionType(connectionType); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.inner().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.inner().withConnectionProtocol(connectionProtocol); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.inner().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.inner().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.inner().withPeer(peer); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.inner().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.inner().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionInner.java new file mode 100644 index 0000000000000..8b40f0ccc9069 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,528 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the connectionProtocol value + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param connectionProtocol the connectionProtocol value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 0000000000000..26d95661d6f2f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionStatus; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionType; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.SubResource; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_08_01.TunnelConnectionHealth; + +class VirtualNetworkGatewayConnectionListEntityImpl extends WrapperImpl implements VirtualNetworkGatewayConnectionListEntity { + private final NetworkManager manager; + + VirtualNetworkGatewayConnectionListEntityImpl(VirtualNetworkGatewayConnectionListEntityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.inner().connectionProtocol(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.inner().localNetworkGateway2(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.inner().virtualNetworkGateway1(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.inner().virtualNetworkGateway2(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java new file mode 100644 index 0000000000000..e5fe7c785ac9f --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,529 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2(VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2(VirtualNetworkConnectionGatewayReference localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the connectionProtocol value + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param connectionProtocol the connectionProtocol value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsImpl.java new file mode 100644 index 0000000000000..93ca298c243b6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionSharedKey; +import com.microsoft.azure.management.network.v2018_08_01.ConnectionResetSharedKey; + +class VirtualNetworkGatewayConnectionsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGatewayConnections { + protected VirtualNetworkGatewayConnectionsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGatewayConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnection call(VirtualNetworkGatewayConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength) + .map(new Func1() { + @Override + public ConnectionResetSharedKey call(ConnectionResetSharedKeyInner inner) { + return new ConnectionResetSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(VirtualNetworkGatewayConnectionInner inner) { + return new VirtualNetworkGatewayConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, new VirtualNetworkGatewayConnectionInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsInner.java new file mode 100644 index 0000000000000..33a78f834248d --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayConnectionsInner.java @@ -0,0 +1,1485 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGatewayConnections. + */ +public class VirtualNetworkGatewayConnectionsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewayConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewayConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewayConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGatewayConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewayConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections setSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> setSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections beginSetSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> beginSetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections getSharedKey" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> getSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections resetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> resetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections beginResetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> beginResetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> getSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + Observable> observable = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + return service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..fab618b9df3d4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateway; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_08_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; + +class VirtualNetworkGatewayImpl extends GroupableResourceCoreImpl implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + VirtualNetworkGatewayImpl(String name, VirtualNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean activeActive() { + return this.inner().activeActive(); + } + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource gatewayDefaultSite() { + return this.inner().gatewayDefaultSite(); + } + + @Override + public VirtualNetworkGatewayType gatewayType() { + return this.inner().gatewayType(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public VpnClientConfiguration vpnClientConfiguration() { + return this.inner().vpnClientConfiguration(); + } + + @Override + public VpnType vpnType() { + return this.inner().vpnType(); + } + + @Override + public VirtualNetworkGatewayImpl withActiveActive(Boolean activeActive) { + this.inner().withActiveActive(activeActive); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.inner().withGatewayDefaultSite(gatewayDefaultSite); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.inner().withGatewayType(gatewayType); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.inner().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.inner().withVpnType(vpnType); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayInner.java new file mode 100644 index 0000000000000..10364457b80b2 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewayInner.java @@ -0,0 +1,366 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_08_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayInner extends Resource { + /** + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The type of this virtual network gateway. Possible values are: 'Vpn' and + * 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + */ + @JsonProperty(value = "properties.gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /** + * The type of this virtual network gateway. Possible values are: + * 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', + * 'RouteBased'. + */ + @JsonProperty(value = "properties.vpnType") + private VpnType vpnType; + + /** + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean activeActive; + + /** + * The reference of the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of + * removing existing default site setting. + */ + @JsonProperty(value = "properties.gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /** + * The reference of the VirtualNetworkGatewaySku resource which represents + * the SKU selected for Virtual network gateway. + */ + @JsonProperty(value = "properties.sku") + private VirtualNetworkGatewaySku sku; + + /** + * The reference of the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + */ + @JsonProperty(value = "properties.vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /** + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the VirtualNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get iP configurations for virtual network gateway. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configurations for virtual network gateway. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @return the gatewayType value + */ + public VirtualNetworkGatewayType gatewayType() { + return this.gatewayType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @param gatewayType the gatewayType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.gatewayType = gatewayType; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @return the vpnType value + */ + public VpnType vpnType() { + return this.vpnType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @param vpnType the vpnType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { + this.vpnType = vpnType; + return this; + } + + /** + * Get whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set whether BGP is enabled for this virtual network gateway or not. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get activeActive flag. + * + * @return the activeActive value + */ + public Boolean activeActive() { + return this.activeActive; + } + + /** + * Set activeActive flag. + * + * @param activeActive the activeActive value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActiveActive(Boolean activeActive) { + this.activeActive = activeActive; + return this; + } + + /** + * Get the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @return the gatewayDefaultSite value + */ + public SubResource gatewayDefaultSite() { + return this.gatewayDefaultSite; + } + + /** + * Set the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @param gatewayDefaultSite the gatewayDefaultSite value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.gatewayDefaultSite = gatewayDefaultSite; + return this; + } + + /** + * Get the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @return the sku value + */ + public VirtualNetworkGatewaySku sku() { + return this.sku; + } + + /** + * Set the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @param sku the sku value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value + */ + public VpnClientConfiguration vpnClientConfiguration() { + return this.vpnClientConfiguration; + } + + /** + * Set the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @param vpnClientConfiguration the vpnClientConfiguration value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set virtual network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..4abd8e1a888d6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.BgpPeerStatusListResult; +import com.microsoft.azure.management.network.v2018_08_01.GatewayRouteListResult; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientIPsecParameters; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.management.network.v2018_08_01.VpnDeviceScriptParameters; + +class VirtualNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGateways { + protected VirtualNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); + } + + @Override + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { + return new BgpPeerStatusListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(String name) { + return new VirtualNetworkGatewayImpl(name, new VirtualNetworkGatewayInner(), this.manager()); + } + + private VirtualNetworkGatewayConnectionListEntityImpl wrapVirtualNetworkGatewayConnectionListEntityModel(VirtualNetworkGatewayConnectionListEntityInner inner) { + return new VirtualNetworkGatewayConnectionListEntityImpl(inner, manager()); + } + + @Override + public Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConnectionListEntityInner inner) { + return wrapVirtualNetworkGatewayConnectionListEntityModel(inner); + } + }); + } + + @Override + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java new file mode 100644 index 0000000000000..a4438655a7ba9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java @@ -0,0 +1,3439 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.management.network.v2018_08_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_08_01.VpnDeviceScriptParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGateways. + */ +public class VirtualNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways listConnections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + Observable> listConnections(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> reset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways resetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> resetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginResetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> beginResetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways generatevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGeneratevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> beginGeneratevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGenerateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGetVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> beginGetVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> getBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGetBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> beginGetBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways supportedVpnDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + Observable> supportedVpnDevices(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> getLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGetLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> beginGetLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> getAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGetAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> beginGetAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways setVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> setVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginSetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> beginSetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways getVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> getVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways beginGetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> beginGetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways vpnDeviceConfigurationScript" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + Observable> vpnDeviceConfigurationScript(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VpnDeviceScriptParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGateways listConnectionsNext" }) + @GET + Observable> listConnectionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnections(final String resourceGroupName, final String virtualNetworkGatewayName) { + ServiceResponse> response = listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsSinglePageAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listConnections(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String gatewayVip = null; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String gatewayVip = null; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetVpnClientSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetVpnClientSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGeneratevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGeneratevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGeneratevpnclientpackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGeneratevpnclientpackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGetVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGetVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnProfilePackageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnProfilePackageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String peer = null; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String peer = null; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetBgpPeerStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> supportedVpnDevicesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedVpnDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedVpnDevicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetLearnedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetLearnedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAdvertisedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAdvertisedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner setVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().last().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-08-01"; + Observable> observable = service.setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().single().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginSetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-08-01"; + return service.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginGetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> vpnDeviceConfigurationScriptWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = vpnDeviceConfigurationScriptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse vpnDeviceConfigurationScriptDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnectionsNext(final String nextPageLink) { + ServiceResponse> response = listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsNextAsync(final String nextPageLink) { + return listConnectionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsNextWithServiceResponseAsync(final String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listConnectionsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..bf69fab304e62 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetwork; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.Subnet; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeering; + +class VirtualNetworkImpl extends GroupableResourceCoreImpl implements VirtualNetwork, VirtualNetwork.Definition, VirtualNetwork.Update { + VirtualNetworkImpl(String name, VirtualNetworkInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public SubResource ddosProtectionPlan() { + return this.inner().ddosProtectionPlan(); + } + + @Override + public DhcpOptions dhcpOptions() { + return this.inner().dhcpOptions(); + } + + @Override + public Boolean enableDdosProtection() { + return this.inner().enableDdosProtection(); + } + + @Override + public Boolean enableVmProtection() { + return this.inner().enableVmProtection(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List virtualNetworkPeerings() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkPeerings() != null) { + for (VirtualNetworkPeeringInner inner : this.inner().virtualNetworkPeerings()) { + lst.add( new VirtualNetworkPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.inner().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + @Override + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.inner().withDhcpOptions(dhcpOptions); + return this; + } + + @Override + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.inner().withEnableDdosProtection(enableDdosProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.inner().withEnableVmProtection(enableVmProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkImpl withSubnets(List subnets) { + this.inner().withSubnets(subnets); + return this; + } + + @Override + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.inner().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkInner.java new file mode 100644 index 0000000000000..bd6f55eed3ea4 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkInner extends Resource { + /** + * The AddressSpace that contains an array of IP address ranges that can be + * used by subnets. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The dhcpOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "properties.dhcpOptions") + private DhcpOptions dhcpOptions; + + /** + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "properties.subnets") + private List subnets; + + /** + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "properties.virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /** + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated + * with the resource. + */ + @JsonProperty(value = "properties.enableDdosProtection") + private Boolean enableDdosProtection; + + /** + * Indicates if VM protection is enabled for all the subnets in the virtual + * network. + */ + @JsonProperty(value = "properties.enableVmProtection") + private Boolean enableVmProtection; + + /** + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "properties.ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @param addressSpace the addressSpace value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @return the dhcpOptions value + */ + public DhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @param dhcpOptions the dhcpOptions value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get a list of subnets in a Virtual Network. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Set a list of subnets in a Virtual Network. + * + * @param subnets the subnets value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get a list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value + */ + public List virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * Set a list of peerings in a Virtual Network. + * + * @param virtualNetworkPeerings the virtualNetworkPeerings value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.virtualNetworkPeerings = virtualNetworkPeerings; + return this; + } + + /** + * Get the resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resourceGuid property of the Virtual Network resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @return the enableDdosProtection value + */ + public Boolean enableDdosProtection() { + return this.enableDdosProtection; + } + + /** + * Set indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @param enableDdosProtection the enableDdosProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @return the enableVmProtection value + */ + public Boolean enableVmProtection() { + return this.enableVmProtection; + } + + /** + * Set indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @param enableVmProtection the enableVmProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { + this.enableVmProtection = enableVmProtection; + return this; + } + + /** + * Get the DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the DDoS protection plan associated with the virtual network. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringImpl.java new file mode 100644 index 0000000000000..b24ac60b489ef --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeeringState; + +class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String virtualNetworkPeeringName; + + VirtualNetworkPeeringImpl(String name, NetworkManager manager) { + super(name, new VirtualNetworkPeeringInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = name; + // + } + + VirtualNetworkPeeringImpl(VirtualNetworkPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkPeerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowForwardedTraffic() { + return this.inner().allowForwardedTraffic(); + } + + @Override + public Boolean allowGatewayTransit() { + return this.inner().allowGatewayTransit(); + } + + @Override + public Boolean allowVirtualNetworkAccess() { + return this.inner().allowVirtualNetworkAccess(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkPeeringState peeringState() { + return this.inner().peeringState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AddressSpace remoteAddressSpace() { + return this.inner().remoteAddressSpace(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Boolean useRemoteGateways() { + return this.inner().useRemoteGateways(); + } + + @Override + public VirtualNetworkPeeringImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.inner().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.inner().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.inner().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.inner().withPeeringState(peeringState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.inner().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.inner().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.inner().withUseRemoteGateways(useRemoteGateways); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringInner.java new file mode 100644 index 0000000000000..fbf0f17c3681c --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Peerings in a virtual network resource. + */ +@JsonFlatten +public class VirtualNetworkPeeringInner extends SubResource { + /** + * Whether the VMs in the linked virtual network space would be able to + * access all the VMs in local Virtual network space. + */ + @JsonProperty(value = "properties.allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /** + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + */ + @JsonProperty(value = "properties.allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /** + * If gateway links can be used in remote virtual networking to link to + * this virtual network. + */ + @JsonProperty(value = "properties.allowGatewayTransit") + private Boolean allowGatewayTransit; + + /** + * If remote gateways can be used on this virtual network. If the flag is + * set to true, and allowGatewayTransit on remote peering is also true, + * virtual network will use gateways of remote virtual network for transit. + * Only one peering can have this flag set to true. This flag cannot be set + * if virtual network already has a gateway. + */ + @JsonProperty(value = "properties.useRemoteGateways") + private Boolean useRemoteGateways; + + /** + * The reference of the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register + * for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * The reference of the remote virtual network address space. + */ + @JsonProperty(value = "properties.remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /** + * The status of the virtual network peering. Possible values are + * 'Initiated', 'Connected', and 'Disconnected'. Possible values include: + * 'Initiated', 'Connected', 'Disconnected'. + */ + @JsonProperty(value = "properties.peeringState") + private VirtualNetworkPeeringState peeringState; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @return the allowVirtualNetworkAccess value + */ + public Boolean allowVirtualNetworkAccess() { + return this.allowVirtualNetworkAccess; + } + + /** + * Set whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; + return this; + } + + /** + * Get whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @return the allowForwardedTraffic value + */ + public Boolean allowForwardedTraffic() { + return this.allowForwardedTraffic; + } + + /** + * Set whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @param allowForwardedTraffic the allowForwardedTraffic value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.allowForwardedTraffic = allowForwardedTraffic; + return this; + } + + /** + * Get if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @return the allowGatewayTransit value + */ + public Boolean allowGatewayTransit() { + return this.allowGatewayTransit; + } + + /** + * Set if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @param allowGatewayTransit the allowGatewayTransit value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.allowGatewayTransit = allowGatewayTransit; + return this; + } + + /** + * Get if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @return the useRemoteGateways value + */ + public Boolean useRemoteGateways() { + return this.useRemoteGateways; + } + + /** + * Set if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @param useRemoteGateways the useRemoteGateways value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { + this.useRemoteGateways = useRemoteGateways; + return this; + } + + /** + * Get the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the reference of the remote virtual network address space. + * + * @return the remoteAddressSpace value + */ + public AddressSpace remoteAddressSpace() { + return this.remoteAddressSpace; + } + + /** + * Set the reference of the remote virtual network address space. + * + * @param remoteAddressSpace the remoteAddressSpace value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.remoteAddressSpace = remoteAddressSpace; + return this; + } + + /** + * Get the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @return the peeringState value + */ + public VirtualNetworkPeeringState peeringState() { + return this.peeringState; + } + + /** + * Set the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @param peeringState the peeringState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { + this.peeringState = peeringState; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsImpl.java new file mode 100644 index 0000000000000..b81ba724f3b8e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeering; + +class VirtualNetworkPeeringsImpl extends WrapperImpl implements VirtualNetworkPeerings { + private final NetworkManager manager; + + VirtualNetworkPeeringsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkPeeringImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkPeeringImpl wrapModel(VirtualNetworkPeeringInner inner) { + return new VirtualNetworkPeeringImpl(inner, manager()); + } + + private VirtualNetworkPeeringImpl wrapModel(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsInner.java new file mode 100644 index 0000000000000..ab501befc9087 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkPeerings. + */ +public class VirtualNetworkPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapImpl.java new file mode 100644 index 0000000000000..cd7c773a7e160 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTap; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_08_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.NetworkInterfaceTapConfiguration; + +class VirtualNetworkTapImpl extends GroupableResourceCoreImpl implements VirtualNetworkTap, VirtualNetworkTap.Definition, VirtualNetworkTap.Update { + VirtualNetworkTapImpl(String name, VirtualNetworkTapInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration() { + FrontendIPConfigurationInner inner = this.inner().destinationLoadBalancerFrontEndIPConfiguration(); + if (inner != null) { + return new FrontendIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().destinationNetworkInterfaceIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer destinationPort() { + return this.inner().destinationPort(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaceTapConfigurations() { + List lst = new ArrayList(); + if (this.inner().networkInterfaceTapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().networkInterfaceTapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkTapImpl withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration) { + this.inner().withDestinationLoadBalancerFrontEndIPConfiguration(destinationLoadBalancerFrontEndIPConfiguration); + return this; + } + + @Override + public VirtualNetworkTapImpl withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration) { + this.inner().withDestinationNetworkInterfaceIPConfiguration(destinationNetworkInterfaceIPConfiguration); + return this; + } + + @Override + public VirtualNetworkTapImpl withDestinationPort(Integer destinationPort) { + this.inner().withDestinationPort(destinationPort); + return this; + } + + @Override + public VirtualNetworkTapImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapInner.java new file mode 100644 index 0000000000000..680e92553ed5e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapInner.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network Tap resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkTapInner extends Resource { + /** + * Specifies the list of resource IDs for the network interface IP + * configuration that needs to be tapped. + */ + @JsonProperty(value = "properties.networkInterfaceTapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaceTapConfigurations; + + /** + * The resourceGuid property of the virtual network tap. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the virtual network tap. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The reference to the private IP Address of the collector nic that will + * receive the tap. + */ + @JsonProperty(value = "properties.destinationNetworkInterfaceIPConfiguration") + private NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration; + + /** + * The reference to the private IP address on the internal Load Balancer + * that will receive the tap. + */ + @JsonProperty(value = "properties.destinationLoadBalancerFrontEndIPConfiguration") + private FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration; + + /** + * The VXLAN destination port that will receive the tapped traffic. + */ + @JsonProperty(value = "properties.destinationPort") + private Integer destinationPort; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. + * + * @return the networkInterfaceTapConfigurations value + */ + public List networkInterfaceTapConfigurations() { + return this.networkInterfaceTapConfigurations; + } + + /** + * Get the resourceGuid property of the virtual network tap. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the virtual network tap. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the reference to the private IP Address of the collector nic that will receive the tap. + * + * @return the destinationNetworkInterfaceIPConfiguration value + */ + public NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration() { + return this.destinationNetworkInterfaceIPConfiguration; + } + + /** + * Set the reference to the private IP Address of the collector nic that will receive the tap. + * + * @param destinationNetworkInterfaceIPConfiguration the destinationNetworkInterfaceIPConfiguration value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration) { + this.destinationNetworkInterfaceIPConfiguration = destinationNetworkInterfaceIPConfiguration; + return this; + } + + /** + * Get the reference to the private IP address on the internal Load Balancer that will receive the tap. + * + * @return the destinationLoadBalancerFrontEndIPConfiguration value + */ + public FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration() { + return this.destinationLoadBalancerFrontEndIPConfiguration; + } + + /** + * Set the reference to the private IP address on the internal Load Balancer that will receive the tap. + * + * @param destinationLoadBalancerFrontEndIPConfiguration the destinationLoadBalancerFrontEndIPConfiguration value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration) { + this.destinationLoadBalancerFrontEndIPConfiguration = destinationLoadBalancerFrontEndIPConfiguration; + return this; + } + + /** + * Get the VXLAN destination port that will receive the tapped traffic. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the VXLAN destination port that will receive the tapped traffic. + * + * @param destinationPort the destinationPort value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsImpl.java new file mode 100644 index 0000000000000..10712ace61f9e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTap; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualNetworkTapsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkTaps { + protected VirtualNetworkTapsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkTaps(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkTapsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkTapsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkTapsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkTapsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkTap call(VirtualNetworkTapInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworkTapsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworkTapsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkTap call(VirtualNetworkTapInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkTapImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualNetworkTapImpl wrapModel(VirtualNetworkTapInner inner) { + return new VirtualNetworkTapImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkTapImpl wrapModel(String name) { + return new VirtualNetworkTapImpl(name, new VirtualNetworkTapInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java new file mode 100644 index 0000000000000..44c0c820fc404 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkTaps. + */ +public class VirtualNetworkTapsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkTapsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkTapsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkTapsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkTapsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkTaps to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkTapsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkTapInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkTapInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject tapParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject tapParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkTaps listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String tapName) { + deleteWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String tapName) { + return deleteWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String tapName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String tapName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String tapName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters), serviceCallback); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, tapName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginCreateOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters), serviceCallback); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, tapName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().last().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String tapName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).toBlocking().last().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String tapName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String tapName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String tapName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String tapName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).toBlocking().single().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String tapName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String tapName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String tapName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..5fb5734bbadaf --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkUsageName; + +class VirtualNetworkUsageImpl extends WrapperImpl implements VirtualNetworkUsage { + private final NetworkManager manager; + + VirtualNetworkUsageImpl(VirtualNetworkUsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public VirtualNetworkUsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageInner.java new file mode 100644 index 0000000000000..2f97a51430a14 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkUsageInner.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage details for subnet. + */ +public class VirtualNetworkUsageInner { + /** + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /** + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /** + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get indicates number of IPs used from the Subnet. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get subnet identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get indicates the size of the subnet. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name containing common and localized value for usage. + * + * @return the name value + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get usage units. Returns 'Count'. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..892cf29051c2b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetwork; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.IPAddressAvailabilityResult; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkUsage; + +class VirtualNetworksImpl extends GroupableResourcesCoreImpl implements VirtualNetworks { + protected VirtualNetworksImpl(NetworkManager manager) { + super(manager.inner().virtualNetworks(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworksInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + VirtualNetworksInner client = this.inner(); + return client.checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress) + .map(new Func1() { + @Override + public IPAddressAvailabilityResult call(IPAddressAvailabilityResultInner inner) { + return new IPAddressAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkImpl wrapModel(VirtualNetworkInner inner) { + return new VirtualNetworkImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkImpl wrapModel(String name) { + return new VirtualNetworkImpl(name, new VirtualNetworkInner(), this.manager()); + } + + private VirtualNetworkUsageImpl wrapVirtualNetworkUsageModel(VirtualNetworkUsageInner inner) { + return new VirtualNetworkUsageImpl(inner, manager()); + } + + @Override + public Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.listUsageAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkUsage call(VirtualNetworkUsageInner inner) { + return wrapVirtualNetworkUsageModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksInner.java new file mode 100644 index 0000000000000..18abed6210aa8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworksInner.java @@ -0,0 +1,1690 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworks. + */ +public class VirtualNetworksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks checkIPAddressAvailability" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + Observable> checkIPAddressAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("ipAddress") String ipAddress, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks listUsage" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages") + Observable> listUsage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualNetworks listUsageNext" }) + @GET + Observable> listUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single().body(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (ipAddress == null) { + throw new IllegalArgumentException("Parameter ipAddress is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkIPAddressAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsage(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listUsageSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listUsage(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsageNext(final String nextPageLink) { + ServiceResponse> response = listUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageNextAsync(final String nextPageLink) { + return listUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANImpl.java new file mode 100644 index 0000000000000..b11f354250e33 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualWAN; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.OfficeTrafficCategory; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.P2SVpnServerConfiguration; + +class VirtualWANImpl extends GroupableResourceCoreImpl implements VirtualWAN, VirtualWAN.Definition, VirtualWAN.Update { + VirtualWANImpl(String name, VirtualWANInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowBranchToBranchTraffic() { + return this.inner().allowBranchToBranchTraffic(); + } + + @Override + public Boolean allowVnetToVnetTraffic() { + return this.inner().allowVnetToVnetTraffic(); + } + + @Override + public Boolean disableVpnEncryption() { + return this.inner().disableVpnEncryption(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.inner().office365LocalBreakoutCategory(); + } + + @Override + public List p2SVpnServerConfigurations() { + List lst = new ArrayList(); + if (this.inner().p2SVpnServerConfigurations() != null) { + for (P2SVpnServerConfigurationInner inner : this.inner().p2SVpnServerConfigurations()) { + lst.add( new P2SVpnServerConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String securityProviderName() { + return this.inner().securityProviderName(); + } + + @Override + public List virtualHubs() { + return this.inner().virtualHubs(); + } + + @Override + public List vpnSites() { + return this.inner().vpnSites(); + } + + @Override + public VirtualWANImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.inner().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + @Override + public VirtualWANImpl withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.inner().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); + return this; + } + + @Override + public VirtualWANImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.inner().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + @Override + public VirtualWANImpl withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory) { + this.inner().withOffice365LocalBreakoutCategory(office365LocalBreakoutCategory); + return this; + } + + @Override + public VirtualWANImpl withP2SVpnServerConfigurations(List p2SVpnServerConfigurations) { + this.inner().withP2SVpnServerConfigurations(p2SVpnServerConfigurations); + return this; + } + + @Override + public VirtualWANImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualWANImpl withSecurityProviderName(String securityProviderName) { + this.inner().withSecurityProviderName(securityProviderName); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANInner.java new file mode 100644 index 0000000000000..f71769bf24397 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWANInner.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.OfficeTrafficCategory; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualWAN Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualWANInner extends Resource { + /** + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "properties.disableVpnEncryption") + private Boolean disableVpnEncryption; + + /** + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "properties.virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /** + * The vpnSites property. + */ + @JsonProperty(value = "properties.vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /** + * The Security Provider name. + */ + @JsonProperty(value = "properties.securityProviderName") + private String securityProviderName; + + /** + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "properties.allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /** + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "properties.allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /** + * The office local breakout category. Possible values include: 'Optimize', + * 'OptimizeAndAllow', 'All', 'None'. + */ + @JsonProperty(value = "properties.office365LocalBreakoutCategory") + private OfficeTrafficCategory office365LocalBreakoutCategory; + + /** + * list of all P2SVpnServerConfigurations associated with the virtual wan. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigurations") + private List p2SVpnServerConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value + */ + public Boolean disableVpnEncryption() { + return this.disableVpnEncryption; + } + + /** + * Set vpn encryption to be disabled or not. + * + * @param disableVpnEncryption the disableVpnEncryption value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.disableVpnEncryption = disableVpnEncryption; + return this; + } + + /** + * Get list of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value + */ + public List virtualHubs() { + return this.virtualHubs; + } + + /** + * Get the vpnSites value. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Get the Security Provider name. + * + * @return the securityProviderName value + */ + public String securityProviderName() { + return this.securityProviderName; + } + + /** + * Set the Security Provider name. + * + * @param securityProviderName the securityProviderName value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withSecurityProviderName(String securityProviderName) { + this.securityProviderName = securityProviderName; + return this; + } + + /** + * Get true if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set true if branch to branch traffic is allowed. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get true if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value + */ + public Boolean allowVnetToVnetTraffic() { + return this.allowVnetToVnetTraffic; + } + + /** + * Set true if Vnet to Vnet traffic is allowed. + * + * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; + return this; + } + + /** + * Get the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None'. + * + * @return the office365LocalBreakoutCategory value + */ + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.office365LocalBreakoutCategory; + } + + /** + * Set the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None'. + * + * @param office365LocalBreakoutCategory the office365LocalBreakoutCategory value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory) { + this.office365LocalBreakoutCategory = office365LocalBreakoutCategory; + return this; + } + + /** + * Get list of all P2SVpnServerConfigurations associated with the virtual wan. + * + * @return the p2SVpnServerConfigurations value + */ + public List p2SVpnServerConfigurations() { + return this.p2SVpnServerConfigurations; + } + + /** + * Set list of all P2SVpnServerConfigurations associated with the virtual wan. + * + * @param p2SVpnServerConfigurations the p2SVpnServerConfigurations value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withP2SVpnServerConfigurations(List p2SVpnServerConfigurations) { + this.p2SVpnServerConfigurations = p2SVpnServerConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWanSecurityProvidersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWanSecurityProvidersInner.java new file mode 100644 index 0000000000000..a4b99e534d1df --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWanSecurityProvidersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.VirtualWanSecurityProvider; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Collection of SecurityProviders. + */ +public class VirtualWanSecurityProvidersInner { + /** + * The supportedProviders property. + */ + @JsonProperty(value = "supportedProviders") + private List supportedProviders; + + /** + * Get the supportedProviders value. + * + * @return the supportedProviders value + */ + public List supportedProviders() { + return this.supportedProviders; + } + + /** + * Set the supportedProviders value. + * + * @param supportedProviders the supportedProviders value to set + * @return the VirtualWanSecurityProvidersInner object itself. + */ + public VirtualWanSecurityProvidersInner withSupportedProviders(List supportedProviders) { + this.supportedProviders = supportedProviders; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansImpl.java new file mode 100644 index 0000000000000..33690fde09806 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VirtualWans; +import com.microsoft.azure.management.network.v2018_08_01.VirtualWAN; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualWansImpl extends GroupableResourcesCoreImpl implements VirtualWans { + protected VirtualWansImpl(NetworkManager manager) { + super(manager.inner().virtualWans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualWansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualWansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualWansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualWansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualWansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualWansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualWANImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualWANImpl wrapModel(VirtualWANInner inner) { + return new VirtualWANImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualWANImpl wrapModel(String name) { + return new VirtualWANImpl(name, new VirtualWANInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansInner.java new file mode 100644 index 0000000000000..05f78e3a98e52 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualWansInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualWans. + */ +public class VirtualWansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualWansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualWansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualWansService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualWans to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualWansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VirtualWans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(resourceGroupName, virtualWANName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner createOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginCreateOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualWANName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWANName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWANName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWANName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..3040157848049 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VpnClientIPsecParameters; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.DhGroup; +import com.microsoft.azure.management.network.v2018_08_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_08_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_08_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_08_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_08_01.PfsGroup; + +class VpnClientIPsecParametersImpl extends WrapperImpl implements VpnClientIPsecParameters { + private final NetworkManager manager; + VpnClientIPsecParametersImpl(VpnClientIPsecParametersInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DhGroup dhGroup() { + return this.inner().dhGroup(); + } + + @Override + public IkeEncryption ikeEncryption() { + return this.inner().ikeEncryption(); + } + + @Override + public IkeIntegrity ikeIntegrity() { + return this.inner().ikeIntegrity(); + } + + @Override + public IpsecEncryption ipsecEncryption() { + return this.inner().ipsecEncryption(); + } + + @Override + public IpsecIntegrity ipsecIntegrity() { + return this.inner().ipsecIntegrity(); + } + + @Override + public PfsGroup pfsGroup() { + return this.inner().pfsGroup(); + } + + @Override + public int saDataSizeKilobytes() { + return this.inner().saDataSizeKilobytes(); + } + + @Override + public int saLifeTimeSeconds() { + return this.inner().saLifeTimeSeconds(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersInner.java new file mode 100644 index 0000000000000..b49d0d8876dc0 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnClientIPsecParametersInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_08_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_08_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_08_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_08_01.DhGroup; +import com.microsoft.azure.management.network.v2018_08_01.PfsGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + */ +public class VpnClientIPsecParametersInner { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..374f2604b6057 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionImpl.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VpnConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnectionStatus; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; + +class VpnConnectionImpl extends CreatableUpdatableImpl implements VpnConnection, VpnConnection.Definition, VpnConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String gatewayName; + private String connectionName; + + VpnConnectionImpl(String name, NetworkManager manager) { + super(name, new VpnConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + VpnConnectionImpl(VpnConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.gatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.getAsync(this.resourceGroupName, this.gatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer connectionBandwidth() { + return this.inner().connectionBandwidth(); + } + + @Override + public VpnConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public Boolean enableInternetSecurity() { + return this.inner().enableInternetSecurity(); + } + + @Override + public Boolean enableRateLimiting() { + return this.inner().enableRateLimiting(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVpnSite() { + return this.inner().remoteVpnSite(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.inner().vpnConnectionProtocolType(); + } + + @Override + public VpnConnectionImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + @Override + public VpnConnectionImpl withConnectionBandwidth(Integer connectionBandwidth) { + this.inner().withConnectionBandwidth(connectionBandwidth); + return this; + } + + @Override + public VpnConnectionImpl withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.inner().withConnectionStatus(connectionStatus); + return this; + } + + @Override + public VpnConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VpnConnectionImpl withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.inner().withEnableInternetSecurity(enableInternetSecurity); + return this; + } + + @Override + public VpnConnectionImpl withEnableRateLimiting(Boolean enableRateLimiting) { + this.inner().withEnableRateLimiting(enableRateLimiting); + return this; + } + + @Override + public VpnConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VpnConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VpnConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VpnConnectionImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnConnectionImpl withRemoteVpnSite(SubResource remoteVpnSite) { + this.inner().withRemoteVpnSite(remoteVpnSite); + return this; + } + + @Override + public VpnConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VpnConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VpnConnectionImpl withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.inner().withVpnConnectionProtocolType(vpnConnectionProtocolType); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionInner.java new file mode 100644 index 0000000000000..12aaaddc94378 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionInner.java @@ -0,0 +1,387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnectionStatus; +import com.microsoft.azure.management.network.v2018_08_01.VirtualNetworkGatewayConnectionProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * VpnConnection Resource. + */ +@JsonFlatten +public class VpnConnectionInner extends SubResource { + /** + * Id of the connected vpn site. + */ + @JsonProperty(value = "properties.remoteVpnSite") + private SubResource remoteVpnSite; + + /** + * routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The connection status. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus") + private VpnConnectionStatus connectionStatus; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /** + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidth") + private Integer connectionBandwidth; + + /** + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableRateLimiting") + private Boolean enableRateLimiting; + + /** + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get id of the connected vpn site. + * + * @return the remoteVpnSite value + */ + public SubResource remoteVpnSite() { + return this.remoteVpnSite; + } + + /** + * Set id of the connected vpn site. + * + * @param remoteVpnSite the remoteVpnSite value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { + this.remoteVpnSite = remoteVpnSite; + return this; + } + + /** + * Get routing weight for vpn connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Set the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @param connectionStatus the connectionStatus value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.connectionStatus = connectionStatus; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the vpnConnectionProtocolType value + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.vpnConnectionProtocolType; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.vpnConnectionProtocolType = vpnConnectionProtocolType; + return this; + } + + /** + * Get ingress bytes transferred. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get egress bytes transferred. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get expected bandwidth in MBPS. + * + * @return the connectionBandwidth value + */ + public Integer connectionBandwidth() { + return this.connectionBandwidth; + } + + /** + * Set expected bandwidth in MBPS. + * + * @param connectionBandwidth the connectionBandwidth value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionBandwidth(Integer connectionBandwidth) { + this.connectionBandwidth = connectionBandwidth; + return this; + } + + /** + * Get sharedKey for the vpn connection. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set sharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableRateLimiting value + */ + public Boolean enableRateLimiting() { + return this.enableRateLimiting; + } + + /** + * Set enableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + this.enableRateLimiting = enableRateLimiting; + return this; + } + + /** + * Get enable internet security. + * + * @return the enableInternetSecurity value + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsImpl.java new file mode 100644 index 0000000000000..adbbc625c2808 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnection; + +class VpnConnectionsImpl extends WrapperImpl implements VpnConnections { + private final NetworkManager manager; + + VpnConnectionsImpl(NetworkManager manager) { + super(manager.inner().vpnConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VpnConnectionImpl define(String name) { + return wrapModel(name); + } + + private VpnConnectionImpl wrapModel(VpnConnectionInner inner) { + return new VpnConnectionImpl(inner, manager()); + } + + private VpnConnectionImpl wrapModel(String name) { + return new VpnConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + VpnConnectionsInner client = this.inner(); + return client.listByVpnGatewayAsync(resourceGroupName, gatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, gatewayName, connectionName) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, gatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsInner.java new file mode 100644 index 0000000000000..6888f54ca86fb --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnConnectionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnConnections. + */ +public class VpnConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private VpnConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections listByVpnGateway" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") + Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnConnections listByVpnGatewayNext" }) + @GET + Observable> listByVpnGatewayNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGateway(final String resourceGroupName, final String gatewayName) { + ServiceResponse> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + ServiceResponse> * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGatewayNext(final String nextPageLink) { + ServiceResponse> response = listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewayNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayNextAsync(final String nextPageLink) { + return listByVpnGatewayNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayNextWithServiceResponseAsync(final String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewayNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVpnGatewayNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..f10d948a4fc86 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_08_01.VpnConnection; + +class VpnGatewayImpl extends GroupableResourceCoreImpl implements VpnGateway, VpnGateway.Definition, VpnGateway.Update { + VpnGatewayImpl(String name, VpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (VpnConnectionInner inner : this.inner().connections()) { + lst.add( new VpnConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public Integer vpnGatewayScaleUnit() { + return this.inner().vpnGatewayScaleUnit(); + } + + @Override + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VpnGatewayImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public VpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public VpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.inner().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayInner.java new file mode 100644 index 0000000000000..3074adba6b3d8 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewayInner.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * list of all vpn connections to the gateway. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The scale unit for this vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get list of all vpn connections to the gateway. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set list of all vpn connections to the gateway. + * + * @param connections the connections value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the scale unit for this vpn gateway. + * + * @return the vpnGatewayScaleUnit value + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the scale unit for this vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysImpl.java new file mode 100644 index 0000000000000..6442d7bac185e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_08_01.VpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnGatewaysImpl extends GroupableResourcesCoreImpl implements VpnGateways { + protected VpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().vpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnGatewayImpl wrapModel(VpnGatewayInner inner) { + return new VpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnGatewayImpl wrapModel(String name) { + return new VpnGatewayImpl(name, new VpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java new file mode 100644 index 0000000000000..40f65f7db48ae --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnGateways. + */ +public class VpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().last().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().single().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseImpl.java new file mode 100644 index 0000000000000..b2d05abcde7c3 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.management.network.v2018_08_01.VpnProfileResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class VpnProfileResponseImpl extends WrapperImpl implements VpnProfileResponse { + private final NetworkManager manager; + VpnProfileResponseImpl(VpnProfileResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String profileUrl() { + return this.inner().profileUrl(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseInner.java new file mode 100644 index 0000000000000..84c0c95444b8b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnProfileResponseInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Profile Response for package generation. + */ +public class VpnProfileResponseInner { + /** + * URL to the VPN profile. + */ + @JsonProperty(value = "profileUrl") + private String profileUrl; + + /** + * Get uRL to the VPN profile. + * + * @return the profileUrl value + */ + public String profileUrl() { + return this.profileUrl; + } + + /** + * Set uRL to the VPN profile. + * + * @param profileUrl the profileUrl value to set + * @return the VpnProfileResponseInner object itself. + */ + public VpnProfileResponseInner withProfileUrl(String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..36fb86dcd80b1 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteImpl.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnSite; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; + +class VpnSiteImpl extends GroupableResourceCoreImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + VpnSiteImpl(String name, VpnSiteInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public BgpSettings bgpProperties() { + return this.inner().bgpProperties(); + } + + @Override + public DeviceProperties deviceProperties() { + return this.inner().deviceProperties(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public Boolean isSecuritySite() { + return this.inner().isSecuritySite(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String siteKey() { + return this.inner().siteKey(); + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.inner().withBgpProperties(bgpProperties); + return this; + } + + @Override + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.inner().withDeviceProperties(deviceProperties); + return this; + } + + @Override + public VpnSiteImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public VpnSiteImpl withIsSecuritySite(Boolean isSecuritySite) { + this.inner().withIsSecuritySite(isSecuritySite); + return this; + } + + @Override + public VpnSiteImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnSiteImpl withSiteKey(String siteKey) { + this.inner().withSiteKey(siteKey); + return this; + } + + @Override + public VpnSiteImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteInner.java new file mode 100644 index 0000000000000..e8158bf847ad6 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSiteInner.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_08_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_08_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_08_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_08_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnSite Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnSiteInner extends Resource { + /** + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * The device properties. + */ + @JsonProperty(value = "properties.deviceProperties") + private DeviceProperties deviceProperties; + + /** + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "properties.siteKey") + private String siteKey; + + /** + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private BgpSettings bgpProperties; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * IsSecuritySite flag. + */ + @JsonProperty(value = "properties.isSecuritySite") + private Boolean isSecuritySite; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the vpnSite belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the device properties. + * + * @return the deviceProperties value + */ + public DeviceProperties deviceProperties() { + return this.deviceProperties; + } + + /** + * Set the device properties. + * + * @param deviceProperties the deviceProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { + this.deviceProperties = deviceProperties; + return this; + } + + /** + * Get the ip-address for the vpn-site. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ip-address for the vpn-site. + * + * @param ipAddress the ipAddress value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the key for vpn-site that can be used for connections. + * + * @return the siteKey value + */ + public String siteKey() { + return this.siteKey; + } + + /** + * Set the key for vpn-site that can be used for connections. + * + * @param siteKey the siteKey value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withSiteKey(String siteKey) { + this.siteKey = siteKey; + return this; + } + + /** + * Get the AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges. + * + * @param addressSpace the addressSpace value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the set of bgp properties. + * + * @return the bgpProperties value + */ + public BgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get isSecuritySite flag. + * + * @return the isSecuritySite value + */ + public Boolean isSecuritySite() { + return this.isSecuritySite; + } + + /** + * Set isSecuritySite flag. + * + * @param isSecuritySite the isSecuritySite value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIsSecuritySite(Boolean isSecuritySite) { + this.isSecuritySite = isSecuritySite; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsImpl.java new file mode 100644 index 0000000000000..67b4a6505c7ba --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnSitesConfigurations; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_08_01.GetVpnSitesConfigurationRequest; + +class VpnSitesConfigurationsImpl extends WrapperImpl implements VpnSitesConfigurations { + private final NetworkManager manager; + + VpnSitesConfigurationsImpl(NetworkManager manager) { + super(manager.inner().vpnSitesConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + VpnSitesConfigurationsInner client = this.inner(); + return client.downloadAsync(resourceGroupName, virtualWANName, request).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsInner.java new file mode 100644 index 0000000000000..a15fe6ce76ee9 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesConfigurationsInner.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.GetVpnSitesConfigurationRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSitesConfigurations. + */ +public class VpnSitesConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private VpnSitesConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSitesConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSitesConfigurations download" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> download(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSitesConfigurations beginDownload" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> beginDownload(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void download(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().last().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-08-01"; + Observable> observable = service.download(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDownload(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().single().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDownloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-08-01"; + return service.beginDownload(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDownloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDownloadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesImpl.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesImpl.java new file mode 100644 index 0000000000000..950b8d357636b --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_08_01.VpnSites; +import com.microsoft.azure.management.network.v2018_08_01.VpnSite; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnSitesImpl extends GroupableResourcesCoreImpl implements VpnSites { + protected VpnSitesImpl(NetworkManager manager) { + super(manager.inner().vpnSites(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnSitesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnSitesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnSiteImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnSiteImpl wrapModel(VpnSiteInner inner) { + return new VpnSiteImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnSiteImpl wrapModel(String name) { + return new VpnSiteImpl(name, new VpnSiteInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java new file mode 100644 index 0000000000000..ee299b055c803 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_08_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_08_01.ErrorException; +import com.microsoft.azure.management.network.v2018_08_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSites. + */ +public class VpnSitesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnSitesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSites to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_08_01.VpnSites listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().last().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-08-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vpnSiteName) { + deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vpnSiteName) { + return deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vpnSiteName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vpnSiteName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-08-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/package-info.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/package-info.java new file mode 100644 index 0000000000000..524f03d55e84e --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_08_01.implementation; diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/package-info.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/package-info.java new file mode 100644 index 0000000000000..d5a73055bbb50 --- /dev/null +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_08_01; diff --git a/notificationhubs/resource-manager/v2014_09_01/pom.xml b/notificationhubs/resource-manager/v2014_09_01/pom.xml new file mode 100644 index 0000000000000..24005998f5c72 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2014_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.java new file mode 100644 index 0000000000000..3cf387036ceee --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.java new file mode 100644 index 0000000000000..9672a9383e52c --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub AdmCredential. + */ +public class AdmCredential { + /** + * Gets or sets properties of NotificationHub AdmCredential. + */ + @JsonProperty(value = "properties") + private AdmCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub AdmCredential. + * + * @return the properties value + */ + public AdmCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub AdmCredential. + * + * @param properties the properties value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withProperties(AdmCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.java new file mode 100644 index 0000000000000..bb3eb206ed1bd --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub AdmCredential. + */ +public class AdmCredentialProperties { + /** + * Gets or sets the client identifier. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Gets or sets the credential secret access key. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Gets or sets the URL of the authorization token. + */ + @JsonProperty(value = "authTokenUrl") + private String authTokenUrl; + + /** + * Get gets or sets the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set gets or sets the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get gets or sets the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set gets or sets the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get gets or sets the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set gets or sets the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.java new file mode 100644 index 0000000000000..67a401b73d44e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub ApnsCredential. + */ +public class ApnsCredential { + /** + * Gets or sets properties of NotificationHub ApnsCredential. + */ + @JsonProperty(value = "properties") + private ApnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub ApnsCredential. + * + * @return the properties value + */ + public ApnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub ApnsCredential. + * + * @param properties the properties value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withProperties(ApnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java new file mode 100644 index 0000000000000..61ccd2a8508c1 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub ApnsCredential. + */ +public class ApnsCredentialProperties { + /** + * Gets or sets the APNS certificate. + */ + @JsonProperty(value = "apnsCertificate") + private String apnsCertificate; + + /** + * Gets or sets the certificate key. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /** + * Gets or sets the endpoint of this credential. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** + * Gets or sets the Apns certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get gets or sets the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set gets or sets the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get gets or sets the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set gets or sets the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get gets or sets the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set gets or sets the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get gets or sets the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set gets or sets the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.java new file mode 100644 index 0000000000000..dd747f014dec0 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BaiduCredential. + */ +public class BaiduCredential { + /** + * Gets or sets properties of NotificationHub BaiduCredential. + */ + @JsonProperty(value = "properties") + private BaiduCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub BaiduCredential. + * + * @return the properties value + */ + public BaiduCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub BaiduCredential. + * + * @param properties the properties value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withProperties(BaiduCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.java new file mode 100644 index 0000000000000..04b7933d289ae --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BaiduCredential. + */ +public class BaiduCredentialProperties { + /** + * Get or Set Baidu Api Key. + */ + @JsonProperty(value = "baiduApiKey") + private String baiduApiKey; + + /** + * Get or Set Baidu Endpoint. + */ + @JsonProperty(value = "baiduEndPoint") + private String baiduEndPoint; + + /** + * Get or Set Baidu Secret Key. + */ + @JsonProperty(value = "baiduSecretKey") + private String baiduSecretKey; + + /** + * Get get or Set Baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set get or Set Baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get get or Set Baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set get or Set Baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get get or Set Baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set get or Set Baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java new file mode 100644 index 0000000000000..a96f93d355e05 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Gets or sets name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Gets or sets location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets true if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get gets or sets name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java new file mode 100644 index 0000000000000..9fb5c9dc88d80 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.CheckAvailabilityResourceInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResource. + */ +public interface CheckAvailabilityResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.java new file mode 100644 index 0000000000000..f6b4baf4435fa --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub GcmCredential. + */ +public class GcmCredential { + /** + * Gets or sets properties of NotificationHub GcmCredential. + */ + @JsonProperty(value = "properties") + private GcmCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub GcmCredential. + * + * @return the properties value + */ + public GcmCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub GcmCredential. + * + * @param properties the properties value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withProperties(GcmCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.java new file mode 100644 index 0000000000000..faf96e801e54e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub GcmCredential. + */ +public class GcmCredentialProperties { + /** + * Gets or sets the GCM endpoint. + */ + @JsonProperty(value = "gcmEndpoint") + private String gcmEndpoint; + + /** + * Gets or sets the Google API key. + */ + @JsonProperty(value = "googleApiKey") + private String googleApiKey; + + /** + * Get gets or sets the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set gets or sets the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredentialProperties object itself. + */ + public GcmCredentialProperties withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get gets or sets the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set gets or sets the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredentialProperties object itself. + */ + public GcmCredentialProperties withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.java new file mode 100644 index 0000000000000..855b68706fbf1 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub MpnsCredential. + */ +public class MpnsCredential { + /** + * Gets or sets properties of NotificationHub MpnsCredential. + */ + @JsonProperty(value = "properties") + private MpnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub MpnsCredential. + * + * @return the properties value + */ + public MpnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub MpnsCredential. + * + * @param properties the properties value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withProperties(MpnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.java new file mode 100644 index 0000000000000..ac9ba041730c5 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub MpnsCredential. + */ +public class MpnsCredentialProperties { + /** + * Gets or sets the MPNS certificate. + */ + @JsonProperty(value = "mpnsCertificate") + private String mpnsCertificate; + + /** + * Gets or sets the certificate key for this credential. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /** + * Gets or sets the Mpns certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get gets or sets the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set gets or sets the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get gets or sets the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set gets or sets the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get gets or sets the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set gets or sets the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..74ee50dea6ece --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +public class NamespaceCreateOrUpdateParameters { + /** + * Gets or sets Namespace data center location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets Namespace tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties", required = true) + private NamespaceProperties properties; + + /** + * Get gets or sets Namespace data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets Namespace data center location. + * + * @param location the location value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets Namespace tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets Namespace tags. + * + * @param tags the tags value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public NamespaceProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java new file mode 100644 index 0000000000000..fb5b7678e5e26 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace properties. + */ +public class NamespaceProperties { + /** + * The name of the namespace. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets provisioning state of the Namespace. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "critical") + private Boolean critical; + + /** + * Gets or sets the namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "namespaceType") + private NamespaceType namespaceType; + + /** + * Get the name of the namespace. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the namespace. + * + * @param name the name value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets or sets provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get gets or sets the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set gets or sets the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java new file mode 100644 index 0000000000000..6075117a26a6a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the properties value. + */ + NamespaceProperties properties(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace + * @return the next definition stage +*/ + WithCreate withProperties(NamespaceProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..d01429410fef1 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + SharedAccessAuthorizationRuleProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithProperties withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithName { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next update stage + */ + Update withName(String name); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.java new file mode 100644 index 0000000000000..91942daec48a7 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java new file mode 100644 index 0000000000000..d27f677325b39 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getLongRunningOperationStatusAsync(String operationStatusLink); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..1bc832efd273b --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +public class NotificationHubCreateOrUpdateParameters { + /** + * Gets or sets NotificationHub data center location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets NotificationHub tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the NotificationHub. + */ + @JsonProperty(value = "properties", required = true) + private NotificationHubProperties properties; + + /** + * Get gets or sets NotificationHub data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets NotificationHub data center location. + * + * @param location the location value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets NotificationHub tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets NotificationHub tags. + * + * @param tags the tags value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the NotificationHub. + * + * @return the properties value + */ + public NotificationHubProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the NotificationHub. + * + * @param properties the properties value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withProperties(NotificationHubProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..64787f72f1379 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + SharedAccessAuthorizationRuleProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithProperties withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithName { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next update stage + */ + Update withName(String name); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java new file mode 100644 index 0000000000000..7474d18991eb4 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * NotificationHub properties. + */ +public class NotificationHubProperties { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "baiduCredential") + private BaiduCredential baiduCredential; + + /** + * Get the NotificationHub name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the NotificationHub name. + * + * @param name the name value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.java new file mode 100644 index 0000000000000..3d7baf2d5ca89 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + NotificationHubProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets NotificationHub data center location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the NotificationHub + * @return the next definition stage + */ + WithCreate withProperties(NotificationHubProperties properties); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Gets or sets NotificationHub tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Gets or sets NotificationHub tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java new file mode 100644 index 0000000000000..79221672b9297 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java new file mode 100644 index 0000000000000..d30360757f2c6 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..5e3a4745f8c9f --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters { + /** + * Gets or sets Namespace data center location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets Name of the Namespace AuthorizationRule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get gets or sets Namespace data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets Namespace data center location. + * + * @param location the location value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets Name of the Namespace AuthorizationRule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets Name of the Namespace AuthorizationRule. + * + * @param name the name value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 0000000000000..cdb5a512d228e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The primary key that was used. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * The secondary key that was used. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * The name of the key that was used. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * The type of the claim. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /** + * The value of the claim. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * The time at which the authorization rule was created. + */ + @JsonProperty(value = "createdTime") + private DateTime createdTime; + + /** + * The most recent time the rule was updated. + */ + @JsonProperty(value = "modifiedTime") + private DateTime modifiedTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "revision") + private Integer revision; + + /** + * Get the primary key that was used. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primary key that was used. + * + * @param primaryKey the primaryKey value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondary key that was used. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondary key that was used. + * + * @param secondaryKey the secondaryKey value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the name of the key that was used. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of the key that was used. + * + * @param keyName the keyName value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the type of the claim. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Set the type of the claim. + * + * @param claimType the claimType value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withClaimType(String claimType) { + this.claimType = claimType; + return this; + } + + /** + * Get the value of the claim. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set the value of the claim. + * + * @param claimValue the claimValue value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get the time at which the authorization rule was created. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Set the time at which the authorization rule was created. + * + * @param createdTime the createdTime value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withCreatedTime(DateTime createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Get the most recent time the rule was updated. + * + * @return the modifiedTime value + */ + public DateTime modifiedTime() { + return this.modifiedTime; + } + + /** + * Set the most recent time the rule was updated. + * + * @param modifiedTime the modifiedTime value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withModifiedTime(DateTime modifiedTime) { + this.modifiedTime = modifiedTime; + return this; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + + /** + * Set the revision number for the rule. + * + * @param revision the revision value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRevision(Integer revision) { + this.revision = revision; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.java new file mode 100644 index 0000000000000..14085de58dc3a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub WnsCredential. + */ +public class WnsCredential { + /** + * Gets or sets properties of NotificationHub WnsCredential. + */ + @JsonProperty(value = "properties") + private WnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub WnsCredential. + * + * @return the properties value + */ + public WnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub WnsCredential. + * + * @param properties the properties value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withProperties(WnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.java new file mode 100644 index 0000000000000..74da872fe8372 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub WnsCredential. + */ +public class WnsCredentialProperties { + /** + * Gets or sets the package ID for this credential. + */ + @JsonProperty(value = "packageSid") + private String packageSid; + + /** + * Gets or sets the secret key. + */ + @JsonProperty(value = "secretKey") + private String secretKey; + + /** + * Gets or sets the Windows Live endpoint. + */ + @JsonProperty(value = "windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get gets or sets the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set gets or sets the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get gets or sets the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set gets or sets the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get gets or sets the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set gets or sets the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.java new file mode 100644 index 0000000000000..7ff3ca2035bf7 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CheckAvailabilityResourceImpl extends WrapperImpl implements CheckAvailabilityResource { + private final NotificationHubsManager manager; + CheckAvailabilityResourceImpl(CheckAvailabilityResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java new file mode 100644 index 0000000000000..dd2f0fef8dfdf --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a CheckAvailibility resource. + */ +public class CheckAvailabilityResourceInner { + /** + * Gets or sets the id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets true if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get gets or sets the id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id. + * + * @param id the id value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location. + * + * @param location the location value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name. + * + * @param name the name value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type. + * + * @param type the type value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..cd227e4b8e496 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 0000000000000..e6bb81a5611af --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceProperties; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createOrUpdateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new NamespaceCreateOrUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NamespaceCreateOrUpdateParameters(); + } + + @Override + public NamespaceProperties properties() { + return this.inner().properties(); + } + + @Override + public NamespaceResourceImpl withProperties(NamespaceProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java new file mode 100644 index 0000000000000..b0db44558b41e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceProperties; + +/** + * Description of a Namespace resource. + */ +public class NamespaceResourceInner extends Resource { + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties") + private NamespaceProperties properties; + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public NamespaceProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..443095e370311 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import java.util.Map; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SharedAccessAuthorizationRuleProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withName(String name) { + this.createOrUpdateParameter.withName(name); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..b04bc4b0e2869 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceResource; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable getLongRunningOperationStatusAsync(String operationStatusLink) { + NamespacesInner client = this.inner(); + return client.getLongRunningOperationStatusAsync(operationStatusLink).toCompletable(); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResource call(CheckAvailabilityResourceInner inner) { + return new CheckAvailabilityResourceImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java new file mode 100644 index 0000000000000..1e27ad6ba0ba0 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java @@ -0,0 +1,1685 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces getAuthorizationRule" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces getLongRunningOperationStatus" }) + @GET("{operationStatusLink}") + Observable> getLongRunningOperationStatus(@Path(value = "operationStatusLink", encoded = true) String operationStatusLink, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listAuthorizationRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResourceInner object if successful. + */ + public CheckAvailabilityResourceInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResourceInner>() { + @Override + public CheckAvailabilityResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLongRunningOperationStatus(String operationStatusLink) { + getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink).toBlocking().single().body(); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLongRunningOperationStatusAsync(String operationStatusLink, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink), serviceCallback); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLongRunningOperationStatusAsync(String operationStatusLink) { + return getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLongRunningOperationStatusWithServiceResponseAsync(String operationStatusLink) { + if (operationStatusLink == null) { + throw new IllegalArgumentException("Parameter operationStatusLink is required and cannot be null."); + } + return service.getLongRunningOperationStatus(operationStatusLink, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLongRunningOperationStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLongRunningOperationStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..9a04a081ba1d5 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import java.util.Map; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SharedAccessAuthorizationRuleProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withName(String name) { + this.createOrUpdateParameter.withName(name); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 0000000000000..0dc84a8af10b1 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubCreateOrUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubProperties; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NotificationHubProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubResourceImpl withProperties(NotificationHubProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 0000000000000..fc246a763944d --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub Resource. + */ +public class NotificationHubResourceInner { + /** + * Gets or sets the id of the created NotificationHub. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location of the NotificationHub. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name of the NotificationHub. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type of the NotificationHub. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags of the NotificationHub. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the NotificationHub. + */ + @JsonProperty(value = "properties") + private NotificationHubProperties properties; + + /** + * Get gets or sets the id of the created NotificationHub. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id of the created NotificationHub. + * + * @param id the id value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location of the NotificationHub. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location of the NotificationHub. + * + * @param location the location value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name of the NotificationHub. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name of the NotificationHub. + * + * @param name the name value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type of the NotificationHub. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type of the NotificationHub. + * + * @param type the type value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags of the NotificationHub. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags of the NotificationHub. + * + * @param tags the tags value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the NotificationHub. + * + * @return the properties value + */ + public NotificationHubProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the NotificationHub. + * + * @param properties the properties value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withProperties(NotificationHubProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java new file mode 100644 index 0000000000000..dfb5d7bda7647 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + @Override + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResource call(CheckAvailabilityResourceInner inner) { + return new CheckAvailabilityResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java new file mode 100644 index 0000000000000..69329930cee0e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java @@ -0,0 +1,1480 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs checkAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs getAuthorizationRule" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs listAuthorizationRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResourceInner object if successful. + */ + public CheckAvailabilityResourceInner checkAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResourceInner>() { + @Override + public CheckAvailabilityResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 0000000000000..bb3bd88f8bddb --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2014-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NotificationHubsManagementClient", "2014-09-01"); + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java new file mode 100644 index 0000000000000..521face7ea86e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..cf2c8c64f1e3c --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 0000000000000..02591f2d40dc1 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java new file mode 100644 index 0000000000000..ba20ce3600021 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * Gets or sets the primaryConnectionString of the created Namespace + * AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * Gets or sets the secondaryConnectionString of the created Namespace + * AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * Get gets or sets the primaryConnectionString of the created Namespace AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set gets or sets the primaryConnectionString of the created Namespace AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get gets or sets the secondaryConnectionString of the created Namespace AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set gets or sets the secondaryConnectionString of the created Namespace AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 0000000000000..904737bf46ada --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleResourceInner { + /** + * Gets or sets the id of the created Namespace AuthorizationRules. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties") + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get gets or sets the id of the created Namespace AuthorizationRules. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id of the created Namespace AuthorizationRules. + * + * @param id the id value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location of the Namespace AuthorizationRules. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location of the Namespace AuthorizationRules. + * + * @param location the location value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name of the Namespace AuthorizationRules. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name of the Namespace AuthorizationRules. + * + * @param name the name value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type of the Namespace AuthorizationRules. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type of the Namespace AuthorizationRules. + * + * @param type the type value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags of the Namespace AuthorizationRules. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags of the Namespace AuthorizationRules. + * + * @param tags the tags value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/package-info.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/package-info.java new file mode 100644 index 0000000000000..5b3327511b5ec --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/package-info.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/package-info.java new file mode 100644 index 0000000000000..6cc9380f223b8 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2014_09_01; diff --git a/notificationhubs/resource-manager/v2016_03_01/pom.xml b/notificationhubs/resource-manager/v2016_03_01/pom.xml new file mode 100644 index 0000000000000..859d4f3427c8d --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2016_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.java new file mode 100644 index 0000000000000..af2cca1145617 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java new file mode 100644 index 0000000000000..2d28c47ac8063 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub AdmCredential. + */ +@JsonFlatten +public class AdmCredential { + /** + * The client identifier. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /** + * The credential secret access key. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * The URL of the authorization token. + */ + @JsonProperty(value = "properties.authTokenUrl") + private String authTokenUrl; + + /** + * Get the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.java new file mode 100644 index 0000000000000..e33eab99d3520 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub ApnsCredential. + */ +@JsonFlatten +public class ApnsCredential { + /** + * The APNS certificate. + */ + @JsonProperty(value = "properties.apnsCertificate") + private String apnsCertificate; + + /** + * The certificate key. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The endpoint of this credential. + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /** + * The Apns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java new file mode 100644 index 0000000000000..0969ac14da561 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub BaiduCredential. + */ +@JsonFlatten +public class BaiduCredential { + /** + * Baidu Api Key. + */ + @JsonProperty(value = "properties.baiduApiKey") + private String baiduApiKey; + + /** + * Baidu Endpoint. + */ + @JsonProperty(value = "properties.baiduEndPoint") + private String baiduEndPoint; + + /** + * Baidu Secret Key. + */ + @JsonProperty(value = "properties.baiduSecretKey") + private String baiduSecretKey; + + /** + * Get baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java new file mode 100644 index 0000000000000..c1b1c76dcf863 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.java new file mode 100644 index 0000000000000..220afa297feb1 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.CheckAvailabilityResultInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResult. + */ +public interface CheckAvailabilityResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java new file mode 100644 index 0000000000000..343bf7a3781cd --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub GcmCredential. + */ +@JsonFlatten +public class GcmCredential { + /** + * The GCM endpoint. + */ + @JsonProperty(value = "properties.gcmEndpoint") + private String gcmEndpoint; + + /** + * The Google API key. + */ + @JsonProperty(value = "properties.googleApiKey") + private String googleApiKey; + + /** + * Get the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java new file mode 100644 index 0000000000000..a8e9119363762 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub MpnsCredential. + */ +@JsonFlatten +public class MpnsCredential { + /** + * The MPNS certificate. + */ + @JsonProperty(value = "properties.mpnsCertificate") + private String mpnsCertificate; + + /** + * The certificate key for this credential. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The Mpns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..fe6a1cbb5365b --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,339 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +@JsonFlatten +public class NamespaceCreateOrUpdateParameters extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceCreateOrUpdateParametersName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceCreateOrUpdateParametersName value + */ + public String namespaceCreateOrUpdateParametersName() { + return this.namespaceCreateOrUpdateParametersName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceCreateOrUpdateParametersName the namespaceCreateOrUpdateParametersName value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.namespaceCreateOrUpdateParametersName = namespaceCreateOrUpdateParametersName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java new file mode 100644 index 0000000000000..b4e64c1734668 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Patch Namespace operation. + */ +public class NamespacePatchParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java new file mode 100644 index 0000000000000..20fa7154eb7a0 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the critical value. + */ + Boolean critical(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the namespaceResourceName value. + */ + String namespaceResourceName(); + + /** + * @return the namespaceType value. + */ + NamespaceType namespaceType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the scaleUnit value. + */ + String scaleUnit(); + + /** + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify CreatedAt. + */ + interface WithCreatedAt { + /** + * Specifies createdAt. + * @param createdAt The time the namespace was created + * @return the next definition stage + */ + WithCreate withCreatedAt(DateTime createdAt); + } + + /** + * The stage of the namespaceresource definition allowing to specify Critical. + */ + interface WithCritical { + /** + * Specifies critical. + * @param critical Whether or not the namespace is set as Critical + * @return the next definition stage + */ + WithCreate withCritical(Boolean critical); + } + + /** + * The stage of the namespaceresource definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled Whether or not the namespace is currently enabled + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceCreateOrUpdateParametersName. + */ + interface WithNamespaceCreateOrUpdateParametersName { + /** + * Specifies namespaceCreateOrUpdateParametersName. + * @param namespaceCreateOrUpdateParametersName The name of the namespace + * @return the next definition stage + */ + WithCreate withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceType. + */ + interface WithNamespaceType { + /** + * Specifies namespaceType. + * @param namespaceType The namespace type. Possible values include: 'Messaging', 'NotificationHub' + * @return the next definition stage + */ + WithCreate withNamespaceType(NamespaceType namespaceType); + } + + /** + * The stage of the namespaceresource definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Namespace + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the namespaceresource definition allowing to specify ScaleUnit. + */ + interface WithScaleUnit { + /** + * Specifies scaleUnit. + * @param scaleUnit ScaleUnit where the namespace gets created + * @return the next definition stage + */ + WithCreate withScaleUnit(String scaleUnit); + } + + /** + * The stage of the namespaceresource definition allowing to specify ServiceBusEndpoint. + */ + interface WithServiceBusEndpoint { + /** + * Specifies serviceBusEndpoint. + * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations + * @return the next definition stage + */ + WithCreate withServiceBusEndpoint(String serviceBusEndpoint); + } + + /** + * The stage of the namespaceresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespaceresource definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting + * @return the next definition stage + */ + WithCreate withStatus(String status); + } + + /** + * The stage of the namespaceresource definition allowing to specify SubscriptionId. + */ + interface WithSubscriptionId { + /** + * Specifies subscriptionId. + * @param subscriptionId The Id of the Azure subscription associated with the namespace + * @return the next definition stage + */ + WithCreate withSubscriptionId(String subscriptionId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCreatedAt, DefinitionStages.WithCritical, DefinitionStages.WithEnabled, DefinitionStages.WithNamespaceCreateOrUpdateParametersName, DefinitionStages.WithNamespaceType, DefinitionStages.WithProvisioningState, DefinitionStages.WithScaleUnit, DefinitionStages.WithServiceBusEndpoint, DefinitionStages.WithSku, DefinitionStages.WithStatus, DefinitionStages.WithSubscriptionId { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespaceresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..5545186ed919c --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithSku, DefinitionStages.WithTags { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSku, UpdateStages.WithTags { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.java new file mode 100644 index 0000000000000..08b0e95efd66e --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java new file mode 100644 index 0000000000000..026bb60b6ba74 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import rx.Completable; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..fde1f42338421 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +@JsonFlatten +public class NotificationHubCreateOrUpdateParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubCreateOrUpdateParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubCreateOrUpdateParametersName value + */ + public String notificationHubCreateOrUpdateParametersName() { + return this.notificationHubCreateOrUpdateParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubCreateOrUpdateParametersName the notificationHubCreateOrUpdateParametersName value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.notificationHubCreateOrUpdateParametersName = notificationHubCreateOrUpdateParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..1b8fd8b7dc14a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithLocation withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithSku, DefinitionStages.WithTags { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSku, UpdateStages.WithTags { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java new file mode 100644 index 0000000000000..33c26b5a6136d --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java @@ -0,0 +1,426 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the authorizationRules value. + */ + List authorizationRules(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the notificationHubResourceName value. + */ + String notificationHubResourceName(); + + /** + * @return the registrationTtl value. + */ + String registrationTtl(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource definition allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next definition stage + */ + WithCreate withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next definition stage + */ + WithCreate withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the notificationhubresource definition allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withWnsCredential(WnsCredential wnsCredential); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAdmCredential, DefinitionStages.WithApnsCredential, DefinitionStages.WithAuthorizationRules, DefinitionStages.WithBaiduCredential, DefinitionStages.WithGcmCredential, DefinitionStages.WithMpnsCredential, DefinitionStages.WithNotificationHubCreateOrUpdateParametersName, DefinitionStages.WithRegistrationTtl, DefinitionStages.WithSku, DefinitionStages.WithTags, DefinitionStages.WithWnsCredential { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAdmCredential, UpdateStages.WithApnsCredential, UpdateStages.WithAuthorizationRules, UpdateStages.WithBaiduCredential, UpdateStages.WithGcmCredential, UpdateStages.WithMpnsCredential, UpdateStages.WithNotificationHubCreateOrUpdateParametersName, UpdateStages.WithRegistrationTtl, UpdateStages.WithSku, UpdateStages.WithTags, UpdateStages.WithWnsCredential { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next update stage + */ + Update withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next update stage + */ + Update withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource update allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next update stage + */ + Update withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next update stage + */ + Update withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next update stage + */ + Update withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource update allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next update stage + */ + Update withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the notificationhubresource update allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withWnsCredential(WnsCredential wnsCredential); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java new file mode 100644 index 0000000000000..6583d42136b10 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.java new file mode 100644 index 0000000000000..4ce71231cc1b5 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.PnsCredentialsResourceInner; +import java.util.Map; + +/** + * Type representing PnsCredentialsResource. + */ +public interface PnsCredentialsResource extends HasInner, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java new file mode 100644 index 0000000000000..70367b235729c --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Regenerate Keys. + */ +public class PolicykeyResource { + /** + * Name of the key that has to be regenerated for the + * Namespace/Notification Hub Authorization Rule. The value can be Primary + * Key/Secondary Key. + */ + @JsonProperty(value = "policyKey") + private String policyKey; + + /** + * Get name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @return the policyKey value + */ + public String policyKey() { + return this.policyKey; + } + + /** + * Set name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @param policyKey the policyKey value to set + * @return the PolicykeyResource object itself. + */ + public PolicykeyResource withPolicyKey(String policyKey) { + this.policyKey = policyKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java new file mode 100644 index 0000000000000..0f93caf21d5cf --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..91f8c40aade41 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters extends Resource { + /** + * Properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 0000000000000..9f241953cb9a5 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.java new file mode 100644 index 0000000000000..66bd4294d24b8 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku description for a namespace. + */ +public class Sku { + /** + * Name of the notification hub sku. Possible values include: 'Free', + * 'Basic', 'Standard'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The tier of particular sku. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The Sku size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The Sku Family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The capacity of the resource. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier of particular sku. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of particular sku. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the Sku size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the Sku size. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the Sku Family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the Sku Family. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity of the resource. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the resource. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.java new file mode 100644 index 0000000000000..5b81ec73258a2 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Free for SkuName. */ + public static final SkuName FREE = fromString("Free"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java new file mode 100644 index 0000000000000..d5e07d3aafabd --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub WnsCredential. + */ +@JsonFlatten +public class WnsCredential { + /** + * The package ID for this credential. + */ + @JsonProperty(value = "properties.packageSid") + private String packageSid; + + /** + * The secret key. + */ + @JsonProperty(value = "properties.secretKey") + private String secretKey; + + /** + * The Windows Live endpoint. + */ + @JsonProperty(value = "properties.windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java new file mode 100644 index 0000000000000..2f82b7fce8f3a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import java.util.Map; + +class CheckAvailabilityResultImpl extends WrapperImpl implements CheckAvailabilityResult { + private final NotificationHubsManager manager; + CheckAvailabilityResultImpl(CheckAvailabilityResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java new file mode 100644 index 0000000000000..979fed6832881 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Description of a CheckAvailibility resource. + */ +public class CheckAvailabilityResultInner extends Resource { + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..fcc80df147502 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 0000000000000..4a37d24faadeb --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceCreateOrUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createParameter; + private NamespacePatchParameters updateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean critical() { + return this.inner().critical(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String namespaceResourceName() { + return this.inner().namespaceResourceName(); + } + + @Override + public NamespaceType namespaceType() { + return this.inner().namespaceType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scaleUnit() { + return this.inner().scaleUnit(); + } + + @Override + public String serviceBusEndpoint() { + return this.inner().serviceBusEndpoint(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public NamespaceResourceImpl withCreatedAt(DateTime createdAt) { + this.createParameter.withCreatedAt(createdAt); + return this; + } + + @Override + public NamespaceResourceImpl withCritical(Boolean critical) { + this.createParameter.withCritical(critical); + return this; + } + + @Override + public NamespaceResourceImpl withEnabled(Boolean enabled) { + this.createParameter.withEnabled(enabled); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.createParameter.withNamespaceCreateOrUpdateParametersName(namespaceCreateOrUpdateParametersName); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { + this.createParameter.withNamespaceType(namespaceType); + return this; + } + + @Override + public NamespaceResourceImpl withProvisioningState(String provisioningState) { + this.createParameter.withProvisioningState(provisioningState); + return this; + } + + @Override + public NamespaceResourceImpl withScaleUnit(String scaleUnit) { + this.createParameter.withScaleUnit(scaleUnit); + return this; + } + + @Override + public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { + this.createParameter.withServiceBusEndpoint(serviceBusEndpoint); + return this; + } + + @Override + public NamespaceResourceImpl withStatus(String status) { + this.createParameter.withStatus(status); + return this; + } + + @Override + public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { + this.createParameter.withSubscriptionId(subscriptionId); + return this; + } + + @Override + public NamespaceResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java new file mode 100644 index 0000000000000..52aa12e268b5c --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,341 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace resource. + */ +@JsonFlatten +public class NamespaceResourceInner extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceResourceName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceResourceName value + */ + public String namespaceResourceName() { + return this.namespaceResourceName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceResourceName the namespaceResourceName value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceResourceName(String namespaceResourceName) { + this.namespaceResourceName = namespaceResourceName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..59750521a20be --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..569fbfb3fad28 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceResource; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java new file mode 100644 index 0000000000000..c0e28aa7fe51f --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java @@ -0,0 +1,1900 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.patch(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..dda48a5d9726f --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 0000000000000..d3a79e76f4e88 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public List authorizationRules() { + return this.inner().authorizationRules(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String notificationHubResourceName() { + return this.inner().notificationHubResourceName(); + } + + @Override + public String registrationTtl() { + return this.inner().registrationTtl(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { + this.createOrUpdateParameter.withAdmCredential(admCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredential) { + this.createOrUpdateParameter.withApnsCredential(apnsCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withAuthorizationRules(List authorizationRules) { + this.createOrUpdateParameter.withAuthorizationRules(authorizationRules); + return this; + } + + @Override + public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { + this.createOrUpdateParameter.withBaiduCredential(baiduCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { + this.createOrUpdateParameter.withGcmCredential(gcmCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { + this.createOrUpdateParameter.withMpnsCredential(mpnsCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.createOrUpdateParameter.withNotificationHubCreateOrUpdateParametersName(notificationHubCreateOrUpdateParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { + this.createOrUpdateParameter.withRegistrationTtl(registrationTtl); + return this; + } + + @Override + public NotificationHubResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + + @Override + public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { + this.createOrUpdateParameter.withWnsCredential(wnsCredential); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 0000000000000..326ae60fd0843 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,289 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +public class NotificationHubResourceInner extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubResourceName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubResourceName value + */ + public String notificationHubResourceName() { + return this.notificationHubResourceName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubResourceName the notificationHubResourceName value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withNotificationHubResourceName(String notificationHubResourceName) { + this.notificationHubResourceName = notificationHubResourceName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java new file mode 100644 index 0000000000000..c58f365913748 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PnsCredentialsResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public PnsCredentialsResource call(PnsCredentialsResourceInner inner) { + return new PnsCredentialsResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNotificationHubsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String notificationHubName = IdParsingUtils.getValueFromIdByName(id, "notificationHubs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + } + + @Override + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java new file mode 100644 index 0000000000000..63c9342c8e110 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java @@ -0,0 +1,1687 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs checkAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PnsCredentialsResourceInner object if successful. + */ + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, PnsCredentialsResourceInner>() { + @Override + public PnsCredentialsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 0000000000000..7972c9754f23b --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NotificationHubsManagementClient", "2016-03-01"); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java new file mode 100644 index 0000000000000..921c4a7bd31f4 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..ebf3d7afd2390 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java new file mode 100644 index 0000000000000..2bd2ea0ccf574 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PnsCredentialsResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; + +class PnsCredentialsResourceImpl extends WrapperImpl implements PnsCredentialsResource { + private final NotificationHubsManager manager; + PnsCredentialsResourceImpl(PnsCredentialsResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java new file mode 100644 index 0000000000000..4f18a221002e7 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub PNS Credentials. + */ +@JsonFlatten +public class PnsCredentialsResourceInner extends Resource { + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 0000000000000..cd2b82a2f964a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.java new file mode 100644 index 0000000000000..a9d2e00f22b14 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * PrimaryConnectionString of the AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SecondaryConnectionString of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * PrimaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * SecondaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * KeyName of the created AuthorizationRule. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Get primaryConnectionString of the AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set primaryConnectionString of the AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get secondaryConnectionString of the created AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set secondaryConnectionString of the created AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Get primaryKey of the created AuthorizationRule. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set primaryKey of the created AuthorizationRule. + * + * @param primaryKey the primaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get secondaryKey of the created AuthorizationRule. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set secondaryKey of the created AuthorizationRule. + * + * @param secondaryKey the secondaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get keyName of the created AuthorizationRule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set keyName of the created AuthorizationRule. + * + * @param keyName the keyName value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 0000000000000..362162a38cfd8 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace AuthorizationRules. + */ +@JsonFlatten +public class SharedAccessAuthorizationRuleResourceInner extends Resource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/package-info.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..ba4fec4fb5b73 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/package-info.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/package-info.java new file mode 100644 index 0000000000000..a576a3c99f449 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2016_03_01; diff --git a/notificationhubs/resource-manager/v2017_04_01/pom.xml b/notificationhubs/resource-manager/v2017_04_01/pom.xml new file mode 100644 index 0000000000000..b50d4212cfb81 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2017_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.java new file mode 100644 index 0000000000000..1fd290f292d3c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java new file mode 100644 index 0000000000000..5ba7d24ac9ea9 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub AdmCredential. + */ +@JsonFlatten +public class AdmCredential { + /** + * The client identifier. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /** + * The credential secret access key. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * The URL of the authorization token. + */ + @JsonProperty(value = "properties.authTokenUrl") + private String authTokenUrl; + + /** + * Get the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java new file mode 100644 index 0000000000000..5b7a2717f93c8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub ApnsCredential. + */ +@JsonFlatten +public class ApnsCredential { + /** + * The APNS certificate. + */ + @JsonProperty(value = "properties.apnsCertificate") + private String apnsCertificate; + + /** + * The certificate key. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The endpoint of this credential. + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /** + * The Apns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * A 10-character key identifier (kid) key, obtained from your developer + * account. + */ + @JsonProperty(value = "properties.keyId") + private String keyId; + + /** + * The name of the application. + */ + @JsonProperty(value = "properties.appName") + private String appName; + + /** + * The issuer (iss) registered claim key, whose value is your 10-character + * Team ID, obtained from your developer account. + */ + @JsonProperty(value = "properties.appId") + private String appId; + + /** + * Provider Authentication Token, obtained through your developer account. + */ + @JsonProperty(value = "properties.token") + private String token; + + /** + * Get the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get a 10-character key identifier (kid) key, obtained from your developer account. + * + * @return the keyId value + */ + public String keyId() { + return this.keyId; + } + + /** + * Set a 10-character key identifier (kid) key, obtained from your developer account. + * + * @param keyId the keyId value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the name of the application. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set the name of the application. + * + * @param appName the appName value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set the issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account. + * + * @param appId the appId value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get provider Authentication Token, obtained through your developer account. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set provider Authentication Token, obtained through your developer account. + * + * @param token the token value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withToken(String token) { + this.token = token; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java new file mode 100644 index 0000000000000..740908f33b465 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub BaiduCredential. + */ +@JsonFlatten +public class BaiduCredential { + /** + * Baidu Api Key. + */ + @JsonProperty(value = "properties.baiduApiKey") + private String baiduApiKey; + + /** + * Baidu Endpoint. + */ + @JsonProperty(value = "properties.baiduEndPoint") + private String baiduEndPoint; + + /** + * Baidu Secret Key. + */ + @JsonProperty(value = "properties.baiduSecretKey") + private String baiduSecretKey; + + /** + * Get baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java new file mode 100644 index 0000000000000..d2cb25f35f04b --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.java new file mode 100644 index 0000000000000..10bedc6297b9c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.CheckAvailabilityResultInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResult. + */ +public interface CheckAvailabilityResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java new file mode 100644 index 0000000000000..74c36d7d152b8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.DebugSendResponseInner; +import java.util.Map; + +/** + * Type representing DebugSendResponse. + */ +public interface DebugSendResponse extends HasInner, HasManager { + /** + * @return the failure value. + */ + Double failure(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the results value. + */ + Object results(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the success value. + */ + Double success(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java new file mode 100644 index 0000000000000..bfc46084a8a57 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error reponse indicates NotificationHubs service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.java new file mode 100644 index 0000000000000..e88744505309e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java new file mode 100644 index 0000000000000..db1271e4f1af2 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub GcmCredential. + */ +@JsonFlatten +public class GcmCredential { + /** + * The GCM endpoint. + */ + @JsonProperty(value = "properties.gcmEndpoint") + private String gcmEndpoint; + + /** + * The Google API key. + */ + @JsonProperty(value = "properties.googleApiKey") + private String googleApiKey; + + /** + * Get the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java new file mode 100644 index 0000000000000..4ecac2bceeb2e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub MpnsCredential. + */ +@JsonFlatten +public class MpnsCredential { + /** + * The MPNS certificate. + */ + @JsonProperty(value = "properties.mpnsCertificate") + private String mpnsCertificate; + + /** + * The certificate key for this credential. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The Mpns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..4202c237c265f --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,408 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +@JsonFlatten +@SkipParentValidation +public class NamespaceCreateOrUpdateParameters extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceCreateOrUpdateParametersName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceCreateOrUpdateParametersName value + */ + public String namespaceCreateOrUpdateParametersName() { + return this.namespaceCreateOrUpdateParametersName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceCreateOrUpdateParametersName the namespaceCreateOrUpdateParametersName value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.namespaceCreateOrUpdateParametersName = namespaceCreateOrUpdateParametersName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get identifier for Azure Insights metrics. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the time the namespace was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the time the namespace was updated. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get data center for the namespace. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set data center for the namespace. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java new file mode 100644 index 0000000000000..c55bcea97eed5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Patch Namespace operation. + */ +public class NamespacePatchParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java new file mode 100644 index 0000000000000..a8c8db0624875 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java @@ -0,0 +1,307 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the critical value. + */ + Boolean critical(); + + /** + * @return the dataCenter value. + */ + String dataCenter(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the metricId value. + */ + String metricId(); + + /** + * @return the namespaceResourceName value. + */ + String namespaceResourceName(); + + /** + * @return the namespaceType value. + */ + NamespaceType namespaceType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the scaleUnit value. + */ + String scaleUnit(); + + /** + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify CreatedAt. + */ + interface WithCreatedAt { + /** + * Specifies createdAt. + * @param createdAt The time the namespace was created + * @return the next definition stage + */ + WithCreate withCreatedAt(DateTime createdAt); + } + + /** + * The stage of the namespaceresource definition allowing to specify Critical. + */ + interface WithCritical { + /** + * Specifies critical. + * @param critical Whether or not the namespace is set as Critical + * @return the next definition stage + */ + WithCreate withCritical(Boolean critical); + } + + /** + * The stage of the namespaceresource definition allowing to specify DataCenter. + */ + interface WithDataCenter { + /** + * Specifies dataCenter. + * @param dataCenter Data center for the namespace + * @return the next definition stage + */ + WithCreate withDataCenter(String dataCenter); + } + + /** + * The stage of the namespaceresource definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled Whether or not the namespace is currently enabled + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceCreateOrUpdateParametersName. + */ + interface WithNamespaceCreateOrUpdateParametersName { + /** + * Specifies namespaceCreateOrUpdateParametersName. + * @param namespaceCreateOrUpdateParametersName The name of the namespace + * @return the next definition stage + */ + WithCreate withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceType. + */ + interface WithNamespaceType { + /** + * Specifies namespaceType. + * @param namespaceType The namespace type. Possible values include: 'Messaging', 'NotificationHub' + * @return the next definition stage + */ + WithCreate withNamespaceType(NamespaceType namespaceType); + } + + /** + * The stage of the namespaceresource definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Namespace + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the namespaceresource definition allowing to specify ScaleUnit. + */ + interface WithScaleUnit { + /** + * Specifies scaleUnit. + * @param scaleUnit ScaleUnit where the namespace gets created + * @return the next definition stage + */ + WithCreate withScaleUnit(String scaleUnit); + } + + /** + * The stage of the namespaceresource definition allowing to specify ServiceBusEndpoint. + */ + interface WithServiceBusEndpoint { + /** + * Specifies serviceBusEndpoint. + * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations + * @return the next definition stage + */ + WithCreate withServiceBusEndpoint(String serviceBusEndpoint); + } + + /** + * The stage of the namespaceresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespaceresource definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting + * @return the next definition stage + */ + WithCreate withStatus(String status); + } + + /** + * The stage of the namespaceresource definition allowing to specify SubscriptionId. + */ + interface WithSubscriptionId { + /** + * Specifies subscriptionId. + * @param subscriptionId The Id of the Azure subscription associated with the namespace + * @return the next definition stage + */ + WithCreate withSubscriptionId(String subscriptionId); + } + + /** + * The stage of the namespaceresource definition allowing to specify UpdatedAt. + */ + interface WithUpdatedAt { + /** + * Specifies updatedAt. + * @param updatedAt The time the namespace was updated + * @return the next definition stage + */ + WithCreate withUpdatedAt(DateTime updatedAt); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCreatedAt, DefinitionStages.WithCritical, DefinitionStages.WithDataCenter, DefinitionStages.WithEnabled, DefinitionStages.WithNamespaceCreateOrUpdateParametersName, DefinitionStages.WithNamespaceType, DefinitionStages.WithProvisioningState, DefinitionStages.WithScaleUnit, DefinitionStages.WithServiceBusEndpoint, DefinitionStages.WithSku, DefinitionStages.WithStatus, DefinitionStages.WithSubscriptionId, DefinitionStages.WithUpdatedAt { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespaceresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..d74a71890673a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the claimType value. + */ + String claimType(); + + /** + * @return the claimValue value. + */ + String claimValue(); + + /** + * @return the createdTime value. + */ + String createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the modifiedTime value. + */ + String modifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the revision value. + */ + Integer revision(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithProperties withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next update stage + */ + Update withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.java new file mode 100644 index 0000000000000..b92f8f722d96e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java new file mode 100644 index 0000000000000..fd3d1d54dee91 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import rx.Completable; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..4b650872991d2 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubCreateOrUpdateParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubCreateOrUpdateParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubCreateOrUpdateParametersName value + */ + public String notificationHubCreateOrUpdateParametersName() { + return this.notificationHubCreateOrUpdateParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubCreateOrUpdateParametersName the notificationHubCreateOrUpdateParametersName value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.notificationHubCreateOrUpdateParametersName = notificationHubCreateOrUpdateParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 0000000000000..652b04f25642c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the claimType value. + */ + String claimType(); + + /** + * @return the claimValue value. + */ + String claimValue(); + + /** + * @return the createdTime value. + */ + String createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the modifiedTime value. + */ + String modifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the revision value. + */ + Integer revision(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithProperties withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next update stage + */ + Update withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.java new file mode 100644 index 0000000000000..fa681ec14550f --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the patch NotificationHub operation. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubPatchParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubPatchParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubPatchParametersName value + */ + public String notificationHubPatchParametersName() { + return this.notificationHubPatchParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubPatchParametersName the notificationHubPatchParametersName value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withNotificationHubPatchParametersName(String notificationHubPatchParametersName) { + this.notificationHubPatchParametersName = notificationHubPatchParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java new file mode 100644 index 0000000000000..fce97833a7b5a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java @@ -0,0 +1,438 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the authorizationRules value. + */ + List authorizationRules(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the notificationHubResourceName value. + */ + String notificationHubResourceName(); + + /** + * @return the registrationTtl value. + */ + String registrationTtl(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource definition allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next definition stage + */ + WithCreate withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next definition stage + */ + WithCreate withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the notificationhubresource definition allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withWnsCredential(WnsCredential wnsCredential); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAdmCredential, DefinitionStages.WithApnsCredential, DefinitionStages.WithAuthorizationRules, DefinitionStages.WithBaiduCredential, DefinitionStages.WithGcmCredential, DefinitionStages.WithLocation, DefinitionStages.WithMpnsCredential, DefinitionStages.WithNotificationHubCreateOrUpdateParametersName, DefinitionStages.WithRegistrationTtl, DefinitionStages.WithSku, DefinitionStages.WithTags, DefinitionStages.WithWnsCredential { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAdmCredential, UpdateStages.WithApnsCredential, UpdateStages.WithAuthorizationRules, UpdateStages.WithBaiduCredential, UpdateStages.WithGcmCredential, UpdateStages.WithLocation, UpdateStages.WithMpnsCredential, UpdateStages.WithNotificationHubPatchParametersName, UpdateStages.WithRegistrationTtl, UpdateStages.WithSku, UpdateStages.WithTags, UpdateStages.WithWnsCredential { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next update stage + */ + Update withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next update stage + */ + Update withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource update allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next update stage + */ + Update withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next update stage + */ + Update withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the notificationhubresource update allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify NotificationHubPatchParametersName. + */ + interface WithNotificationHubPatchParametersName { + /** + * Specifies notificationHubPatchParametersName. + * @param notificationHubPatchParametersName The NotificationHub name + * @return the next update stage + */ + Update withNotificationHubPatchParametersName(String notificationHubPatchParametersName); + } + + /** + * The stage of the notificationhubresource update allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next update stage + */ + Update withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the notificationhubresource update allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withWnsCredential(WnsCredential wnsCredential); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java new file mode 100644 index 0000000000000..51d606c6e0588 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java new file mode 100644 index 0000000000000..1e307ad4c8e11 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.java new file mode 100644 index 0000000000000..a47508a273b3f --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.NotificationHubs. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: Invoice, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get service provider: Microsoft.NotificationHubs. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed: Invoice, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operations.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operations.java new file mode 100644 index 0000000000000..41e85133e61c1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.java new file mode 100644 index 0000000000000..c76c04da4bcd7 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.PnsCredentialsResourceInner; +import java.util.Map; + +/** + * Type representing PnsCredentialsResource. + */ +public interface PnsCredentialsResource extends HasInner, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java new file mode 100644 index 0000000000000..b479554bb73e4 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Regenerate Keys. + */ +public class PolicykeyResource { + /** + * Name of the key that has to be regenerated for the + * Namespace/Notification Hub Authorization Rule. The value can be Primary + * Key/Secondary Key. + */ + @JsonProperty(value = "policyKey") + private String policyKey; + + /** + * Get name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @return the policyKey value + */ + public String policyKey() { + return this.policyKey; + } + + /** + * Set name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @param policyKey the policyKey value to set + * @return the PolicykeyResource object itself. + */ + public PolicykeyResource withPolicyKey(String policyKey) { + this.policyKey = policyKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java new file mode 100644 index 0000000000000..cd1aa122ef72d --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..f62d242030351 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters { + /** + * Properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java new file mode 100644 index 0000000000000..7f990c5ce3c81 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleListResultInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import java.util.List; + +/** + * Type representing SharedAccessAuthorizationRuleListResult. + */ +public interface SharedAccessAuthorizationRuleListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 0000000000000..d3a3186448b25 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the authorization rule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get a string that describes the claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get a string that describes the claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the last modified time for this rule. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the created time for this rule. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.java new file mode 100644 index 0000000000000..2c8558fa3c707 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku description for a namespace. + */ +public class Sku { + /** + * Name of the notification hub sku. Possible values include: 'Free', + * 'Basic', 'Standard'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The tier of particular sku. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The Sku size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The Sku Family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The capacity of the resource. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier of particular sku. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of particular sku. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the Sku size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the Sku size. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the Sku Family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the Sku Family. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity of the resource. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the resource. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.java new file mode 100644 index 0000000000000..8bbe95bb6cad8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Free for SkuName. */ + public static final SkuName FREE = fromString("Free"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java new file mode 100644 index 0000000000000..8c091a650cd87 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub WnsCredential. + */ +@JsonFlatten +public class WnsCredential { + /** + * The package ID for this credential. + */ + @JsonProperty(value = "properties.packageSid") + private String packageSid; + + /** + * The secret key. + */ + @JsonProperty(value = "properties.secretKey") + private String secretKey; + + /** + * The Windows Live endpoint. + */ + @JsonProperty(value = "properties.windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java new file mode 100644 index 0000000000000..cc58a6632e4a3 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; + +class CheckAvailabilityResultImpl extends WrapperImpl implements CheckAvailabilityResult { + private final NotificationHubsManager manager; + CheckAvailabilityResultImpl(CheckAvailabilityResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.java new file mode 100644 index 0000000000000..1080a649ee40a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a CheckAvailibility resource. + */ +@SkipParentValidation +public class CheckAvailabilityResultInner extends Resource { + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java new file mode 100644 index 0000000000000..f23e9e9cf2398 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.DebugSendResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; + +class DebugSendResponseImpl extends WrapperImpl implements DebugSendResponse { + private final NotificationHubsManager manager; + DebugSendResponseImpl(DebugSendResponseInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Double failure() { + return this.inner().failure(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object results() { + return this.inner().results(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Double success() { + return this.inner().success(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java new file mode 100644 index 0000000000000..540ed02539305 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class DebugSendResponseInner extends Resource { + /** + * successful send. + */ + @JsonProperty(value = "properties.success") + private Double success; + + /** + * send failure. + */ + @JsonProperty(value = "properties.failure") + private Double failure; + + /** + * actual failure description. + */ + @JsonProperty(value = "properties.results") + private Object results; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get successful send. + * + * @return the success value + */ + public Double success() { + return this.success; + } + + /** + * Set successful send. + * + * @param success the success value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withSuccess(Double success) { + this.success = success; + return this; + } + + /** + * Get send failure. + * + * @return the failure value + */ + public Double failure() { + return this.failure; + } + + /** + * Set send failure. + * + * @param failure the failure value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withFailure(Double failure) { + this.failure = failure; + return this; + } + + /** + * Get actual failure description. + * + * @return the results value + */ + public Object results() { + return this.results; + } + + /** + * Set actual failure description. + * + * @param results the results value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withResults(Object results) { + this.results = results; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..d4aa4aeb65c57 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 0000000000000..78651650e8c5e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceCreateOrUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createParameter; + private NamespacePatchParameters updateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean critical() { + return this.inner().critical(); + } + + @Override + public String dataCenter() { + return this.inner().dataCenter(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String metricId() { + return this.inner().metricId(); + } + + @Override + public String namespaceResourceName() { + return this.inner().namespaceResourceName(); + } + + @Override + public NamespaceType namespaceType() { + return this.inner().namespaceType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scaleUnit() { + return this.inner().scaleUnit(); + } + + @Override + public String serviceBusEndpoint() { + return this.inner().serviceBusEndpoint(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public NamespaceResourceImpl withCreatedAt(DateTime createdAt) { + this.createParameter.withCreatedAt(createdAt); + return this; + } + + @Override + public NamespaceResourceImpl withCritical(Boolean critical) { + this.createParameter.withCritical(critical); + return this; + } + + @Override + public NamespaceResourceImpl withDataCenter(String dataCenter) { + this.createParameter.withDataCenter(dataCenter); + return this; + } + + @Override + public NamespaceResourceImpl withEnabled(Boolean enabled) { + this.createParameter.withEnabled(enabled); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.createParameter.withNamespaceCreateOrUpdateParametersName(namespaceCreateOrUpdateParametersName); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { + this.createParameter.withNamespaceType(namespaceType); + return this; + } + + @Override + public NamespaceResourceImpl withProvisioningState(String provisioningState) { + this.createParameter.withProvisioningState(provisioningState); + return this; + } + + @Override + public NamespaceResourceImpl withScaleUnit(String scaleUnit) { + this.createParameter.withScaleUnit(scaleUnit); + return this; + } + + @Override + public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { + this.createParameter.withServiceBusEndpoint(serviceBusEndpoint); + return this; + } + + @Override + public NamespaceResourceImpl withStatus(String status) { + this.createParameter.withStatus(status); + return this; + } + + @Override + public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { + this.createParameter.withSubscriptionId(subscriptionId); + return this; + } + + @Override + public NamespaceResourceImpl withUpdatedAt(DateTime updatedAt) { + this.createParameter.withUpdatedAt(updatedAt); + return this; + } + + @Override + public NamespaceResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java new file mode 100644 index 0000000000000..a7e015a1611c6 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,410 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace resource. + */ +@JsonFlatten +@SkipParentValidation +public class NamespaceResourceInner extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceResourceName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceResourceName value + */ + public String namespaceResourceName() { + return this.namespaceResourceName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceResourceName the namespaceResourceName value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceResourceName(String namespaceResourceName) { + this.namespaceResourceName = namespaceResourceName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get identifier for Azure Insights metrics. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the time the namespace was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the time the namespace was updated. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get data center for the namespace. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set data center for the namespace. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..28d5772bca464 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleProperties cproperties; + private SharedAccessAuthorizationRuleProperties uproperties; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.cproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.uproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public String claimType() { + return this.inner().claimType(); + } + + @Override + public String claimValue() { + return this.inner().claimValue(); + } + + @Override + public String createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String modifiedTime() { + return this.inner().modifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public Integer revision() { + return this.inner().revision(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..08561e14e2fe1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceResource; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleListResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleListResult call(SharedAccessAuthorizationRuleListResultInner inner) { + return new SharedAccessAuthorizationRuleListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java new file mode 100644 index 0000000000000..19656b77575a1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java @@ -0,0 +1,1903 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.patch(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleListResultInner object if successful. + */ + public SharedAccessAuthorizationRuleListResultInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleListResultInner>() { + @Override + public SharedAccessAuthorizationRuleListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NamespaceResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 0000000000000..e72860347a04a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,197 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleProperties cproperties; + private SharedAccessAuthorizationRuleProperties uproperties; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.cproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.uproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public String claimType() { + return this.inner().claimType(); + } + + @Override + public String claimValue() { + return this.inner().claimValue(); + } + + @Override + public String createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String modifiedTime() { + return this.inner().modifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public Integer revision() { + return this.inner().revision(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 0000000000000..e799705869e71 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,313 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubPatchParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createParameter; + private NotificationHubPatchParameters updateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.patchAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.updateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public List authorizationRules() { + return this.inner().authorizationRules(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String notificationHubResourceName() { + return this.inner().notificationHubResourceName(); + } + + @Override + public String registrationTtl() { + return this.inner().registrationTtl(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.createParameter.withNotificationHubCreateOrUpdateParametersName(notificationHubCreateOrUpdateParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubPatchParametersName(String notificationHubPatchParametersName) { + this.updateParameter.withNotificationHubPatchParametersName(notificationHubPatchParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { + if (isInCreateMode()) { + this.createParameter.withAdmCredential(admCredential); + } else { + this.updateParameter.withAdmCredential(admCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredential) { + if (isInCreateMode()) { + this.createParameter.withApnsCredential(apnsCredential); + } else { + this.updateParameter.withApnsCredential(apnsCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withAuthorizationRules(List authorizationRules) { + if (isInCreateMode()) { + this.createParameter.withAuthorizationRules(authorizationRules); + } else { + this.updateParameter.withAuthorizationRules(authorizationRules); + } + return this; + } + + @Override + public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { + if (isInCreateMode()) { + this.createParameter.withBaiduCredential(baiduCredential); + } else { + this.updateParameter.withBaiduCredential(baiduCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { + if (isInCreateMode()) { + this.createParameter.withGcmCredential(gcmCredential); + } else { + this.updateParameter.withGcmCredential(gcmCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + if (isInCreateMode()) { + this.createParameter.withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { + if (isInCreateMode()) { + this.createParameter.withMpnsCredential(mpnsCredential); + } else { + this.updateParameter.withMpnsCredential(mpnsCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { + if (isInCreateMode()) { + this.createParameter.withRegistrationTtl(registrationTtl); + } else { + this.updateParameter.withRegistrationTtl(registrationTtl); + } + return this; + } + + @Override + public NotificationHubResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { + if (isInCreateMode()) { + this.createParameter.withWnsCredential(wnsCredential); + } else { + this.updateParameter.withWnsCredential(wnsCredential); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 0000000000000..13ca3a15d9562 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,291 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubResourceInner extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubResourceName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubResourceName value + */ + public String notificationHubResourceName() { + return this.notificationHubResourceName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubResourceName the notificationHubResourceName value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withNotificationHubResourceName(String notificationHubResourceName) { + this.notificationHubResourceName = notificationHubResourceName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java new file mode 100644 index 0000000000000..f288f15a3855e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.DebugSendResponse; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PnsCredentialsResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.debugSendAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public DebugSendResponse call(DebugSendResponseInner inner) { + return new DebugSendResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public PnsCredentialsResource call(PnsCredentialsResourceInner inner) { + return new PnsCredentialsResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNotificationHubsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String notificationHubName = IdParsingUtils.getValueFromIdByName(id, "notificationHubs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + } + + @Override + public Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkNotificationHubAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java new file mode 100644 index 0000000000000..826ec8ddc5701 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java @@ -0,0 +1,2069 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubPatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs checkNotificationHubAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkNotificationHubAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubPatchParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs debugSend" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend") + Observable> debugSend(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body Object parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkNotificationHubAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNotificationHubAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNotificationHubAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNotificationHubAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner patch(String resourceGroupName, String namespaceName, String notificationHubName) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final NotificationHubPatchParameters parameters = null; + return service.patch(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner patch(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.patch(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DebugSendResponseInner object if successful. + */ + public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, DebugSendResponseInner>() { + @Override + public DebugSendResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable> debugSendWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Object parameters = null; + return service.debugSend(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = debugSendDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DebugSendResponseInner object if successful. + */ + public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, DebugSendResponseInner>() { + @Override + public DebugSendResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable> debugSendWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.debugSend(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = debugSendDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse debugSendDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PnsCredentialsResourceInner object if successful. + */ + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, PnsCredentialsResourceInner>() { + @Override + public PnsCredentialsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NotificationHubResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 0000000000000..dbd5f3e148298 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NotificationHubsManagementClient", "2017-04-01"); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.java new file mode 100644 index 0000000000000..2e9200f1823db --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operations; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Operations operations; + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..56f9a28ce994d --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final NotificationHubsManager manager; + OperationImpl(OperationInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..f1c4a0f2b8d56 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A NotificationHubs REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..1288932250d75 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NotificationHubsManager manager; + + OperationsImpl(NotificationHubsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..8373138dd5376 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Operations list" }) + @GET("providers/Microsoft.NotificationHubs/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..a1234b05e73d8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java new file mode 100644 index 0000000000000..81e1e1576e9e5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PnsCredentialsResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; + +class PnsCredentialsResourceImpl extends WrapperImpl implements PnsCredentialsResource { + private final NotificationHubsManager manager; + PnsCredentialsResourceImpl(PnsCredentialsResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java new file mode 100644 index 0000000000000..b26f39f4f08b7 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java @@ -0,0 +1,211 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub PNS Credentials. + */ +@JsonFlatten +@SkipParentValidation +public class PnsCredentialsResourceInner extends Resource { + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 0000000000000..468ba39610d80 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.java new file mode 100644 index 0000000000000..8c997229f3cac --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * PrimaryConnectionString of the AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SecondaryConnectionString of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * PrimaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * SecondaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * KeyName of the created AuthorizationRule. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Get primaryConnectionString of the AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set primaryConnectionString of the AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get secondaryConnectionString of the created AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set secondaryConnectionString of the created AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Get primaryKey of the created AuthorizationRule. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set primaryKey of the created AuthorizationRule. + * + * @param primaryKey the primaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get secondaryKey of the created AuthorizationRule. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set secondaryKey of the created AuthorizationRule. + * + * @param secondaryKey the secondaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get keyName of the created AuthorizationRule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set keyName of the created AuthorizationRule. + * + * @param keyName the keyName value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java new file mode 100644 index 0000000000000..7f3ab68a7e7af --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class SharedAccessAuthorizationRuleListResultImpl extends WrapperImpl implements SharedAccessAuthorizationRuleListResult { + private final NotificationHubsManager manager; + SharedAccessAuthorizationRuleListResultImpl(SharedAccessAuthorizationRuleListResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java new file mode 100644 index 0000000000000..9e0003fd99bd1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response of the List Namespace operation. + */ +public class SharedAccessAuthorizationRuleListResultInner { + /** + * Result of the List AuthorizationRules operation. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Link to the next set of results. Not empty if Value contains incomplete + * list of AuthorizationRules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get result of the List AuthorizationRules operation. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set result of the List AuthorizationRules operation. + * + * @param value the value value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules. + * + * @param nextLink the nextLink value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 0000000000000..1541fd0842e4e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace AuthorizationRules. + */ +@JsonFlatten +@SkipParentValidation +public class SharedAccessAuthorizationRuleResourceInner extends Resource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "properties.keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "properties.claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "properties.claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "properties.modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "properties.revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the authorization rule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get a string that describes the claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get a string that describes the claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the last modified time for this rule. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the created time for this rule. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/package-info.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/package-info.java new file mode 100644 index 0000000000000..b105be980c7ed --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/package-info.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/package-info.java new file mode 100644 index 0000000000000..435ec812f8c16 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2017_04_01; diff --git a/policy/resource-manager/v2016_12_01/pom.xml b/policy/resource-manager/v2016_12_01/pom.xml index 90fdbcb42077c..0da79d26cf732 100644 --- a/policy/resource-manager/v2016_12_01/pom.xml +++ b/policy/resource-manager/v2016_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-policy diff --git a/policy/resource-manager/v2018_03_01/pom.xml b/policy/resource-manager/v2018_03_01/pom.xml index 23c34f2146588..3d5cc7859460e 100644 --- a/policy/resource-manager/v2018_03_01/pom.xml +++ b/policy/resource-manager/v2018_03_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-policy diff --git a/policyinsights/resource-manager/v2018_04_04/pom.xml b/policyinsights/resource-manager/v2018_04_04/pom.xml index b63b9900f1978..7b7d6341a767e 100644 --- a/policyinsights/resource-manager/v2018_04_04/pom.xml +++ b/policyinsights/resource-manager/v2018_04_04/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-policyinsights diff --git a/pom.client.build.xml b/pom.client.build.xml new file mode 100644 index 0000000000000..d0f1a308d7135 --- /dev/null +++ b/pom.client.build.xml @@ -0,0 +1,40 @@ + + 4.0.0 + + com.microsoft.azure + azure-sdk-parent + 1.0-SNAPSHOT + ./pom.client.xml + + + azure-sdk-parent-build + ${parent.version} + pom + + Microsoft Azure SDK Build + This package bundles all the SDKs in a multi-module for build/CI purposes. + https://github.com/Azure/azure-sdk-for-java + + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.22.v20170606 + + 0 + 11079 + STOP + false + ./jetty.xml + + + + + + + ./template/client + ./keyvault/data-plane + + diff --git a/pom.client.xml b/pom.client.xml new file mode 100644 index 0000000000000..52fc0d84f9206 --- /dev/null +++ b/pom.client.xml @@ -0,0 +1,53 @@ + + 4.0.0 + com.microsoft.azure + azure-sdk-parent + pom + 1.0-SNAPSHOT + + Microsoft Azure SDK Parent + This package contains the parent module of Microsoft Azure SDK. + https://github.com/Azure/azure-sdk-for-java + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + true + true + -Xlint:unchecked + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.22.v20170606 + + 0 + 11079 + STOP + false + ./jetty.xml + + + + + + + + + junit + junit + 4.12 + test + + + + + diff --git a/pom.xml b/pom.xml index bb9f1258166e7..8a452854cf695 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.microsoft.azure - 0.0.2-beta + 0.0.3-beta azure-arm-parent pom @@ -33,8 +33,8 @@ playback 11080 - 1.5.2 - 1.11.1 + 1.6.3 + 1.14.0
@@ -57,17 +57,17 @@ com.fasterxml.jackson.core jackson-core - 2.7.2 + 2.9.4 com.fasterxml.jackson.core jackson-databind - 2.7.2 + 2.9.4 com.fasterxml.jackson.core jackson-annotations - 2.7.0 + 2.9.0 commons-codec diff --git a/postgresql/resource-manager/v2017_12_01/pom.xml b/postgresql/resource-manager/v2017_12_01/pom.xml index 421e267f06331..9d59124804930 100644 --- a/postgresql/resource-manager/v2017_12_01/pom.xml +++ b/postgresql/resource-manager/v2017_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-postgresql diff --git a/profiles/2018-03-01-hybrid/azure/pom.xml b/profiles/2018-03-01-hybrid/azure/pom.xml index b2d28cd30cd55..cdf203a6d55ad 100644 --- a/profiles/2018-03-01-hybrid/azure/pom.xml +++ b/profiles/2018-03-01-hybrid/azure/pom.xml @@ -69,6 +69,11 @@ azure-mgmt-dns 1.0.0-beta-1 + + com.microsoft.azure.resources.v2016_06_01 + azure-mgmt-subscriptions + 1.0.0-beta + com.microsoft.azure.resources.v2018_02_01 azure-mgmt-resources diff --git a/profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java b/profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java index 4b947fd26aa0e..88751bbe202f4 100644 --- a/profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java +++ b/profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java @@ -8,6 +8,8 @@ import com.microsoft.azure.AzureEnvironment; import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.PagedList; import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.credentials.AzureTokenCredentials; @@ -20,8 +22,8 @@ import com.microsoft.azure.management.appservice.v2016_08_01.WebApps; import com.microsoft.azure.management.appservice.v2016_09_01.AppServiceEnvironments; import com.microsoft.azure.management.appservice.v2016_09_01.AppServicePlans; -import com.microsoft.azure.management.policy.v2016_12_01.PolicyAssignments; -import com.microsoft.azure.management.policy.v2016_12_01.PolicyDefinitions; +import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignments; +import com.microsoft.azure.management.authorization.v2015_07_01.RoleDefinitions; import com.microsoft.azure.management.compute.v2017_03_30.AvailabilitySets; import com.microsoft.azure.management.compute.v2017_03_30.Disks; import com.microsoft.azure.management.compute.v2017_03_30.Images; @@ -40,6 +42,7 @@ import com.microsoft.azure.management.compute.v2017_03_30.VirtualMachines; import com.microsoft.azure.management.dns.v2016_04_01.RecordSets; import com.microsoft.azure.management.dns.v2016_04_01.Zones; +import com.microsoft.azure.management.keyvault.v2016_10_01.Vaults; import com.microsoft.azure.management.network.v2017_10_01.ApplicationGateways; import com.microsoft.azure.management.network.v2017_10_01.ApplicationSecurityGroups; import com.microsoft.azure.management.network.v2017_10_01.AvailableEndpointServices; @@ -76,6 +79,11 @@ import com.microsoft.azure.management.network.v2017_10_01.VirtualNetworkGateways; import com.microsoft.azure.management.network.v2017_10_01.VirtualNetworkPeerings; import com.microsoft.azure.management.network.v2017_10_01.VirtualNetworks; +import com.microsoft.azure.management.policy.v2016_12_01.PolicyAssignments; +import com.microsoft.azure.management.policy.v2016_12_01.PolicyDefinitions; +import com.microsoft.azure.management.resources.v2016_06_01.Subscription; +import com.microsoft.azure.management.resources.v2016_06_01.Subscriptions; +import com.microsoft.azure.management.resources.v2016_06_01.Tenants; import com.microsoft.azure.management.resources.v2018_02_01.DeploymentOperations; import com.microsoft.azure.management.resources.v2018_02_01.Deployments; import com.microsoft.azure.management.resources.v2018_02_01.Providers; @@ -86,6 +94,8 @@ import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; +import java.io.IOException; + /** * Entry point to Azure ContainerService resource management. */ @@ -96,9 +106,12 @@ public final class Azure { private com.microsoft.azure.management.network.v2017_10_01.implementation.NetworkManager networkManager20171001; private com.microsoft.azure.management.dns.v2016_04_01.implementation.NetworkManager dnsManager20160401; private com.microsoft.azure.management.storage.v2016_01_01.implementation.StorageManager storageManager20160101; + private com.microsoft.azure.management.keyvault.v2016_10_01.implementation.KeyVaultManager keyVaultManager20161001; private com.microsoft.azure.management.appservice.v2016_03_01.implementation.AppServiceManager appServiceManager20160301; private com.microsoft.azure.management.appservice.v2016_08_01.implementation.AppServiceManager appServiceManager20160801; private com.microsoft.azure.management.appservice.v2016_09_01.implementation.AppServiceManager appServiceManager20160901; + private final String subscriptionId; + private final Authenticated authenticated; /** * Get a Configurable instance that can be used to create Azure with optional configuration. @@ -108,31 +121,32 @@ public final class Azure { public static Configurable configure() { return new Azure.ConfigurableImpl(); } + /** - * Creates an instance of Azure that exposes ContainerService resource management API entry points. + * Creates an instance of Azure.Authenticated that exposes subscription, tenant, and authorization API entry points. * * @param credentials the credentials to use - * @param subscriptionId the subscription UUID - * @return the Azure + * @return the Azure.Authenticated */ - public static Azure authenticate(AzureTokenCredentials credentials, String subscriptionId) { - return new Azure(new RestClient.Builder() + public static Authenticated authenticate(AzureTokenCredentials credentials) { + return new AuthenticatedImpl(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) - .build(), subscriptionId); + .build()); } + /** * Creates an instance of Azure that exposes ContainerService resource management API entry points. * * @param restClient the RestClient to be used for API calls. - * @param subscriptionId the subscription UUID - * @return the Azure + * @return the Azure.Authenticated */ - public static Azure authenticate(RestClient restClient, String subscriptionId) { - return new Azure(restClient, subscriptionId); + public static Authenticated authenticate(RestClient restClient) { + return new AuthenticatedImpl(restClient); } + /** * The interface allowing configurations to be set. */ @@ -147,6 +161,124 @@ public interface Configurable extends AzureConfigurable { Azure authenticate(AzureTokenCredentials credentials, String subscriptionId); } + /** + * Provides authenticated access to a subset of Azure APIs that do not require a specific subscription. + *

+ * To access the subscription-specific APIs, use {@link Authenticated#withSubscription(String)}, + * or withDefaultSubscription() if a default subscription has already been previously specified + * (for example, in a previously specified authentication file). + */ + public interface Authenticated { + /** + * Entry point to subscription management APIs. + * + * @return Subscriptions interface providing access to subscription management + */ + Subscriptions subscriptions(); + + /** + * Entry point to tenant management APIs. + * + * @return Tenants interface providing access to tenant management + */ + Tenants tenants(); + + /** + * Selects a specific subscription for the APIs to work with. + *

+ * Most Azure APIs require a specific subscription to be selected. + * @param subscriptionId the ID of the subscription + * @return an authenticated Azure client configured to work with the specified subscription + */ + Azure withSubscription(String subscriptionId); + + /** + * Selects the default subscription as the subscription for the APIs to work with. + *

+ * The default subscription can be specified inside the authentication file using {@link Azure#authenticate(AzureTokenCredentials)}. + * If no default subscription has been previously provided, the first subscription as + * returned by {@link Authenticated#subscriptions()} will be selected. + * @return an authenticated Azure client configured to work with the default subscription + * @throws CloudException exception thrown from Azure + * @throws IOException exception thrown from serialization/deserialization + */ + Azure withDefaultSubscription() throws CloudException, IOException; + + /** + * Entry point to role definition management APIs. + * + * @return RoleDefinitions interface providing access to tenant management + */ + RoleDefinitions roleDefinitions(); + + /** + * Entry point to role assignment management APIs. + * + * @return RoleAssignments interface providing access to tenant management + */ + RoleAssignments roleAssignments(); + } + + /** + * The implementation for the Authenticated interface. + */ + private static final class AuthenticatedImpl implements Authenticated { + private final RestClient restClient; + private final com.microsoft.azure.management.resources.v2016_06_01.implementation.Manager subscriptionManager20160601; + private final com.microsoft.azure.management.authorization.v2015_07_01.implementation.AuthorizationManager authorizationManager20150701; + private String defaultSubscription; + + private AuthenticatedImpl(RestClient restClient) { + this.subscriptionManager20160601 = com.microsoft.azure.management.resources.v2016_06_01.implementation.Manager.authenticate(restClient); + this.authorizationManager20150701 = com.microsoft.azure.management.authorization.v2015_07_01.implementation.AuthorizationManager.authenticate(restClient, null); + this.restClient = restClient; + } + + private AuthenticatedImpl withDefaultSubscription(String subscriptionId) { + this.defaultSubscription = subscriptionId; + return this; + } + + @Override + public Subscriptions subscriptions() { + return subscriptionManager20160601.subscriptions(); + } + + @Override + public Tenants tenants() { + return subscriptionManager20160601.tenants(); + } + + @Override + public RoleDefinitions roleDefinitions() { + return authorizationManager20150701.roleDefinitions(); + } + + @Override + public RoleAssignments roleAssignments() { + return authorizationManager20150701.roleAssignments(); + } + + @Override + public Azure withSubscription(String subscriptionId) { + return new Azure(restClient, subscriptionId, this); + } + + @Override + public Azure withDefaultSubscription() throws CloudException, IOException { + if (this.defaultSubscription != null) { + return withSubscription(this.defaultSubscription); + } else { + PagedList subs = this.subscriptions().list(); + if (!subs.isEmpty()) { + return withSubscription(subs.get(0).subscriptionId()); + } else { + return withSubscription(null); + } + } + } + } + /** * @return Entry point to manage PolicyDefinitions. */ @@ -602,6 +734,13 @@ public com.microsoft.azure.management.storage.v2016_01_01.Usages storageUsages() return this.storageManager20160101.usages(); } + /** + * @return Entry point to manage key vaults. + */ + public Vaults keyVaults() { + return this.keyVaultManager20161001.vaults(); + } + /** * @return Entry point to manage Certificates. */ @@ -677,11 +816,11 @@ public AppServicePlans appServicePlans() { */ private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { public Azure authenticate(AzureTokenCredentials credentials, String subscriptionId) { - return Azure.authenticate(buildRestClient(credentials), subscriptionId); + return Azure.authenticate(buildRestClient(credentials)).withSubscription(subscriptionId); } } - private Azure(RestClient restClient, String subscriptionId) { + private Azure(RestClient restClient, String subscriptionId, Authenticated authenticated) { this.computeManager20170330 = com.microsoft.azure.management.compute.v2017_03_30.implementation.ComputeManager.authenticate(restClient, subscriptionId); this.resourceManager20180201 = com.microsoft.azure.management.resources.v2018_02_01.implementation.ResourcesManager.authenticate(restClient, subscriptionId); this.authorizationManager20161201 = com.microsoft.azure.management.policy.v2016_12_01.implementation.PolicyManager.authenticate(restClient, subscriptionId); @@ -691,5 +830,8 @@ private Azure(RestClient restClient, String subscriptionId) { this.appServiceManager20160301 = com.microsoft.azure.management.appservice.v2016_03_01.implementation.AppServiceManager.authenticate(restClient, subscriptionId); this.appServiceManager20160801 = com.microsoft.azure.management.appservice.v2016_08_01.implementation.AppServiceManager.authenticate(restClient, subscriptionId); this.appServiceManager20160901 = com.microsoft.azure.management.appservice.v2016_09_01.implementation.AppServiceManager.authenticate(restClient, subscriptionId); + this.keyVaultManager20161001 = com.microsoft.azure.management.keyvault.v2016_10_01.implementation.KeyVaultManager.authenticate(restClient, subscriptionId); + this.subscriptionId = subscriptionId; + this.authenticated = authenticated; } } diff --git a/profiles/2018-03-01-hybrid/azure/src/test/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/AzureTests.java b/profiles/2018-03-01-hybrid/azure/src/test/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/AzureTests.java index 19ba6ace7b6c5..7fc644c44ea24 100644 --- a/profiles/2018-03-01-hybrid/azure/src/test/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/AzureTests.java +++ b/profiles/2018-03-01-hybrid/azure/src/test/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/AzureTests.java @@ -11,6 +11,7 @@ import com.microsoft.azure.arm.core.TestBase; import com.microsoft.azure.arm.resources.Region; import com.microsoft.azure.arm.utils.SdkContext; +import com.microsoft.azure.management.resources.v2016_06_01.Subscription; import com.microsoft.azure.management.resources.v2018_02_01.ResourceGroup; import com.microsoft.azure.management.storage.v2016_01_01.Kind; import com.microsoft.azure.management.storage.v2016_01_01.Sku; @@ -20,24 +21,30 @@ import org.junit.Assert; import org.junit.Test; +import java.util.List; + public class AzureTests extends TestBase { - protected static Azure azure; + protected static Azure.Authenticated authenticated; private static String rgName; @Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { - azure = Azure.authenticate(restClient, defaultSubscription); + authenticated = Azure.authenticate(restClient); } @Override protected void cleanUpResources() { - azure.resourceGroups().deleteAsync(rgName).await(); } @Test - public void firstTest() { - ResourceGroup rg = azure.resourceGroups().listAsync() - .toBlocking().last(); + public void firstTest() throws Exception { + List subscriptions = authenticated.subscriptions().list(); + + if (subscriptions == null || subscriptions.size() == 0) { + Assert.fail("Credential isn't assigned to any subscription"); + } + + Azure azure = authenticated.withSubscription(subscriptions.get(0).subscriptionId()); rgName = SdkContext.randomResourceName("rg", 20); String saName = SdkContext.randomResourceName("sa", 20); diff --git a/profiles/2018-03-01-hybrid/pom.xml b/profiles/2018-03-01-hybrid/pom.xml index 97856380ceb54..611ed307a4fb3 100644 --- a/profiles/2018-03-01-hybrid/pom.xml +++ b/profiles/2018-03-01-hybrid/pom.xml @@ -9,7 +9,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../pom.xml azure-profile-parent @@ -110,6 +110,7 @@ ./azure + ../../resources/resource-manager/v2016_06_01 ../../resources/resource-manager/v2018_02_01 ../../authorization/resource-manager/v2015_07_01 ../../policy/resource-manager/v2016_12_01 diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml b/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml index 37ae8fa255a27..4aa50d0ad2e75 100644 --- a/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml +++ b/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-recoveryservices diff --git a/recoveryservices.backup/resource-manager/v2016_12_01/pom.xml b/recoveryservices.backup/resource-manager/v2016_12_01/pom.xml index 6c4f2111ad75c..5d6b89aa612af 100644 --- a/recoveryservices.backup/resource-manager/v2016_12_01/pom.xml +++ b/recoveryservices.backup/resource-manager/v2016_12_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-recoveryservices diff --git a/recoveryservices.backup/resource-manager/v2017_07_01/pom.xml b/recoveryservices.backup/resource-manager/v2017_07_01/pom.xml index f2c7ce32a831b..dfb012df3ca04 100644 --- a/recoveryservices.backup/resource-manager/v2017_07_01/pom.xml +++ b/recoveryservices.backup/resource-manager/v2017_07_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-recoveryservices diff --git a/recoveryservices/resource-manager/v2016_06_01/pom.xml b/recoveryservices/resource-manager/v2016_06_01/pom.xml index be6ce82e815a0..a36577d2228f4 100644 --- a/recoveryservices/resource-manager/v2016_06_01/pom.xml +++ b/recoveryservices/resource-manager/v2016_06_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-recoveryservices diff --git a/redis/resource-manager/v2017_10_01/pom.xml b/redis/resource-manager/v2017_10_01/pom.xml index ca9d23a05782f..888f317a93ee4 100644 --- a/redis/resource-manager/v2017_10_01/pom.xml +++ b/redis/resource-manager/v2017_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-redis diff --git a/redis/resource-manager/v2018_03_01/pom.xml b/redis/resource-manager/v2018_03_01/pom.xml index 0026582ef29a1..f235bfd7275af 100644 --- a/redis/resource-manager/v2018_03_01/pom.xml +++ b/redis/resource-manager/v2018_03_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-redis diff --git a/resources/resource-manager/v2016_06_01/pom.xml b/resources/resource-manager/v2016_06_01/pom.xml index 3341318077724..238aab92c9c9b 100644 --- a/resources/resource-manager/v2016_06_01/pom.xml +++ b/resources/resource-manager/v2016_06_01/pom.xml @@ -11,10 +11,10 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml - azure-mgmt- + azure-mgmt-subscriptions 1.0.0-beta jar Microsoft Azure SDK for Management diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscriptions.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscriptions.java index 6f1480cbdde73..f3b1f4685190e 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscriptions.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscriptions.java @@ -8,10 +8,10 @@ package com.microsoft.azure.management.resources.v2016_06_01; -import rx.Observable; -import com.microsoft.azure.management.resources.v2016_06_01.implementation.SubscriptionsInner; +import com.microsoft.azure.PagedList; import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.resources.v2016_06_01.Location; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.SubscriptionsInner; +import rx.Observable; /** * Type representing Subscriptions. @@ -26,6 +26,14 @@ public interface Subscriptions extends HasInner { */ Observable getAsync(String subscriptionId); + /** + * Gets all subscriptions for a tenant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + PagedList list(); + /** * Gets all subscriptions for a tenant. * diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java index 73ce48bb8aacd..d6b6d88817c16 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java @@ -9,14 +9,17 @@ package com.microsoft.azure.management.resources.v2016_06_01.implementation; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.resources.v2016_06_01.Location; +import com.microsoft.azure.management.resources.v2016_06_01.Subscription; import com.microsoft.azure.management.resources.v2016_06_01.Subscriptions; -import rx.functions.Func1; import rx.Observable; -import com.microsoft.azure.Page; -import com.microsoft.azure.management.resources.v2016_06_01.Subscription; +import rx.functions.Func1; + import java.util.List; -import com.microsoft.azure.management.resources.v2016_06_01.Location; class SubscriptionsImpl extends WrapperImpl implements Subscriptions { private final Manager manager; @@ -42,6 +45,17 @@ public Subscription call(SubscriptionInner inner) { }); } + @Override + public PagedList list() { + return new PagedListConverter() { + + @Override + public Observable typeConvertAsync(SubscriptionInner subscriptionInner) { + return Observable.just((Subscription) new SubscriptionImpl(subscriptionInner, manager())); + } + }.convert(inner().list()); + } + @Override public Observable listAsync() { SubscriptionsInner client = this.inner(); diff --git a/resources/resource-manager/v2016_09_01/pom.xml b/resources/resource-manager/v2016_09_01/pom.xml index 2047aed1aa4ca..ad20e22962821 100644 --- a/resources/resource-manager/v2016_09_01/pom.xml +++ b/resources/resource-manager/v2016_09_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-resources diff --git a/resources/resource-manager/v2018_02_01/pom.xml b/resources/resource-manager/v2018_02_01/pom.xml index 978385e04e8ae..9f8e148a9e1d0 100644 --- a/resources/resource-manager/v2018_02_01/pom.xml +++ b/resources/resource-manager/v2018_02_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-resources diff --git a/signalr/resource-manager/v2018_03_01_preview/pom.xml b/signalr/resource-manager/v2018_03_01_preview/pom.xml index 3fead7dac0bf1..546589eef045d 100644 --- a/signalr/resource-manager/v2018_03_01_preview/pom.xml +++ b/signalr/resource-manager/v2018_03_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-signalr diff --git a/sql/resource-manager/v2014_04_01/pom.xml b/sql/resource-manager/v2014_04_01/pom.xml index 15ee9d56a144a..ea0859894df53 100644 --- a/sql/resource-manager/v2014_04_01/pom.xml +++ b/sql/resource-manager/v2014_04_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-sql diff --git a/sql/resource-manager/v2017_10_01_preview/pom.xml b/sql/resource-manager/v2017_10_01_preview/pom.xml index c8dd3d5addf73..6e9980f3ddc1b 100644 --- a/sql/resource-manager/v2017_10_01_preview/pom.xml +++ b/sql/resource-manager/v2017_10_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-sql diff --git a/storage/resource-manager/v2016_01_01/pom.xml b/storage/resource-manager/v2016_01_01/pom.xml index 75e99d87fc6df..615b1b836b3b1 100644 --- a/storage/resource-manager/v2016_01_01/pom.xml +++ b/storage/resource-manager/v2016_01_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.storage.v2016_01_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-storage - 1.0.0-beta-1 - jar - Microsoft Azure SDK for Storage Management - This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.storage.v2016_01_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java index 891eae49919ee..7597576a81b8b 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java @@ -30,7 +30,7 @@ public class CustomDomain { private Boolean useSubDomain; /** - * Get the name value. + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @param name the name value to set * @return the CustomDomain object itself. @@ -50,7 +50,7 @@ public CustomDomain withName(String name) { } /** - * Get the useSubDomain value. + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @return the useSubDomain value */ @@ -59,7 +59,7 @@ public Boolean useSubDomain() { } /** - * Set the useSubDomain value. + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @param useSubDomain the useSubDomain value to set * @return the CustomDomain object itself. diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Encryption.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Encryption.java index 4fd49ac9ff3c1..8c955b28f17cd 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Encryption.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Encryption.java @@ -35,7 +35,7 @@ public Encryption() { } /** - * Get the services value. + * Get list of services which support encryption. * * @return the services value */ @@ -44,7 +44,7 @@ public EncryptionServices services() { } /** - * Set the services value. + * Set list of services which support encryption. * * @param services the services value to set * @return the Encryption object itself. @@ -55,7 +55,7 @@ public Encryption withServices(EncryptionServices services) { } /** - * Get the keySource value. + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage. * * @return the keySource value */ @@ -64,7 +64,7 @@ public String keySource() { } /** - * Set the keySource value. + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage. * * @param keySource the keySource value to set * @return the Encryption object itself. diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionService.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionService.java index 0ba17b5c452af..b178ad39b1d48 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionService.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionService.java @@ -32,7 +32,7 @@ public class EncryptionService { private DateTime lastEnabledTime; /** - * Get the enabled value. + * Get a boolean indicating whether or not the service encrypts the data as it is stored. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set a boolean indicating whether or not the service encrypts the data as it is stored. * * @param enabled the enabled value to set * @return the EncryptionService object itself. @@ -52,7 +52,7 @@ public EncryptionService withEnabled(Boolean enabled) { } /** - * Get the lastEnabledTime value. + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. * * @return the lastEnabledTime value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionServices.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionServices.java index b95be81d617b5..96ba4404175c3 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionServices.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/EncryptionServices.java @@ -21,7 +21,7 @@ public class EncryptionServices { private EncryptionService blob; /** - * Get the blob value. + * Get the encryption function of the blob storage service. * * @return the blob value */ @@ -30,7 +30,7 @@ public EncryptionService blob() { } /** - * Set the blob value. + * Set the encryption function of the blob storage service. * * @param blob the blob value to set * @return the EncryptionServices object itself. diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Endpoints.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Endpoints.java index 241a9bc306429..f68c75e752fac 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Endpoints.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Endpoints.java @@ -40,7 +40,7 @@ public class Endpoints { private String file; /** - * Get the blob value. + * Get gets the blob endpoint. * * @return the blob value */ @@ -49,7 +49,7 @@ public String blob() { } /** - * Get the queue value. + * Get gets the queue endpoint. * * @return the queue value */ @@ -58,7 +58,7 @@ public String queue() { } /** - * Get the table value. + * Get gets the table endpoint. * * @return the table value */ @@ -67,7 +67,7 @@ public String table() { } /** - * Get the file value. + * Get gets the file endpoint. * * @return the file value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Sku.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Sku.java index c74e2e438381c..f4200ef7e8d17 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Sku.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/Sku.java @@ -31,7 +31,7 @@ public class Sku { private SkuTier tier; /** - * Get the name value. + * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @return the name value */ @@ -40,7 +40,7 @@ public SkuName name() { } /** - * Set the name value. + * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @param name the name value to set * @return the Sku object itself. @@ -51,7 +51,7 @@ public Sku withName(SkuName name) { } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java index 69038314b982c..29d682b11e7a3 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2016_01_01.implementation.StorageManager; import org.joda.time.DateTime; diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCheckNameAvailabilityParameters.java index 0bddf8fa36f42..f9b1cde56c2fc 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCheckNameAvailabilityParameters.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCheckNameAvailabilityParameters.java @@ -28,6 +28,7 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the name value. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCreateParameters.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCreateParameters.java index 771e2931fcd90..c24ffdef11acc 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCreateParameters.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountCreateParameters.java @@ -75,7 +75,7 @@ public class StorageAccountCreateParameters { private AccessTier accessTier; /** - * Get the sku value. + * Get required. Gets or sets the sku name. * * @return the sku value */ @@ -84,7 +84,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set required. Gets or sets the sku name. * * @param sku the sku value to set * @return the StorageAccountCreateParameters object itself. @@ -95,7 +95,7 @@ public StorageAccountCreateParameters withSku(Sku sku) { } /** - * Get the kind value. + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'BlobStorage'. * * @return the kind value */ @@ -104,7 +104,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountCreateParameters object itself. @@ -115,7 +115,7 @@ public StorageAccountCreateParameters withKind(Kind kind) { } /** - * Get the location value. + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @return the location value */ @@ -124,7 +124,7 @@ public String location() { } /** - * Set the location value. + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @param location the location value to set * @return the StorageAccountCreateParameters object itself. @@ -135,7 +135,7 @@ public StorageAccountCreateParameters withLocation(String location) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @return the tags value */ @@ -144,7 +144,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @param tags the tags value to set * @return the StorageAccountCreateParameters object itself. @@ -155,7 +155,7 @@ public StorageAccountCreateParameters withTags(Map tags) { } /** - * Get the customDomain value. + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -164,7 +164,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountCreateParameters object itself. @@ -175,7 +175,7 @@ public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @return the encryption value */ @@ -184,7 +184,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountCreateParameters object itself. @@ -195,7 +195,7 @@ public StorageAccountCreateParameters withEncryption(Encryption encryption) { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -204,7 +204,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountCreateParameters object itself. diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountKey.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountKey.java index ad54578f0d47f..6c0e82a980a4c 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountKey.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountKey.java @@ -34,7 +34,7 @@ public class StorageAccountKey { private KeyPermission permissions; /** - * Get the keyName value. + * Get name of the key. * * @return the keyName value */ @@ -43,7 +43,7 @@ public String keyName() { } /** - * Get the value value. + * Get base 64-encoded value of the key. * * @return the value value */ @@ -52,7 +52,7 @@ public String value() { } /** - * Get the permissions value. + * Get permissions for the key -- read-only or full permissions. Possible values include: 'READ', 'FULL'. * * @return the permissions value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountUpdateParameters.java index 10bd2ddb8b653..b1966caf62c02 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountUpdateParameters.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccountUpdateParameters.java @@ -60,7 +60,7 @@ public class StorageAccountUpdateParameters { private AccessTier accessTier; /** - * Get the sku value. + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @return the sku value */ @@ -69,7 +69,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. @@ -80,7 +80,7 @@ public StorageAccountUpdateParameters withSku(Sku sku) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @return the tags value */ @@ -89,7 +89,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @param tags the tags value to set * @return the StorageAccountUpdateParameters object itself. @@ -100,7 +100,7 @@ public StorageAccountUpdateParameters withTags(Map tags) { } /** - * Get the customDomain value. + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -109,7 +109,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountUpdateParameters object itself. @@ -120,7 +120,7 @@ public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. The default setting is unencrypted. * * @return the encryption value */ @@ -129,7 +129,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountUpdateParameters object itself. @@ -140,7 +140,7 @@ public StorageAccountUpdateParameters withEncryption(Encryption encryption) { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -149,7 +149,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountUpdateParameters object itself. diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/UsageName.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/UsageName.java index de37f3fec9491..70838a3c82260 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/UsageName.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get gets a string describing the resource name. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get gets a localized string describing the resource name. * * @return the localizedValue value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/CheckNameAvailabilityResultInner.java index c7ec326b31707..40a0ff5e43537 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/CheckNameAvailabilityResultInner.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/CheckNameAvailabilityResultInner.java @@ -38,7 +38,7 @@ public class CheckNameAvailabilityResultInner { private String message; /** - * Get the nameAvailable value. + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. * * @return the nameAvailable value */ @@ -47,7 +47,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. * * @return the reason value */ @@ -56,7 +56,7 @@ public Reason reason() { } /** - * Get the message value. + * Get gets an error message explaining the Reason value in more detail. * * @return the message value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountInner.java index cc7ba79ca4689..fd004f7f1b467 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountInner.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountInner.java @@ -131,7 +131,7 @@ public class StorageAccountInner extends Resource { private AccessTier accessTier; /** - * Get the sku value. + * Get gets the SKU. * * @return the sku value */ @@ -140,7 +140,7 @@ public Sku sku() { } /** - * Get the kind value. + * Get gets the Kind. Possible values include: 'Storage', 'BlobStorage'. * * @return the kind value */ @@ -149,7 +149,7 @@ public Kind kind() { } /** - * Get the provisioningState value. + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. * * @return the provisioningState value */ @@ -158,7 +158,7 @@ public ProvisioningState provisioningState() { } /** - * Get the primaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. * * @return the primaryEndpoints value */ @@ -167,7 +167,7 @@ public Endpoints primaryEndpoints() { } /** - * Get the primaryLocation value. + * Get gets the location of the primary data center for the storage account. * * @return the primaryLocation value */ @@ -176,7 +176,7 @@ public String primaryLocation() { } /** - * Get the statusOfPrimary value. + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable'. * * @return the statusOfPrimary value */ @@ -185,7 +185,7 @@ public AccountStatus statusOfPrimary() { } /** - * Get the lastGeoFailoverTime value. + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the lastGeoFailoverTime value */ @@ -194,7 +194,7 @@ public DateTime lastGeoFailoverTime() { } /** - * Get the secondaryLocation value. + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the secondaryLocation value */ @@ -203,7 +203,7 @@ public String secondaryLocation() { } /** - * Get the statusOfSecondary value. + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable'. * * @return the statusOfSecondary value */ @@ -212,7 +212,7 @@ public AccountStatus statusOfSecondary() { } /** - * Get the creationTime value. + * Get gets the creation date and time of the storage account in UTC. * * @return the creationTime value */ @@ -221,7 +221,7 @@ public DateTime creationTime() { } /** - * Get the customDomain value. + * Get gets the custom domain the user assigned to this storage account. * * @return the customDomain value */ @@ -230,7 +230,7 @@ public CustomDomain customDomain() { } /** - * Get the secondaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. * * @return the secondaryEndpoints value */ @@ -239,7 +239,7 @@ public Endpoints secondaryEndpoints() { } /** - * Get the encryption value. + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. * * @return the encryption value */ @@ -248,7 +248,7 @@ public Encryption encryption() { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountListKeysResultInner.java index ca80b9306fb54..286ba9c7cab97 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountListKeysResultInner.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/StorageAccountListKeysResultInner.java @@ -24,7 +24,7 @@ public class StorageAccountListKeysResultInner { private List keys; /** - * Get the keys value. + * Get gets the list of storage account keys and their properties for the specified storage account. * * @return the keys value */ diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/UsageInner.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/UsageInner.java index 833b0afda101a..1e87563f68a59 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/UsageInner.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/implementation/UsageInner.java @@ -43,7 +43,7 @@ public class UsageInner { private UsageName name; /** - * Get the unit value. + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. * * @return the unit value */ @@ -52,7 +52,7 @@ public UsageUnit unit() { } /** - * Get the currentValue value. + * Get gets the current count of the allocated resources in the subscription. * * @return the currentValue value */ @@ -61,7 +61,7 @@ public Integer currentValue() { } /** - * Get the limit value. + * Get gets the maximum count of the resources that can be allocated in the subscription. * * @return the limit value */ @@ -70,7 +70,7 @@ public Integer limit() { } /** - * Get the name value. + * Get gets the name of the type of usage. * * @return the name value */ diff --git a/storage/resource-manager/v2017_10_01/pom.xml b/storage/resource-manager/v2017_10_01/pom.xml index 1b5aa73f1f4a9..1ad59c15226e5 100644 --- a/storage/resource-manager/v2017_10_01/pom.xml +++ b/storage/resource-manager/v2017_10_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.storage.v2017_10_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-storage - 1.0.0-beta - jar - Microsoft Azure SDK for Storage Management - This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.storage.v2017_10_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/AccountSasParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/AccountSasParameters.java index caa5dc4beb273..6b0f6220e85d9 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/AccountSasParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/AccountSasParameters.java @@ -74,7 +74,7 @@ public class AccountSasParameters { private String keyToSign; /** - * Get the services value. + * Get the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @return the services value */ @@ -83,7 +83,7 @@ public Services services() { } /** - * Set the services value. + * Set the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @param services the services value to set * @return the AccountSasParameters object itself. @@ -94,7 +94,7 @@ public AccountSasParameters withServices(Services services) { } /** - * Get the resourceTypes value. + * Get the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @return the resourceTypes value */ @@ -103,7 +103,7 @@ public SignedResourceTypes resourceTypes() { } /** - * Set the resourceTypes value. + * Set the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @param resourceTypes the resourceTypes value to set * @return the AccountSasParameters object itself. @@ -114,7 +114,7 @@ public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) } /** - * Get the permissions value. + * Get the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -123,7 +123,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the AccountSasParameters object itself. @@ -134,7 +134,7 @@ public AccountSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -143,7 +143,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the AccountSasParameters object itself. @@ -154,7 +154,7 @@ public AccountSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -163,7 +163,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the AccountSasParameters object itself. @@ -174,7 +174,7 @@ public AccountSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -183,7 +183,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the AccountSasParameters object itself. @@ -194,7 +194,7 @@ public AccountSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -203,7 +203,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the AccountSasParameters object itself. @@ -214,7 +214,7 @@ public AccountSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -223,7 +223,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the AccountSasParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java index 7aa49dab321a3..cbc14318cf296 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java @@ -30,7 +30,7 @@ public class CustomDomain { private Boolean useSubDomain; /** - * Get the name value. + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @param name the name value to set * @return the CustomDomain object itself. @@ -50,7 +50,7 @@ public CustomDomain withName(String name) { } /** - * Get the useSubDomain value. + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @return the useSubDomain value */ @@ -59,7 +59,7 @@ public Boolean useSubDomain() { } /** - * Set the useSubDomain value. + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @param useSubDomain the useSubDomain value to set * @return the CustomDomain object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java index 21b261317b5b4..9cb5f123501e9 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java @@ -27,7 +27,7 @@ public class Dimension { private String displayName; /** - * Get the name value. + * Get display name of dimension. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Set the name value. + * Set display name of dimension. * * @param name the name value to set * @return the Dimension object itself. @@ -47,7 +47,7 @@ public Dimension withName(String name) { } /** - * Get the displayName value. + * Get display name of dimension. * * @return the displayName value */ @@ -56,7 +56,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of dimension. * * @param displayName the displayName value to set * @return the Dimension object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Encryption.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Encryption.java index a35e416db3ce0..c6d34415e1b87 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Encryption.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Encryption.java @@ -35,7 +35,7 @@ public class Encryption { private KeyVaultProperties keyVaultProperties; /** - * Get the services value. + * Get list of services which support encryption. * * @return the services value */ @@ -44,7 +44,7 @@ public EncryptionServices services() { } /** - * Set the services value. + * Set list of services which support encryption. * * @param services the services value to set * @return the Encryption object itself. @@ -55,7 +55,7 @@ public Encryption withServices(EncryptionServices services) { } /** - * Get the keySource value. + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @return the keySource value */ @@ -64,7 +64,7 @@ public KeySource keySource() { } /** - * Set the keySource value. + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @param keySource the keySource value to set * @return the Encryption object itself. @@ -75,7 +75,7 @@ public Encryption withKeySource(KeySource keySource) { } /** - * Get the keyVaultProperties value. + * Get properties provided by key vault. * * @return the keyVaultProperties value */ @@ -84,7 +84,7 @@ public KeyVaultProperties keyVaultProperties() { } /** - * Set the keyVaultProperties value. + * Set properties provided by key vault. * * @param keyVaultProperties the keyVaultProperties value to set * @return the Encryption object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionService.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionService.java index aa32bdcbbb182..5257fca9e59ff 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionService.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionService.java @@ -32,7 +32,7 @@ public class EncryptionService { private DateTime lastEnabledTime; /** - * Get the enabled value. + * Get a boolean indicating whether or not the service encrypts the data as it is stored. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set a boolean indicating whether or not the service encrypts the data as it is stored. * * @param enabled the enabled value to set * @return the EncryptionService object itself. @@ -52,7 +52,7 @@ public EncryptionService withEnabled(Boolean enabled) { } /** - * Get the lastEnabledTime value. + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. * * @return the lastEnabledTime value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionServices.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionServices.java index 1e54c2518d3d3..dff260cf076ab 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionServices.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/EncryptionServices.java @@ -39,7 +39,7 @@ public class EncryptionServices { private EncryptionService queue; /** - * Get the blob value. + * Get the encryption function of the blob storage service. * * @return the blob value */ @@ -48,7 +48,7 @@ public EncryptionService blob() { } /** - * Set the blob value. + * Set the encryption function of the blob storage service. * * @param blob the blob value to set * @return the EncryptionServices object itself. @@ -59,7 +59,7 @@ public EncryptionServices withBlob(EncryptionService blob) { } /** - * Get the file value. + * Get the encryption function of the file storage service. * * @return the file value */ @@ -68,7 +68,7 @@ public EncryptionService file() { } /** - * Set the file value. + * Set the encryption function of the file storage service. * * @param file the file value to set * @return the EncryptionServices object itself. @@ -79,7 +79,7 @@ public EncryptionServices withFile(EncryptionService file) { } /** - * Get the table value. + * Get the encryption function of the table storage service. * * @return the table value */ @@ -88,7 +88,7 @@ public EncryptionService table() { } /** - * Get the queue value. + * Get the encryption function of the queue storage service. * * @return the queue value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Endpoints.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Endpoints.java index 5d66cb8932bd8..b7db755ab359b 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Endpoints.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Endpoints.java @@ -40,7 +40,7 @@ public class Endpoints { private String file; /** - * Get the blob value. + * Get gets the blob endpoint. * * @return the blob value */ @@ -49,7 +49,7 @@ public String blob() { } /** - * Get the queue value. + * Get gets the queue endpoint. * * @return the queue value */ @@ -58,7 +58,7 @@ public String queue() { } /** - * Get the table value. + * Get gets the table endpoint. * * @return the table value */ @@ -67,7 +67,7 @@ public String table() { } /** - * Get the file value. + * Get gets the file endpoint. * * @return the file value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/IPRule.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/IPRule.java index df1ea1385bfc8..1022770779941 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/IPRule.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/IPRule.java @@ -28,7 +28,7 @@ public class IPRule { private Action action; /** - * Get the iPAddressOrRange value. + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @return the iPAddressOrRange value */ @@ -37,7 +37,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the IPRule object itself. @@ -48,7 +48,7 @@ public IPRule withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the action value. + * Get the action of IP ACL rule. Possible values include: 'Allow'. * * @return the action value */ @@ -57,7 +57,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of IP ACL rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the IPRule object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Identity.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Identity.java index 78535a23e4c44..4b2a391cdfd16 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Identity.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Identity.java @@ -40,7 +40,7 @@ public Identity() { } /** - * Get the principalId value. + * Get the principal ID of resource identity. * * @return the principalId value */ @@ -49,7 +49,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant ID of resource. * * @return the tenantId value */ @@ -58,7 +58,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the identity type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Set the type value. + * Set the identity type. * * @param type the type value to set * @return the Identity object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/KeyVaultProperties.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/KeyVaultProperties.java index 5f0462e628d1b..ac36cb6c31fcd 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/KeyVaultProperties.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/KeyVaultProperties.java @@ -33,7 +33,7 @@ public class KeyVaultProperties { private String keyVaultUri; /** - * Get the keyName value. + * Get the name of KeyVault key. * * @return the keyName value */ @@ -42,7 +42,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of KeyVault key. * * @param keyName the keyName value to set * @return the KeyVaultProperties object itself. @@ -53,7 +53,7 @@ public KeyVaultProperties withKeyName(String keyName) { } /** - * Get the keyVersion value. + * Get the version of KeyVault key. * * @return the keyVersion value */ @@ -62,7 +62,7 @@ public String keyVersion() { } /** - * Set the keyVersion value. + * Set the version of KeyVault key. * * @param keyVersion the keyVersion value to set * @return the KeyVaultProperties object itself. @@ -73,7 +73,7 @@ public KeyVaultProperties withKeyVersion(String keyVersion) { } /** - * Get the keyVaultUri value. + * Get the Uri of KeyVault. * * @return the keyVaultUri value */ @@ -82,7 +82,7 @@ public String keyVaultUri() { } /** - * Set the keyVaultUri value. + * Set the Uri of KeyVault. * * @param keyVaultUri the keyVaultUri value to set * @return the KeyVaultProperties object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/MetricSpecification.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/MetricSpecification.java index 3c2d7331da058..3c6082815d8da 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/MetricSpecification.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/MetricSpecification.java @@ -70,7 +70,7 @@ public class MetricSpecification { private String resourceIdDimensionNameOverride; /** - * Get the name value. + * Get name of metric specification. * * @return the name value */ @@ -79,7 +79,7 @@ public String name() { } /** - * Set the name value. + * Set name of metric specification. * * @param name the name value to set * @return the MetricSpecification object itself. @@ -90,7 +90,7 @@ public MetricSpecification withName(String name) { } /** - * Get the displayName value. + * Get display name of metric specification. * * @return the displayName value */ @@ -99,7 +99,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of metric specification. * * @param displayName the displayName value to set * @return the MetricSpecification object itself. @@ -110,7 +110,7 @@ public MetricSpecification withDisplayName(String displayName) { } /** - * Get the displayDescription value. + * Get display description of metric specification. * * @return the displayDescription value */ @@ -119,7 +119,7 @@ public String displayDescription() { } /** - * Set the displayDescription value. + * Set display description of metric specification. * * @param displayDescription the displayDescription value to set * @return the MetricSpecification object itself. @@ -130,7 +130,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { } /** - * Get the unit value. + * Get unit could be Bytes or Count. * * @return the unit value */ @@ -139,7 +139,7 @@ public String unit() { } /** - * Set the unit value. + * Set unit could be Bytes or Count. * * @param unit the unit value to set * @return the MetricSpecification object itself. @@ -150,7 +150,7 @@ public MetricSpecification withUnit(String unit) { } /** - * Get the dimensions value. + * Get dimensions of blobs, including blob type and access tier. * * @return the dimensions value */ @@ -159,7 +159,7 @@ public List dimensions() { } /** - * Set the dimensions value. + * Set dimensions of blobs, including blob type and access tier. * * @param dimensions the dimensions value to set * @return the MetricSpecification object itself. @@ -170,7 +170,7 @@ public MetricSpecification withDimensions(List dimensions) { } /** - * Get the aggregationType value. + * Get aggregation type could be Average. * * @return the aggregationType value */ @@ -179,7 +179,7 @@ public String aggregationType() { } /** - * Set the aggregationType value. + * Set aggregation type could be Average. * * @param aggregationType the aggregationType value to set * @return the MetricSpecification object itself. @@ -190,7 +190,7 @@ public MetricSpecification withAggregationType(String aggregationType) { } /** - * Get the fillGapWithZero value. + * Get the property to decide fill gap with zero or not. * * @return the fillGapWithZero value */ @@ -199,7 +199,7 @@ public Boolean fillGapWithZero() { } /** - * Set the fillGapWithZero value. + * Set the property to decide fill gap with zero or not. * * @param fillGapWithZero the fillGapWithZero value to set * @return the MetricSpecification object itself. @@ -210,7 +210,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { } /** - * Get the category value. + * Get the category this metric specification belong to, could be Capacity. * * @return the category value */ @@ -219,7 +219,7 @@ public String category() { } /** - * Set the category value. + * Set the category this metric specification belong to, could be Capacity. * * @param category the category value to set * @return the MetricSpecification object itself. @@ -230,7 +230,7 @@ public MetricSpecification withCategory(String category) { } /** - * Get the resourceIdDimensionNameOverride value. + * Get account Resource Id. * * @return the resourceIdDimensionNameOverride value */ @@ -239,7 +239,7 @@ public String resourceIdDimensionNameOverride() { } /** - * Set the resourceIdDimensionNameOverride value. + * Set account Resource Id. * * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set * @return the MetricSpecification object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/NetworkRuleSet.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/NetworkRuleSet.java index 2cc2d8d354793..10e2ee66824da 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/NetworkRuleSet.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/NetworkRuleSet.java @@ -45,7 +45,7 @@ public class NetworkRuleSet { private DefaultAction defaultAction; /** - * Get the bypass value. + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @return the bypass value */ @@ -54,7 +54,7 @@ public Bypass bypass() { } /** - * Set the bypass value. + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @param bypass the bypass value to set * @return the NetworkRuleSet object itself. @@ -65,7 +65,7 @@ public NetworkRuleSet withBypass(Bypass bypass) { } /** - * Get the virtualNetworkRules value. + * Get sets the virtual network rules. * * @return the virtualNetworkRules value */ @@ -74,7 +74,7 @@ public List virtualNetworkRules() { } /** - * Set the virtualNetworkRules value. + * Set sets the virtual network rules. * * @param virtualNetworkRules the virtualNetworkRules value to set * @return the NetworkRuleSet object itself. @@ -85,7 +85,7 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe } /** - * Get the ipRules value. + * Get sets the IP ACL rules. * * @return the ipRules value */ @@ -94,7 +94,7 @@ public List ipRules() { } /** - * Set the ipRules value. + * Set sets the IP ACL rules. * * @param ipRules the ipRules value to set * @return the NetworkRuleSet object itself. @@ -105,7 +105,7 @@ public NetworkRuleSet withIpRules(List ipRules) { } /** - * Get the defaultAction value. + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @return the defaultAction value */ @@ -114,7 +114,7 @@ public DefaultAction defaultAction() { } /** - * Set the defaultAction value. + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @param defaultAction the defaultAction value to set * @return the NetworkRuleSet object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/OperationDisplay.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/OperationDisplay.java index 6e8eb87b26841..d60bb5532f2d0 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/OperationDisplay.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/OperationDisplay.java @@ -33,7 +33,7 @@ public class OperationDisplay { private String operation; /** - * Get the provider value. + * Get service provider: Microsoft Storage. * * @return the provider value */ @@ -42,7 +42,7 @@ public String provider() { } /** - * Set the provider value. + * Set service provider: Microsoft Storage. * * @param provider the provider value to set * @return the OperationDisplay object itself. @@ -53,7 +53,7 @@ public OperationDisplay withProvider(String provider) { } /** - * Get the resource value. + * Get resource on which the operation is performed etc. * * @return the resource value */ @@ -62,7 +62,7 @@ public String resource() { } /** - * Set the resource value. + * Set resource on which the operation is performed etc. * * @param resource the resource value to set * @return the OperationDisplay object itself. @@ -73,7 +73,7 @@ public OperationDisplay withResource(String resource) { } /** - * Get the operation value. + * Get type of operation: get, read, delete, etc. * * @return the operation value */ @@ -82,7 +82,7 @@ public String operation() { } /** - * Set the operation value. + * Set type of operation: get, read, delete, etc. * * @param operation the operation value to set * @return the OperationDisplay object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Restriction.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Restriction.java index 07786ab74e8a0..d4642fab11a82 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Restriction.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Restriction.java @@ -30,17 +30,17 @@ public class Restriction { private List values; /** - * The reason for the restriction. As of now this can be “QuotaId” or - * “NotAvailableForSubscription”. Quota Id is set when the SKU has + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has * requiredQuotas parameter as the subscription does not belong to that - * quota. The “NotAvailableForSubscription” is related to capacity at DC. + * quota. The "NotAvailableForSubscription" is related to capacity at DC. * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. */ @JsonProperty(value = "reasonCode") private ReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. As of now only possible value for this is location. * * @return the type value */ @@ -49,7 +49,7 @@ public String type() { } /** - * Get the values value. + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. * * @return the values value */ @@ -58,7 +58,7 @@ public List values() { } /** - * Get the reasonCode value. + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @return the reasonCode value */ @@ -67,7 +67,7 @@ public ReasonCode reasonCode() { } /** - * Set the reasonCode value. + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @param reasonCode the reasonCode value to set * @return the Restriction object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/SKUCapability.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/SKUCapability.java index ab9c05b2fb1db..9038cca00c50c 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/SKUCapability.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/SKUCapability.java @@ -30,7 +30,7 @@ public class SKUCapability { private String value; /** - * Get the name value. + * Get the name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Get the value value. + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. * * @return the value value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java index 95c9b9b6f1298..033862f56610c 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java @@ -131,7 +131,7 @@ public class ServiceSasParameters { private String contentType; /** - * Get the canonicalizedResource value. + * Get the canonical path to the signed resource. * * @return the canonicalizedResource value */ @@ -140,7 +140,7 @@ public String canonicalizedResource() { } /** - * Set the canonicalizedResource value. + * Set the canonical path to the signed resource. * * @param canonicalizedResource the canonicalizedResource value to set * @return the ServiceSasParameters object itself. @@ -151,7 +151,7 @@ public ServiceSasParameters withCanonicalizedResource(String canonicalizedResour } /** - * Get the resource value. + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @return the resource value */ @@ -160,7 +160,7 @@ public SignedResource resource() { } /** - * Set the resource value. + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @param resource the resource value to set * @return the ServiceSasParameters object itself. @@ -171,7 +171,7 @@ public ServiceSasParameters withResource(SignedResource resource) { } /** - * Get the permissions value. + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -180,7 +180,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the ServiceSasParameters object itself. @@ -191,7 +191,7 @@ public ServiceSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -200,7 +200,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the ServiceSasParameters object itself. @@ -211,7 +211,7 @@ public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -220,7 +220,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the ServiceSasParameters object itself. @@ -231,7 +231,7 @@ public ServiceSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -240,7 +240,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the ServiceSasParameters object itself. @@ -251,7 +251,7 @@ public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -260,7 +260,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the ServiceSasParameters object itself. @@ -271,7 +271,7 @@ public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the identifier value. + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @return the identifier value */ @@ -280,7 +280,7 @@ public String identifier() { } /** - * Set the identifier value. + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @param identifier the identifier value to set * @return the ServiceSasParameters object itself. @@ -291,7 +291,7 @@ public ServiceSasParameters withIdentifier(String identifier) { } /** - * Get the partitionKeyStart value. + * Get the start of partition key. * * @return the partitionKeyStart value */ @@ -300,7 +300,7 @@ public String partitionKeyStart() { } /** - * Set the partitionKeyStart value. + * Set the start of partition key. * * @param partitionKeyStart the partitionKeyStart value to set * @return the ServiceSasParameters object itself. @@ -311,7 +311,7 @@ public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { } /** - * Get the partitionKeyEnd value. + * Get the end of partition key. * * @return the partitionKeyEnd value */ @@ -320,7 +320,7 @@ public String partitionKeyEnd() { } /** - * Set the partitionKeyEnd value. + * Set the end of partition key. * * @param partitionKeyEnd the partitionKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -331,7 +331,7 @@ public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { } /** - * Get the rowKeyStart value. + * Get the start of row key. * * @return the rowKeyStart value */ @@ -340,7 +340,7 @@ public String rowKeyStart() { } /** - * Set the rowKeyStart value. + * Set the start of row key. * * @param rowKeyStart the rowKeyStart value to set * @return the ServiceSasParameters object itself. @@ -351,7 +351,7 @@ public ServiceSasParameters withRowKeyStart(String rowKeyStart) { } /** - * Get the rowKeyEnd value. + * Get the end of row key. * * @return the rowKeyEnd value */ @@ -360,7 +360,7 @@ public String rowKeyEnd() { } /** - * Set the rowKeyEnd value. + * Set the end of row key. * * @param rowKeyEnd the rowKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -371,7 +371,7 @@ public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -380,7 +380,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the ServiceSasParameters object itself. @@ -391,7 +391,7 @@ public ServiceSasParameters withKeyToSign(String keyToSign) { } /** - * Get the cacheControl value. + * Get the response header override for cache control. * * @return the cacheControl value */ @@ -400,7 +400,7 @@ public String cacheControl() { } /** - * Set the cacheControl value. + * Set the response header override for cache control. * * @param cacheControl the cacheControl value to set * @return the ServiceSasParameters object itself. @@ -411,7 +411,7 @@ public ServiceSasParameters withCacheControl(String cacheControl) { } /** - * Get the contentDisposition value. + * Get the response header override for content disposition. * * @return the contentDisposition value */ @@ -420,7 +420,7 @@ public String contentDisposition() { } /** - * Set the contentDisposition value. + * Set the response header override for content disposition. * * @param contentDisposition the contentDisposition value to set * @return the ServiceSasParameters object itself. @@ -431,7 +431,7 @@ public ServiceSasParameters withContentDisposition(String contentDisposition) { } /** - * Get the contentEncoding value. + * Get the response header override for content encoding. * * @return the contentEncoding value */ @@ -440,7 +440,7 @@ public String contentEncoding() { } /** - * Set the contentEncoding value. + * Set the response header override for content encoding. * * @param contentEncoding the contentEncoding value to set * @return the ServiceSasParameters object itself. @@ -451,7 +451,7 @@ public ServiceSasParameters withContentEncoding(String contentEncoding) { } /** - * Get the contentLanguage value. + * Get the response header override for content language. * * @return the contentLanguage value */ @@ -460,7 +460,7 @@ public String contentLanguage() { } /** - * Set the contentLanguage value. + * Set the response header override for content language. * * @param contentLanguage the contentLanguage value to set * @return the ServiceSasParameters object itself. @@ -471,7 +471,7 @@ public ServiceSasParameters withContentLanguage(String contentLanguage) { } /** - * Get the contentType value. + * Get the response header override for content type. * * @return the contentType value */ @@ -480,7 +480,7 @@ public String contentType() { } /** - * Set the contentType value. + * Set the response header override for content type. * * @param contentType the contentType value to set * @return the ServiceSasParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSpecification.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSpecification.java index 253d82ce029ce..e9afb761ed8d2 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSpecification.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSpecification.java @@ -22,7 +22,7 @@ public class ServiceSpecification { private List metricSpecifications; /** - * Get the metricSpecifications value. + * Get metric specifications of operation. * * @return the metricSpecifications value */ @@ -31,7 +31,7 @@ public List metricSpecifications() { } /** - * Set the metricSpecifications value. + * Set metric specifications of operation. * * @param metricSpecifications the metricSpecifications value to set * @return the ServiceSpecification object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java index 0ac3b08c2921a..0a7a5fe13744d 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2017_10_01.implementation.StorageManager; import com.microsoft.azure.management.storage.v2017_10_01.implementation.SkuInner; diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCheckNameAvailabilityParameters.java index 0493671817e3d..4a7a034043b1b 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCheckNameAvailabilityParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCheckNameAvailabilityParameters.java @@ -28,13 +28,14 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; } /** - * Get the name value. + * Get the storage account name. * * @return the name value */ @@ -43,7 +44,7 @@ public String name() { } /** - * Set the name value. + * Set the storage account name. * * @param name the name value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. @@ -54,7 +55,7 @@ public StorageAccountCheckNameAvailabilityParameters withName(String name) { } /** - * Get the type value. + * Get the type of resource, Microsoft.Storage/storageAccounts. * * @return the type value */ @@ -63,7 +64,7 @@ public String type() { } /** - * Set the type value. + * Set the type of resource, Microsoft.Storage/storageAccounts. * * @param type the type value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCreateParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCreateParameters.java index e218d0277e5c9..1847792d6b1f7 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCreateParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountCreateParameters.java @@ -94,7 +94,7 @@ public class StorageAccountCreateParameters { private Boolean enableHttpsTrafficOnly; /** - * Get the sku value. + * Get required. Gets or sets the sku name. * * @return the sku value */ @@ -103,7 +103,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set required. Gets or sets the sku name. * * @param sku the sku value to set * @return the StorageAccountCreateParameters object itself. @@ -114,7 +114,7 @@ public StorageAccountCreateParameters withSku(SkuInner sku) { } /** - * Get the kind value. + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -123,7 +123,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountCreateParameters object itself. @@ -134,7 +134,7 @@ public StorageAccountCreateParameters withKind(Kind kind) { } /** - * Get the location value. + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @return the location value */ @@ -143,7 +143,7 @@ public String location() { } /** - * Set the location value. + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @param location the location value to set * @return the StorageAccountCreateParameters object itself. @@ -154,7 +154,7 @@ public StorageAccountCreateParameters withLocation(String location) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @return the tags value */ @@ -163,7 +163,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @param tags the tags value to set * @return the StorageAccountCreateParameters object itself. @@ -174,7 +174,7 @@ public StorageAccountCreateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -183,7 +183,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountCreateParameters object itself. @@ -194,7 +194,7 @@ public StorageAccountCreateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -203,7 +203,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountCreateParameters object itself. @@ -214,7 +214,7 @@ public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @return the encryption value */ @@ -223,7 +223,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountCreateParameters object itself. @@ -234,7 +234,7 @@ public StorageAccountCreateParameters withEncryption(Encryption encryption) { } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -243,7 +243,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountCreateParameters object itself. @@ -254,7 +254,7 @@ public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -263,7 +263,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountCreateParameters object itself. @@ -274,7 +274,7 @@ public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -283,7 +283,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountCreateParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountKey.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountKey.java index ba77f3dda8703..99cf7cfe91ab1 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountKey.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountKey.java @@ -34,7 +34,7 @@ public class StorageAccountKey { private KeyPermission permissions; /** - * Get the keyName value. + * Get name of the key. * * @return the keyName value */ @@ -43,7 +43,7 @@ public String keyName() { } /** - * Get the value value. + * Get base 64-encoded value of the key. * * @return the value value */ @@ -52,7 +52,7 @@ public String value() { } /** - * Get the permissions value. + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. * * @return the permissions value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountRegenerateKeyParameters.java index 1a21defa6e7d3..edb640efa9c55 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountRegenerateKeyParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountRegenerateKeyParameters.java @@ -22,7 +22,7 @@ public class StorageAccountRegenerateKeyParameters { private String keyName; /** - * Get the keyName value. + * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountUpdateParameters.java index 2966e5397c0e4..5a0b2922f168b 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountUpdateParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccountUpdateParameters.java @@ -87,7 +87,7 @@ public class StorageAccountUpdateParameters { private Kind kind; /** - * Get the sku value. + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @return the sku value */ @@ -96,7 +96,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. @@ -107,7 +107,7 @@ public StorageAccountUpdateParameters withSku(SkuInner sku) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @return the tags value */ @@ -116,7 +116,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @param tags the tags value to set * @return the StorageAccountUpdateParameters object itself. @@ -127,7 +127,7 @@ public StorageAccountUpdateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -136,7 +136,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountUpdateParameters object itself. @@ -147,7 +147,7 @@ public StorageAccountUpdateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -156,7 +156,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountUpdateParameters object itself. @@ -167,7 +167,7 @@ public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. The default setting is unencrypted. * * @return the encryption value */ @@ -176,7 +176,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountUpdateParameters object itself. @@ -187,7 +187,7 @@ public StorageAccountUpdateParameters withEncryption(Encryption encryption) { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -196,7 +196,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountUpdateParameters object itself. @@ -207,7 +207,7 @@ public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -216,7 +216,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountUpdateParameters object itself. @@ -227,7 +227,7 @@ public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableH } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -236,7 +236,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountUpdateParameters object itself. @@ -247,7 +247,7 @@ public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the kind value. + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -256,7 +256,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountUpdateParameters object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/UsageName.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/UsageName.java index a943bd1955001..745d4c6520d75 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/UsageName.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get gets a string describing the resource name. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get gets a localized string describing the resource name. * * @return the localizedValue value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/VirtualNetworkRule.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/VirtualNetworkRule.java index a61118195afe7..dec8e35a7cb75 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/VirtualNetworkRule.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/VirtualNetworkRule.java @@ -36,7 +36,7 @@ public class VirtualNetworkRule { private State state; /** - * Get the virtualNetworkResourceId value. + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @return the virtualNetworkResourceId value */ @@ -45,7 +45,7 @@ public String virtualNetworkResourceId() { } /** - * Set the virtualNetworkResourceId value. + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @param virtualNetworkResourceId the virtualNetworkResourceId value to set * @return the VirtualNetworkRule object itself. @@ -56,7 +56,7 @@ public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkReso } /** - * Get the action value. + * Get the action of virtual network rule. Possible values include: 'Allow'. * * @return the action value */ @@ -65,7 +65,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of virtual network rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the VirtualNetworkRule object itself. @@ -76,7 +76,7 @@ public VirtualNetworkRule withAction(Action action) { } /** - * Get the state value. + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @return the state value */ @@ -85,7 +85,7 @@ public State state() { } /** - * Set the state value. + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @param state the state value to set * @return the VirtualNetworkRule object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/CheckNameAvailabilityResultInner.java index 62238c0976fc3..586e9b1541e8f 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/CheckNameAvailabilityResultInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/CheckNameAvailabilityResultInner.java @@ -38,7 +38,7 @@ public class CheckNameAvailabilityResultInner { private String message; /** - * Get the nameAvailable value. + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. * * @return the nameAvailable value */ @@ -47,7 +47,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. * * @return the reason value */ @@ -56,7 +56,7 @@ public Reason reason() { } /** - * Get the message value. + * Get gets an error message explaining the Reason value in more detail. * * @return the message value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListAccountSasResponseInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListAccountSasResponseInner.java index 48031b4619efb..3742a311a4788 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListAccountSasResponseInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListAccountSasResponseInner.java @@ -21,7 +21,7 @@ public class ListAccountSasResponseInner { private String accountSasToken; /** - * Get the accountSasToken value. + * Get list SAS credentials of storage account. * * @return the accountSasToken value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListServiceSasResponseInner.java index 4b6ba7f73c792..a93381e449fb4 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/ListServiceSasResponseInner.java @@ -21,7 +21,7 @@ public class ListServiceSasResponseInner { private String serviceSasToken; /** - * Get the serviceSasToken value. + * Get list service SAS credentials of speicific resource. * * @return the serviceSasToken value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationInner.java index 02b8f6bc6bdec..798a315526eec 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationInner.java @@ -43,7 +43,7 @@ public class OperationInner { private ServiceSpecification serviceSpecification; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{operation}. * * @return the name value */ @@ -52,7 +52,7 @@ public String name() { } /** - * Set the name value. + * Set operation name: {provider}/{resource}/{operation}. * * @param name the name value to set * @return the OperationInner object itself. @@ -63,7 +63,7 @@ public OperationInner withName(String name) { } /** - * Get the display value. + * Get display metadata associated with the operation. * * @return the display value */ @@ -72,7 +72,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set display metadata associated with the operation. * * @param display the display value to set * @return the OperationInner object itself. @@ -83,7 +83,7 @@ public OperationInner withDisplay(OperationDisplay display) { } /** - * Get the origin value. + * Get the origin of operations. * * @return the origin value */ @@ -92,7 +92,7 @@ public String origin() { } /** - * Set the origin value. + * Set the origin of operations. * * @param origin the origin value to set * @return the OperationInner object itself. @@ -103,7 +103,7 @@ public OperationInner withOrigin(String origin) { } /** - * Get the serviceSpecification value. + * Get one property of operation, include metric specifications. * * @return the serviceSpecification value */ @@ -112,7 +112,7 @@ public ServiceSpecification serviceSpecification() { } /** - * Set the serviceSpecification value. + * Set one property of operation, include metric specifications. * * @param serviceSpecification the serviceSpecification value to set * @return the OperationInner object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationsImpl.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationsImpl.java index 768929da85a82..a259c4e55e529 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationsImpl.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/OperationsImpl.java @@ -37,7 +37,8 @@ public Observable listAsync() { public Observable call(List innerList) { return Observable.from(innerList); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public Operation call(OperationInner inner) { return new OperationImpl(inner, manager()); diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/SkuInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/SkuInner.java index 9bfff491c3055..317f6ede0e05d 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/SkuInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/SkuInner.java @@ -72,7 +72,7 @@ public class SkuInner { private List restrictions; /** - * Get the name value. + * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @return the name value */ @@ -81,7 +81,7 @@ public SkuName name() { } /** - * Set the name value. + * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @param name the name value to set * @return the SkuInner object itself. @@ -92,7 +92,7 @@ public SkuInner withName(SkuName name) { } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ @@ -101,7 +101,7 @@ public SkuTier tier() { } /** - * Get the resourceType value. + * Get the type of the resource, usually it is 'storageAccounts'. * * @return the resourceType value */ @@ -110,7 +110,7 @@ public String resourceType() { } /** - * Get the kind value. + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -119,7 +119,7 @@ public Kind kind() { } /** - * Get the locations value. + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). * * @return the locations value */ @@ -128,7 +128,7 @@ public List locations() { } /** - * Get the capabilities value. + * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the capabilities value */ @@ -137,7 +137,7 @@ public List capabilities() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ @@ -146,7 +146,7 @@ public List restrictions() { } /** - * Set the restrictions value. + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @param restrictions the restrictions value to set * @return the SkuInner object itself. diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountInner.java index 76900ed8e50d5..707c19136c15d 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountInner.java @@ -151,7 +151,7 @@ public class StorageAccountInner extends Resource { private NetworkRuleSet networkRuleSet; /** - * Get the sku value. + * Get gets the SKU. * * @return the sku value */ @@ -160,7 +160,7 @@ public SkuInner sku() { } /** - * Get the kind value. + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -169,7 +169,7 @@ public Kind kind() { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -178,7 +178,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountInner object itself. @@ -189,7 +189,7 @@ public StorageAccountInner withIdentity(Identity identity) { } /** - * Get the provisioningState value. + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. * * @return the provisioningState value */ @@ -198,7 +198,7 @@ public ProvisioningState provisioningState() { } /** - * Get the primaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. * * @return the primaryEndpoints value */ @@ -207,7 +207,7 @@ public Endpoints primaryEndpoints() { } /** - * Get the primaryLocation value. + * Get gets the location of the primary data center for the storage account. * * @return the primaryLocation value */ @@ -216,7 +216,7 @@ public String primaryLocation() { } /** - * Get the statusOfPrimary value. + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. * * @return the statusOfPrimary value */ @@ -225,7 +225,7 @@ public AccountStatus statusOfPrimary() { } /** - * Get the lastGeoFailoverTime value. + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the lastGeoFailoverTime value */ @@ -234,7 +234,7 @@ public DateTime lastGeoFailoverTime() { } /** - * Get the secondaryLocation value. + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the secondaryLocation value */ @@ -243,7 +243,7 @@ public String secondaryLocation() { } /** - * Get the statusOfSecondary value. + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. * * @return the statusOfSecondary value */ @@ -252,7 +252,7 @@ public AccountStatus statusOfSecondary() { } /** - * Get the creationTime value. + * Get gets the creation date and time of the storage account in UTC. * * @return the creationTime value */ @@ -261,7 +261,7 @@ public DateTime creationTime() { } /** - * Get the customDomain value. + * Get gets the custom domain the user assigned to this storage account. * * @return the customDomain value */ @@ -270,7 +270,7 @@ public CustomDomain customDomain() { } /** - * Get the secondaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. * * @return the secondaryEndpoints value */ @@ -279,7 +279,7 @@ public Endpoints secondaryEndpoints() { } /** - * Get the encryption value. + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. * * @return the encryption value */ @@ -288,7 +288,7 @@ public Encryption encryption() { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -297,7 +297,7 @@ public AccessTier accessTier() { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -306,7 +306,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountInner object itself. @@ -317,7 +317,7 @@ public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTraffic } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountListKeysResultInner.java index 95a9874165914..4d24a7d8d334e 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountListKeysResultInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/StorageAccountListKeysResultInner.java @@ -24,7 +24,7 @@ public class StorageAccountListKeysResultInner { private List keys; /** - * Get the keys value. + * Get gets the list of storage account keys and their properties for the specified storage account. * * @return the keys value */ diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/UsageInner.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/UsageInner.java index c6f26d9a32cdd..a2b2d09afcc3b 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/UsageInner.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/implementation/UsageInner.java @@ -43,7 +43,7 @@ public class UsageInner { private UsageName name; /** - * Get the unit value. + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. * * @return the unit value */ @@ -52,7 +52,7 @@ public UsageUnit unit() { } /** - * Get the currentValue value. + * Get gets the current count of the allocated resources in the subscription. * * @return the currentValue value */ @@ -61,7 +61,7 @@ public Integer currentValue() { } /** - * Get the limit value. + * Get gets the maximum count of the resources that can be allocated in the subscription. * * @return the limit value */ @@ -70,7 +70,7 @@ public Integer limit() { } /** - * Get the name value. + * Get gets the name of the type of usage. * * @return the name value */ diff --git a/storage/resource-manager/v2018_02_01/pom.xml b/storage/resource-manager/v2018_02_01/pom.xml index a31a7bd5a0648..674e44ea3aeb7 100644 --- a/storage/resource-manager/v2018_02_01/pom.xml +++ b/storage/resource-manager/v2018_02_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.storage.v2018_02_01 - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-storage - 1.0.0-beta - jar - Microsoft Azure SDK for Storage Management - This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.storage.v2018_02_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AccountSasParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AccountSasParameters.java index 3301309ee1b10..b85429d612e9d 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AccountSasParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AccountSasParameters.java @@ -74,7 +74,7 @@ public class AccountSasParameters { private String keyToSign; /** - * Get the services value. + * Get the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @return the services value */ @@ -83,7 +83,7 @@ public Services services() { } /** - * Set the services value. + * Set the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @param services the services value to set * @return the AccountSasParameters object itself. @@ -94,7 +94,7 @@ public AccountSasParameters withServices(Services services) { } /** - * Get the resourceTypes value. + * Get the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @return the resourceTypes value */ @@ -103,7 +103,7 @@ public SignedResourceTypes resourceTypes() { } /** - * Set the resourceTypes value. + * Set the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @param resourceTypes the resourceTypes value to set * @return the AccountSasParameters object itself. @@ -114,7 +114,7 @@ public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) } /** - * Get the permissions value. + * Get the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -123,7 +123,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the AccountSasParameters object itself. @@ -134,7 +134,7 @@ public AccountSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -143,7 +143,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the AccountSasParameters object itself. @@ -154,7 +154,7 @@ public AccountSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -163,7 +163,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the AccountSasParameters object itself. @@ -174,7 +174,7 @@ public AccountSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -183,7 +183,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the AccountSasParameters object itself. @@ -194,7 +194,7 @@ public AccountSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -203,7 +203,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the AccountSasParameters object itself. @@ -214,7 +214,7 @@ public AccountSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -223,7 +223,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the AccountSasParameters object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AzureEntityResource.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AzureEntityResource.java index ef5c5b70a7822..c8ccc3f800532 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AzureEntityResource.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/AzureEntityResource.java @@ -23,7 +23,7 @@ public class AzureEntityResource extends ProxyResource { private String etag; /** - * Get the etag value. + * Get resource Etag. * * @return the etag value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java index 0d1c4bcc16bb5..feaf8cb438fd2 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java @@ -16,8 +16,18 @@ * Type representing BlobContainers. */ public interface BlobContainers { + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ BlobContainer.DefinitionStages.Blank defineContainer(String name); + /** + * Begins definition for a new ImmutabilityPolicy resource. + * @param name resource name. + * @return the first stage of the new ImmutabilityPolicy definition. + */ ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); /** diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java index d470bca66836d..ec1b16d581b55 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersDeleteImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersDeleteImmutabilityPolicyHeaders.java index 438fbf388575b..afc33afa83c97 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersDeleteImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersDeleteImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersExtendImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersExtendImmutabilityPolicyHeaders.java index af220b641bffa..e6aa97bd6b64a 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersExtendImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersExtendImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersGetImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersGetImmutabilityPolicyHeaders.java index 986149d499e45..76615af8f5183 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersGetImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersGetImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersGetImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersLockImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersLockImmutabilityPolicyHeaders.java index ea619080a4c4d..d893df7ce0ee6 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersLockImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainersLockImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersLockImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java index 06a46c842084b..eb6a3f64f18f2 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java @@ -30,7 +30,7 @@ public class CustomDomain { private Boolean useSubDomain; /** - * Get the name value. + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @param name the name value to set * @return the CustomDomain object itself. @@ -50,7 +50,7 @@ public CustomDomain withName(String name) { } /** - * Get the useSubDomain value. + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @return the useSubDomain value */ @@ -59,7 +59,7 @@ public Boolean useSubDomain() { } /** - * Set the useSubDomain value. + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @param useSubDomain the useSubDomain value to set * @return the CustomDomain object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java index cd8a113913378..e328ee85e6422 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java @@ -27,7 +27,7 @@ public class Dimension { private String displayName; /** - * Get the name value. + * Get display name of dimension. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Set the name value. + * Set display name of dimension. * * @param name the name value to set * @return the Dimension object itself. @@ -47,7 +47,7 @@ public Dimension withName(String name) { } /** - * Get the displayName value. + * Get display name of dimension. * * @return the displayName value */ @@ -56,7 +56,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of dimension. * * @param displayName the displayName value to set * @return the Dimension object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Encryption.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Encryption.java index 6eeb0c192d8e4..2e0a7a7c99122 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Encryption.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Encryption.java @@ -35,7 +35,7 @@ public class Encryption { private KeyVaultProperties keyVaultProperties; /** - * Get the services value. + * Get list of services which support encryption. * * @return the services value */ @@ -44,7 +44,7 @@ public EncryptionServices services() { } /** - * Set the services value. + * Set list of services which support encryption. * * @param services the services value to set * @return the Encryption object itself. @@ -55,7 +55,7 @@ public Encryption withServices(EncryptionServices services) { } /** - * Get the keySource value. + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @return the keySource value */ @@ -64,7 +64,7 @@ public KeySource keySource() { } /** - * Set the keySource value. + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @param keySource the keySource value to set * @return the Encryption object itself. @@ -75,7 +75,7 @@ public Encryption withKeySource(KeySource keySource) { } /** - * Get the keyVaultProperties value. + * Get properties provided by key vault. * * @return the keyVaultProperties value */ @@ -84,7 +84,7 @@ public KeyVaultProperties keyVaultProperties() { } /** - * Set the keyVaultProperties value. + * Set properties provided by key vault. * * @param keyVaultProperties the keyVaultProperties value to set * @return the Encryption object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionService.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionService.java index 9de026a54b4ef..8812b0e9d1c04 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionService.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionService.java @@ -32,7 +32,7 @@ public class EncryptionService { private DateTime lastEnabledTime; /** - * Get the enabled value. + * Get a boolean indicating whether or not the service encrypts the data as it is stored. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set a boolean indicating whether or not the service encrypts the data as it is stored. * * @param enabled the enabled value to set * @return the EncryptionService object itself. @@ -52,7 +52,7 @@ public EncryptionService withEnabled(Boolean enabled) { } /** - * Get the lastEnabledTime value. + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. * * @return the lastEnabledTime value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionServices.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionServices.java index c40f568d8e50b..cc5bf11968316 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionServices.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/EncryptionServices.java @@ -39,7 +39,7 @@ public class EncryptionServices { private EncryptionService queue; /** - * Get the blob value. + * Get the encryption function of the blob storage service. * * @return the blob value */ @@ -48,7 +48,7 @@ public EncryptionService blob() { } /** - * Set the blob value. + * Set the encryption function of the blob storage service. * * @param blob the blob value to set * @return the EncryptionServices object itself. @@ -59,7 +59,7 @@ public EncryptionServices withBlob(EncryptionService blob) { } /** - * Get the file value. + * Get the encryption function of the file storage service. * * @return the file value */ @@ -68,7 +68,7 @@ public EncryptionService file() { } /** - * Set the file value. + * Set the encryption function of the file storage service. * * @param file the file value to set * @return the EncryptionServices object itself. @@ -79,7 +79,7 @@ public EncryptionServices withFile(EncryptionService file) { } /** - * Get the table value. + * Get the encryption function of the table storage service. * * @return the table value */ @@ -88,7 +88,7 @@ public EncryptionService table() { } /** - * Get the queue value. + * Get the encryption function of the queue storage service. * * @return the queue value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Endpoints.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Endpoints.java index 5713f0c54496c..1478be8208a84 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Endpoints.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Endpoints.java @@ -11,8 +11,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The URIs that are used to perform a retrieval of a public blob, queue, or - * table object. + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. */ public class Endpoints { /** @@ -40,7 +40,19 @@ public class Endpoints { private String file; /** - * Get the blob value. + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. * * @return the blob value */ @@ -49,7 +61,7 @@ public String blob() { } /** - * Get the queue value. + * Get gets the queue endpoint. * * @return the queue value */ @@ -58,7 +70,7 @@ public String queue() { } /** - * Get the table value. + * Get gets the table endpoint. * * @return the table value */ @@ -67,7 +79,7 @@ public String table() { } /** - * Get the file value. + * Get gets the file endpoint. * * @return the file value */ @@ -75,4 +87,22 @@ public String file() { return this.file; } + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/IPRule.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/IPRule.java index 69cd9b84a2ab7..709e6eb964df4 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/IPRule.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/IPRule.java @@ -28,7 +28,7 @@ public class IPRule { private Action action; /** - * Get the iPAddressOrRange value. + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @return the iPAddressOrRange value */ @@ -37,7 +37,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the IPRule object itself. @@ -48,7 +48,7 @@ public IPRule withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the action value. + * Get the action of IP ACL rule. Possible values include: 'Allow'. * * @return the action value */ @@ -57,7 +57,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of IP ACL rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the IPRule object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Identity.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Identity.java index 605154b62b974..65f67605d0283 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Identity.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Identity.java @@ -40,7 +40,7 @@ public Identity() { } /** - * Get the principalId value. + * Get the principal ID of resource identity. * * @return the principalId value */ @@ -49,7 +49,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant ID of resource. * * @return the tenantId value */ @@ -58,7 +58,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the identity type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Set the type value. + * Set the identity type. * * @param type the type value to set * @return the Identity object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicyProperties.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicyProperties.java index 4ff82ec809be8..f69c39e71c2d1 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicyProperties.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicyProperties.java @@ -45,7 +45,7 @@ public class ImmutabilityPolicyProperties { private List updateHistory; /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -54,7 +54,7 @@ public int immutabilityPeriodSinceCreationInDays() { } /** - * Set the immutabilityPeriodSinceCreationInDays value. + * Set the immutability period for the blobs in the container since the policy creation, in days. * * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set * @return the ImmutabilityPolicyProperties object itself. @@ -65,7 +65,7 @@ public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays(in } /** - * Get the state value. + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. * * @return the state value */ @@ -74,7 +74,7 @@ public ImmutabilityPolicyState state() { } /** - * Get the etag value. + * Get immutabilityPolicy Etag. * * @return the etag value */ @@ -83,7 +83,7 @@ public String etag() { } /** - * Get the updateHistory value. + * Get the ImmutabilityPolicy update history of the blob container. * * @return the updateHistory value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/KeyVaultProperties.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/KeyVaultProperties.java index 618166fda7e8f..bd70654c767ac 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/KeyVaultProperties.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/KeyVaultProperties.java @@ -33,7 +33,7 @@ public class KeyVaultProperties { private String keyVaultUri; /** - * Get the keyName value. + * Get the name of KeyVault key. * * @return the keyName value */ @@ -42,7 +42,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of KeyVault key. * * @param keyName the keyName value to set * @return the KeyVaultProperties object itself. @@ -53,7 +53,7 @@ public KeyVaultProperties withKeyName(String keyName) { } /** - * Get the keyVersion value. + * Get the version of KeyVault key. * * @return the keyVersion value */ @@ -62,7 +62,7 @@ public String keyVersion() { } /** - * Set the keyVersion value. + * Set the version of KeyVault key. * * @param keyVersion the keyVersion value to set * @return the KeyVaultProperties object itself. @@ -73,7 +73,7 @@ public KeyVaultProperties withKeyVersion(String keyVersion) { } /** - * Get the keyVaultUri value. + * Get the Uri of KeyVault. * * @return the keyVaultUri value */ @@ -82,7 +82,7 @@ public String keyVaultUri() { } /** - * Set the keyVaultUri value. + * Set the Uri of KeyVault. * * @param keyVaultUri the keyVaultUri value to set * @return the KeyVaultProperties object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LegalHoldProperties.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LegalHoldProperties.java index 0f4f06b96d6d3..190b9522519cd 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LegalHoldProperties.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LegalHoldProperties.java @@ -32,7 +32,7 @@ public class LegalHoldProperties { private List tags; /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -41,7 +41,7 @@ public Boolean hasLegalHold() { } /** - * Get the tags value. + * Get the list of LegalHold tags of a blob container. * * @return the tags value */ @@ -50,7 +50,7 @@ public List tags() { } /** - * Set the tags value. + * Set the list of LegalHold tags of a blob container. * * @param tags the tags value to set * @return the LegalHoldProperties object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ListContainerItem.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ListContainerItem.java index d9c3ab15b26ad..d45ccabbb6b91 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ListContainerItem.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ListContainerItem.java @@ -91,7 +91,7 @@ public class ListContainerItem extends AzureEntityResource { private Boolean hasImmutabilityPolicy; /** - * Get the publicAccess value. + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @return the publicAccess value */ @@ -100,7 +100,7 @@ public PublicAccess publicAccess() { } /** - * Set the publicAccess value. + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @param publicAccess the publicAccess value to set * @return the ListContainerItem object itself. @@ -111,7 +111,7 @@ public ListContainerItem withPublicAccess(PublicAccess publicAccess) { } /** - * Get the lastModifiedTime value. + * Get returns the date and time the container was last modified. * * @return the lastModifiedTime value */ @@ -120,7 +120,7 @@ public DateTime lastModifiedTime() { } /** - * Get the leaseStatus value. + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. * * @return the leaseStatus value */ @@ -129,7 +129,7 @@ public LeaseStatus leaseStatus() { } /** - * Get the leaseState value. + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. * * @return the leaseState value */ @@ -138,7 +138,7 @@ public LeaseState leaseState() { } /** - * Get the leaseDuration value. + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. * * @return the leaseDuration value */ @@ -147,7 +147,7 @@ public LeaseDuration leaseDuration() { } /** - * Get the metadata value. + * Get a name-value pair to associate with the container as metadata. * * @return the metadata value */ @@ -156,7 +156,7 @@ public Map metadata() { } /** - * Set the metadata value. + * Set a name-value pair to associate with the container as metadata. * * @param metadata the metadata value to set * @return the ListContainerItem object itself. @@ -167,7 +167,7 @@ public ListContainerItem withMetadata(Map metadata) { } /** - * Get the immutabilityPolicy value. + * Get the ImmutabilityPolicy property of the container. * * @return the immutabilityPolicy value */ @@ -176,7 +176,7 @@ public ImmutabilityPolicyProperties immutabilityPolicy() { } /** - * Get the legalHold value. + * Get the LegalHold property of the container. * * @return the legalHold value */ @@ -185,7 +185,7 @@ public LegalHoldProperties legalHold() { } /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -194,7 +194,7 @@ public Boolean hasLegalHold() { } /** - * Get the hasImmutabilityPolicy value. + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. * * @return the hasImmutabilityPolicy value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/MetricSpecification.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/MetricSpecification.java index 514e92b528deb..c6c3e65c8ba66 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/MetricSpecification.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/MetricSpecification.java @@ -70,7 +70,7 @@ public class MetricSpecification { private String resourceIdDimensionNameOverride; /** - * Get the name value. + * Get name of metric specification. * * @return the name value */ @@ -79,7 +79,7 @@ public String name() { } /** - * Set the name value. + * Set name of metric specification. * * @param name the name value to set * @return the MetricSpecification object itself. @@ -90,7 +90,7 @@ public MetricSpecification withName(String name) { } /** - * Get the displayName value. + * Get display name of metric specification. * * @return the displayName value */ @@ -99,7 +99,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of metric specification. * * @param displayName the displayName value to set * @return the MetricSpecification object itself. @@ -110,7 +110,7 @@ public MetricSpecification withDisplayName(String displayName) { } /** - * Get the displayDescription value. + * Get display description of metric specification. * * @return the displayDescription value */ @@ -119,7 +119,7 @@ public String displayDescription() { } /** - * Set the displayDescription value. + * Set display description of metric specification. * * @param displayDescription the displayDescription value to set * @return the MetricSpecification object itself. @@ -130,7 +130,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { } /** - * Get the unit value. + * Get unit could be Bytes or Count. * * @return the unit value */ @@ -139,7 +139,7 @@ public String unit() { } /** - * Set the unit value. + * Set unit could be Bytes or Count. * * @param unit the unit value to set * @return the MetricSpecification object itself. @@ -150,7 +150,7 @@ public MetricSpecification withUnit(String unit) { } /** - * Get the dimensions value. + * Get dimensions of blobs, including blob type and access tier. * * @return the dimensions value */ @@ -159,7 +159,7 @@ public List dimensions() { } /** - * Set the dimensions value. + * Set dimensions of blobs, including blob type and access tier. * * @param dimensions the dimensions value to set * @return the MetricSpecification object itself. @@ -170,7 +170,7 @@ public MetricSpecification withDimensions(List dimensions) { } /** - * Get the aggregationType value. + * Get aggregation type could be Average. * * @return the aggregationType value */ @@ -179,7 +179,7 @@ public String aggregationType() { } /** - * Set the aggregationType value. + * Set aggregation type could be Average. * * @param aggregationType the aggregationType value to set * @return the MetricSpecification object itself. @@ -190,7 +190,7 @@ public MetricSpecification withAggregationType(String aggregationType) { } /** - * Get the fillGapWithZero value. + * Get the property to decide fill gap with zero or not. * * @return the fillGapWithZero value */ @@ -199,7 +199,7 @@ public Boolean fillGapWithZero() { } /** - * Set the fillGapWithZero value. + * Set the property to decide fill gap with zero or not. * * @param fillGapWithZero the fillGapWithZero value to set * @return the MetricSpecification object itself. @@ -210,7 +210,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { } /** - * Get the category value. + * Get the category this metric specification belong to, could be Capacity. * * @return the category value */ @@ -219,7 +219,7 @@ public String category() { } /** - * Set the category value. + * Set the category this metric specification belong to, could be Capacity. * * @param category the category value to set * @return the MetricSpecification object itself. @@ -230,7 +230,7 @@ public MetricSpecification withCategory(String category) { } /** - * Get the resourceIdDimensionNameOverride value. + * Get account Resource Id. * * @return the resourceIdDimensionNameOverride value */ @@ -239,7 +239,7 @@ public String resourceIdDimensionNameOverride() { } /** - * Set the resourceIdDimensionNameOverride value. + * Set account Resource Id. * * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set * @return the MetricSpecification object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/NetworkRuleSet.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/NetworkRuleSet.java index 3ec56a59ce852..37313dbe083bf 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/NetworkRuleSet.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/NetworkRuleSet.java @@ -45,7 +45,7 @@ public class NetworkRuleSet { private DefaultAction defaultAction; /** - * Get the bypass value. + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @return the bypass value */ @@ -54,7 +54,7 @@ public Bypass bypass() { } /** - * Set the bypass value. + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @param bypass the bypass value to set * @return the NetworkRuleSet object itself. @@ -65,7 +65,7 @@ public NetworkRuleSet withBypass(Bypass bypass) { } /** - * Get the virtualNetworkRules value. + * Get sets the virtual network rules. * * @return the virtualNetworkRules value */ @@ -74,7 +74,7 @@ public List virtualNetworkRules() { } /** - * Set the virtualNetworkRules value. + * Set sets the virtual network rules. * * @param virtualNetworkRules the virtualNetworkRules value to set * @return the NetworkRuleSet object itself. @@ -85,7 +85,7 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe } /** - * Get the ipRules value. + * Get sets the IP ACL rules. * * @return the ipRules value */ @@ -94,7 +94,7 @@ public List ipRules() { } /** - * Set the ipRules value. + * Set sets the IP ACL rules. * * @param ipRules the ipRules value to set * @return the NetworkRuleSet object itself. @@ -105,7 +105,7 @@ public NetworkRuleSet withIpRules(List ipRules) { } /** - * Get the defaultAction value. + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @return the defaultAction value */ @@ -114,7 +114,7 @@ public DefaultAction defaultAction() { } /** - * Set the defaultAction value. + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @param defaultAction the defaultAction value to set * @return the NetworkRuleSet object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/OperationDisplay.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/OperationDisplay.java index 5afa127792804..3c373a376e850 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/OperationDisplay.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/OperationDisplay.java @@ -33,7 +33,13 @@ public class OperationDisplay { private String operation; /** - * Get the provider value. + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Storage. * * @return the provider value */ @@ -42,7 +48,7 @@ public String provider() { } /** - * Set the provider value. + * Set service provider: Microsoft Storage. * * @param provider the provider value to set * @return the OperationDisplay object itself. @@ -53,7 +59,7 @@ public OperationDisplay withProvider(String provider) { } /** - * Get the resource value. + * Get resource on which the operation is performed etc. * * @return the resource value */ @@ -62,7 +68,7 @@ public String resource() { } /** - * Set the resource value. + * Set resource on which the operation is performed etc. * * @param resource the resource value to set * @return the OperationDisplay object itself. @@ -73,7 +79,7 @@ public OperationDisplay withResource(String resource) { } /** - * Get the operation value. + * Get type of operation: get, read, delete, etc. * * @return the operation value */ @@ -82,7 +88,7 @@ public String operation() { } /** - * Set the operation value. + * Set type of operation: get, read, delete, etc. * * @param operation the operation value to set * @return the OperationDisplay object itself. @@ -92,4 +98,24 @@ public OperationDisplay withOperation(String operation) { return this; } + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Restriction.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Restriction.java index 0563d8a7e84e3..d9c9126486b14 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Restriction.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Restriction.java @@ -30,17 +30,17 @@ public class Restriction { private List values; /** - * The reason for the restriction. As of now this can be “QuotaId” or - * “NotAvailableForSubscription”. Quota Id is set when the SKU has + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has * requiredQuotas parameter as the subscription does not belong to that - * quota. The “NotAvailableForSubscription” is related to capacity at DC. + * quota. The "NotAvailableForSubscription" is related to capacity at DC. * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. */ @JsonProperty(value = "reasonCode") private ReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. As of now only possible value for this is location. * * @return the type value */ @@ -49,7 +49,7 @@ public String type() { } /** - * Get the values value. + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. * * @return the values value */ @@ -58,7 +58,7 @@ public List values() { } /** - * Get the reasonCode value. + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @return the reasonCode value */ @@ -67,7 +67,7 @@ public ReasonCode reasonCode() { } /** - * Set the reasonCode value. + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @param reasonCode the reasonCode value to set * @return the Restriction object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/SKUCapability.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/SKUCapability.java index 1dd73fbf016ad..6913e85a4defd 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/SKUCapability.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/SKUCapability.java @@ -30,7 +30,7 @@ public class SKUCapability { private String value; /** - * Get the name value. + * Get the name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Get the value value. + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. * * @return the value value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java index 3a356eaf62854..030dd36f59f50 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java @@ -26,7 +26,7 @@ public class ServiceSasParameters { * include: Blob (b), Container (c), File (f), Share (s). Possible values * include: 'b', 'c', 'f', 's'. */ - @JsonProperty(value = "signedResource", required = true) + @JsonProperty(value = "signedResource") private SignedResource resource; /** @@ -131,7 +131,7 @@ public class ServiceSasParameters { private String contentType; /** - * Get the canonicalizedResource value. + * Get the canonical path to the signed resource. * * @return the canonicalizedResource value */ @@ -140,7 +140,7 @@ public String canonicalizedResource() { } /** - * Set the canonicalizedResource value. + * Set the canonical path to the signed resource. * * @param canonicalizedResource the canonicalizedResource value to set * @return the ServiceSasParameters object itself. @@ -151,7 +151,7 @@ public ServiceSasParameters withCanonicalizedResource(String canonicalizedResour } /** - * Get the resource value. + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @return the resource value */ @@ -160,7 +160,7 @@ public SignedResource resource() { } /** - * Set the resource value. + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @param resource the resource value to set * @return the ServiceSasParameters object itself. @@ -171,7 +171,7 @@ public ServiceSasParameters withResource(SignedResource resource) { } /** - * Get the permissions value. + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -180,7 +180,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the ServiceSasParameters object itself. @@ -191,7 +191,7 @@ public ServiceSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -200,7 +200,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the ServiceSasParameters object itself. @@ -211,7 +211,7 @@ public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -220,7 +220,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the ServiceSasParameters object itself. @@ -231,7 +231,7 @@ public ServiceSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -240,7 +240,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the ServiceSasParameters object itself. @@ -251,7 +251,7 @@ public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -260,7 +260,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the ServiceSasParameters object itself. @@ -271,7 +271,7 @@ public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the identifier value. + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @return the identifier value */ @@ -280,7 +280,7 @@ public String identifier() { } /** - * Set the identifier value. + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @param identifier the identifier value to set * @return the ServiceSasParameters object itself. @@ -291,7 +291,7 @@ public ServiceSasParameters withIdentifier(String identifier) { } /** - * Get the partitionKeyStart value. + * Get the start of partition key. * * @return the partitionKeyStart value */ @@ -300,7 +300,7 @@ public String partitionKeyStart() { } /** - * Set the partitionKeyStart value. + * Set the start of partition key. * * @param partitionKeyStart the partitionKeyStart value to set * @return the ServiceSasParameters object itself. @@ -311,7 +311,7 @@ public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { } /** - * Get the partitionKeyEnd value. + * Get the end of partition key. * * @return the partitionKeyEnd value */ @@ -320,7 +320,7 @@ public String partitionKeyEnd() { } /** - * Set the partitionKeyEnd value. + * Set the end of partition key. * * @param partitionKeyEnd the partitionKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -331,7 +331,7 @@ public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { } /** - * Get the rowKeyStart value. + * Get the start of row key. * * @return the rowKeyStart value */ @@ -340,7 +340,7 @@ public String rowKeyStart() { } /** - * Set the rowKeyStart value. + * Set the start of row key. * * @param rowKeyStart the rowKeyStart value to set * @return the ServiceSasParameters object itself. @@ -351,7 +351,7 @@ public ServiceSasParameters withRowKeyStart(String rowKeyStart) { } /** - * Get the rowKeyEnd value. + * Get the end of row key. * * @return the rowKeyEnd value */ @@ -360,7 +360,7 @@ public String rowKeyEnd() { } /** - * Set the rowKeyEnd value. + * Set the end of row key. * * @param rowKeyEnd the rowKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -371,7 +371,7 @@ public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -380,7 +380,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the ServiceSasParameters object itself. @@ -391,7 +391,7 @@ public ServiceSasParameters withKeyToSign(String keyToSign) { } /** - * Get the cacheControl value. + * Get the response header override for cache control. * * @return the cacheControl value */ @@ -400,7 +400,7 @@ public String cacheControl() { } /** - * Set the cacheControl value. + * Set the response header override for cache control. * * @param cacheControl the cacheControl value to set * @return the ServiceSasParameters object itself. @@ -411,7 +411,7 @@ public ServiceSasParameters withCacheControl(String cacheControl) { } /** - * Get the contentDisposition value. + * Get the response header override for content disposition. * * @return the contentDisposition value */ @@ -420,7 +420,7 @@ public String contentDisposition() { } /** - * Set the contentDisposition value. + * Set the response header override for content disposition. * * @param contentDisposition the contentDisposition value to set * @return the ServiceSasParameters object itself. @@ -431,7 +431,7 @@ public ServiceSasParameters withContentDisposition(String contentDisposition) { } /** - * Get the contentEncoding value. + * Get the response header override for content encoding. * * @return the contentEncoding value */ @@ -440,7 +440,7 @@ public String contentEncoding() { } /** - * Set the contentEncoding value. + * Set the response header override for content encoding. * * @param contentEncoding the contentEncoding value to set * @return the ServiceSasParameters object itself. @@ -451,7 +451,7 @@ public ServiceSasParameters withContentEncoding(String contentEncoding) { } /** - * Get the contentLanguage value. + * Get the response header override for content language. * * @return the contentLanguage value */ @@ -460,7 +460,7 @@ public String contentLanguage() { } /** - * Set the contentLanguage value. + * Set the response header override for content language. * * @param contentLanguage the contentLanguage value to set * @return the ServiceSasParameters object itself. @@ -471,7 +471,7 @@ public ServiceSasParameters withContentLanguage(String contentLanguage) { } /** - * Get the contentType value. + * Get the response header override for content type. * * @return the contentType value */ @@ -480,7 +480,7 @@ public String contentType() { } /** - * Set the contentType value. + * Set the response header override for content type. * * @param contentType the contentType value to set * @return the ServiceSasParameters object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSpecification.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSpecification.java index 98adf82752712..35a56b0e2e26d 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSpecification.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSpecification.java @@ -22,7 +22,7 @@ public class ServiceSpecification { private List metricSpecifications; /** - * Get the metricSpecifications value. + * Get metric specifications of operation. * * @return the metricSpecifications value */ @@ -31,7 +31,7 @@ public List metricSpecifications() { } /** - * Set the metricSpecifications value. + * Set metric specifications of operation. * * @param metricSpecifications the metricSpecifications value to set * @return the ServiceSpecification object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java index a21fbde7fee51..f571f0589619e 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2018_02_01.implementation.StorageManager; import com.microsoft.azure.management.storage.v2018_02_01.implementation.SkuInner; @@ -56,6 +56,11 @@ public interface StorageAccount extends HasInner, Resource, */ Identity identity(); + /** + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + /** * @return the kind value. */ @@ -203,6 +208,16 @@ interface WithIdentity { WithCreate withIdentity(Identity identity); } + /** + * The stage of the storageaccount update allowing to specify IsHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies isHnsEnabled. + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + /** * The stage of the storageaccount update allowing to specify NetworkRuleSet. */ @@ -218,7 +233,7 @@ interface WithNetworkRuleSet { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithNetworkRuleSet { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithNetworkRuleSet { } } /** diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCheckNameAvailabilityParameters.java index 783903586ebc3..771c556aa05d3 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCheckNameAvailabilityParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCheckNameAvailabilityParameters.java @@ -28,13 +28,14 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; } /** - * Get the name value. + * Get the storage account name. * * @return the name value */ @@ -43,7 +44,7 @@ public String name() { } /** - * Set the name value. + * Set the storage account name. * * @param name the name value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. @@ -54,7 +55,7 @@ public StorageAccountCheckNameAvailabilityParameters withName(String name) { } /** - * Get the type value. + * Get the type of resource, Microsoft.Storage/storageAccounts. * * @return the type value */ @@ -63,7 +64,7 @@ public String type() { } /** - * Set the type value. + * Set the type of resource, Microsoft.Storage/storageAccounts. * * @param type the type value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCreateParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCreateParameters.java index 99f7cc714e00c..5c2c380981621 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCreateParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountCreateParameters.java @@ -94,7 +94,13 @@ public class StorageAccountCreateParameters { private Boolean enableHttpsTrafficOnly; /** - * Get the sku value. + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get required. Gets or sets the sku name. * * @return the sku value */ @@ -103,7 +109,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set required. Gets or sets the sku name. * * @param sku the sku value to set * @return the StorageAccountCreateParameters object itself. @@ -114,7 +120,7 @@ public StorageAccountCreateParameters withSku(SkuInner sku) { } /** - * Get the kind value. + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -123,7 +129,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountCreateParameters object itself. @@ -134,7 +140,7 @@ public StorageAccountCreateParameters withKind(Kind kind) { } /** - * Get the location value. + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @return the location value */ @@ -143,7 +149,7 @@ public String location() { } /** - * Set the location value. + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @param location the location value to set * @return the StorageAccountCreateParameters object itself. @@ -154,7 +160,7 @@ public StorageAccountCreateParameters withLocation(String location) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @return the tags value */ @@ -163,7 +169,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @param tags the tags value to set * @return the StorageAccountCreateParameters object itself. @@ -174,7 +180,7 @@ public StorageAccountCreateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -183,7 +189,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountCreateParameters object itself. @@ -194,7 +200,7 @@ public StorageAccountCreateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -203,7 +209,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountCreateParameters object itself. @@ -214,7 +220,7 @@ public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @return the encryption value */ @@ -223,7 +229,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountCreateParameters object itself. @@ -234,7 +240,7 @@ public StorageAccountCreateParameters withEncryption(Encryption encryption) { } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -243,7 +249,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountCreateParameters object itself. @@ -254,7 +260,7 @@ public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -263,7 +269,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountCreateParameters object itself. @@ -274,7 +280,7 @@ public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -283,7 +289,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountCreateParameters object itself. @@ -293,4 +299,24 @@ public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableH return this; } + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountKey.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountKey.java index ba8aaea9f8276..c2928e16aff0f 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountKey.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountKey.java @@ -34,7 +34,7 @@ public class StorageAccountKey { private KeyPermission permissions; /** - * Get the keyName value. + * Get name of the key. * * @return the keyName value */ @@ -43,7 +43,7 @@ public String keyName() { } /** - * Get the value value. + * Get base 64-encoded value of the key. * * @return the value value */ @@ -52,7 +52,7 @@ public String value() { } /** - * Get the permissions value. + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. * * @return the permissions value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountRegenerateKeyParameters.java index f56a59fe92485..9a1f13f759713 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountRegenerateKeyParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountRegenerateKeyParameters.java @@ -22,7 +22,7 @@ public class StorageAccountRegenerateKeyParameters { private String keyName; /** - * Get the keyName value. + * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountUpdateParameters.java index c02f250211bf2..7d6359dc88486 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountUpdateParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccountUpdateParameters.java @@ -87,7 +87,7 @@ public class StorageAccountUpdateParameters { private Kind kind; /** - * Get the sku value. + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @return the sku value */ @@ -96,7 +96,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. @@ -107,7 +107,7 @@ public StorageAccountUpdateParameters withSku(SkuInner sku) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @return the tags value */ @@ -116,7 +116,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @param tags the tags value to set * @return the StorageAccountUpdateParameters object itself. @@ -127,7 +127,7 @@ public StorageAccountUpdateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -136,7 +136,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountUpdateParameters object itself. @@ -147,7 +147,7 @@ public StorageAccountUpdateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -156,7 +156,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountUpdateParameters object itself. @@ -167,7 +167,7 @@ public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. The default setting is unencrypted. * * @return the encryption value */ @@ -176,7 +176,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountUpdateParameters object itself. @@ -187,7 +187,7 @@ public StorageAccountUpdateParameters withEncryption(Encryption encryption) { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -196,7 +196,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountUpdateParameters object itself. @@ -207,7 +207,7 @@ public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -216,7 +216,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountUpdateParameters object itself. @@ -227,7 +227,7 @@ public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableH } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -236,7 +236,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountUpdateParameters object itself. @@ -247,7 +247,7 @@ public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the kind value. + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -256,7 +256,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountUpdateParameters object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/TagProperty.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/TagProperty.java index 2c504becf21eb..134ecde8e6112 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/TagProperty.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/TagProperty.java @@ -56,7 +56,7 @@ public String tag() { } /** - * Get the timestamp value. + * Get returns the date and time the tag was added. * * @return the timestamp value */ @@ -65,7 +65,7 @@ public DateTime timestamp() { } /** - * Get the objectIdentifier value. + * Get returns the Object ID of the user who added the tag. * * @return the objectIdentifier value */ @@ -74,7 +74,7 @@ public String objectIdentifier() { } /** - * Get the tenantId value. + * Get returns the Tenant ID that issued the token for the user who added the tag. * * @return the tenantId value */ @@ -83,7 +83,7 @@ public String tenantId() { } /** - * Get the upn value. + * Get returns the User Principal Name of the user who added the tag. * * @return the upn value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UpdateHistoryProperty.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UpdateHistoryProperty.java index 4d6b593801c33..76b73f809fb55 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UpdateHistoryProperty.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UpdateHistoryProperty.java @@ -57,7 +57,7 @@ public class UpdateHistoryProperty { private String upn; /** - * Get the update value. + * Get the ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'put', 'lock', 'extend'. * * @return the update value */ @@ -66,7 +66,7 @@ public ImmutabilityPolicyUpdateType update() { } /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -75,7 +75,7 @@ public Integer immutabilityPeriodSinceCreationInDays() { } /** - * Get the timestamp value. + * Get returns the date and time the ImmutabilityPolicy was updated. * * @return the timestamp value */ @@ -84,7 +84,7 @@ public DateTime timestamp() { } /** - * Get the objectIdentifier value. + * Get returns the Object ID of the user who updated the ImmutabilityPolicy. * * @return the objectIdentifier value */ @@ -93,7 +93,7 @@ public String objectIdentifier() { } /** - * Get the tenantId value. + * Get returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. * * @return the tenantId value */ @@ -102,7 +102,7 @@ public String tenantId() { } /** - * Get the upn value. + * Get returns the User Principal Name of the user who updated the ImmutabilityPolicy. * * @return the upn value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UsageName.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UsageName.java index 67efa5a9a0b0e..74937d780cc8e 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UsageName.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get gets a string describing the resource name. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get gets a localized string describing the resource name. * * @return the localizedValue value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/VirtualNetworkRule.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/VirtualNetworkRule.java index 235e8f3b332a5..cd7e5c870201c 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/VirtualNetworkRule.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/VirtualNetworkRule.java @@ -36,7 +36,7 @@ public class VirtualNetworkRule { private State state; /** - * Get the virtualNetworkResourceId value. + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @return the virtualNetworkResourceId value */ @@ -45,7 +45,7 @@ public String virtualNetworkResourceId() { } /** - * Set the virtualNetworkResourceId value. + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @param virtualNetworkResourceId the virtualNetworkResourceId value to set * @return the VirtualNetworkRule object itself. @@ -56,7 +56,7 @@ public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkReso } /** - * Get the action value. + * Get the action of virtual network rule. Possible values include: 'Allow'. * * @return the action value */ @@ -65,7 +65,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of virtual network rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the VirtualNetworkRule object itself. @@ -76,7 +76,7 @@ public VirtualNetworkRule withAction(Action action) { } /** - * Get the state value. + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @return the state value */ @@ -85,7 +85,7 @@ public State state() { } /** - * Set the state value. + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @param state the state value to set * @return the VirtualNetworkRule object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainerInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainerInner.java index 0f4e85c564b96..d314c4028d7a2 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainerInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainerInner.java @@ -99,7 +99,7 @@ public class BlobContainerInner extends AzureEntityResource { private Boolean hasImmutabilityPolicy; /** - * Get the publicAccess value. + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @return the publicAccess value */ @@ -108,7 +108,7 @@ public PublicAccess publicAccess() { } /** - * Set the publicAccess value. + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @param publicAccess the publicAccess value to set * @return the BlobContainerInner object itself. @@ -119,7 +119,7 @@ public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { } /** - * Get the lastModifiedTime value. + * Get returns the date and time the container was last modified. * * @return the lastModifiedTime value */ @@ -128,7 +128,7 @@ public DateTime lastModifiedTime() { } /** - * Get the leaseStatus value. + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. * * @return the leaseStatus value */ @@ -137,7 +137,7 @@ public LeaseStatus leaseStatus() { } /** - * Get the leaseState value. + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. * * @return the leaseState value */ @@ -146,7 +146,7 @@ public LeaseState leaseState() { } /** - * Get the leaseDuration value. + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. * * @return the leaseDuration value */ @@ -155,7 +155,7 @@ public LeaseDuration leaseDuration() { } /** - * Get the metadata value. + * Get a name-value pair to associate with the container as metadata. * * @return the metadata value */ @@ -164,7 +164,7 @@ public Map metadata() { } /** - * Set the metadata value. + * Set a name-value pair to associate with the container as metadata. * * @param metadata the metadata value to set * @return the BlobContainerInner object itself. @@ -175,7 +175,7 @@ public BlobContainerInner withMetadata(Map metadata) { } /** - * Get the immutabilityPolicy value. + * Get the ImmutabilityPolicy property of the container. * * @return the immutabilityPolicy value */ @@ -184,7 +184,7 @@ public ImmutabilityPolicyProperties immutabilityPolicy() { } /** - * Get the legalHold value. + * Get the LegalHold property of the container. * * @return the legalHold value */ @@ -193,7 +193,7 @@ public LegalHoldProperties legalHold() { } /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -202,7 +202,7 @@ public Boolean hasLegalHold() { } /** - * Get the hasImmutabilityPolicy value. + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. * * @return the hasImmutabilityPolicy value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/CheckNameAvailabilityResultInner.java index 7040ab5555bc5..dff6ae8234e8a 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/CheckNameAvailabilityResultInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/CheckNameAvailabilityResultInner.java @@ -38,7 +38,7 @@ public class CheckNameAvailabilityResultInner { private String message; /** - * Get the nameAvailable value. + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. * * @return the nameAvailable value */ @@ -47,7 +47,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. * * @return the reason value */ @@ -56,7 +56,7 @@ public Reason reason() { } /** - * Get the message value. + * Get gets an error message explaining the Reason value in more detail. * * @return the message value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyInner.java index 06068c4326db9..5bcacdef62136 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyInner.java @@ -35,7 +35,7 @@ public class ImmutabilityPolicyInner extends AzureEntityResource { private ImmutabilityPolicyState state; /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -44,7 +44,7 @@ public int immutabilityPeriodSinceCreationInDays() { } /** - * Set the immutabilityPeriodSinceCreationInDays value. + * Set the immutability period for the blobs in the container since the policy creation, in days. * * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set * @return the ImmutabilityPolicyInner object itself. @@ -55,7 +55,7 @@ public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays(int imm } /** - * Get the state value. + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. * * @return the state value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LegalHoldInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LegalHoldInner.java index 4d820bfecfb99..1a84ec9c5744f 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LegalHoldInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LegalHoldInner.java @@ -33,7 +33,7 @@ public class LegalHoldInner { private List tags; /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -42,7 +42,7 @@ public Boolean hasLegalHold() { } /** - * Get the tags value. + * Get each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. * * @return the tags value */ @@ -51,7 +51,7 @@ public List tags() { } /** - * Set the tags value. + * Set each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. * * @param tags the tags value to set * @return the LegalHoldInner object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListAccountSasResponseInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListAccountSasResponseInner.java index 577ac00b40334..1053d6e696bc0 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListAccountSasResponseInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListAccountSasResponseInner.java @@ -21,7 +21,7 @@ public class ListAccountSasResponseInner { private String accountSasToken; /** - * Get the accountSasToken value. + * Get list SAS credentials of storage account. * * @return the accountSasToken value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListContainerItemsInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListContainerItemsInner.java index d9f2533b609f3..d4991a8badff7 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListContainerItemsInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListContainerItemsInner.java @@ -23,7 +23,7 @@ public class ListContainerItemsInner { private List value; /** - * Get the value value. + * Get the list of blob containers. * * @return the value value */ @@ -32,7 +32,7 @@ public List value() { } /** - * Set the value value. + * Set the list of blob containers. * * @param value the value value to set * @return the ListContainerItemsInner object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java index a6b11b067f84c..1be2c12da9a07 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java @@ -21,7 +21,7 @@ public class ListServiceSasResponseInner { private String serviceSasToken; /** - * Get the serviceSasToken value. + * Get list service SAS credentials of speicific resource. * * @return the serviceSasToken value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationInner.java index 537ce2fdde46f..565596ad06cc0 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationInner.java @@ -43,7 +43,7 @@ public class OperationInner { private ServiceSpecification serviceSpecification; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{operation}. * * @return the name value */ @@ -52,7 +52,7 @@ public String name() { } /** - * Set the name value. + * Set operation name: {provider}/{resource}/{operation}. * * @param name the name value to set * @return the OperationInner object itself. @@ -63,7 +63,7 @@ public OperationInner withName(String name) { } /** - * Get the display value. + * Get display metadata associated with the operation. * * @return the display value */ @@ -72,7 +72,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set display metadata associated with the operation. * * @param display the display value to set * @return the OperationInner object itself. @@ -83,7 +83,7 @@ public OperationInner withDisplay(OperationDisplay display) { } /** - * Get the origin value. + * Get the origin of operations. * * @return the origin value */ @@ -92,7 +92,7 @@ public String origin() { } /** - * Set the origin value. + * Set the origin of operations. * * @param origin the origin value to set * @return the OperationInner object itself. @@ -103,7 +103,7 @@ public OperationInner withOrigin(String origin) { } /** - * Get the serviceSpecification value. + * Get one property of operation, include metric specifications. * * @return the serviceSpecification value */ @@ -112,7 +112,7 @@ public ServiceSpecification serviceSpecification() { } /** - * Set the serviceSpecification value. + * Set one property of operation, include metric specifications. * * @param serviceSpecification the serviceSpecification value to set * @return the OperationInner object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationsImpl.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationsImpl.java index 8712ceba9e6a1..b349c4d99fcdb 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationsImpl.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/OperationsImpl.java @@ -37,7 +37,8 @@ public Observable listAsync() { public Observable call(List innerList) { return Observable.from(innerList); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public Operation call(OperationInner inner) { return new OperationImpl(inner, manager()); diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/SkuInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/SkuInner.java index d422f78a6e1a8..c57e154cced86 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/SkuInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/SkuInner.java @@ -72,7 +72,7 @@ public class SkuInner { private List restrictions; /** - * Get the name value. + * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @return the name value */ @@ -81,7 +81,7 @@ public SkuName name() { } /** - * Set the name value. + * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @param name the name value to set * @return the SkuInner object itself. @@ -92,7 +92,7 @@ public SkuInner withName(SkuName name) { } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ @@ -101,7 +101,7 @@ public SkuTier tier() { } /** - * Get the resourceType value. + * Get the type of the resource, usually it is 'storageAccounts'. * * @return the resourceType value */ @@ -110,7 +110,7 @@ public String resourceType() { } /** - * Get the kind value. + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -119,7 +119,7 @@ public Kind kind() { } /** - * Get the locations value. + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). * * @return the locations value */ @@ -128,7 +128,7 @@ public List locations() { } /** - * Get the capabilities value. + * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the capabilities value */ @@ -137,7 +137,7 @@ public List capabilities() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ @@ -146,7 +146,7 @@ public List restrictions() { } /** - * Set the restrictions value. + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @param restrictions the restrictions value to set * @return the SkuInner object itself. diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountImpl.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountImpl.java index ab6a5e2b577c7..e0e8a70ce7c54 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountImpl.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountImpl.java @@ -111,6 +111,11 @@ public Identity identity() { return this.inner().identity(); } + @Override + public Boolean isHnsEnabled() { + return this.inner().isHnsEnabled(); + } + @Override public Kind kind() { return this.inner().kind(); @@ -171,6 +176,12 @@ public AccountStatus statusOfSecondary() { return this.inner().statusOfSecondary(); } + @Override + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameter.withIsHnsEnabled(isHnsEnabled); + return this; + } + @Override public StorageAccountImpl withKind(Kind kind) { if (isInCreateMode()) { diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountInner.java index 15c968931551d..9a502b300a309 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountInner.java @@ -149,7 +149,13 @@ public class StorageAccountInner extends Resource { private NetworkRuleSet networkRuleSet; /** - * Get the sku value. + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get gets the SKU. * * @return the sku value */ @@ -158,7 +164,7 @@ public SkuInner sku() { } /** - * Get the kind value. + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -167,7 +173,7 @@ public Kind kind() { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -176,7 +182,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountInner object itself. @@ -187,7 +193,7 @@ public StorageAccountInner withIdentity(Identity identity) { } /** - * Get the provisioningState value. + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. * * @return the provisioningState value */ @@ -196,7 +202,7 @@ public ProvisioningState provisioningState() { } /** - * Get the primaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. * * @return the primaryEndpoints value */ @@ -205,7 +211,7 @@ public Endpoints primaryEndpoints() { } /** - * Get the primaryLocation value. + * Get gets the location of the primary data center for the storage account. * * @return the primaryLocation value */ @@ -214,7 +220,7 @@ public String primaryLocation() { } /** - * Get the statusOfPrimary value. + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. * * @return the statusOfPrimary value */ @@ -223,7 +229,7 @@ public AccountStatus statusOfPrimary() { } /** - * Get the lastGeoFailoverTime value. + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the lastGeoFailoverTime value */ @@ -232,7 +238,7 @@ public DateTime lastGeoFailoverTime() { } /** - * Get the secondaryLocation value. + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the secondaryLocation value */ @@ -241,7 +247,7 @@ public String secondaryLocation() { } /** - * Get the statusOfSecondary value. + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. * * @return the statusOfSecondary value */ @@ -250,7 +256,7 @@ public AccountStatus statusOfSecondary() { } /** - * Get the creationTime value. + * Get gets the creation date and time of the storage account in UTC. * * @return the creationTime value */ @@ -259,7 +265,7 @@ public DateTime creationTime() { } /** - * Get the customDomain value. + * Get gets the custom domain the user assigned to this storage account. * * @return the customDomain value */ @@ -268,7 +274,7 @@ public CustomDomain customDomain() { } /** - * Get the secondaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. * * @return the secondaryEndpoints value */ @@ -277,7 +283,7 @@ public Endpoints secondaryEndpoints() { } /** - * Get the encryption value. + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. * * @return the encryption value */ @@ -286,7 +292,7 @@ public Encryption encryption() { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -295,7 +301,7 @@ public AccessTier accessTier() { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -304,7 +310,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountInner object itself. @@ -315,7 +321,7 @@ public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTraffic } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -323,4 +329,24 @@ public NetworkRuleSet networkRuleSet() { return this.networkRuleSet; } + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountListKeysResultInner.java index ec199c5008f62..f15b04622cefe 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountListKeysResultInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountListKeysResultInner.java @@ -24,7 +24,7 @@ public class StorageAccountListKeysResultInner { private List keys; /** - * Get the keys value. + * Get gets the list of storage account keys and their properties for the specified storage account. * * @return the keys value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/UsageInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/UsageInner.java index 3d022f23e5d52..c931196653994 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/UsageInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/UsageInner.java @@ -43,7 +43,7 @@ public class UsageInner { private UsageName name; /** - * Get the unit value. + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. * * @return the unit value */ @@ -52,7 +52,7 @@ public UsageUnit unit() { } /** - * Get the currentValue value. + * Get gets the current count of the allocated resources in the subscription. * * @return the currentValue value */ @@ -61,7 +61,7 @@ public Integer currentValue() { } /** - * Get the limit value. + * Get gets the maximum count of the resources that can be allocated in the subscription. * * @return the limit value */ @@ -70,7 +70,7 @@ public Integer limit() { } /** - * Get the name value. + * Get gets the name of the type of usage. * * @return the name value */ diff --git a/storage/resource-manager/v2018_03_01_preview/pom.xml b/storage/resource-manager/v2018_03_01_preview/pom.xml index 5703f1f07ceba..1e53c3ff243f3 100644 --- a/storage/resource-manager/v2018_03_01_preview/pom.xml +++ b/storage/resource-manager/v2018_03_01_preview/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.storage.v2018_03_01_preview - - com.microsoft.azure - azure-arm-parent - 0.0.2-beta - ../../../pom.xml - - azure-mgmt-storage - 1.0.0-beta - jar - Microsoft Azure SDK for Storage Management - This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.storage.v2018_03_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AccountSasParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AccountSasParameters.java index 9011110fe301e..ddbcef3b820cd 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AccountSasParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AccountSasParameters.java @@ -74,7 +74,7 @@ public class AccountSasParameters { private String keyToSign; /** - * Get the services value. + * Get the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @return the services value */ @@ -83,7 +83,7 @@ public Services services() { } /** - * Set the services value. + * Set the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. * * @param services the services value to set * @return the AccountSasParameters object itself. @@ -94,7 +94,7 @@ public AccountSasParameters withServices(Services services) { } /** - * Get the resourceTypes value. + * Get the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @return the resourceTypes value */ @@ -103,7 +103,7 @@ public SignedResourceTypes resourceTypes() { } /** - * Set the resourceTypes value. + * Set the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. * * @param resourceTypes the resourceTypes value to set * @return the AccountSasParameters object itself. @@ -114,7 +114,7 @@ public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) } /** - * Get the permissions value. + * Get the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -123,7 +123,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the AccountSasParameters object itself. @@ -134,7 +134,7 @@ public AccountSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -143,7 +143,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the AccountSasParameters object itself. @@ -154,7 +154,7 @@ public AccountSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -163,7 +163,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the AccountSasParameters object itself. @@ -174,7 +174,7 @@ public AccountSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -183,7 +183,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the AccountSasParameters object itself. @@ -194,7 +194,7 @@ public AccountSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -203,7 +203,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the AccountSasParameters object itself. @@ -214,7 +214,7 @@ public AccountSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -223,7 +223,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the AccountSasParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AzureEntityResource.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AzureEntityResource.java index b44d811a34a67..449dd50086521 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AzureEntityResource.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/AzureEntityResource.java @@ -23,7 +23,7 @@ public class AzureEntityResource extends ProxyResource { private String etag; /** - * Get the etag value. + * Get resource Etag. * * @return the etag value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java index 77d7193259b9a..d25debdf12485 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java @@ -16,8 +16,18 @@ * Type representing BlobContainers. */ public interface BlobContainers { + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ BlobContainer.DefinitionStages.Blank defineContainer(String name); + /** + * Begins definition for a new ImmutabilityPolicy resource. + * @param name resource name. + * @return the first stage of the new ImmutabilityPolicy definition. + */ ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); /** diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java index d62609d0ebd11..52864fc35f39c 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java index 2d0f69ffb000b..1fa859d3c627e 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersDeleteImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java index 734c870e72bf8..15513869ebe28 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersExtendImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java index b00c2940f5b69..e2fec7423db6d 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersGetImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java index 4d99f54251d66..30c874a456ec1 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java @@ -24,7 +24,7 @@ public class BlobContainersLockImmutabilityPolicyHeaders { private String eTag; /** - * Get the eTag value. + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @return the eTag value */ @@ -33,7 +33,7 @@ public String eTag() { } /** - * Set the eTag value. + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. * * @param eTag the eTag value to set * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java index dd208a5c287e5..f89dcb1e5d071 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java @@ -30,7 +30,7 @@ public class CustomDomain { private Boolean useSubDomain; /** - * Get the name value. + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @param name the name value to set * @return the CustomDomain object itself. @@ -50,7 +50,7 @@ public CustomDomain withName(String name) { } /** - * Get the useSubDomain value. + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @return the useSubDomain value */ @@ -59,7 +59,7 @@ public Boolean useSubDomain() { } /** - * Set the useSubDomain value. + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @param useSubDomain the useSubDomain value to set * @return the CustomDomain object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java index 47df54760355f..360fb387ec97a 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java @@ -27,7 +27,7 @@ public class Dimension { private String displayName; /** - * Get the name value. + * Get display name of dimension. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Set the name value. + * Set display name of dimension. * * @param name the name value to set * @return the Dimension object itself. @@ -47,7 +47,7 @@ public Dimension withName(String name) { } /** - * Get the displayName value. + * Get display name of dimension. * * @return the displayName value */ @@ -56,7 +56,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of dimension. * * @param displayName the displayName value to set * @return the Dimension object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Encryption.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Encryption.java index b297cf6487c6f..6d1dd1abc5819 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Encryption.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Encryption.java @@ -35,7 +35,7 @@ public class Encryption { private KeyVaultProperties keyVaultProperties; /** - * Get the services value. + * Get list of services which support encryption. * * @return the services value */ @@ -44,7 +44,7 @@ public EncryptionServices services() { } /** - * Set the services value. + * Set list of services which support encryption. * * @param services the services value to set * @return the Encryption object itself. @@ -55,7 +55,7 @@ public Encryption withServices(EncryptionServices services) { } /** - * Get the keySource value. + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @return the keySource value */ @@ -64,7 +64,7 @@ public KeySource keySource() { } /** - * Set the keySource value. + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @param keySource the keySource value to set * @return the Encryption object itself. @@ -75,7 +75,7 @@ public Encryption withKeySource(KeySource keySource) { } /** - * Get the keyVaultProperties value. + * Get properties provided by key vault. * * @return the keyVaultProperties value */ @@ -84,7 +84,7 @@ public KeyVaultProperties keyVaultProperties() { } /** - * Set the keyVaultProperties value. + * Set properties provided by key vault. * * @param keyVaultProperties the keyVaultProperties value to set * @return the Encryption object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionService.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionService.java index 8e10139ef4de3..8ae089e2e4d36 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionService.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionService.java @@ -32,7 +32,7 @@ public class EncryptionService { private DateTime lastEnabledTime; /** - * Get the enabled value. + * Get a boolean indicating whether or not the service encrypts the data as it is stored. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set a boolean indicating whether or not the service encrypts the data as it is stored. * * @param enabled the enabled value to set * @return the EncryptionService object itself. @@ -52,7 +52,7 @@ public EncryptionService withEnabled(Boolean enabled) { } /** - * Get the lastEnabledTime value. + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. * * @return the lastEnabledTime value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionServices.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionServices.java index aa655a6594329..9fbf34147c68b 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionServices.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/EncryptionServices.java @@ -39,7 +39,7 @@ public class EncryptionServices { private EncryptionService queue; /** - * Get the blob value. + * Get the encryption function of the blob storage service. * * @return the blob value */ @@ -48,7 +48,7 @@ public EncryptionService blob() { } /** - * Set the blob value. + * Set the encryption function of the blob storage service. * * @param blob the blob value to set * @return the EncryptionServices object itself. @@ -59,7 +59,7 @@ public EncryptionServices withBlob(EncryptionService blob) { } /** - * Get the file value. + * Get the encryption function of the file storage service. * * @return the file value */ @@ -68,7 +68,7 @@ public EncryptionService file() { } /** - * Set the file value. + * Set the encryption function of the file storage service. * * @param file the file value to set * @return the EncryptionServices object itself. @@ -79,7 +79,7 @@ public EncryptionServices withFile(EncryptionService file) { } /** - * Get the table value. + * Get the encryption function of the table storage service. * * @return the table value */ @@ -88,7 +88,7 @@ public EncryptionService table() { } /** - * Get the queue value. + * Get the encryption function of the queue storage service. * * @return the queue value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Endpoints.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Endpoints.java index a2b70275920c9..525e0b0bf422a 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Endpoints.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Endpoints.java @@ -11,8 +11,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The URIs that are used to perform a retrieval of a public blob, queue, or - * table object. + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. */ public class Endpoints { /** @@ -40,7 +40,19 @@ public class Endpoints { private String file; /** - * Get the blob value. + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. * * @return the blob value */ @@ -49,7 +61,7 @@ public String blob() { } /** - * Get the queue value. + * Get gets the queue endpoint. * * @return the queue value */ @@ -58,7 +70,7 @@ public String queue() { } /** - * Get the table value. + * Get gets the table endpoint. * * @return the table value */ @@ -67,7 +79,7 @@ public String table() { } /** - * Get the file value. + * Get gets the file endpoint. * * @return the file value */ @@ -75,4 +87,22 @@ public String file() { return this.file; } + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/IPRule.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/IPRule.java index eff3273e6054d..da21eb566808f 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/IPRule.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/IPRule.java @@ -28,7 +28,7 @@ public class IPRule { private Action action; /** - * Get the iPAddressOrRange value. + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @return the iPAddressOrRange value */ @@ -37,7 +37,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the IPRule object itself. @@ -48,7 +48,7 @@ public IPRule withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the action value. + * Get the action of IP ACL rule. Possible values include: 'Allow'. * * @return the action value */ @@ -57,7 +57,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of IP ACL rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the IPRule object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Identity.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Identity.java index 4ffa7727c7f99..7f851ea838ba6 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Identity.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Identity.java @@ -40,7 +40,7 @@ public Identity() { } /** - * Get the principalId value. + * Get the principal ID of resource identity. * * @return the principalId value */ @@ -49,7 +49,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant ID of resource. * * @return the tenantId value */ @@ -58,7 +58,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the identity type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Set the type value. + * Set the identity type. * * @param type the type value to set * @return the Identity object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicyProperties.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicyProperties.java index 8caf42f69599a..9b46f134e3dde 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicyProperties.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicyProperties.java @@ -45,7 +45,7 @@ public class ImmutabilityPolicyProperties { private List updateHistory; /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -54,7 +54,7 @@ public int immutabilityPeriodSinceCreationInDays() { } /** - * Set the immutabilityPeriodSinceCreationInDays value. + * Set the immutability period for the blobs in the container since the policy creation, in days. * * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set * @return the ImmutabilityPolicyProperties object itself. @@ -65,7 +65,7 @@ public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays(in } /** - * Get the state value. + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. * * @return the state value */ @@ -74,7 +74,7 @@ public ImmutabilityPolicyState state() { } /** - * Get the etag value. + * Get immutabilityPolicy Etag. * * @return the etag value */ @@ -83,7 +83,7 @@ public String etag() { } /** - * Get the updateHistory value. + * Get the ImmutabilityPolicy update history of the blob container. * * @return the updateHistory value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/KeyVaultProperties.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/KeyVaultProperties.java index 52374d131b8b7..39955998580bb 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/KeyVaultProperties.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/KeyVaultProperties.java @@ -33,7 +33,7 @@ public class KeyVaultProperties { private String keyVaultUri; /** - * Get the keyName value. + * Get the name of KeyVault key. * * @return the keyName value */ @@ -42,7 +42,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of KeyVault key. * * @param keyName the keyName value to set * @return the KeyVaultProperties object itself. @@ -53,7 +53,7 @@ public KeyVaultProperties withKeyName(String keyName) { } /** - * Get the keyVersion value. + * Get the version of KeyVault key. * * @return the keyVersion value */ @@ -62,7 +62,7 @@ public String keyVersion() { } /** - * Set the keyVersion value. + * Set the version of KeyVault key. * * @param keyVersion the keyVersion value to set * @return the KeyVaultProperties object itself. @@ -73,7 +73,7 @@ public KeyVaultProperties withKeyVersion(String keyVersion) { } /** - * Get the keyVaultUri value. + * Get the Uri of KeyVault. * * @return the keyVaultUri value */ @@ -82,7 +82,7 @@ public String keyVaultUri() { } /** - * Set the keyVaultUri value. + * Set the Uri of KeyVault. * * @param keyVaultUri the keyVaultUri value to set * @return the KeyVaultProperties object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LegalHoldProperties.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LegalHoldProperties.java index b6474f5f07aab..5bce9199de80f 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LegalHoldProperties.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LegalHoldProperties.java @@ -32,7 +32,7 @@ public class LegalHoldProperties { private List tags; /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -41,7 +41,7 @@ public Boolean hasLegalHold() { } /** - * Get the tags value. + * Get the list of LegalHold tags of a blob container. * * @return the tags value */ @@ -50,7 +50,7 @@ public List tags() { } /** - * Set the tags value. + * Set the list of LegalHold tags of a blob container. * * @param tags the tags value to set * @return the LegalHoldProperties object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ListContainerItem.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ListContainerItem.java index a0c0a65425127..05cde6086ea86 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ListContainerItem.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ListContainerItem.java @@ -91,7 +91,7 @@ public class ListContainerItem extends AzureEntityResource { private Boolean hasImmutabilityPolicy; /** - * Get the publicAccess value. + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @return the publicAccess value */ @@ -100,7 +100,7 @@ public PublicAccess publicAccess() { } /** - * Set the publicAccess value. + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @param publicAccess the publicAccess value to set * @return the ListContainerItem object itself. @@ -111,7 +111,7 @@ public ListContainerItem withPublicAccess(PublicAccess publicAccess) { } /** - * Get the lastModifiedTime value. + * Get returns the date and time the container was last modified. * * @return the lastModifiedTime value */ @@ -120,7 +120,7 @@ public DateTime lastModifiedTime() { } /** - * Get the leaseStatus value. + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. * * @return the leaseStatus value */ @@ -129,7 +129,7 @@ public LeaseStatus leaseStatus() { } /** - * Get the leaseState value. + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. * * @return the leaseState value */ @@ -138,7 +138,7 @@ public LeaseState leaseState() { } /** - * Get the leaseDuration value. + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. * * @return the leaseDuration value */ @@ -147,7 +147,7 @@ public LeaseDuration leaseDuration() { } /** - * Get the metadata value. + * Get a name-value pair to associate with the container as metadata. * * @return the metadata value */ @@ -156,7 +156,7 @@ public Map metadata() { } /** - * Set the metadata value. + * Set a name-value pair to associate with the container as metadata. * * @param metadata the metadata value to set * @return the ListContainerItem object itself. @@ -167,7 +167,7 @@ public ListContainerItem withMetadata(Map metadata) { } /** - * Get the immutabilityPolicy value. + * Get the ImmutabilityPolicy property of the container. * * @return the immutabilityPolicy value */ @@ -176,7 +176,7 @@ public ImmutabilityPolicyProperties immutabilityPolicy() { } /** - * Get the legalHold value. + * Get the LegalHold property of the container. * * @return the legalHold value */ @@ -185,7 +185,7 @@ public LegalHoldProperties legalHold() { } /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -194,7 +194,7 @@ public Boolean hasLegalHold() { } /** - * Get the hasImmutabilityPolicy value. + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. * * @return the hasImmutabilityPolicy value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ManagementPoliciesRulesSetParameter.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ManagementPoliciesRulesSetParameter.java index f77f65a73695e..1bce34c250bc1 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ManagementPoliciesRulesSetParameter.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ManagementPoliciesRulesSetParameter.java @@ -27,7 +27,7 @@ public class ManagementPoliciesRulesSetParameter { private Object policy; /** - * Get the policy value. + * Get the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * * @return the policy value */ @@ -36,7 +36,7 @@ public Object policy() { } /** - * Set the policy value. + * Set the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * * @param policy the policy value to set * @return the ManagementPoliciesRulesSetParameter object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/MetricSpecification.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/MetricSpecification.java index 22d731290431c..d811de192bd30 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/MetricSpecification.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/MetricSpecification.java @@ -70,7 +70,7 @@ public class MetricSpecification { private String resourceIdDimensionNameOverride; /** - * Get the name value. + * Get name of metric specification. * * @return the name value */ @@ -79,7 +79,7 @@ public String name() { } /** - * Set the name value. + * Set name of metric specification. * * @param name the name value to set * @return the MetricSpecification object itself. @@ -90,7 +90,7 @@ public MetricSpecification withName(String name) { } /** - * Get the displayName value. + * Get display name of metric specification. * * @return the displayName value */ @@ -99,7 +99,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of metric specification. * * @param displayName the displayName value to set * @return the MetricSpecification object itself. @@ -110,7 +110,7 @@ public MetricSpecification withDisplayName(String displayName) { } /** - * Get the displayDescription value. + * Get display description of metric specification. * * @return the displayDescription value */ @@ -119,7 +119,7 @@ public String displayDescription() { } /** - * Set the displayDescription value. + * Set display description of metric specification. * * @param displayDescription the displayDescription value to set * @return the MetricSpecification object itself. @@ -130,7 +130,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { } /** - * Get the unit value. + * Get unit could be Bytes or Count. * * @return the unit value */ @@ -139,7 +139,7 @@ public String unit() { } /** - * Set the unit value. + * Set unit could be Bytes or Count. * * @param unit the unit value to set * @return the MetricSpecification object itself. @@ -150,7 +150,7 @@ public MetricSpecification withUnit(String unit) { } /** - * Get the dimensions value. + * Get dimensions of blobs, including blob type and access tier. * * @return the dimensions value */ @@ -159,7 +159,7 @@ public List dimensions() { } /** - * Set the dimensions value. + * Set dimensions of blobs, including blob type and access tier. * * @param dimensions the dimensions value to set * @return the MetricSpecification object itself. @@ -170,7 +170,7 @@ public MetricSpecification withDimensions(List dimensions) { } /** - * Get the aggregationType value. + * Get aggregation type could be Average. * * @return the aggregationType value */ @@ -179,7 +179,7 @@ public String aggregationType() { } /** - * Set the aggregationType value. + * Set aggregation type could be Average. * * @param aggregationType the aggregationType value to set * @return the MetricSpecification object itself. @@ -190,7 +190,7 @@ public MetricSpecification withAggregationType(String aggregationType) { } /** - * Get the fillGapWithZero value. + * Get the property to decide fill gap with zero or not. * * @return the fillGapWithZero value */ @@ -199,7 +199,7 @@ public Boolean fillGapWithZero() { } /** - * Set the fillGapWithZero value. + * Set the property to decide fill gap with zero or not. * * @param fillGapWithZero the fillGapWithZero value to set * @return the MetricSpecification object itself. @@ -210,7 +210,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { } /** - * Get the category value. + * Get the category this metric specification belong to, could be Capacity. * * @return the category value */ @@ -219,7 +219,7 @@ public String category() { } /** - * Set the category value. + * Set the category this metric specification belong to, could be Capacity. * * @param category the category value to set * @return the MetricSpecification object itself. @@ -230,7 +230,7 @@ public MetricSpecification withCategory(String category) { } /** - * Get the resourceIdDimensionNameOverride value. + * Get account Resource Id. * * @return the resourceIdDimensionNameOverride value */ @@ -239,7 +239,7 @@ public String resourceIdDimensionNameOverride() { } /** - * Set the resourceIdDimensionNameOverride value. + * Set account Resource Id. * * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set * @return the MetricSpecification object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/NetworkRuleSet.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/NetworkRuleSet.java index 66a229d14d9e1..b2d60b41312b4 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/NetworkRuleSet.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/NetworkRuleSet.java @@ -45,7 +45,7 @@ public class NetworkRuleSet { private DefaultAction defaultAction; /** - * Get the bypass value. + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @return the bypass value */ @@ -54,7 +54,7 @@ public Bypass bypass() { } /** - * Set the bypass value. + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. * * @param bypass the bypass value to set * @return the NetworkRuleSet object itself. @@ -65,7 +65,7 @@ public NetworkRuleSet withBypass(Bypass bypass) { } /** - * Get the virtualNetworkRules value. + * Get sets the virtual network rules. * * @return the virtualNetworkRules value */ @@ -74,7 +74,7 @@ public List virtualNetworkRules() { } /** - * Set the virtualNetworkRules value. + * Set sets the virtual network rules. * * @param virtualNetworkRules the virtualNetworkRules value to set * @return the NetworkRuleSet object itself. @@ -85,7 +85,7 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe } /** - * Get the ipRules value. + * Get sets the IP ACL rules. * * @return the ipRules value */ @@ -94,7 +94,7 @@ public List ipRules() { } /** - * Set the ipRules value. + * Set sets the IP ACL rules. * * @param ipRules the ipRules value to set * @return the NetworkRuleSet object itself. @@ -105,7 +105,7 @@ public NetworkRuleSet withIpRules(List ipRules) { } /** - * Get the defaultAction value. + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @return the defaultAction value */ @@ -114,7 +114,7 @@ public DefaultAction defaultAction() { } /** - * Set the defaultAction value. + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @param defaultAction the defaultAction value to set * @return the NetworkRuleSet object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/OperationDisplay.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/OperationDisplay.java index 570cc5d70f937..dff50e8f64e1c 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/OperationDisplay.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/OperationDisplay.java @@ -33,7 +33,13 @@ public class OperationDisplay { private String operation; /** - * Get the provider value. + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Storage. * * @return the provider value */ @@ -42,7 +48,7 @@ public String provider() { } /** - * Set the provider value. + * Set service provider: Microsoft Storage. * * @param provider the provider value to set * @return the OperationDisplay object itself. @@ -53,7 +59,7 @@ public OperationDisplay withProvider(String provider) { } /** - * Get the resource value. + * Get resource on which the operation is performed etc. * * @return the resource value */ @@ -62,7 +68,7 @@ public String resource() { } /** - * Set the resource value. + * Set resource on which the operation is performed etc. * * @param resource the resource value to set * @return the OperationDisplay object itself. @@ -73,7 +79,7 @@ public OperationDisplay withResource(String resource) { } /** - * Get the operation value. + * Get type of operation: get, read, delete, etc. * * @return the operation value */ @@ -82,7 +88,7 @@ public String operation() { } /** - * Set the operation value. + * Set type of operation: get, read, delete, etc. * * @param operation the operation value to set * @return the OperationDisplay object itself. @@ -92,4 +98,24 @@ public OperationDisplay withOperation(String operation) { return this; } + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Restriction.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Restriction.java index 0828b438e74f8..08b04f288bf22 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Restriction.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Restriction.java @@ -30,17 +30,17 @@ public class Restriction { private List values; /** - * The reason for the restriction. As of now this can be “QuotaId” or - * “NotAvailableForSubscription”. Quota Id is set when the SKU has + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has * requiredQuotas parameter as the subscription does not belong to that - * quota. The “NotAvailableForSubscription” is related to capacity at DC. + * quota. The "NotAvailableForSubscription" is related to capacity at DC. * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. */ @JsonProperty(value = "reasonCode") private ReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. As of now only possible value for this is location. * * @return the type value */ @@ -49,7 +49,7 @@ public String type() { } /** - * Get the values value. + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. * * @return the values value */ @@ -58,7 +58,7 @@ public List values() { } /** - * Get the reasonCode value. + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @return the reasonCode value */ @@ -67,7 +67,7 @@ public ReasonCode reasonCode() { } /** - * Set the reasonCode value. + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @param reasonCode the reasonCode value to set * @return the Restriction object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/SKUCapability.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/SKUCapability.java index a7edb39412c80..14f170a07b189 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/SKUCapability.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/SKUCapability.java @@ -30,7 +30,7 @@ public class SKUCapability { private String value; /** - * Get the name value. + * Get the name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Get the value value. + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. * * @return the value value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java index 31af2bbf20e3c..89e4208e2c524 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java @@ -26,7 +26,7 @@ public class ServiceSasParameters { * include: Blob (b), Container (c), File (f), Share (s). Possible values * include: 'b', 'c', 'f', 's'. */ - @JsonProperty(value = "signedResource", required = true) + @JsonProperty(value = "signedResource") private SignedResource resource; /** @@ -131,7 +131,7 @@ public class ServiceSasParameters { private String contentType; /** - * Get the canonicalizedResource value. + * Get the canonical path to the signed resource. * * @return the canonicalizedResource value */ @@ -140,7 +140,7 @@ public String canonicalizedResource() { } /** - * Set the canonicalizedResource value. + * Set the canonical path to the signed resource. * * @param canonicalizedResource the canonicalizedResource value to set * @return the ServiceSasParameters object itself. @@ -151,7 +151,7 @@ public ServiceSasParameters withCanonicalizedResource(String canonicalizedResour } /** - * Get the resource value. + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @return the resource value */ @@ -160,7 +160,7 @@ public SignedResource resource() { } /** - * Set the resource value. + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. * * @param resource the resource value to set * @return the ServiceSasParameters object itself. @@ -171,7 +171,7 @@ public ServiceSasParameters withResource(SignedResource resource) { } /** - * Get the permissions value. + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @return the permissions value */ @@ -180,7 +180,7 @@ public Permissions permissions() { } /** - * Set the permissions value. + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. * * @param permissions the permissions value to set * @return the ServiceSasParameters object itself. @@ -191,7 +191,7 @@ public ServiceSasParameters withPermissions(Permissions permissions) { } /** - * Get the iPAddressOrRange value. + * Get an IP address or a range of IP addresses from which to accept requests. * * @return the iPAddressOrRange value */ @@ -200,7 +200,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * Set an IP address or a range of IP addresses from which to accept requests. * * @param iPAddressOrRange the iPAddressOrRange value to set * @return the ServiceSasParameters object itself. @@ -211,7 +211,7 @@ public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the protocols value. + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @return the protocols value */ @@ -220,7 +220,7 @@ public HttpProtocol protocols() { } /** - * Set the protocols value. + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. * * @param protocols the protocols value to set * @return the ServiceSasParameters object itself. @@ -231,7 +231,7 @@ public ServiceSasParameters withProtocols(HttpProtocol protocols) { } /** - * Get the sharedAccessStartTime value. + * Get the time at which the SAS becomes valid. * * @return the sharedAccessStartTime value */ @@ -240,7 +240,7 @@ public DateTime sharedAccessStartTime() { } /** - * Set the sharedAccessStartTime value. + * Set the time at which the SAS becomes valid. * * @param sharedAccessStartTime the sharedAccessStartTime value to set * @return the ServiceSasParameters object itself. @@ -251,7 +251,7 @@ public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStart } /** - * Get the sharedAccessExpiryTime value. + * Get the time at which the shared access signature becomes invalid. * * @return the sharedAccessExpiryTime value */ @@ -260,7 +260,7 @@ public DateTime sharedAccessExpiryTime() { } /** - * Set the sharedAccessExpiryTime value. + * Set the time at which the shared access signature becomes invalid. * * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set * @return the ServiceSasParameters object itself. @@ -271,7 +271,7 @@ public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpi } /** - * Get the identifier value. + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @return the identifier value */ @@ -280,7 +280,7 @@ public String identifier() { } /** - * Set the identifier value. + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. * * @param identifier the identifier value to set * @return the ServiceSasParameters object itself. @@ -291,7 +291,7 @@ public ServiceSasParameters withIdentifier(String identifier) { } /** - * Get the partitionKeyStart value. + * Get the start of partition key. * * @return the partitionKeyStart value */ @@ -300,7 +300,7 @@ public String partitionKeyStart() { } /** - * Set the partitionKeyStart value. + * Set the start of partition key. * * @param partitionKeyStart the partitionKeyStart value to set * @return the ServiceSasParameters object itself. @@ -311,7 +311,7 @@ public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { } /** - * Get the partitionKeyEnd value. + * Get the end of partition key. * * @return the partitionKeyEnd value */ @@ -320,7 +320,7 @@ public String partitionKeyEnd() { } /** - * Set the partitionKeyEnd value. + * Set the end of partition key. * * @param partitionKeyEnd the partitionKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -331,7 +331,7 @@ public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { } /** - * Get the rowKeyStart value. + * Get the start of row key. * * @return the rowKeyStart value */ @@ -340,7 +340,7 @@ public String rowKeyStart() { } /** - * Set the rowKeyStart value. + * Set the start of row key. * * @param rowKeyStart the rowKeyStart value to set * @return the ServiceSasParameters object itself. @@ -351,7 +351,7 @@ public ServiceSasParameters withRowKeyStart(String rowKeyStart) { } /** - * Get the rowKeyEnd value. + * Get the end of row key. * * @return the rowKeyEnd value */ @@ -360,7 +360,7 @@ public String rowKeyEnd() { } /** - * Set the rowKeyEnd value. + * Set the end of row key. * * @param rowKeyEnd the rowKeyEnd value to set * @return the ServiceSasParameters object itself. @@ -371,7 +371,7 @@ public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { } /** - * Get the keyToSign value. + * Get the key to sign the account SAS token with. * * @return the keyToSign value */ @@ -380,7 +380,7 @@ public String keyToSign() { } /** - * Set the keyToSign value. + * Set the key to sign the account SAS token with. * * @param keyToSign the keyToSign value to set * @return the ServiceSasParameters object itself. @@ -391,7 +391,7 @@ public ServiceSasParameters withKeyToSign(String keyToSign) { } /** - * Get the cacheControl value. + * Get the response header override for cache control. * * @return the cacheControl value */ @@ -400,7 +400,7 @@ public String cacheControl() { } /** - * Set the cacheControl value. + * Set the response header override for cache control. * * @param cacheControl the cacheControl value to set * @return the ServiceSasParameters object itself. @@ -411,7 +411,7 @@ public ServiceSasParameters withCacheControl(String cacheControl) { } /** - * Get the contentDisposition value. + * Get the response header override for content disposition. * * @return the contentDisposition value */ @@ -420,7 +420,7 @@ public String contentDisposition() { } /** - * Set the contentDisposition value. + * Set the response header override for content disposition. * * @param contentDisposition the contentDisposition value to set * @return the ServiceSasParameters object itself. @@ -431,7 +431,7 @@ public ServiceSasParameters withContentDisposition(String contentDisposition) { } /** - * Get the contentEncoding value. + * Get the response header override for content encoding. * * @return the contentEncoding value */ @@ -440,7 +440,7 @@ public String contentEncoding() { } /** - * Set the contentEncoding value. + * Set the response header override for content encoding. * * @param contentEncoding the contentEncoding value to set * @return the ServiceSasParameters object itself. @@ -451,7 +451,7 @@ public ServiceSasParameters withContentEncoding(String contentEncoding) { } /** - * Get the contentLanguage value. + * Get the response header override for content language. * * @return the contentLanguage value */ @@ -460,7 +460,7 @@ public String contentLanguage() { } /** - * Set the contentLanguage value. + * Set the response header override for content language. * * @param contentLanguage the contentLanguage value to set * @return the ServiceSasParameters object itself. @@ -471,7 +471,7 @@ public ServiceSasParameters withContentLanguage(String contentLanguage) { } /** - * Get the contentType value. + * Get the response header override for content type. * * @return the contentType value */ @@ -480,7 +480,7 @@ public String contentType() { } /** - * Set the contentType value. + * Set the response header override for content type. * * @param contentType the contentType value to set * @return the ServiceSasParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSpecification.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSpecification.java index 5293473b6b5ff..f5dbfaa831c87 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSpecification.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSpecification.java @@ -22,7 +22,7 @@ public class ServiceSpecification { private List metricSpecifications; /** - * Get the metricSpecifications value. + * Get metric specifications of operation. * * @return the metricSpecifications value */ @@ -31,7 +31,7 @@ public List metricSpecifications() { } /** - * Set the metricSpecifications value. + * Set metric specifications of operation. * * @param metricSpecifications the metricSpecifications value to set * @return the ServiceSpecification object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java index 542a08a5987bd..9338ff33a4128 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2018_03_01_preview.implementation.StorageManager; import com.microsoft.azure.management.storage.v2018_03_01_preview.implementation.SkuInner; @@ -56,6 +56,11 @@ public interface StorageAccount extends HasInner, Resource, */ Identity identity(); + /** + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + /** * @return the kind value. */ @@ -203,6 +208,16 @@ interface WithIdentity { WithCreate withIdentity(Identity identity); } + /** + * The stage of the storageaccount update allowing to specify IsHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies isHnsEnabled. + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + /** * The stage of the storageaccount update allowing to specify NetworkRuleSet. */ @@ -218,7 +233,7 @@ interface WithNetworkRuleSet { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithNetworkRuleSet { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithNetworkRuleSet { } } /** diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCheckNameAvailabilityParameters.java index 0329322c11f59..bc2aa2ce79756 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCheckNameAvailabilityParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCheckNameAvailabilityParameters.java @@ -28,13 +28,14 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; } /** - * Get the name value. + * Get the storage account name. * * @return the name value */ @@ -43,7 +44,7 @@ public String name() { } /** - * Set the name value. + * Set the storage account name. * * @param name the name value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. @@ -54,7 +55,7 @@ public StorageAccountCheckNameAvailabilityParameters withName(String name) { } /** - * Get the type value. + * Get the type of resource, Microsoft.Storage/storageAccounts. * * @return the type value */ @@ -63,7 +64,7 @@ public String type() { } /** - * Set the type value. + * Set the type of resource, Microsoft.Storage/storageAccounts. * * @param type the type value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCreateParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCreateParameters.java index 8a49edfcf452d..f3cfb865f7fa3 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCreateParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountCreateParameters.java @@ -94,7 +94,13 @@ public class StorageAccountCreateParameters { private Boolean enableHttpsTrafficOnly; /** - * Get the sku value. + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get required. Gets or sets the sku name. * * @return the sku value */ @@ -103,7 +109,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set required. Gets or sets the sku name. * * @param sku the sku value to set * @return the StorageAccountCreateParameters object itself. @@ -114,7 +120,7 @@ public StorageAccountCreateParameters withSku(SkuInner sku) { } /** - * Get the kind value. + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -123,7 +129,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountCreateParameters object itself. @@ -134,7 +140,7 @@ public StorageAccountCreateParameters withKind(Kind kind) { } /** - * Get the location value. + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @return the location value */ @@ -143,7 +149,7 @@ public String location() { } /** - * Set the location value. + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. * * @param location the location value to set * @return the StorageAccountCreateParameters object itself. @@ -154,7 +160,7 @@ public StorageAccountCreateParameters withLocation(String location) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @return the tags value */ @@ -163,7 +169,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. * * @param tags the tags value to set * @return the StorageAccountCreateParameters object itself. @@ -174,7 +180,7 @@ public StorageAccountCreateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -183,7 +189,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountCreateParameters object itself. @@ -194,7 +200,7 @@ public StorageAccountCreateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -203,7 +209,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountCreateParameters object itself. @@ -214,7 +220,7 @@ public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @return the encryption value */ @@ -223,7 +229,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountCreateParameters object itself. @@ -234,7 +240,7 @@ public StorageAccountCreateParameters withEncryption(Encryption encryption) { } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -243,7 +249,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountCreateParameters object itself. @@ -254,7 +260,7 @@ public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -263,7 +269,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountCreateParameters object itself. @@ -274,7 +280,7 @@ public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -283,7 +289,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountCreateParameters object itself. @@ -293,4 +299,24 @@ public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableH return this; } + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountKey.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountKey.java index 70c5e9f86c9d1..7f313a6c6f052 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountKey.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountKey.java @@ -34,7 +34,7 @@ public class StorageAccountKey { private KeyPermission permissions; /** - * Get the keyName value. + * Get name of the key. * * @return the keyName value */ @@ -43,7 +43,7 @@ public String keyName() { } /** - * Get the value value. + * Get base 64-encoded value of the key. * * @return the value value */ @@ -52,7 +52,7 @@ public String value() { } /** - * Get the permissions value. + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. * * @return the permissions value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java index 32bba3bef9d2e..c78fc8a24f889 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java @@ -22,7 +22,7 @@ public class StorageAccountRegenerateKeyParameters { private String keyName; /** - * Get the keyName value. + * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountUpdateParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountUpdateParameters.java index d4596c3c87cff..439ec53b4aad6 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountUpdateParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountUpdateParameters.java @@ -87,7 +87,7 @@ public class StorageAccountUpdateParameters { private Kind kind; /** - * Get the sku value. + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @return the sku value */ @@ -96,7 +96,7 @@ public SkuInner sku() { } /** - * Set the sku value. + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. @@ -107,7 +107,7 @@ public StorageAccountUpdateParameters withSku(SkuInner sku) { } /** - * Get the tags value. + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @return the tags value */ @@ -116,7 +116,7 @@ public Map tags() { } /** - * Set the tags value. + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @param tags the tags value to set * @return the StorageAccountUpdateParameters object itself. @@ -127,7 +127,7 @@ public StorageAccountUpdateParameters withTags(Map tags) { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -136,7 +136,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountUpdateParameters object itself. @@ -147,7 +147,7 @@ public StorageAccountUpdateParameters withIdentity(Identity identity) { } /** - * Get the customDomain value. + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ @@ -156,7 +156,7 @@ public CustomDomain customDomain() { } /** - * Set the customDomain value. + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountUpdateParameters object itself. @@ -167,7 +167,7 @@ public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain } /** - * Get the encryption value. + * Get provides the encryption settings on the account. The default setting is unencrypted. * * @return the encryption value */ @@ -176,7 +176,7 @@ public Encryption encryption() { } /** - * Set the encryption value. + * Set provides the encryption settings on the account. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountUpdateParameters object itself. @@ -187,7 +187,7 @@ public StorageAccountUpdateParameters withEncryption(Encryption encryption) { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -196,7 +196,7 @@ public AccessTier accessTier() { } /** - * Set the accessTier value. + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountUpdateParameters object itself. @@ -207,7 +207,7 @@ public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -216,7 +216,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountUpdateParameters object itself. @@ -227,7 +227,7 @@ public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableH } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -236,7 +236,7 @@ public NetworkRuleSet networkRuleSet() { } /** - * Set the networkRuleSet value. + * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountUpdateParameters object itself. @@ -247,7 +247,7 @@ public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkR } /** - * Get the kind value. + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -256,7 +256,7 @@ public Kind kind() { } /** - * Set the kind value. + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @param kind the kind value to set * @return the StorageAccountUpdateParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java index bcf2dfecf5720..9250577e7185c 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java @@ -23,6 +23,11 @@ * Type representing StorageAccounts. */ public interface StorageAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new ManagementPolicy resource. + * @param name resource name. + * @return the first stage of the new ManagementPolicy definition. + */ StorageAccountManagementPolicies.DefinitionStages.Blank defineManagementPolicy(String name); /** diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/TagProperty.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/TagProperty.java index a4989ede37e76..9e4d56faf3c02 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/TagProperty.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/TagProperty.java @@ -56,7 +56,7 @@ public String tag() { } /** - * Get the timestamp value. + * Get returns the date and time the tag was added. * * @return the timestamp value */ @@ -65,7 +65,7 @@ public DateTime timestamp() { } /** - * Get the objectIdentifier value. + * Get returns the Object ID of the user who added the tag. * * @return the objectIdentifier value */ @@ -74,7 +74,7 @@ public String objectIdentifier() { } /** - * Get the tenantId value. + * Get returns the Tenant ID that issued the token for the user who added the tag. * * @return the tenantId value */ @@ -83,7 +83,7 @@ public String tenantId() { } /** - * Get the upn value. + * Get returns the User Principal Name of the user who added the tag. * * @return the upn value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UpdateHistoryProperty.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UpdateHistoryProperty.java index 8f7c08e312e25..f26c58e0eb2bc 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UpdateHistoryProperty.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UpdateHistoryProperty.java @@ -57,7 +57,7 @@ public class UpdateHistoryProperty { private String upn; /** - * Get the update value. + * Get the ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'put', 'lock', 'extend'. * * @return the update value */ @@ -66,7 +66,7 @@ public ImmutabilityPolicyUpdateType update() { } /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -75,7 +75,7 @@ public Integer immutabilityPeriodSinceCreationInDays() { } /** - * Get the timestamp value. + * Get returns the date and time the ImmutabilityPolicy was updated. * * @return the timestamp value */ @@ -84,7 +84,7 @@ public DateTime timestamp() { } /** - * Get the objectIdentifier value. + * Get returns the Object ID of the user who updated the ImmutabilityPolicy. * * @return the objectIdentifier value */ @@ -93,7 +93,7 @@ public String objectIdentifier() { } /** - * Get the tenantId value. + * Get returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. * * @return the tenantId value */ @@ -102,7 +102,7 @@ public String tenantId() { } /** - * Get the upn value. + * Get returns the User Principal Name of the user who updated the ImmutabilityPolicy. * * @return the upn value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UsageName.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UsageName.java index e0e1f9bc1fd80..19b781c907742 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UsageName.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get gets a string describing the resource name. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get gets a localized string describing the resource name. * * @return the localizedValue value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/VirtualNetworkRule.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/VirtualNetworkRule.java index 9ca645962a51b..8d9a22e62ad5e 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/VirtualNetworkRule.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/VirtualNetworkRule.java @@ -36,7 +36,7 @@ public class VirtualNetworkRule { private State state; /** - * Get the virtualNetworkResourceId value. + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @return the virtualNetworkResourceId value */ @@ -45,7 +45,7 @@ public String virtualNetworkResourceId() { } /** - * Set the virtualNetworkResourceId value. + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @param virtualNetworkResourceId the virtualNetworkResourceId value to set * @return the VirtualNetworkRule object itself. @@ -56,7 +56,7 @@ public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkReso } /** - * Get the action value. + * Get the action of virtual network rule. Possible values include: 'Allow'. * * @return the action value */ @@ -65,7 +65,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of virtual network rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the VirtualNetworkRule object itself. @@ -76,7 +76,7 @@ public VirtualNetworkRule withAction(Action action) { } /** - * Get the state value. + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @return the state value */ @@ -85,7 +85,7 @@ public State state() { } /** - * Set the state value. + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @param state the state value to set * @return the VirtualNetworkRule object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainerInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainerInner.java index 12c5463674d40..9a2004c67aa76 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainerInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainerInner.java @@ -99,7 +99,7 @@ public class BlobContainerInner extends AzureEntityResource { private Boolean hasImmutabilityPolicy; /** - * Get the publicAccess value. + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @return the publicAccess value */ @@ -108,7 +108,7 @@ public PublicAccess publicAccess() { } /** - * Set the publicAccess value. + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. * * @param publicAccess the publicAccess value to set * @return the BlobContainerInner object itself. @@ -119,7 +119,7 @@ public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { } /** - * Get the lastModifiedTime value. + * Get returns the date and time the container was last modified. * * @return the lastModifiedTime value */ @@ -128,7 +128,7 @@ public DateTime lastModifiedTime() { } /** - * Get the leaseStatus value. + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. * * @return the leaseStatus value */ @@ -137,7 +137,7 @@ public LeaseStatus leaseStatus() { } /** - * Get the leaseState value. + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. * * @return the leaseState value */ @@ -146,7 +146,7 @@ public LeaseState leaseState() { } /** - * Get the leaseDuration value. + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. * * @return the leaseDuration value */ @@ -155,7 +155,7 @@ public LeaseDuration leaseDuration() { } /** - * Get the metadata value. + * Get a name-value pair to associate with the container as metadata. * * @return the metadata value */ @@ -164,7 +164,7 @@ public Map metadata() { } /** - * Set the metadata value. + * Set a name-value pair to associate with the container as metadata. * * @param metadata the metadata value to set * @return the BlobContainerInner object itself. @@ -175,7 +175,7 @@ public BlobContainerInner withMetadata(Map metadata) { } /** - * Get the immutabilityPolicy value. + * Get the ImmutabilityPolicy property of the container. * * @return the immutabilityPolicy value */ @@ -184,7 +184,7 @@ public ImmutabilityPolicyProperties immutabilityPolicy() { } /** - * Get the legalHold value. + * Get the LegalHold property of the container. * * @return the legalHold value */ @@ -193,7 +193,7 @@ public LegalHoldProperties legalHold() { } /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -202,7 +202,7 @@ public Boolean hasLegalHold() { } /** - * Get the hasImmutabilityPolicy value. + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. * * @return the hasImmutabilityPolicy value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/CheckNameAvailabilityResultInner.java index cbb670e103e41..75a89c63eb5b7 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/CheckNameAvailabilityResultInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/CheckNameAvailabilityResultInner.java @@ -38,7 +38,7 @@ public class CheckNameAvailabilityResultInner { private String message; /** - * Get the nameAvailable value. + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. * * @return the nameAvailable value */ @@ -47,7 +47,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. * * @return the reason value */ @@ -56,7 +56,7 @@ public Reason reason() { } /** - * Get the message value. + * Get gets an error message explaining the Reason value in more detail. * * @return the message value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyInner.java index ba2729fc50202..ac8869e9c3b50 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyInner.java @@ -35,7 +35,7 @@ public class ImmutabilityPolicyInner extends AzureEntityResource { private ImmutabilityPolicyState state; /** - * Get the immutabilityPeriodSinceCreationInDays value. + * Get the immutability period for the blobs in the container since the policy creation, in days. * * @return the immutabilityPeriodSinceCreationInDays value */ @@ -44,7 +44,7 @@ public int immutabilityPeriodSinceCreationInDays() { } /** - * Set the immutabilityPeriodSinceCreationInDays value. + * Set the immutability period for the blobs in the container since the policy creation, in days. * * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set * @return the ImmutabilityPolicyInner object itself. @@ -55,7 +55,7 @@ public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays(int imm } /** - * Get the state value. + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. * * @return the state value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LegalHoldInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LegalHoldInner.java index 7b14a552698da..bdb438306ac02 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LegalHoldInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LegalHoldInner.java @@ -33,7 +33,7 @@ public class LegalHoldInner { private List tags; /** - * Get the hasLegalHold value. + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. * * @return the hasLegalHold value */ @@ -42,7 +42,7 @@ public Boolean hasLegalHold() { } /** - * Get the tags value. + * Get each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. * * @return the tags value */ @@ -51,7 +51,7 @@ public List tags() { } /** - * Set the tags value. + * Set each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. * * @param tags the tags value to set * @return the LegalHoldInner object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListAccountSasResponseInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListAccountSasResponseInner.java index bfa960538587d..827c8d0ee0699 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListAccountSasResponseInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListAccountSasResponseInner.java @@ -21,7 +21,7 @@ public class ListAccountSasResponseInner { private String accountSasToken; /** - * Get the accountSasToken value. + * Get list SAS credentials of storage account. * * @return the accountSasToken value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListContainerItemsInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListContainerItemsInner.java index b7abf57a866a1..28220fc114147 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListContainerItemsInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListContainerItemsInner.java @@ -23,7 +23,7 @@ public class ListContainerItemsInner { private List value; /** - * Get the value value. + * Get the list of blob containers. * * @return the value value */ @@ -32,7 +32,7 @@ public List value() { } /** - * Set the value value. + * Set the list of blob containers. * * @param value the value value to set * @return the ListContainerItemsInner object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java index aa676f5860e65..a7d8f454128e8 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java @@ -21,7 +21,7 @@ public class ListServiceSasResponseInner { private String serviceSasToken; /** - * Get the serviceSasToken value. + * Get list service SAS credentials of speicific resource. * * @return the serviceSasToken value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationInner.java index f4afd630d8ac9..453bae7ba0f64 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationInner.java @@ -43,7 +43,7 @@ public class OperationInner { private ServiceSpecification serviceSpecification; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{operation}. * * @return the name value */ @@ -52,7 +52,7 @@ public String name() { } /** - * Set the name value. + * Set operation name: {provider}/{resource}/{operation}. * * @param name the name value to set * @return the OperationInner object itself. @@ -63,7 +63,7 @@ public OperationInner withName(String name) { } /** - * Get the display value. + * Get display metadata associated with the operation. * * @return the display value */ @@ -72,7 +72,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set display metadata associated with the operation. * * @param display the display value to set * @return the OperationInner object itself. @@ -83,7 +83,7 @@ public OperationInner withDisplay(OperationDisplay display) { } /** - * Get the origin value. + * Get the origin of operations. * * @return the origin value */ @@ -92,7 +92,7 @@ public String origin() { } /** - * Set the origin value. + * Set the origin of operations. * * @param origin the origin value to set * @return the OperationInner object itself. @@ -103,7 +103,7 @@ public OperationInner withOrigin(String origin) { } /** - * Get the serviceSpecification value. + * Get one property of operation, include metric specifications. * * @return the serviceSpecification value */ @@ -112,7 +112,7 @@ public ServiceSpecification serviceSpecification() { } /** - * Set the serviceSpecification value. + * Set one property of operation, include metric specifications. * * @param serviceSpecification the serviceSpecification value to set * @return the OperationInner object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationsImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationsImpl.java index c6a2da09d5f14..5b04b6eff75fd 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationsImpl.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/OperationsImpl.java @@ -37,7 +37,8 @@ public Observable listAsync() { public Observable call(List innerList) { return Observable.from(innerList); } - }) .map(new Func1() { + }) + .map(new Func1() { @Override public Operation call(OperationInner inner) { return new OperationImpl(inner, manager()); diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/SkuInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/SkuInner.java index 815302f7bcb1a..b19dff5e8aee1 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/SkuInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/SkuInner.java @@ -72,7 +72,7 @@ public class SkuInner { private List restrictions; /** - * Get the name value. + * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @return the name value */ @@ -81,7 +81,7 @@ public SkuName name() { } /** - * Set the name value. + * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'. * * @param name the name value to set * @return the SkuInner object itself. @@ -92,7 +92,7 @@ public SkuInner withName(SkuName name) { } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ @@ -101,7 +101,7 @@ public SkuTier tier() { } /** - * Get the resourceType value. + * Get the type of the resource, usually it is 'storageAccounts'. * * @return the resourceType value */ @@ -110,7 +110,7 @@ public String resourceType() { } /** - * Get the kind value. + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -119,7 +119,7 @@ public Kind kind() { } /** - * Get the locations value. + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). * * @return the locations value */ @@ -128,7 +128,7 @@ public List locations() { } /** - * Get the capabilities value. + * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the capabilities value */ @@ -137,7 +137,7 @@ public List capabilities() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ @@ -146,7 +146,7 @@ public List restrictions() { } /** - * Set the restrictions value. + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @param restrictions the restrictions value to set * @return the SkuInner object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountImpl.java index ff48a2b25922f..83ba7a87e6c68 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountImpl.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountImpl.java @@ -111,6 +111,11 @@ public Identity identity() { return this.inner().identity(); } + @Override + public Boolean isHnsEnabled() { + return this.inner().isHnsEnabled(); + } + @Override public Kind kind() { return this.inner().kind(); @@ -171,6 +176,12 @@ public AccountStatus statusOfSecondary() { return this.inner().statusOfSecondary(); } + @Override + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameter.withIsHnsEnabled(isHnsEnabled); + return this; + } + @Override public StorageAccountImpl withKind(Kind kind) { if (isInCreateMode()) { diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountInner.java index 4ade36dcfad4b..091d2de355992 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountInner.java @@ -149,7 +149,13 @@ public class StorageAccountInner extends Resource { private NetworkRuleSet networkRuleSet; /** - * Get the sku value. + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get gets the SKU. * * @return the sku value */ @@ -158,7 +164,7 @@ public SkuInner sku() { } /** - * Get the kind value. + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -167,7 +173,7 @@ public Kind kind() { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -176,7 +182,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountInner object itself. @@ -187,7 +193,7 @@ public StorageAccountInner withIdentity(Identity identity) { } /** - * Get the provisioningState value. + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. * * @return the provisioningState value */ @@ -196,7 +202,7 @@ public ProvisioningState provisioningState() { } /** - * Get the primaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. * * @return the primaryEndpoints value */ @@ -205,7 +211,7 @@ public Endpoints primaryEndpoints() { } /** - * Get the primaryLocation value. + * Get gets the location of the primary data center for the storage account. * * @return the primaryLocation value */ @@ -214,7 +220,7 @@ public String primaryLocation() { } /** - * Get the statusOfPrimary value. + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. * * @return the statusOfPrimary value */ @@ -223,7 +229,7 @@ public AccountStatus statusOfPrimary() { } /** - * Get the lastGeoFailoverTime value. + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the lastGeoFailoverTime value */ @@ -232,7 +238,7 @@ public DateTime lastGeoFailoverTime() { } /** - * Get the secondaryLocation value. + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. * * @return the secondaryLocation value */ @@ -241,7 +247,7 @@ public String secondaryLocation() { } /** - * Get the statusOfSecondary value. + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. * * @return the statusOfSecondary value */ @@ -250,7 +256,7 @@ public AccountStatus statusOfSecondary() { } /** - * Get the creationTime value. + * Get gets the creation date and time of the storage account in UTC. * * @return the creationTime value */ @@ -259,7 +265,7 @@ public DateTime creationTime() { } /** - * Get the customDomain value. + * Get gets the custom domain the user assigned to this storage account. * * @return the customDomain value */ @@ -268,7 +274,7 @@ public CustomDomain customDomain() { } /** - * Get the secondaryEndpoints value. + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. * * @return the secondaryEndpoints value */ @@ -277,7 +283,7 @@ public Endpoints secondaryEndpoints() { } /** - * Get the encryption value. + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. * * @return the encryption value */ @@ -286,7 +292,7 @@ public Encryption encryption() { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -295,7 +301,7 @@ public AccessTier accessTier() { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -304,7 +310,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountInner object itself. @@ -315,7 +321,7 @@ public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTraffic } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ @@ -323,4 +329,24 @@ public NetworkRuleSet networkRuleSet() { return this.networkRuleSet; } + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountListKeysResultInner.java index c5ade470b9292..427c6bfc16ea6 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountListKeysResultInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountListKeysResultInner.java @@ -24,7 +24,7 @@ public class StorageAccountListKeysResultInner { private List keys; /** - * Get the keys value. + * Get gets the list of storage account keys and their properties for the specified storage account. * * @return the keys value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesInner.java index f2383a2623f88..74c9ed7f3347f 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesInner.java @@ -33,7 +33,7 @@ public class StorageAccountManagementPoliciesInner extends ProxyResource { private DateTime lastModifiedTime; /** - * Get the policy value. + * Get the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * * @return the policy value */ @@ -42,7 +42,7 @@ public Object policy() { } /** - * Set the policy value. + * Set the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * * @param policy the policy value to set * @return the StorageAccountManagementPoliciesInner object itself. @@ -53,7 +53,7 @@ public StorageAccountManagementPoliciesInner withPolicy(Object policy) { } /** - * Get the lastModifiedTime value. + * Get returns the date and time the ManagementPolicies was last modified. * * @return the lastModifiedTime value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/UsageInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/UsageInner.java index 2cd94452002d9..dad5326e65953 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/UsageInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/UsageInner.java @@ -43,7 +43,7 @@ public class UsageInner { private UsageName name; /** - * Get the unit value. + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. * * @return the unit value */ @@ -52,7 +52,7 @@ public UsageUnit unit() { } /** - * Get the currentValue value. + * Get gets the current count of the allocated resources in the subscription. * * @return the currentValue value */ @@ -61,7 +61,7 @@ public Integer currentValue() { } /** - * Get the limit value. + * Get gets the maximum count of the resources that can be allocated in the subscription. * * @return the limit value */ @@ -70,7 +70,7 @@ public Integer limit() { } /** - * Get the name value. + * Get gets the name of the type of usage. * * @return the name value */ diff --git a/storage/resource-manager/v2018_07_01/pom.xml b/storage/resource-manager/v2018_07_01/pom.xml new file mode 100644 index 0000000000000..a69acbb04c02e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.storage.v2018_07_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccessTier.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccessTier.java new file mode 100644 index 0000000000000..f9bd978583b05 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccessTier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessTier. + */ +public enum AccessTier { + /** Enum value Hot. */ + HOT("Hot"), + + /** Enum value Cool. */ + COOL("Cool"); + + /** The actual serialized value for a AccessTier instance. */ + private String value; + + AccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessTier object, or null if unable to parse. + */ + @JsonCreator + public static AccessTier fromString(String value) { + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountSasParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountSasParameters.java new file mode 100644 index 0000000000000..c8733cc583010 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountSasParameters.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list SAS credentials of a storage account. + */ +public class AccountSasParameters { + /** + * The signed services accessible with the account SAS. Possible values + * include: Blob (b), Queue (q), Table (t), File (f). Possible values + * include: 'b', 'q', 't', 'f'. + */ + @JsonProperty(value = "signedServices", required = true) + private Services services; + + /** + * The signed resource types that are accessible with the account SAS. + * Service (s): Access to service-level APIs; Container (c): Access to + * container-level APIs; Object (o): Access to object-level APIs for blobs, + * queue messages, table entities, and files. Possible values include: 's', + * 'c', 'o'. + */ + @JsonProperty(value = "signedResourceTypes", required = true) + private SignedResourceTypes resourceTypes; + + /** + * The signed permissions for the account SAS. Possible values include: + * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update + * (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', + * 'c', 'u', 'p'. + */ + @JsonProperty(value = "signedPermission", required = true) + private Permissions permissions; + + /** + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String iPAddressOrRange; + + /** + * The protocol permitted for a request made with the account SAS. Possible + * values include: 'https,http', 'https'. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /** + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private DateTime sharedAccessStartTime; + + /** + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry", required = true) + private DateTime sharedAccessExpiryTime; + + /** + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * Get the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. + * + * @return the services value + */ + public Services services() { + return this.services; + } + + /** + * Set the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. + * + * @param services the services value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withServices(Services services) { + this.services = services; + return this; + } + + /** + * Get the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. + * + * @return the resourceTypes value + */ + public SignedResourceTypes resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. + * + * @param resourceTypes the resourceTypes value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @param permissions the permissions value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get an IP address or a range of IP addresses from which to accept requests. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set an IP address or a range of IP addresses from which to accept requests. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @return the protocols value + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @param protocols the protocols value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value + */ + public DateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessStartTime(DateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value + */ + public DateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the key to sign the account SAS token with. + * + * @return the keyToSign value + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountStatus.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountStatus.java new file mode 100644 index 0000000000000..8bb3ecb8330b7 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AccountStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccountStatus. + */ +public enum AccountStatus { + /** Enum value available. */ + AVAILABLE("available"), + + /** Enum value unavailable. */ + UNAVAILABLE("unavailable"); + + /** The actual serialized value for a AccountStatus instance. */ + private String value; + + AccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static AccountStatus fromString(String value) { + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Action.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Action.java new file mode 100644 index 0000000000000..1b3daa0e428bd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Action.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Action. + */ +public enum Action { + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a Action instance. */ + private String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + @JsonCreator + public static Action fromString(String value) { + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AzureEntityResource.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AzureEntityResource.java new file mode 100644 index 0000000000000..27c1323935460 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java new file mode 100644 index 0000000000000..3094bc2edbce2 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.BlobContainerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing BlobContainer. + */ +public interface BlobContainer extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BlobContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithCreate { + } + + /** + * Grouping of BlobContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BlobContainer definition. + */ + interface Blank extends WithBlobService { + } + + /** + * The stage of the blobcontainer definition allowing to specify BlobService. + */ + interface WithBlobService { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a BlobContainer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of BlobContainer update stages. + */ + interface UpdateStages { + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java new file mode 100644 index 0000000000000..19a94b05e165b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import rx.Completable; +import rx.Observable; +import java.util.List; + +/** + * Type representing BlobContainers. + */ +public interface BlobContainers { + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ + BlobContainer.DefinitionStages.Blank defineContainer(String name); + + /** + * Begins definition for a new ImmutabilityPolicy resource. + * @param name resource name. + * @return the first stage of the new ImmutabilityPolicy definition. + */ + ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..db2d123e31ed9 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CreateOrUpdateImmutabilityPolicy operation. + */ +public class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersDeleteImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..f3b043de5328c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for DeleteImmutabilityPolicy operation. + */ +public class BlobContainersDeleteImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. + */ + public BlobContainersDeleteImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersExtendImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..c641ff8365cc0 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for ExtendImmutabilityPolicy operation. + */ +public class BlobContainersExtendImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. + */ + public BlobContainersExtendImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersGetImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..cc903df662510 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersGetImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for GetImmutabilityPolicy operation. + */ +public class BlobContainersGetImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. + */ + public BlobContainersGetImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersLockImmutabilityPolicyHeaders.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..783a40031c1fc --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainersLockImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for LockImmutabilityPolicy operation. + */ +public class BlobContainersLockImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. + */ + public BlobContainersLockImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Bypass.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Bypass.java new file mode 100644 index 0000000000000..a68d9e2fe5a3c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Bypass.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Bypass. + */ +public final class Bypass extends ExpandableStringEnum { + /** Static value None for Bypass. */ + public static final Bypass NONE = fromString("None"); + + /** Static value Logging for Bypass. */ + public static final Bypass LOGGING = fromString("Logging"); + + /** Static value Metrics for Bypass. */ + public static final Bypass METRICS = fromString("Metrics"); + + /** Static value AzureServices for Bypass. */ + public static final Bypass AZURE_SERVICES = fromString("AzureServices"); + + /** + * Creates or finds a Bypass from its string representation. + * @param name a name to look for + * @return the corresponding Bypass + */ + @JsonCreator + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** + * @return known Bypass values + */ + public static Collection values() { + return values(Bypass.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CheckNameAvailabilityResult.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..9b9d52040b505 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java new file mode 100644 index 0000000000000..d94a30c7346dd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The custom domain assigned to this storage account. This can be set via + * Update. + */ +public class CustomDomain { + /** + * Gets or sets the custom domain name assigned to the storage account. + * Name is the CNAME source. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + */ + @JsonProperty(value = "useSubDomain") + private Boolean useSubDomain; + + /** + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @param name the name value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @return the useSubDomain value + */ + public Boolean useSubDomain() { + return this.useSubDomain; + } + + /** + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @param useSubDomain the useSubDomain value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withUseSubDomain(Boolean useSubDomain) { + this.useSubDomain = useSubDomain; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DefaultAction.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DefaultAction.java new file mode 100644 index 0000000000000..1288b15213b03 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DefaultAction.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DefaultAction. + */ +public enum DefaultAction { + /** Enum value Allow. */ + ALLOW("Allow"), + + /** Enum value Deny. */ + DENY("Deny"); + + /** The actual serialized value for a DefaultAction instance. */ + private String value; + + DefaultAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultAction object, or null if unable to parse. + */ + @JsonCreator + public static DefaultAction fromString(String value) { + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java new file mode 100644 index 0000000000000..865d0b65bb53c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of blobs, possiblly be blob type or access tier. + */ +public class Dimension { + /** + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get display name of dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set display name of dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Encryption.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Encryption.java new file mode 100644 index 0000000000000..4adf6db17e0c4 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Encryption.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption settings on the storage account. + */ +public class Encryption { + /** + * List of services which support encryption. + */ + @JsonProperty(value = "services") + private EncryptionServices services; + + /** + * The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. Possible values include: + * 'Microsoft.Storage', 'Microsoft.Keyvault'. + */ + @JsonProperty(value = "keySource", required = true) + private KeySource keySource; + + /** + * Properties provided by key vault. + */ + @JsonProperty(value = "keyvaultproperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get list of services which support encryption. + * + * @return the services value + */ + public EncryptionServices services() { + return this.services; + } + + /** + * Set list of services which support encryption. + * + * @param services the services value to set + * @return the Encryption object itself. + */ + public Encryption withServices(EncryptionServices services) { + this.services = services; + return this; + } + + /** + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @return the keySource value + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @param keySource the keySource value to set + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get properties provided by key vault. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionService.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionService.java new file mode 100644 index 0000000000000..2ca0c90fa5fcd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionService.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A service that allows server-side encryption to be used. + */ +public class EncryptionService { + /** + * A boolean indicating whether or not the service encrypts the data as it + * is stored. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Gets a rough estimate of the date/time when the encryption was last + * enabled by the user. Only returned when encryption is enabled. There + * might be some unencrypted blobs which were written after this time, as + * it is just a rough estimate. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastEnabledTime; + + /** + * Get a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @param enabled the enabled value to set + * @return the EncryptionService object itself. + */ + public EncryptionService withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. + * + * @return the lastEnabledTime value + */ + public DateTime lastEnabledTime() { + return this.lastEnabledTime; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionServices.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionServices.java new file mode 100644 index 0000000000000..ea298d31cc509 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/EncryptionServices.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of services that support encryption. + */ +public class EncryptionServices { + /** + * The encryption function of the blob storage service. + */ + @JsonProperty(value = "blob") + private EncryptionService blob; + + /** + * The encryption function of the file storage service. + */ + @JsonProperty(value = "file") + private EncryptionService file; + + /** + * The encryption function of the table storage service. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionService table; + + /** + * The encryption function of the queue storage service. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionService queue; + + /** + * Get the encryption function of the blob storage service. + * + * @return the blob value + */ + public EncryptionService blob() { + return this.blob; + } + + /** + * Set the encryption function of the blob storage service. + * + * @param blob the blob value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withBlob(EncryptionService blob) { + this.blob = blob; + return this; + } + + /** + * Get the encryption function of the file storage service. + * + * @return the file value + */ + public EncryptionService file() { + return this.file; + } + + /** + * Set the encryption function of the file storage service. + * + * @param file the file value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withFile(EncryptionService file) { + this.file = file; + return this; + } + + /** + * Get the encryption function of the table storage service. + * + * @return the table value + */ + public EncryptionService table() { + return this.table; + } + + /** + * Get the encryption function of the queue storage service. + * + * @return the queue value + */ + public EncryptionService queue() { + return this.queue; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Endpoints.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Endpoints.java new file mode 100644 index 0000000000000..024a532869d1d --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Endpoints.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. + */ +public class Endpoints { + /** + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /** + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /** + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /** + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /** + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. + * + * @return the blob value + */ + public String blob() { + return this.blob; + } + + /** + * Get gets the queue endpoint. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Get gets the table endpoint. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Get gets the file endpoint. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/HttpProtocol.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/HttpProtocol.java new file mode 100644 index 0000000000000..7e8329c04604a --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/HttpProtocol.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HttpProtocol. + */ +public enum HttpProtocol { + /** Enum value https,http. */ + HTTPSHTTP("https,http"), + + /** Enum value https. */ + HTTPS("https"); + + /** The actual serialized value for a HttpProtocol instance. */ + private String value; + + HttpProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpProtocol object, or null if unable to parse. + */ + @JsonCreator + public static HttpProtocol fromString(String value) { + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/IPRule.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/IPRule.java new file mode 100644 index 0000000000000..39969b9a9d564 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/IPRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +public class IPRule { + /** + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String iPAddressOrRange; + + /** + * The action of IP ACL rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the IPRule object itself. + */ + public IPRule withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the action of IP ACL rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of IP ACL rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the IPRule object itself. + */ + public IPRule withAction(Action action) { + this.action = action; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Identity.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Identity.java new file mode 100644 index 0000000000000..a39e940448fbd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Identity.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + type = "SystemAssigned"; + } + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the identity type. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(String type) { + this.type = type; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java new file mode 100644 index 0000000000000..a70873dc21f39 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.ImmutabilityPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; + +/** + * Type representing ImmutabilityPolicy. + */ +public interface ImmutabilityPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPeriodSinceCreationInDays value. + */ + int immutabilityPeriodSinceCreationInDays(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the state value. + */ + ImmutabilityPolicyState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ImmutabilityPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { + } + + /** + * Grouping of ImmutabilityPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ImmutabilityPolicy definition. + */ + interface Blank extends WithContainer { + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies resourceGroupName, accountName, containerName. + */ + WithImmutabilityPeriodSinceCreationInDays withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + */ + WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { + } + + /** + * Grouping of ImmutabilityPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + */ + Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); + } + + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyProperties.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..265ba7f39c34b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyProperties.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The properties of an ImmutabilityPolicy of a blob container. + */ +@JsonFlatten +public class ImmutabilityPolicyProperties { + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays", required = true) + private int immutabilityPeriodSinceCreationInDays; + + /** + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyState state; + + /** + * ImmutabilityPolicy Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The ImmutabilityPolicy update history of the blob container. + */ + @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) + private List updateHistory; + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public int immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutability period for the blobs in the container since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. + * + * @return the state value + */ + public ImmutabilityPolicyState state() { + return this.state; + } + + /** + * Get immutabilityPolicy Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the ImmutabilityPolicy update history of the blob container. + * + * @return the updateHistory value + */ + public List updateHistory() { + return this.updateHistory; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyState.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyState.java new file mode 100644 index 0000000000000..24db04ba66297 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImmutabilityPolicyState. + */ +public final class ImmutabilityPolicyState extends ExpandableStringEnum { + /** Static value Locked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** Static value Unlocked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a ImmutabilityPolicyState from its string representation. + * @param name a name to look for + * @return the corresponding ImmutabilityPolicyState + */ + @JsonCreator + public static ImmutabilityPolicyState fromString(String name) { + return fromString(name, ImmutabilityPolicyState.class); + } + + /** + * @return known ImmutabilityPolicyState values + */ + public static Collection values() { + return values(ImmutabilityPolicyState.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyUpdateType.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyUpdateType.java new file mode 100644 index 0000000000000..f74d6ad53bf7c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImmutabilityPolicyUpdateType. + */ +public final class ImmutabilityPolicyUpdateType extends ExpandableStringEnum { + /** Static value put for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType PUT = fromString("put"); + + /** Static value lock for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType LOCK = fromString("lock"); + + /** Static value extend for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType EXTEND = fromString("extend"); + + /** + * Creates or finds a ImmutabilityPolicyUpdateType from its string representation. + * @param name a name to look for + * @return the corresponding ImmutabilityPolicyUpdateType + */ + @JsonCreator + public static ImmutabilityPolicyUpdateType fromString(String name) { + return fromString(name, ImmutabilityPolicyUpdateType.class); + } + + /** + * @return known ImmutabilityPolicyUpdateType values + */ + public static Collection values() { + return values(ImmutabilityPolicyUpdateType.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyPermission.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyPermission.java new file mode 100644 index 0000000000000..a86ee51c918a6 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyPermission.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyPermission. + */ +public enum KeyPermission { + /** Enum value Read. */ + READ("Read"), + + /** Enum value Full. */ + FULL("Full"); + + /** The actual serialized value for a KeyPermission instance. */ + private String value; + + KeyPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyPermission object, or null if unable to parse. + */ + @JsonCreator + public static KeyPermission fromString(String value) { + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeySource.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeySource.java new file mode 100644 index 0000000000000..066a305ca683b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeySource.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeySource. + */ +public final class KeySource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for KeySource. */ + public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.Keyvault for KeySource. */ + public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates or finds a KeySource from its string representation. + * @param name a name to look for + * @return the corresponding KeySource + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** + * @return known KeySource values + */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyVaultProperties.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyVaultProperties.java new file mode 100644 index 0000000000000..95fa4c9830c9c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/KeyVaultProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of key vault. + */ +public class KeyVaultProperties { + /** + * The name of KeyVault key. + */ + @JsonProperty(value = "keyname") + private String keyName; + + /** + * The version of KeyVault key. + */ + @JsonProperty(value = "keyversion") + private String keyVersion; + + /** + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyvaulturi") + private String keyVaultUri; + + /** + * Get the name of KeyVault key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of KeyVault key. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the version of KeyVault key. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the version of KeyVault key. + * + * @param keyVersion the keyVersion value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the Uri of KeyVault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Kind.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Kind.java new file mode 100644 index 0000000000000..a51356efc98ae --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Kind.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Kind. + */ +public enum Kind { + /** Enum value Storage. */ + STORAGE("Storage"), + + /** Enum value StorageV2. */ + STORAGE_V2("StorageV2"), + + /** Enum value BlobStorage. */ + BLOB_STORAGE("BlobStorage"), + + /** Enum value FileStorage. */ + FILE_STORAGE("FileStorage"), + + /** Enum value BlockBlobStorage. */ + BLOCK_BLOB_STORAGE("BlockBlobStorage"); + + /** The actual serialized value for a Kind instance. */ + private String value; + + Kind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Kind instance. + * + * @param value the serialized value to parse. + * @return the parsed Kind object, or null if unable to parse. + */ + @JsonCreator + public static Kind fromString(String value) { + Kind[] items = Kind.values(); + for (Kind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseDuration.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseDuration.java new file mode 100644 index 0000000000000..d1d6da00b952c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseDuration.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseDuration. + */ +public final class LeaseDuration extends ExpandableStringEnum { + /** Static value Infinite for LeaseDuration. */ + public static final LeaseDuration INFINITE = fromString("Infinite"); + + /** Static value Fixed for LeaseDuration. */ + public static final LeaseDuration FIXED = fromString("Fixed"); + + /** + * Creates or finds a LeaseDuration from its string representation. + * @param name a name to look for + * @return the corresponding LeaseDuration + */ + @JsonCreator + public static LeaseDuration fromString(String name) { + return fromString(name, LeaseDuration.class); + } + + /** + * @return known LeaseDuration values + */ + public static Collection values() { + return values(LeaseDuration.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseState.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseState.java new file mode 100644 index 0000000000000..1f772b5cb0470 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseState. + */ +public final class LeaseState extends ExpandableStringEnum { + /** Static value Available for LeaseState. */ + public static final LeaseState AVAILABLE = fromString("Available"); + + /** Static value Leased for LeaseState. */ + public static final LeaseState LEASED = fromString("Leased"); + + /** Static value Expired for LeaseState. */ + public static final LeaseState EXPIRED = fromString("Expired"); + + /** Static value Breaking for LeaseState. */ + public static final LeaseState BREAKING = fromString("Breaking"); + + /** Static value Broken for LeaseState. */ + public static final LeaseState BROKEN = fromString("Broken"); + + /** + * Creates or finds a LeaseState from its string representation. + * @param name a name to look for + * @return the corresponding LeaseState + */ + @JsonCreator + public static LeaseState fromString(String name) { + return fromString(name, LeaseState.class); + } + + /** + * @return known LeaseState values + */ + public static Collection values() { + return values(LeaseState.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseStatus.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseStatus.java new file mode 100644 index 0000000000000..fcf25e9cb1273 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseStatus. + */ +public final class LeaseStatus extends ExpandableStringEnum { + /** Static value Locked for LeaseStatus. */ + public static final LeaseStatus LOCKED = fromString("Locked"); + + /** Static value Unlocked for LeaseStatus. */ + public static final LeaseStatus UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a LeaseStatus from its string representation. + * @param name a name to look for + * @return the corresponding LeaseStatus + */ + @JsonCreator + public static LeaseStatus fromString(String name) { + return fromString(name, LeaseStatus.class); + } + + /** + * @return known LeaseStatus values + */ + public static Collection values() { + return values(LeaseStatus.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHold.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHold.java new file mode 100644 index 0000000000000..cbbf13b3b23c3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHold.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.LegalHoldInner; +import java.util.List; + +/** + * Type representing LegalHold. + */ +public interface LegalHold extends HasInner, HasManager { + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the tags value. + */ + List tags(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHoldProperties.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHoldProperties.java new file mode 100644 index 0000000000000..1f599f3b760d7 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LegalHoldProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LegalHold property of a blob container. + */ +public class LegalHoldProperties { + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The list of LegalHold tags of a blob container. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the list of LegalHold tags of a blob container. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the list of LegalHold tags of a blob container. + * + * @param tags the tags value to set + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListAccountSasResponse.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListAccountSasResponse.java new file mode 100644 index 0000000000000..e4c73fde7516d --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListAccountSasResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.ListAccountSasResponseInner; + +/** + * Type representing ListAccountSasResponse. + */ +public interface ListAccountSasResponse extends HasInner, HasManager { + /** + * @return the accountSasToken value. + */ + String accountSasToken(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItem.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItem.java new file mode 100644 index 0000000000000..c93c2a5921ac8 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItem.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The blob container properties be listed out. + */ +@JsonFlatten +public class ListContainerItem extends AzureEntityResource { + /** + * Specifies whether data in the container may be accessed publicly and the + * level of access. Possible values include: 'Container', 'Blob', 'None'. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /** + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The lease status of the container. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /** + * Lease state of the container. Possible values include: 'Available', + * 'Leased', 'Expired', 'Breaking', 'Broken'. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /** + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. Possible values include: + * 'Infinite', 'Fixed'. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /** + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /** + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + private LegalHoldProperties legalHold; + + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The + * hasImmutabilityPolicy public property is set to false by SRP if + * ImmutabilityPolicy has not been created for this container. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasImmutabilityPolicy; + + /** + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @return the publicAccess value + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @param publicAccess the publicAccess value to set + * @return the ListContainerItem object itself. + */ + public ListContainerItem withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get returns the date and time the container was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. + * + * @return the leaseStatus value + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. + * + * @return the leaseState value + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. + * + * @return the leaseDuration value + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get a name-value pair to associate with the container as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set + * @return the ListContainerItem object itself. + */ + public ListContainerItem withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the LegalHold property of the container. + * + * @return the legalHold value + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItems.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItems.java new file mode 100644 index 0000000000000..ce20298f3f3a3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListContainerItems.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.ListContainerItemsInner; +import java.util.List; + +/** + * Type representing ListContainerItems. + */ +public interface ListContainerItems extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListServiceSasResponse.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListServiceSasResponse.java new file mode 100644 index 0000000000000..2e650ad268823 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ListServiceSasResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.ListServiceSasResponseInner; + +/** + * Type representing ListServiceSasResponse. + */ +public interface ListServiceSasResponse extends HasInner, HasManager { + /** + * @return the serviceSasToken value. + */ + String serviceSasToken(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/MetricSpecification.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/MetricSpecification.java new file mode 100644 index 0000000000000..0bc0bdbf0ca69 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/MetricSpecification.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification of operation. + */ +public class MetricSpecification { + /** + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get name of metric specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of metric specification. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of metric specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of metric specification. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get display description of metric specification. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set display description of metric specification. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit could be Bytes or Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit could be Bytes or Count. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get aggregation type could be Average. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category this metric specification belong to, could be Capacity. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category this metric specification belong to, could be Capacity. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get account Resource Id. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/NetworkRuleSet.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/NetworkRuleSet.java new file mode 100644 index 0000000000000..9e2f99d27005b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/NetworkRuleSet.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network rule set. + */ +public class NetworkRuleSet { + /** + * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + * Possible values are any combination of Logging|Metrics|AzureServices + * (For example, "Logging, Metrics"), or None to bypass none of those + * traffics. Possible values include: 'None', 'Logging', 'Metrics', + * 'AzureServices'. + */ + @JsonProperty(value = "bypass") + private Bypass bypass; + + /** + * Sets the virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Sets the IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Specifies the default action of allow or deny when no other rules match. + * Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @return the bypass value + */ + public Bypass bypass() { + return this.bypass; + } + + /** + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @param bypass the bypass value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(Bypass bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get sets the virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set sets the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get sets the IP ACL rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set sets the IP ACL rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operation.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operation.java new file mode 100644 index 0000000000000..b59c5459d7c94 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/OperationDisplay.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/OperationDisplay.java new file mode 100644 index 0000000000000..2a6eef8610ee8 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Storage. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Storage. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Storage. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operations.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operations.java new file mode 100644 index 0000000000000..040e58afb869d --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Permissions.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Permissions.java new file mode 100644 index 0000000000000..1b11ef153b905 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Permissions.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Permissions. + */ +public final class Permissions extends ExpandableStringEnum { + /** Static value r for Permissions. */ + public static final Permissions R = fromString("r"); + + /** Static value d for Permissions. */ + public static final Permissions D = fromString("d"); + + /** Static value w for Permissions. */ + public static final Permissions W = fromString("w"); + + /** Static value l for Permissions. */ + public static final Permissions L = fromString("l"); + + /** Static value a for Permissions. */ + public static final Permissions A = fromString("a"); + + /** Static value c for Permissions. */ + public static final Permissions C = fromString("c"); + + /** Static value u for Permissions. */ + public static final Permissions U = fromString("u"); + + /** Static value p for Permissions. */ + public static final Permissions P = fromString("p"); + + /** + * Creates or finds a Permissions from its string representation. + * @param name a name to look for + * @return the corresponding Permissions + */ + @JsonCreator + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** + * @return known Permissions values + */ + public static Collection values() { + return values(Permissions.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ProvisioningState.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ProvisioningState.java new file mode 100644 index 0000000000000..15114d47bb9b3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value ResolvingDNS. */ + RESOLVING_DNS("ResolvingDNS"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/PublicAccess.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/PublicAccess.java new file mode 100644 index 0000000000000..701146c63c681 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/PublicAccess.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PublicAccess. + */ +public enum PublicAccess { + /** Enum value Container. */ + CONTAINER("Container"), + + /** Enum value Blob. */ + BLOB("Blob"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a PublicAccess instance. */ + private String value; + + PublicAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicAccess object, or null if unable to parse. + */ + @JsonCreator + public static PublicAccess fromString(String value) { + PublicAccess[] items = PublicAccess.values(); + for (PublicAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Reason.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Reason.java new file mode 100644 index 0000000000000..27036e5965ae7 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Reason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Reason. + */ +public enum Reason { + /** Enum value AccountNameInvalid. */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a Reason instance. */ + private String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + @JsonCreator + public static Reason fromString(String value) { + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ReasonCode.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ReasonCode.java new file mode 100644 index 0000000000000..d4f8c563aabea --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ReasonCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReasonCode. + */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ReasonCode + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * @return known ReasonCode values + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Restriction.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Restriction.java new file mode 100644 index 0000000000000..422fc8ef49ba7 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Restriction.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The restriction because of which SKU cannot be used. + */ +public class Restriction { + /** + * The type of restrictions. As of now only possible value for this is + * location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has + * requiredQuotas parameter as the subscription does not belong to that + * quota. The "NotAvailableForSubscription" is related to capacity at DC. + * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * Get the type of restrictions. As of now only possible value for this is location. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java new file mode 100644 index 0000000000000..d6557a5d4f927 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The capability information in the specified sku, including file encryption, + * network acls, change notification, etc. + */ +public class SKUCapability { + /** + * The name of capability, The capability information in the specified sku, + * including file encryption, network acls, change notification, etc. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A string value to indicate states of given capability. Possibly 'true' + * or 'false'. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java new file mode 100644 index 0000000000000..fc8c469d9632e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java @@ -0,0 +1,493 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list service SAS credentials of a speicific resource. + */ +public class ServiceSasParameters { + /** + * The canonical path to the signed resource. + */ + @JsonProperty(value = "canonicalizedResource", required = true) + private String canonicalizedResource; + + /** + * The signed services accessible with the service SAS. Possible values + * include: Blob (b), Container (c), File (f), Share (s). Possible values + * include: 'b', 'c', 'f', 's'. + */ + @JsonProperty(value = "signedResource") + private SignedResource resource; + + /** + * The signed permissions for the service SAS. Possible values include: + * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update + * (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', + * 'c', 'u', 'p'. + */ + @JsonProperty(value = "signedPermission") + private Permissions permissions; + + /** + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String iPAddressOrRange; + + /** + * The protocol permitted for a request made with the account SAS. Possible + * values include: 'https,http', 'https'. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /** + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private DateTime sharedAccessStartTime; + + /** + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry") + private DateTime sharedAccessExpiryTime; + + /** + * A unique value up to 64 characters in length that correlates to an + * access policy specified for the container, queue, or table. + */ + @JsonProperty(value = "signedIdentifier") + private String identifier; + + /** + * The start of partition key. + */ + @JsonProperty(value = "startPk") + private String partitionKeyStart; + + /** + * The end of partition key. + */ + @JsonProperty(value = "endPk") + private String partitionKeyEnd; + + /** + * The start of row key. + */ + @JsonProperty(value = "startRk") + private String rowKeyStart; + + /** + * The end of row key. + */ + @JsonProperty(value = "endRk") + private String rowKeyEnd; + + /** + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * The response header override for cache control. + */ + @JsonProperty(value = "rscc") + private String cacheControl; + + /** + * The response header override for content disposition. + */ + @JsonProperty(value = "rscd") + private String contentDisposition; + + /** + * The response header override for content encoding. + */ + @JsonProperty(value = "rsce") + private String contentEncoding; + + /** + * The response header override for content language. + */ + @JsonProperty(value = "rscl") + private String contentLanguage; + + /** + * The response header override for content type. + */ + @JsonProperty(value = "rsct") + private String contentType; + + /** + * Get the canonical path to the signed resource. + * + * @return the canonicalizedResource value + */ + public String canonicalizedResource() { + return this.canonicalizedResource; + } + + /** + * Set the canonical path to the signed resource. + * + * @param canonicalizedResource the canonicalizedResource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { + this.canonicalizedResource = canonicalizedResource; + return this; + } + + /** + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @return the resource value + */ + public SignedResource resource() { + return this.resource; + } + + /** + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @param resource the resource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withResource(SignedResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @param permissions the permissions value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get an IP address or a range of IP addresses from which to accept requests. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set an IP address or a range of IP addresses from which to accept requests. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @return the protocols value + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @param protocols the protocols value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value + */ + public DateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value + */ + public DateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @param identifier the identifier value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the start of partition key. + * + * @return the partitionKeyStart value + */ + public String partitionKeyStart() { + return this.partitionKeyStart; + } + + /** + * Set the start of partition key. + * + * @param partitionKeyStart the partitionKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { + this.partitionKeyStart = partitionKeyStart; + return this; + } + + /** + * Get the end of partition key. + * + * @return the partitionKeyEnd value + */ + public String partitionKeyEnd() { + return this.partitionKeyEnd; + } + + /** + * Set the end of partition key. + * + * @param partitionKeyEnd the partitionKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { + this.partitionKeyEnd = partitionKeyEnd; + return this; + } + + /** + * Get the start of row key. + * + * @return the rowKeyStart value + */ + public String rowKeyStart() { + return this.rowKeyStart; + } + + /** + * Set the start of row key. + * + * @param rowKeyStart the rowKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyStart(String rowKeyStart) { + this.rowKeyStart = rowKeyStart; + return this; + } + + /** + * Get the end of row key. + * + * @return the rowKeyEnd value + */ + public String rowKeyEnd() { + return this.rowKeyEnd; + } + + /** + * Set the end of row key. + * + * @param rowKeyEnd the rowKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { + this.rowKeyEnd = rowKeyEnd; + return this; + } + + /** + * Get the key to sign the account SAS token with. + * + * @return the keyToSign value + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Get the response header override for cache control. + * + * @return the cacheControl value + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the response header override for cache control. + * + * @param cacheControl the cacheControl value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the response header override for content disposition. + * + * @return the contentDisposition value + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the response header override for content disposition. + * + * @param contentDisposition the contentDisposition value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } + + /** + * Get the response header override for content encoding. + * + * @return the contentEncoding value + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the response header override for content encoding. + * + * @param contentEncoding the contentEncoding value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the response header override for content language. + * + * @return the contentLanguage value + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the response header override for content language. + * + * @param contentLanguage the contentLanguage value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the response header override for content type. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the response header override for content type. + * + * @param contentType the contentType value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSpecification.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSpecification.java new file mode 100644 index 0000000000000..f3133cd729e24 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include metric specifications. + */ +public class ServiceSpecification { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Services.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Services.java new file mode 100644 index 0000000000000..01e9001cd3cae --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Services.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Services. + */ +public final class Services extends ExpandableStringEnum { + /** Static value b for Services. */ + public static final Services B = fromString("b"); + + /** Static value q for Services. */ + public static final Services Q = fromString("q"); + + /** Static value t for Services. */ + public static final Services T = fromString("t"); + + /** Static value f for Services. */ + public static final Services F = fromString("f"); + + /** + * Creates or finds a Services from its string representation. + * @param name a name to look for + * @return the corresponding Services + */ + @JsonCreator + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** + * @return known Services values + */ + public static Collection values() { + return values(Services.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResource.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResource.java new file mode 100644 index 0000000000000..1a72f05837d0e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResource.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResource. + */ +public final class SignedResource extends ExpandableStringEnum { + /** Static value b for SignedResource. */ + public static final SignedResource B = fromString("b"); + + /** Static value c for SignedResource. */ + public static final SignedResource C = fromString("c"); + + /** Static value f for SignedResource. */ + public static final SignedResource F = fromString("f"); + + /** Static value s for SignedResource. */ + public static final SignedResource S = fromString("s"); + + /** + * Creates or finds a SignedResource from its string representation. + * @param name a name to look for + * @return the corresponding SignedResource + */ + @JsonCreator + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** + * @return known SignedResource values + */ + public static Collection values() { + return values(SignedResource.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResourceTypes.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResourceTypes.java new file mode 100644 index 0000000000000..ecbceee368e41 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SignedResourceTypes.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResourceTypes. + */ +public final class SignedResourceTypes extends ExpandableStringEnum { + /** Static value s for SignedResourceTypes. */ + public static final SignedResourceTypes S = fromString("s"); + + /** Static value c for SignedResourceTypes. */ + public static final SignedResourceTypes C = fromString("c"); + + /** Static value o for SignedResourceTypes. */ + public static final SignedResourceTypes O = fromString("o"); + + /** + * Creates or finds a SignedResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding SignedResourceTypes + */ + @JsonCreator + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** + * @return known SignedResourceTypes values + */ + public static Collection values() { + return values(SignedResourceTypes.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Sku.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Sku.java new file mode 100644 index 0000000000000..a4fe3ee09924e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Sku.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.SkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import java.util.List; + +/** + * Type representing Sku. + */ +public interface Sku extends HasInner, HasManager { + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + SkuName name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + SkuTier tier(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuName.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuName.java new file mode 100644 index 0000000000000..18b44967239fe --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuName.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuName. + */ +public enum SkuName { + /** Enum value Standard_LRS. */ + STANDARD_LRS("Standard_LRS"), + + /** Enum value Standard_GRS. */ + STANDARD_GRS("Standard_GRS"), + + /** Enum value Standard_RAGRS. */ + STANDARD_RAGRS("Standard_RAGRS"), + + /** Enum value Standard_ZRS. */ + STANDARD_ZRS("Standard_ZRS"), + + /** Enum value Premium_LRS. */ + PREMIUM_LRS("Premium_LRS"), + + /** Enum value Premium_ZRS. */ + PREMIUM_ZRS("Premium_ZRS"); + + /** The actual serialized value for a SkuName instance. */ + private String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuTier.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuTier.java new file mode 100644 index 0000000000000..8faa0f2de4dd8 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SkuTier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Skus.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Skus.java new file mode 100644 index 0000000000000..273599a86d8ca --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Skus.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.SkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Skus. + */ +public interface Skus extends SupportsListing, HasInner { +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/State.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/State.java new file mode 100644 index 0000000000000..42db8f272b3e3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/State.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for State. + */ +public enum State { + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value deprovisioning. */ + DEPROVISIONING("deprovisioning"), + + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value networkSourceDeleted. */ + NETWORK_SOURCE_DELETED("networkSourceDeleted"); + + /** The actual serialized value for a State instance. */ + private String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java new file mode 100644 index 0000000000000..eca1971d1f5f1 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java @@ -0,0 +1,355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.SkuInner; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageAccountInner; + +/** + * Type representing StorageAccount. + */ +public interface StorageAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * @return the enableAzureFilesAadIntegration value. + */ + Boolean enableAzureFilesAadIntegration(); + + /** + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * @return the encryption value. + */ + Encryption encryption(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the lastGeoFailoverTime value. + */ + DateTime lastGeoFailoverTime(); + + /** + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * The entirety of the StorageAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the StorageAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the storageaccount definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + WithSku withKind(Kind kind); + } + + /** + * The stage of the storageaccount definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(SkuInner sku); + } + + /** + * The stage of the storageaccount update allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + */ + WithCreate withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount update allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + */ + WithCreate withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount update allowing to specify EnableAzureFilesAadIntegration. + */ + interface WithEnableAzureFilesAadIntegration { + /** + * Specifies enableAzureFilesAadIntegration. + */ + WithCreate withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration); + } + + /** + * The stage of the storageaccount update allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + */ + WithCreate withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount update allowing to specify IsHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies isHnsEnabled. + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + + /** + * The stage of the storageaccount update allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableAzureFilesAadIntegration, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithNetworkRuleSet { + } + } + /** + * The template for a StorageAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithCustomDomain, UpdateStages.WithEnableAzureFilesAadIntegration, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithNetworkRuleSet, UpdateStages.WithSku { + } + + /** + * Grouping of StorageAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the storageaccount {0} allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + */ + Update withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount {0} allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + */ + Update withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount {0} allowing to specify EnableAzureFilesAadIntegration. + */ + interface WithEnableAzureFilesAadIntegration { + /** + * Specifies enableAzureFilesAadIntegration. + */ + Update withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration); + } + + /** + * The stage of the storageaccount {0} allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + */ + Update withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount {0} allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount {0} allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount {0} allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + Update withKind(Kind kind); + } + + /** + * The stage of the storageaccount {0} allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the storageaccount {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(SkuInner sku); + } + + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..764a81eb55dce --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to check the availabity of the storage account name. + */ +public class StorageAccountCheckNameAvailabilityParameters { + /** + * The storage account name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Storage/storageAccounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. + */ + public StorageAccountCheckNameAvailabilityParameters() { + type = "Microsoft.Storage/storageAccounts"; + } + + /** + * Get the storage account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the storage account name. + * + * @param name the name value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Storage/storageAccounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Storage/storageAccounts. + * + * @param type the type value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCreateParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCreateParameters.java new file mode 100644 index 0000000000000..049832d7f1c0f --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountCreateParameters.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.management.storage.v2018_07_01.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used when creating a storage account. + */ +@JsonFlatten +public class StorageAccountCreateParameters { + /** + * Required. Gets or sets the sku name. + */ + @JsonProperty(value = "sku", required = true) + private SkuInner sku; + + /** + * Required. Indicates the type of storage account. Possible values + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update, the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key with a length no greater than 128 characters and a value + * with a length no greater than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * User domain assigned to the storage account. Name is the CNAME source. + * Only one custom domain is supported per storage account at this time. To + * clear the existing custom domain, use an empty string for the custom + * domain name property. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /** + * Provides the encryption settings on the account. If left unspecified the + * account encryption settings will remain the same. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Enables Azure Files AAD Integration for SMB if sets to true. + */ + @JsonProperty(value = "properties.azureFilesAadIntegration") + private Boolean enableAzureFilesAadIntegration; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get required. Gets or sets the sku name. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set required. Gets or sets the sku name. + * + * @param sku the sku value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @param location the location value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @param tags the tags value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. + * + * @param encryption the encryption value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get enables Azure Files AAD Integration for SMB if sets to true. + * + * @return the enableAzureFilesAadIntegration value + */ + public Boolean enableAzureFilesAadIntegration() { + return this.enableAzureFilesAadIntegration; + } + + /** + * Set enables Azure Files AAD Integration for SMB if sets to true. + * + * @param enableAzureFilesAadIntegration the enableAzureFilesAadIntegration value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration) { + this.enableAzureFilesAadIntegration = enableAzureFilesAadIntegration; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountKey.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountKey.java new file mode 100644 index 0000000000000..c7033a70aa98d --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountKey.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An access key for the storage account. + */ +public class StorageAccountKey { + /** + * Name of the key. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Base 64-encoded value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Permissions for the key -- read-only or full permissions. Possible + * values include: 'Read', 'Full'. + */ + @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) + private KeyPermission permissions; + + /** + * Get name of the key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get base 64-encoded value of the key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. + * + * @return the permissions value + */ + public KeyPermission permissions() { + return this.permissions; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountListKeysResult.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountListKeysResult.java new file mode 100644 index 0000000000000..03a175975ec88 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountListKeysResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageAccountListKeysResultInner; +import java.util.List; + +/** + * Type representing StorageAccountListKeysResult. + */ +public interface StorageAccountListKeysResult extends HasInner, HasManager { + /** + * @return the keys value. + */ + List keys(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java new file mode 100644 index 0000000000000..a81e8d8647dc1 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the storage account key. + */ +public class StorageAccountRegenerateKeyParameters { + /** + * The name of storage keys that want to be regenerated, possible vaules + * are key1, key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * + * @param keyName the keyName value to set + * @return the StorageAccountRegenerateKeyParameters object itself. + */ + public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java new file mode 100644 index 0000000000000..2970b73066914 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.management.storage.v2018_07_01.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters that can be provided when updating the storage account + * properties. + */ +@JsonFlatten +public class StorageAccountUpdateParameters { + /** + * Gets or sets the SKU name. Note that the SKU name cannot be updated to + * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku + * names be updated to any other value. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used in viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key no greater in length than 128 characters and a value no + * greater in length than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Custom domain assigned to the storage account by the user. Name is the + * CNAME source. Only one custom domain is supported per storage account at + * this time. To clear the existing custom domain, use an empty string for + * the custom domain name property. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /** + * Provides the encryption settings on the account. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Enables Azure Files AAD Integration for SMB if sets to true. + */ + @JsonProperty(value = "properties.azureFilesAadIntegration") + private Boolean enableAzureFilesAadIntegration; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Optional. Indicates the type of storage account. Currently only + * StorageV2 value supported by server. Possible values include: 'Storage', + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku names be updated to any other value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku names be updated to any other value. + * + * @param sku the sku value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @param tags the tags value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get provides the encryption settings on the account. The default setting is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set provides the encryption settings on the account. The default setting is unencrypted. + * + * @param encryption the encryption value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get enables Azure Files AAD Integration for SMB if sets to true. + * + * @return the enableAzureFilesAadIntegration value + */ + public Boolean enableAzureFilesAadIntegration() { + return this.enableAzureFilesAadIntegration; + } + + /** + * Set enables Azure Files AAD Integration for SMB if sets to true. + * + * @param enableAzureFilesAadIntegration the enableAzureFilesAadIntegration value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration) { + this.enableAzureFilesAadIntegration = enableAzureFilesAadIntegration; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java new file mode 100644 index 0000000000000..2556de0e4625c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageAccounts. + */ +public interface StorageAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerates one of the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/TagProperty.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/TagProperty.java new file mode 100644 index 0000000000000..bbc5be023dc0c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/TagProperty.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A tag of the LegalHold of a blob container. + */ +public class TagProperty { + /** + * The tag value. + */ + @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) + private String tag; + + /** + * Returns the date and time the tag was added. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Returns the Object ID of the user who added the tag. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /** + * Returns the Tenant ID that issued the token for the user who added the + * tag. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Returns the User Principal Name of the user who added the tag. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * Get the tag value. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Get returns the date and time the tag was added. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get returns the Object ID of the user who added the tag. + * + * @return the objectIdentifier value + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get returns the Tenant ID that issued the token for the user who added the tag. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get returns the User Principal Name of the user who added the tag. + * + * @return the upn value + */ + public String upn() { + return this.upn; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UpdateHistoryProperty.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UpdateHistoryProperty.java new file mode 100644 index 0000000000000..f295b2a0edbc6 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UpdateHistoryProperty.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An update history of the ImmutabilityPolicy of a blob container. + */ +public class UpdateHistoryProperty { + /** + * The ImmutabilityPolicy update type of a blob container, possible values + * include: put, lock and extend. Possible values include: 'put', 'lock', + * 'extend'. + */ + @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyUpdateType update; + + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer immutabilityPeriodSinceCreationInDays; + + /** + * Returns the date and time the ImmutabilityPolicy was updated. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Returns the Object ID of the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /** + * Returns the Tenant ID that issued the token for the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Returns the User Principal Name of the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * Get the ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'put', 'lock', 'extend'. + * + * @return the update value + */ + public ImmutabilityPolicyUpdateType update() { + return this.update; + } + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Get returns the date and time the ImmutabilityPolicy was updated. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get returns the Object ID of the user who updated the ImmutabilityPolicy. + * + * @return the objectIdentifier value + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get returns the User Principal Name of the user who updated the ImmutabilityPolicy. + * + * @return the upn value + */ + public String upn() { + return this.upn; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usage.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usage.java new file mode 100644 index 0000000000000..d115cfcf2d723 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usage.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + UsageUnit unit(); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageName.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageName.java new file mode 100644 index 0000000000000..6510f89ff503c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names that can be used; currently limited to StorageAccount. + */ +public class UsageName { + /** + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get gets a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get gets a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageUnit.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageUnit.java new file mode 100644 index 0000000000000..554a161241ec9 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/UsageUnit.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UsageUnit. + */ +public enum UsageUnit { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountsPerSecond. */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageUnit instance. */ + private String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usages.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usages.java new file mode 100644 index 0000000000000..240eba4a29b13 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByLocationAsync(String location); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/VirtualNetworkRule.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/VirtualNetworkRule.java new file mode 100644 index 0000000000000..6d4b45a3d2ace --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/VirtualNetworkRule.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Network rule. + */ +public class VirtualNetworkRule { + /** + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /** + * The action of virtual network rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Gets the state of virtual network rule. Possible values include: + * 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted'. + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action of virtual network rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of virtual network rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @param state the state value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(State state) { + this.state = state; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java new file mode 100644 index 0000000000000..0d07f22990817 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicyProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseDuration; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseState; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2018_07_01.LegalHoldProperties; +import java.util.Map; +import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; + +class BlobContainerImpl extends CreatableUpdatableImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + + BlobContainerImpl(String name, StorageManager manager) { + super(name, new BlobContainerInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + BlobContainerImpl(BlobContainerInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean hasImmutabilityPolicy() { + return this.inner().hasImmutabilityPolicy(); + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.inner().immutabilityPolicy(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public LeaseDuration leaseDuration() { + return this.inner().leaseDuration(); + } + + @Override + public LeaseState leaseState() { + return this.inner().leaseState(); + } + + @Override + public LeaseStatus leaseStatus() { + return this.inner().leaseStatus(); + } + + @Override + public LegalHoldProperties legalHold() { + return this.inner().legalHold(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PublicAccess publicAccess() { + return this.inner().publicAccess(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BlobContainerImpl withExistingBlobService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerInner.java new file mode 100644 index 0000000000000..f08e7778f94a6 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerInner.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseState; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2018_07_01.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2018_07_01.AzureEntityResource; + +/** + * Properties of the blob container, including Id, resource name, resource + * type, Etag. + */ +@JsonFlatten +public class BlobContainerInner extends AzureEntityResource { + /** + * Specifies whether data in the container may be accessed publicly and the + * level of access. Possible values include: 'Container', 'Blob', 'None'. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /** + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The lease status of the container. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /** + * Lease state of the container. Possible values include: 'Available', + * 'Leased', 'Expired', 'Breaking', 'Broken'. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /** + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. Possible values include: + * 'Infinite', 'Fixed'. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /** + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /** + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + private LegalHoldProperties legalHold; + + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The + * hasImmutabilityPolicy public property is set to false by SRP if + * ImmutabilityPolicy has not been created for this container. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasImmutabilityPolicy; + + /** + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @return the publicAccess value + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @param publicAccess the publicAccess value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get returns the date and time the container was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. + * + * @return the leaseStatus value + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. + * + * @return the leaseState value + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. + * + * @return the leaseDuration value + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get a name-value pair to associate with the container as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the LegalHold property of the container. + * + * @return the legalHold value + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java new file mode 100644 index 0000000000000..f95e86181d0f4 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainers; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.ListContainerItems; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainer; +import com.microsoft.azure.management.storage.v2018_07_01.LegalHold; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicy; + +class BlobContainersImpl extends WrapperImpl implements BlobContainers { + private final StorageManager manager; + + BlobContainersImpl(StorageManager manager) { + super(manager.inner().blobContainers()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public BlobContainerImpl defineContainer(String name) { + return wrapContainerModel(name); + } + + @Override + public ImmutabilityPolicyImpl defineImmutabilityPolicy(String name) { + return wrapImmutabilityPolicyModel(name); + } + + private BlobContainerImpl wrapContainerModel(String name) { + return new BlobContainerImpl(name, this.manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(String name) { + return new ImmutabilityPolicyImpl(name, this.manager()); + } + + private BlobContainerImpl wrapBlobContainerModel(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + + private Observable getImmutabilityPolicyInnerUsingBlobContainersInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "storageAccounts"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + BlobContainersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public ListContainerItems call(ListContainerItemsInner inner) { + return new ListContainerItemsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public BlobContainer call(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, containerName).toCompletable(); + } + + @Override + public Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.setLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.clearLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return wrapImmutabilityPolicyModel(inner); + } + }); + } + + @Override + public Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).toCompletable(); + } + + @Override + public Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + BlobContainersInner client = this.inner(); + return client.extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java new file mode 100644 index 0000000000000..0e5d79d11e6ca --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java @@ -0,0 +1,1680 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersDeleteImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersExtendImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersGetImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BlobContainers. + */ +public class BlobContainersInner { + /** The Retrofit service to perform REST calls. */ + private BlobContainersService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BlobContainersInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(BlobContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for BlobContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface BlobContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobContainerInner blobContainer, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobContainerInner blobContainer, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers setLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") + Observable> setLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers clearLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") + Observable> clearLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers createOrUpdateImmutabilityPolicy" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> createOrUpdateImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers getImmutabilityPolicy" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> getImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers deleteImmutabilityPolicy" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", method = "DELETE", hasBody = true) + Observable> deleteImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers lockImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock") + Observable> lockImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobContainers extendImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") + Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListContainerItemsInner object if successful. + */ + public ListContainerItemsInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContainerItemsInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListContainerItemsInner>() { + @Override + public ListContainerItemsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContainerItemsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner create(String resourceGroupName, String accountName, String containerName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String containerName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final PublicAccess publicAccess = null; + final Map metadata = null; + BlobContainerInner blobContainer = new BlobContainerInner(); + blobContainer.withPublicAccess(null); + blobContainer.withMetadata(null); + return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner create(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).toBlocking().single().body(); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata), serviceCallback); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(metadata); + BlobContainerInner blobContainer = new BlobContainerInner(); + blobContainer.withPublicAccess(publicAccess); + blobContainer.withMetadata(metadata); + return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner update(String resourceGroupName, String accountName, String containerName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String containerName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final PublicAccess publicAccess = null; + final Map metadata = null; + BlobContainerInner blobContainer = new BlobContainerInner(); + blobContainer.withPublicAccess(null); + blobContainer.withMetadata(null); + return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner update(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).toBlocking().single().body(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata), serviceCallback); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(metadata); + BlobContainerInner blobContainer = new BlobContainerInner(); + blobContainer.withPublicAccess(publicAccess); + blobContainer.withMetadata(metadata); + return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobContainerInner object if successful. + */ + public BlobContainerInner get(String resourceGroupName, String accountName, String containerName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String containerName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String containerName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String containerName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LegalHoldInner object if successful. + */ + public LegalHoldInner setLegalHold(String resourceGroupName, String accountName, String containerName, List tags) { + return setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).toBlocking().single().body(); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags), serviceCallback); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + return setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).map(new Func1, LegalHoldInner>() { + @Override + public LegalHoldInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable> setLegalHoldWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, List tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (tags == null) { + throw new IllegalArgumentException("Parameter tags is required and cannot be null."); + } + Validator.validate(tags); + LegalHoldInner legalHold = new LegalHoldInner(); + legalHold.withTags(tags); + return service.setLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), legalHold, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setLegalHoldDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setLegalHoldDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LegalHoldInner object if successful. + */ + public LegalHoldInner clearLegalHold(String resourceGroupName, String accountName, String containerName, List tags) { + return clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).toBlocking().single().body(); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags), serviceCallback); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + return clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).map(new Func1, LegalHoldInner>() { + @Override + public LegalHoldInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable> clearLegalHoldWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, List tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (tags == null) { + throw new IllegalArgumentException("Parameter tags is required and cannot be null."); + } + Validator.validate(tags); + LegalHoldInner legalHold = new LegalHoldInner(); + legalHold.withTags(tags); + return service.clearLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), legalHold, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = clearLegalHoldDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse clearLegalHoldDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays).toBlocking().single().body(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays), serviceCallback); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + final String ifMatch = null; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createOrUpdateImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch).toBlocking().single().body(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch), serviceCallback); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createOrUpdateImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders createOrUpdateImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.class); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> getImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + final String ifMatch = null; + return service.getImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> getImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + return service.getImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersGetImmutabilityPolicyHeaders.class); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> deleteImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + return service.deleteImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = deleteImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders deleteImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersDeleteImmutabilityPolicyHeaders.class); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> lockImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + return service.lockImmutabilityPolicy(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = lockImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders lockImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersLockImmutabilityPolicyHeaders.class); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).toBlocking().single().body(); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays), serviceCallback); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> extendImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.extendImmutabilityPolicy(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = extendImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders extendImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersExtendImmutabilityPolicyHeaders.class); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..6f2dd2d4acf89 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.Reason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final StorageManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..b90d5e6848d7a --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or is invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a storage account name could not be used. The + * Reason element is only returned if NameAvailable is false. Possible + * values include: 'AccountNameInvalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/IdParsingUtils.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..4709261b40486 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java new file mode 100644 index 0000000000000..6940a6bd79fad --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicyState; + +class ImmutabilityPolicyImpl extends CreatableUpdatableImpl implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + private int cimmutabilityPeriodSinceCreationInDays; + private int uimmutabilityPeriodSinceCreationInDays; + + ImmutabilityPolicyImpl(String name, StorageManager manager) { + super(name, new ImmutabilityPolicyInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + ImmutabilityPolicyImpl(ImmutabilityPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.getImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public int immutabilityPeriodSinceCreationInDays() { + return this.inner().immutabilityPeriodSinceCreationInDays(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ImmutabilityPolicyState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, String accountName, String containerName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.containerName = containerName; + return this; + } + + @Override + public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + if (isInCreateMode()) { + this.cimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } else { + this.uimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyInner.java new file mode 100644 index 0000000000000..a9a5fbc591bad --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2018_07_01.AzureEntityResource; + +/** + * The ImmutabilityPolicy property of a blob container, including Id, resource + * name, resource type, Etag. + */ +@JsonFlatten +public class ImmutabilityPolicyInner extends AzureEntityResource { + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays", required = true) + private int immutabilityPeriodSinceCreationInDays; + + /** + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyState state; + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public int immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutability period for the blobs in the container since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. + * + * @return the state value + */ + public ImmutabilityPolicyState state() { + return this.state; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldImpl.java new file mode 100644 index 0000000000000..f968dd8c47a7e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.LegalHold; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class LegalHoldImpl extends WrapperImpl implements LegalHold { + private final StorageManager manager; + LegalHoldImpl(LegalHoldInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldInner.java new file mode 100644 index 0000000000000..4ec77afccfde3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LegalHoldInner.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LegalHold property of a blob container. + */ +public class LegalHoldInner { + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * Each tag should be 3 to 23 alphanumeric characters and is normalized to + * lower case at SRP. + */ + @JsonProperty(value = "tags", required = true) + private List tags; + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @param tags the tags value to set + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseImpl.java new file mode 100644 index 0000000000000..64c895ceae7d3 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.ListAccountSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListAccountSasResponseImpl extends WrapperImpl implements ListAccountSasResponse { + private final StorageManager manager; + ListAccountSasResponseImpl(ListAccountSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String accountSasToken() { + return this.inner().accountSasToken(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseInner.java new file mode 100644 index 0000000000000..3203bde974e7f --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListAccountSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List SAS credentials operation response. + */ +public class ListAccountSasResponseInner { + /** + * List SAS credentials of storage account. + */ + @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String accountSasToken; + + /** + * Get list SAS credentials of storage account. + * + * @return the accountSasToken value + */ + public String accountSasToken() { + return this.accountSasToken; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsImpl.java new file mode 100644 index 0000000000000..f489df67089a4 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.ListContainerItems; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.ListContainerItem; + +class ListContainerItemsImpl extends WrapperImpl implements ListContainerItems { + private final StorageManager manager; + ListContainerItemsImpl(ListContainerItemsInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsInner.java new file mode 100644 index 0000000000000..b538c0e421811 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListContainerItemsInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.ListContainerItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of blob containers. + */ +public class ListContainerItemsInner { + /** + * The list of blob containers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of blob containers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of blob containers. + * + * @param value the value value to set + * @return the ListContainerItemsInner object itself. + */ + public ListContainerItemsInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseImpl.java new file mode 100644 index 0000000000000..05efea06ad58e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.ListServiceSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListServiceSasResponseImpl extends WrapperImpl implements ListServiceSasResponse { + private final StorageManager manager; + ListServiceSasResponseImpl(ListServiceSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String serviceSasToken() { + return this.inner().serviceSasToken(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java new file mode 100644 index 0000000000000..81bad787aefe2 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List service SAS credentials operation response. + */ +public class ListServiceSasResponseInner { + /** + * List service SAS credentials of speicific resource. + */ + @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceSasToken; + + /** + * Get list service SAS credentials of speicific resource. + * + * @return the serviceSasToken value + */ + public String serviceSasToken() { + return this.serviceSasToken; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..26eda0552fbb4 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.storage.v2018_07_01.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final StorageManager manager; + OperationImpl(OperationInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..adbf3bf4ebc8e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.storage.v2018_07_01.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Storage REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..601ad734ad2ca --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final StorageManager manager; + + OperationsImpl(StorageManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..6af8c590b97fb --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.Operations list" }) + @GET("providers/Microsoft.Storage/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/PageImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..58d8d7ed23900 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuImpl.java new file mode 100644 index 0000000000000..02a802b11e533 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.Sku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.SKUCapability; +import com.microsoft.azure.management.storage.v2018_07_01.Kind; +import com.microsoft.azure.management.storage.v2018_07_01.SkuName; +import com.microsoft.azure.management.storage.v2018_07_01.Restriction; +import com.microsoft.azure.management.storage.v2018_07_01.SkuTier; + +class SkuImpl extends WrapperImpl implements Sku { + private final StorageManager manager; + + SkuImpl(SkuInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public SkuName name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public SkuTier tier() { + return this.inner().tier(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java new file mode 100644 index 0000000000000..6473ac9f21ead --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.SkuName; +import com.microsoft.azure.management.storage.v2018_07_01.SkuTier; +import com.microsoft.azure.management.storage.v2018_07_01.Kind; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.SKUCapability; +import com.microsoft.azure.management.storage.v2018_07_01.Restriction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of the storage account. + */ +public class SkuInner { + /** + * Gets or sets the sku name. Required for account creation; optional for + * update. Note that in older versions, sku name was called accountType. + * Possible values include: 'Standard_LRS', 'Standard_GRS', + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Gets the sku tier. This is based on the SKU name. Possible values + * include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * The type of the resource, usually it is 'storageAccounts'. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * Indicates the type of storage account. Possible values include: + * 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The set of locations that the SKU is available. This will be supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + * etc.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The capability information in the specified sku, including file + * encryption, network acls, change notification, etc. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @param restrictions the restrictions value to set + * @return the SkuInner object itself. + */ + public SkuInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusImpl.java new file mode 100644 index 0000000000000..9cc79eda4c2dd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.Skus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.storage.v2018_07_01.Sku; + +class SkusImpl extends WrapperImpl implements Skus { + private PagedListConverter converter; + private final StorageManager manager; + + SkusImpl(StorageManager manager) { + super(manager.inner().skus()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(SkuInner inner) { + return Observable.just((Sku) wrapModel(inner)); + } + }; + } + + public StorageManager manager() { + return this.manager; + } + + private SkuImpl wrapModel(SkuInner inner) { + return new SkuImpl(inner, manager()); + } + + @Override + public PagedList list() { + SkusInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SkusInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Sku call(SkuInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java new file mode 100644 index 0000000000000..5b5faa8cb2e55 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Skus. + */ +public class SkusInner { + /** The Retrofit service to perform REST calls. */ + private SkusService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of SkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(SkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for Skus to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.Skus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java new file mode 100644 index 0000000000000..7d38ffba6fc2b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccount; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountUpdateParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2018_07_01.AccessTier; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2018_07_01.CustomDomain; +import com.microsoft.azure.management.storage.v2018_07_01.Encryption; +import com.microsoft.azure.management.storage.v2018_07_01.Identity; +import com.microsoft.azure.management.storage.v2018_07_01.Kind; +import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2018_07_01.Endpoints; +import com.microsoft.azure.management.storage.v2018_07_01.ProvisioningState; +import com.microsoft.azure.management.storage.v2018_07_01.Sku; +import com.microsoft.azure.management.storage.v2018_07_01.AccountStatus; +import rx.functions.Func1; + +class StorageAccountImpl extends GroupableResourceCoreImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountCreateParameters createParameter; + private StorageAccountUpdateParameters updateParameter; + StorageAccountImpl(String name, StorageAccountInner inner, StorageManager manager) { + super(name, inner, manager); + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public AccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public CustomDomain customDomain() { + return this.inner().customDomain(); + } + + @Override + public Boolean enableAzureFilesAadIntegration() { + return this.inner().enableAzureFilesAadIntegration(); + } + + @Override + public Boolean enableHttpsTrafficOnly() { + return this.inner().enableHttpsTrafficOnly(); + } + + @Override + public Encryption encryption() { + return this.inner().encryption(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public Boolean isHnsEnabled() { + return this.inner().isHnsEnabled(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public DateTime lastGeoFailoverTime() { + return this.inner().lastGeoFailoverTime(); + } + + @Override + public NetworkRuleSet networkRuleSet() { + return this.inner().networkRuleSet(); + } + + @Override + public Endpoints primaryEndpoints() { + return this.inner().primaryEndpoints(); + } + + @Override + public String primaryLocation() { + return this.inner().primaryLocation(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Endpoints secondaryEndpoints() { + return this.inner().secondaryEndpoints(); + } + + @Override + public String secondaryLocation() { + return this.inner().secondaryLocation(); + } + + @Override + public Sku sku() { + SkuInner inner = this.inner().sku(); + if (inner != null) { + return new SkuImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public AccountStatus statusOfPrimary() { + return this.inner().statusOfPrimary(); + } + + @Override + public AccountStatus statusOfSecondary() { + return this.inner().statusOfSecondary(); + } + + @Override + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameter.withIsHnsEnabled(isHnsEnabled); + return this; + } + + @Override + public StorageAccountImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.createParameter.withKind(kind); + } else { + this.updateParameter.withKind(kind); + } + return this; + } + + @Override + public StorageAccountImpl withSku(SkuInner sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public StorageAccountImpl withAccessTier(AccessTier accessTier) { + if (isInCreateMode()) { + this.createParameter.withAccessTier(accessTier); + } else { + this.updateParameter.withAccessTier(accessTier); + } + return this; + } + + @Override + public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { + if (isInCreateMode()) { + this.createParameter.withCustomDomain(customDomain); + } else { + this.updateParameter.withCustomDomain(customDomain); + } + return this; + } + + @Override + public StorageAccountImpl withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration) { + if (isInCreateMode()) { + this.createParameter.withEnableAzureFilesAadIntegration(enableAzureFilesAadIntegration); + } else { + this.updateParameter.withEnableAzureFilesAadIntegration(enableAzureFilesAadIntegration); + } + return this; + } + + @Override + public StorageAccountImpl withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (isInCreateMode()) { + this.createParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } else { + this.updateParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } + return this; + } + + @Override + public StorageAccountImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.createParameter.withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public StorageAccountImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.createParameter.withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.createParameter.withNetworkRuleSet(networkRuleSet); + } else { + this.updateParameter.withNetworkRuleSet(networkRuleSet); + } + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java new file mode 100644 index 0000000000000..a1a80e5cdca42 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.Kind; +import com.microsoft.azure.management.storage.v2018_07_01.Identity; +import com.microsoft.azure.management.storage.v2018_07_01.ProvisioningState; +import com.microsoft.azure.management.storage.v2018_07_01.Endpoints; +import com.microsoft.azure.management.storage.v2018_07_01.AccountStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2018_07_01.CustomDomain; +import com.microsoft.azure.management.storage.v2018_07_01.Encryption; +import com.microsoft.azure.management.storage.v2018_07_01.AccessTier; +import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The storage account. + */ +@JsonFlatten +public class StorageAccountInner extends Resource { + /** + * Gets the SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private SkuInner sku; + + /** + * Gets the Kind. Possible values include: 'Storage', 'StorageV2', + * 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Gets the status of the storage account at the time the operation was + * called. Possible values include: 'Creating', 'ResolvingDNS', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object. Note that Standard_ZRS and Premium_LRS accounts + * only return the blob endpoint. + */ + @JsonProperty(value = "properties.primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints primaryEndpoints; + + /** + * Gets the location of the primary data center for the storage account. + */ + @JsonProperty(value = "properties.primaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String primaryLocation; + + /** + * Gets the status indicating whether the primary location of the storage + * account is available or unavailable. Possible values include: + * 'available', 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfPrimary; + + /** + * Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This + * element is not returned if there has never been a failover instance. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + */ + @JsonProperty(value = "properties.lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastGeoFailoverTime; + + /** + * Gets the location of the geo-replicated secondary for the storage + * account. Only available if the accountType is Standard_GRS or + * Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryLocation; + + /** + * Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is + * Standard_GRS or Standard_RAGRS. Possible values include: 'available', + * 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfSecondary; + + /** + * Gets the creation date and time of the storage account in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets the custom domain the user assigned to this storage account. + */ + @JsonProperty(value = "properties.customDomain", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomain customDomain; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object from the secondary location of the storage + * account. Only available if the SKU name is Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints secondaryEndpoints; + + /** + * Gets the encryption settings on the account. If unspecified, the account + * is unencrypted. + */ + @JsonProperty(value = "properties.encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier", access = JsonProperty.Access.WRITE_ONLY) + private AccessTier accessTier; + + /** + * Enables Azure Files AAD Integration for SMB if sets to true. + */ + @JsonProperty(value = "properties.azureFilesAadIntegration") + private Boolean enableAzureFilesAadIntegration; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls", access = JsonProperty.Access.WRITE_ONLY) + private NetworkRuleSet networkRuleSet; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get gets the SKU. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value + */ + public Endpoints primaryEndpoints() { + return this.primaryEndpoints; + } + + /** + * Get gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfPrimary value + */ + public AccountStatus statusOfPrimary() { + return this.statusOfPrimary; + } + + /** + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value + */ + public DateTime lastGeoFailoverTime() { + return this.lastGeoFailoverTime; + } + + /** + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value + */ + public String secondaryLocation() { + return this.secondaryLocation; + } + + /** + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfSecondary value + */ + public AccountStatus statusOfSecondary() { + return this.statusOfSecondary; + } + + /** + * Get gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. + * + * @return the secondaryEndpoints value + */ + public Endpoints secondaryEndpoints() { + return this.secondaryEndpoints; + } + + /** + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Get enables Azure Files AAD Integration for SMB if sets to true. + * + * @return the enableAzureFilesAadIntegration value + */ + public Boolean enableAzureFilesAadIntegration() { + return this.enableAzureFilesAadIntegration; + } + + /** + * Set enables Azure Files AAD Integration for SMB if sets to true. + * + * @param enableAzureFilesAadIntegration the enableAzureFilesAadIntegration value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableAzureFilesAadIntegration(Boolean enableAzureFilesAadIntegration) { + this.enableAzureFilesAadIntegration = enableAzureFilesAadIntegration; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultImpl.java new file mode 100644 index 0000000000000..82b63e11c3f4f --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountListKeysResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountKey; + +class StorageAccountListKeysResultImpl extends WrapperImpl implements StorageAccountListKeysResult { + private final StorageManager manager; + StorageAccountListKeysResultImpl(StorageAccountListKeysResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List keys() { + return this.inner().keys(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultInner.java new file mode 100644 index 0000000000000..c0fba5a85415e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountListKeysResultInner.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListKeys operation. + */ +public class StorageAccountListKeysResultInner { + /** + * Gets the list of storage account keys and their properties for the + * specified storage account. + */ + @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) + private List keys; + + /** + * Get gets the list of storage account keys and their properties for the specified storage account. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..df33dc4aa49ac --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountListKeysResult; +import com.microsoft.azure.management.storage.v2018_07_01.ListAccountSasResponse; +import com.microsoft.azure.management.storage.v2018_07_01.ListServiceSasResponse; +import com.microsoft.azure.management.storage.v2018_07_01.CheckNameAvailabilityResult; +import com.microsoft.azure.management.storage.v2018_07_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2018_07_01.ServiceSasParameters; + +class StorageAccountsImpl extends GroupableResourcesCoreImpl implements StorageAccounts { + protected StorageAccountsImpl(StorageManager manager) { + super(manager.inner().storageAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + StorageAccountsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public StorageAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + StorageAccountsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, accountName, keyName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listAccountSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListAccountSasResponse call(ListAccountSasResponseInner inner) { + return new ListAccountSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listServiceSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListServiceSasResponse call(ListServiceSasResponseInner inner) { + return new ListServiceSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + StorageAccountsInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected StorageAccountImpl wrapModel(StorageAccountInner inner) { + return new StorageAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected StorageAccountImpl wrapModel(String name) { + return new StorageAccountImpl(name, new StorageAccountInner(), this.manager()); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java new file mode 100644 index 0000000000000..20a62667e3bc7 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java @@ -0,0 +1,1179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2018_07_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2018_07_01.ServiceSasParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCheckNameAvailabilityParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountRegenerateKeyParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageAccounts. + */ +public class StorageAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private StorageAccountsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageAccountsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(StorageAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountCheckNameAvailabilityParameters accountName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountRegenerateKeyParameters regenerateKey, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts listAccountSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas") + Observable> listAccountSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body AccountSasParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts listServiceSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas") + Observable> listServiceSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body ServiceSasParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); + accountName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), accountName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the observable to the List<StorageAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates one of the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeyAsync(String resourceGroupName, String accountName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates one of the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String keyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + StorageAccountRegenerateKeyParameters regenerateKey = new StorageAccountRegenerateKeyParameters(); + regenerateKey.withKeyName(keyName); + return service.regenerateKey(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), regenerateKey, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListAccountSasResponseInner object if successful. + */ + public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListAccountSasResponseInner>() { + @Override + public ListAccountSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listAccountSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAccountSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAccountSASDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListServiceSasResponseInner object if successful. + */ + public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListServiceSasResponseInner>() { + @Override + public ListServiceSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable> listServiceSASWithServiceResponseAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listServiceSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listServiceSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listServiceSASDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java new file mode 100644 index 0000000000000..7b7c819632d77 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the StorageManagementClientImpl class. + */ +public class StorageManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public StorageManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public StorageManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public StorageManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public StorageManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The SkusInner object to access its operations. + */ + private SkusInner skus; + + /** + * Gets the SkusInner object to access its operations. + * @return the SkusInner object. + */ + public SkusInner skus() { + return this.skus; + } + + /** + * The StorageAccountsInner object to access its operations. + */ + private StorageAccountsInner storageAccounts; + + /** + * Gets the StorageAccountsInner object to access its operations. + * @return the StorageAccountsInner object. + */ + public StorageAccountsInner storageAccounts() { + return this.storageAccounts; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The BlobContainersInner object to access its operations. + */ + private BlobContainersInner blobContainers; + + /** + * Gets the BlobContainersInner object to access its operations. + * @return the BlobContainersInner object. + */ + public BlobContainersInner blobContainers() { + return this.blobContainers; + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public StorageManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-07-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.skus = new SkusInner(restClient().retrofit(), this); + this.storageAccounts = new StorageAccountsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.blobContainers = new BlobContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "StorageManagementClient", "2018-07-01"); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java new file mode 100644 index 0000000000000..5f20828e6920c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.storage.v2018_07_01.Operations; +import com.microsoft.azure.management.storage.v2018_07_01.Skus; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts; +import com.microsoft.azure.management.storage.v2018_07_01.Usages; +import com.microsoft.azure.management.storage.v2018_07_01.BlobContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Storage resource management. + */ +public final class StorageManager extends ManagerCore { + private Operations operations; + private Skus skus; + private StorageAccounts storageAccounts; + private Usages usages; + private BlobContainers blobContainers; + /** + * Get a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new StorageManager.ConfigurableImpl(); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new StorageManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(RestClient restClient, String subscriptionId) { + return new StorageManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageManager that exposes Storage management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Storage management API entry points that work across subscriptions + */ + StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(this); + } + return this.skus; + } + + /** + * @return Entry point to manage StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(this); + } + return this.storageAccounts; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage BlobContainers. + */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(this); + } + return this.blobContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return StorageManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private StorageManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new StorageManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..4dc7a166db237 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.UsageName; +import com.microsoft.azure.management.storage.v2018_07_01.UsageUnit; + +class UsageImpl extends WrapperImpl implements Usage { + private final StorageManager manager; + + UsageImpl(UsageInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public UsageUnit unit() { + return this.inner().unit(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..0a9d9da444ea5 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsageInner.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.UsageUnit; +import com.microsoft.azure.management.storage.v2018_07_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes Storage Resource Usage. + */ +public class UsageInner { + /** + * Gets the unit of measurement. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /** + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * Gets the maximum count of the resources that can be allocated in the + * subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get gets the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..8d1e65812702c --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2018_07_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final StorageManager manager; + + UsagesImpl(StorageManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listByLocationAsync(String location) { + UsagesInner client = this.inner(); + return client.listByLocationAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesInner.java new file mode 100644 index 0000000000000..8bd6967bf928b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/UsagesInner.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.Usages listByLocation" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") + Observable> listByLocation(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UsageInner> object if successful. + */ + public List listByLocation(String location) { + return listByLocationWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByLocationAsync(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listByLocationAsync(String location) { + return listByLocationWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listByLocationWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByLocation(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByLocationDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByLocationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/package-info.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/package-info.java new file mode 100644 index 0000000000000..94f71df2cb7e6 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2018_07_01.implementation; diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/package-info.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/package-info.java new file mode 100644 index 0000000000000..7ace52efa0d2f --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2018_07_01; diff --git a/streamanalytics/resource-manager/v2016_03_01/pom.xml b/streamanalytics/resource-manager/v2016_03_01/pom.xml index 331981b8e9472..24f80d63960e5 100644 --- a/streamanalytics/resource-manager/v2016_03_01/pom.xml +++ b/streamanalytics/resource-manager/v2016_03_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.2-beta + 0.0.3-beta ../../../pom.xml azure-mgmt-streamanalytics diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index f58ab2bbcdbd5..9f0a5d60bac4a 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -5,8 +5,8 @@ "verbose": "", "sdkrel:azure-libraries-for-java-folder": ".", "multiapi": "", - "use": "@microsoft.azure/autorest.java@2.1.71" + "use": "@microsoft.azure/autorest.java@preview" }, "version": "0.2.0" } -} \ No newline at end of file +} diff --git a/template/client/README.md b/template/client/README.md new file mode 100644 index 0000000000000..97562a72e63e7 --- /dev/null +++ b/template/client/README.md @@ -0,0 +1,3 @@ +# Azure Template + +This project provides a starter template for a Java client package. diff --git a/template/client/pom.xml b/template/client/pom.xml new file mode 100644 index 0000000000000..68c4478902dba --- /dev/null +++ b/template/client/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + + com.microsoft.azure + azure-sdk-parent + 1.0-SNAPSHOT + ../../pom.client.xml + + + azure-sdk-template + jar + + Microsoft Azure SDK for Template + This package contains Microsoft Azure SDK for Template. + + + + junit + junit + test + + + diff --git a/template/client/src/main/java/com/microsoft/azure/template/Hello.java b/template/client/src/main/java/com/microsoft/azure/template/Hello.java new file mode 100644 index 0000000000000..4af4ad00740d5 --- /dev/null +++ b/template/client/src/main/java/com/microsoft/azure/template/Hello.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.template; + +/** + * This is a sample class for template app. + */ +public class Hello { + /** + * Sample method. + * @return message + */ + public final String getMessage() { + return "hello"; + } +} diff --git a/template/client/src/main/java/com/microsoft/azure/template/package-info.java b/template/client/src/main/java/com/microsoft/azure/template/package-info.java new file mode 100644 index 0000000000000..7181dfbebdd64 --- /dev/null +++ b/template/client/src/main/java/com/microsoft/azure/template/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// + +/** + * This package contains classes for the template project. + */ +package com.microsoft.azure.template; diff --git a/template/client/src/test/java/com/microsoft/azure/template/HelloTest.java b/template/client/src/test/java/com/microsoft/azure/template/HelloTest.java new file mode 100644 index 0000000000000..0bcf2265d0ae1 --- /dev/null +++ b/template/client/src/test/java/com/microsoft/azure/template/HelloTest.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ +package com.microsoft.azure.template; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class HelloTest { + @Test + public void testMessage() { + assertEquals("hello", (new Hello()).getMessage()); + } +}